canvas {
  position: absolute;
  width: 200%;
}


.hallway {
  position: relative;
  width: 100%;
  display: block;
}

.edit-bottom-part {
  background-color: #1E1E24;
  border-width: 0;
  color: #EEF0F2;
}

body {
  color: #EEF0F2;
  background-color: #1E1E24;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  margin: 0;
  align-items: center;
  font-family: 'Noto Sans', 'Roboto', sans-serif;
  border-radius: 15px;
  font-size: 16px;
  line-height: 1.5;
}

.filler_box {
  width: 100vw;
  height: 25vh;
}

.map {
  overflow: auto;
  width: 100%;
  height: 75%;
  position: relative;
  display: inline-block;
}

#panzoom-container {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
}

#error_message {
  background-color: orange;
  text-align: center;
  width: fit-content;
  font-size: large;

}

#error_message_link {
  color: red;
  padding-right: 0px;
}

.message_box {
  width: 100%;
}

.path_button {
  transition: all 0.075s ease;
}

.path_button:active {
  margin-top: 3px;
  box-shadow: none;
  transform: scale(0.98);
}

@media only screen and (max-width: 768px) {

  .warning_box,
  .warning {
    display: none;
  }
}

@media only screen and (min-width: 769px) {
  .warning_box {
    display: flex;
    background-color: #00ADBF;
    width: 100%;
    height: 100%;
    position: fixed;
    justify-content: center;
    align-items: center;
    z-index: 3;
  }

  .warning {
    background-color: #EEF0F2;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

.view-buttons {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 10px;
  z-index: 10000;
}

#zoomIn,
#viewTog,
#downloadMapBtn,
#fitView,
#zoomOut {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #1E1E24;
  color: #EEF0F2;
  border: none;
  font-size: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.3s;
}

#viewTog:hover,
#downloadMapBtn:hover,
#fitView:hover,
#zoomIn:hover,
#zoomOut:hover {
  background-color: #9DBBAE;
}

a {
  color: #00ADBF;
  text-decoration:none;
  font-weight: bolder;

}


a:hover {
  color: #9DBBAE;
}

.tooltip {
  position: absolute;
  color: #EEF0F2;
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 200px;
  word-wrap: break-word;
  display: none;
  z-index: 1001;
  font-size: 14px;
  background-color: rgba(30, 30, 36, 0.95);
  border: 1px solid #2E2E34;
}

#tooltip {
  position: absolute;
  color: #EEF0F2;
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 200px;
  word-wrap: break-word;
  display: none;
  z-index: 1001;
  font-size: 14px;
  background-color: rgba(30, 30, 36, 0.95);
  border: 1px solid #2E2E34;
}
button:active {
  transform: translateY(2px);
}

/* Improve touch targets and interaction */
button, input, select, textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #00ADBF;
  outline-offset: 2px;
}

#mySvg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#hallwayImage {
  display: block;
  width: 100%;
  height: auto;
}

input,
select {
  background-color: #9DBBAE;
  border-width: 0;
  color: #1E1E24;
  border-radius: 15px;
  padding: 12px 16px;
  font-size: 16px;
  min-height: 44px;
  box-sizing: border-box;
}


svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}



textarea {
  background-color: #2E2E34;
  border-width: 0;
  border-radius: 15px;
  color: #EEF0F2;
  padding: 12px 16px;
  font-size: 16px;
  font-family: inherit;
  line-height: 1.4;
  box-sizing: border-box;
  width: 100%;
  resize: vertical;
}

#maindiv {
  display: flex;
  background-color: #1E1E24;
  align-items: center;
  gap: 15px;
  color: #EEF0F2;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 10px;
}

#submit,
.path_button {
  margin-left: 0;
  background-color: #2E2E34;
  border-width: 0;
  color: #EEF0F2;
  min-width: 120px;
  min-height: 54px;
  font-size: 18px;
  border-radius: 15px;
  padding: 12px 20px;
  cursor: pointer;
  touch-action: manipulation;
}



.schedule-box {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: #1E1E24;
  color: #EEF0F2;
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  font-family: 'Open Sans', 'Roboto', sans-serif;
  width: max-content;
  min-width: 210px;
  max-width: min(380px, calc(100vw - 20px));
  box-sizing: border-box;
  z-index: 9999;
  font-size: 14px;
  overflow: visible;
}

.schedule-box:empty {
  display: none;
}

.schedule-legend-scroll {
  max-height: min(34vh, 260px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px 44px 14px 16px;
  border-radius: inherit;
  box-sizing: border-box;
}

.schedule-line {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.schedule-route-button {
  width: max-content;
  min-width: 100%;
  max-width: calc(min(380px, calc(100vw - 20px)) - 60px);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 4px 6px;
  text-align: left;
}

.schedule-route-button:hover,
.schedule-route-button:focus,
.schedule-route-button.active {
  background: rgba(0, 173, 191, 0.2);
}

.schedule-route-button.muted {
  opacity: 0.72;
}

.schedule-clear-focus {
  width: max-content;
  min-width: 100%;
  max-width: calc(min(380px, calc(100vw - 20px)) - 60px);
  min-height: 28px;
  margin-bottom: 8px;
  border: 1px solid #3A3A42;
  border-radius: 6px;
  background: #24242A;
  color: #9DBBAE;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.schedule-clear-focus:hover,
.schedule-clear-focus:focus {
  background: #00ADBF;
  color: #101316;
}

.schedule-pill {
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  margin-right: 8px;
  border: 1px solid #1E1E24;
}

.legend-visibility-toggle {
  width: 32px;
  height: 30px;
  min-width: 32px;
  min-height: 30px;
  border: 1px solid #3A3A42;
  border-radius: 8px;
  background: #24242A;
  color: #EEF0F2;
  cursor: pointer;
}

.legend-hide-toggle {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
}

.legend-show-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.legend-visibility-toggle:hover,
.legend-visibility-toggle:focus {
  border-color: #00ADBF;
  background: #00ADBF;
  color: #101316;
}

.legend-eye {
  position: relative;
  display: block;
  width: 18px;
  height: 12px;
  margin: 0 auto;
  border: 2px solid currentColor;
  border-radius: 50% / 60%;
  box-sizing: border-box;
}

.legend-eye::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: currentColor;
}

.legend-hide-toggle .legend-eye::after {
  content: "";
  position: absolute;
  left: -3px;
  top: 4px;
  width: 22px;
  height: 2px;
  transform: rotate(-38deg);
  transform-origin: center;
  border-radius: 999px;
  background: currentColor;
}

.schedule-box.legend-hidden {
  width: auto;
  min-width: 0;
  max-width: none;
  padding: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.input_controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 10px;
  flex-wrap: wrap;
  padding: 0 10px;
}

.app-topbar {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 6px 18px;
  box-sizing: border-box;
  background: #151519;
  border-bottom: 1px solid #2E2E34;
  position: relative;
  z-index: 20;
}

.app-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 220px;
}

.app-name {
  font-size: 17px;
  font-weight: 700;
}

.app-status {
  color: #9DBBAE;
  font-size: 13px;
  position: absolute;
  left: auto;
  right: 18px;
  top: 50%;
  max-width: 220px;
  transform: translateY(-50%);
  text-align: right;
  white-space: nowrap;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-status[data-state="ready"] {
  color: #58d68d;
}

.app-status[data-state="error"] {
  color: #ffb35c;
}

.app-status[data-state="pending"] {
  color: #d7e8ff;
}

.app-nav {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 13px;
  margin: 0 auto;
  max-width: calc(100% - 480px);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.workflow-panel {
  width: 100%;
  height: var(--panel-height);
  overflow: auto;
  background: #1E1E24;
  border-top: 1px solid #2E2E34;
  box-sizing: border-box;
  padding: 14px 18px 18px;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12000;
  transform: none;
  transition: bottom 0.22s ease;
}

.schedule-form {
  width: min(1480px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(360px, 1.35fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.tool-form {
  width: min(980px, 100%);
  margin: 0 auto;
}

.import-section,
.render-section {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.section-heading h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.panel-kicker,
.field-label {
  color: #BFC8C2;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.import-actions,
.inline-actions,
.submit-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.button,
#submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid #3A3A42;
  border-radius: 8px;
  background: #2E2E34;
  color: #EEF0F2;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 14px;
  box-sizing: border-box;
  cursor: pointer;
  text-decoration: none;
}

.button:hover,
#submit:hover:not(:disabled) {
  background: #3A3A42;
  color: #EEF0F2;
}

.primary-button {
  border-color: #00ADBF;
  background: #00ADBF;
  color: #121417;
}

.compact-button {
  min-height: 38px;
  padding: 8px 12px;
}

#submit {
  min-width: 150px;
  background: #00ADBF;
  color: #101316;
}

#submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.bookmarklet-card {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0 10px;
  padding: 10px;
  border: 1px solid #3A3A42;
  border-radius: 8px;
  background: #24242A;
}

.bookmarklet-card p {
  margin: 0;
  color: #C8D0CC;
  font-size: 13px;
}

.bookmarklet-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: 8px;
  background: #EEF0F2;
  color: #1E1E24;
  padding: 8px 12px;
  font-weight: 700;
}

.workflow-panel textarea {
  width: 100%;
  min-height: 112px;
  max-height: 220px;
  border: 1px solid #3A3A42;
  border-radius: 8px;
  margin-bottom: 10px;
}

.workflow-panel select,
.workflow-panel input {
  border-radius: 8px;
  min-height: 42px;
}

.parse-preview {
  margin-top: 10px;
  min-height: 64px;
}

.schedule-diagnostics {
  margin: 10px 0;
  border: 1px solid #7a3a35;
  border-radius: 8px;
  background: #221c1d;
  color: #EEF0F2;
  overflow: auto;
}

.diagnostics-heading {
  padding: 8px 12px;
  border-bottom: 1px solid #7a3a35;
  color: #ffca91;
  font-size: 13px;
  font-weight: 700;
}

.diagnostic-line {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  border-top: 1px solid rgba(122, 58, 53, 0.55);
}

.diagnostic-line:first-of-type {
  border-top: 0;
}

.diagnostic-line-number {
  padding: 7px 8px;
  color: #9DBBAE;
  text-align: right;
  user-select: none;
}

.diagnostic-code {
  display: block;
  padding: 7px 10px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  color: #EEF0F2;
}

.diagnostic-content {
  min-width: 0;
}

.diagnostic-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 10px 8px;
}

.diagnostic-action {
  min-height: 32px;
}

.diagnostic-report-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-size: 12px;
}

.schedule-error-mark {
  border-radius: 3px;
  background: #ff4d4d;
  color: #101316;
  padding: 1px 2px;
  cursor: help;
}

.preview-empty,
.preview-error {
  border-radius: 8px;
  padding: 10px 12px;
  background: #24242A;
  color: #DCE4E0;
}

.import-checklist {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.check-item {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #24242A;
  color: #DCE4E0;
  font-size: 12px;
  font-weight: 700;
}

.check-item.ok {
  color: #58d68d;
}

.check-item.bad {
  color: #ffca91;
}

.preview-error {
  border: 1px solid #a6652a;
  background: #33271f;
  color: #ffca91;
}

.preview-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.semester-preview {
  border: 1px solid #3A3A42;
  border-radius: 8px;
  background: #24242A;
  padding: 8px 10px;
}

.semester-preview summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 700;
}

.preview-count {
  color: #9DBBAE;
  font-size: 13px;
  white-space: nowrap;
}

.day-counts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.day-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 26px;
  border-radius: 999px;
  background: #1E1E24;
  color: #DCE4E0;
  font-size: 12px;
  font-weight: 700;
}

.class-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.class-preview-table td {
  border-top: 1px solid #36363D;
  padding: 6px 4px;
  vertical-align: top;
}

.class-preview-table td:nth-child(2),
.class-preview-table td:nth-child(3) {
  width: 1%;
  white-space: nowrap;
  color: #C8D0CC;
}

.row-warning td {
  color: #ffca91;
}

.selector-cluster {
  margin-bottom: 14px;
}

.selector-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tab-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tab-button {
  min-width: 46px;
  min-height: 38px;
  border: 1px solid #3A3A42;
  border-radius: 8px;
  background: #24242A;
  color: #EEF0F2;
  font-weight: 700;
  cursor: pointer;
}

.tab-button.active {
  background: #9DBBAE;
  color: #101316;
  border-color: #9DBBAE;
}

.settings-grid#maindiv {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 12px;
  align-items: end;
  justify-content: stretch;
  padding: 0;
  background: transparent;
}

.schedule-settings#maindiv {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-grid .field-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-action {
  display: flex;
  align-items: end;
  min-height: 42px;
}

.settings-action #submit {
  width: 100%;
}

.tool-settings#maindiv {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.path-settings#maindiv {
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
}

.tool-settings.single-field#maindiv {
  grid-template-columns: minmax(260px, 520px);
}

.tool-settings input {
  width: 100%;
}

.field-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(58px, auto);
  gap: 8px;
  align-items: center;
}

.favorite-room-btn,
.swap-route-btn {
  min-width: 58px;
  min-height: 42px;
  border: 1px solid #3A3A42;
  border-radius: 8px;
  background: #24242A;
  color: #EEF0F2;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.favorite-room-btn:hover,
.favorite-room-btn.active,
.swap-route-btn:hover {
  border-color: #00ADBF;
  background: #00ADBF;
  color: #101316;
}

.swap-route-btn {
  align-self: end;
  margin-bottom: 5px;
}

.room-combobox {
  position: relative;
}

.room-combobox-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  z-index: 20000;
  border: 1px solid #3A3A42;
  border-radius: 8px;
  background: #151519;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.36);
}

.room-combobox-option {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #EEF0F2;
  padding: 8px 12px;
  font-size: 14px;
  text-align: left;
}

.room-combobox-empty {
  padding: 10px 12px;
  color: #BFC8C2;
  font-size: 13px;
}

.room-combobox-option:hover,
.room-combobox-option[aria-selected="true"] {
  background: #00ADBF;
  color: #101316;
}

.tool-message {
  margin: 16px 0 0;
  min-height: 24px;
  color: #DCE4E0;
  font-size: 14px;
}

.report-link {
  display: inline-flex;
  margin-top: 8px;
  font-size: 13px;
}

.tool-message[data-state="ready"] {
  color: #58d68d;
}

.tool-message[data-state="error"] {
  color: #ffca91;
}

.tool-message[data-state="pending"] {
  color: #d7e8ff;
}

.checkbox-field {
  min-height: 42px;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-start;
  gap: 10px !important;
  text-transform: none;
}

.checkbox-field input {
  min-height: 20px;
  width: 20px;
}

.submit-row {
  margin-top: 14px;
}

#error_message {
  margin: 0;
  max-width: 520px;
  background: transparent;
  color: #ffca91;
  font-size: 14px;
  text-align: left;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

body.schedule-app {
  align-items: stretch;
  --panel-height: 330px;
}

body.schedule-app.tool-page {
  --panel-height: 220px;
}

body.schedule-app .map {
  height: calc(100vh - 52px - var(--panel-height));
  min-height: 260px;
}

body.schedule-app .view-buttons {
  top: 54px;
}

body.schedule-app #downloadMapBtn,
body.schedule-app #viewTog,
body.schedule-app #fitView,
body.schedule-app #zoomIn,
body.schedule-app #zoomOut {
  width: auto;
  min-width: 42px;
  height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
}

body.schedule-app .schedule-box {
  top: 54px;
  border-radius: 8px;
}

body.schedule-app.panel-closed .workflow-panel {
  bottom: calc(10px - var(--panel-height));
  background: transparent;
  border-top-color: transparent;
  transform: none;
}

body.schedule-app.panel-closed .workflow-panel::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  width: 76px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #9DBBAE;
}

body.schedule-app.panel-closed .workflow-panel > * {
  pointer-events: none;
  visibility: hidden;
}

body.schedule-app.panel-closed .map {
  height: calc(100vh - 52px);
}

.panel-peek {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 13000;
  width: 56px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid #3A3A42;
  border-radius: 8px 8px 0 0;
  background: #00ADBF;
  color: #101316;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
}

body.schedule-app.panel-closed .panel-peek {
  display: flex;
}

.panel-peek:hover {
  background: #9DBBAE;
}

@media only screen and (max-width: 900px) {
  .app-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .app-status {
    position: static;
    transform: none;
    text-align: left;
    white-space: normal;
  }

  .schedule-form,
  .preview-summary,
  .selector-row {
    grid-template-columns: 1fr;
  }

  body.schedule-app {
    --panel-height: 46vh;
  }

  body.schedule-app.tool-page {
    --panel-height: 34vh;
  }

  body.schedule-app .map {
    height: calc(100vh - 52px - var(--panel-height));
    min-height: 220px;
  }

  .section-heading {
    flex-direction: column;
  }

  .settings-grid#maindiv,
  .schedule-settings#maindiv {
    grid-template-columns: 1fr;
  }

  .tool-settings#maindiv,
  .path-settings#maindiv,
  .tool-settings.single-field#maindiv {
    grid-template-columns: 1fr;
  }

  .swap-route-btn {
    width: 100%;
    margin-bottom: 0;
  }
}

.about-page {
  height: auto;
  min-height: 100vh;
  align-items: stretch;
  overflow: auto;
}

.about-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 28px 20px 44px;
  box-sizing: border-box;
}

.about-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0 24px;
}

.about-intro h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
}

.about-logo-link {
  flex: 0 0 auto;
}

.about-logo-link img {
  width: 104px;
  height: auto;
  max-height: 86px;
  object-fit: contain;
  border-radius: 8px;
  background: transparent;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 14px;
  margin-bottom: 14px;
}

.about-card,
.about-details details {
  border: 1px solid #3A3A42;
  border-radius: 8px;
  background: #24242A;
  color: #EEF0F2;
}

.about-card {
  padding: 18px;
}

.about-card h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.about-card p {
  margin: 0 0 10px;
  color: #DCE4E0;
}

.about-link-list {
  display: grid;
  gap: 10px;
}

.about-link-list a {
  display: block;
}

.about-details {
  display: grid;
  gap: 10px;
}

.about-details summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  padding: 0 16px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
}

.about-details summary::-webkit-details-marker {
  display: none;
}

.about-details summary::after {
  content: "+";
  color: #9DBBAE;
  font-size: 20px;
}

.about-details details[open] summary {
  border-bottom: 1px solid #3A3A42;
}

.about-details details[open] summary::after {
  content: "-";
}

.about-detail-body {
  padding: 14px 16px 16px;
  color: #DCE4E0;
}

.about-detail-body p {
  margin: 0 0 12px;
}

.about-steps {
  display: grid;
  gap: 8px;
  margin: 0 0 14px 20px;
  padding: 0;
}

.about-steps li {
  padding-left: 4px;
}

.about-screenshot {
  display: block;
  width: min(100%, 820px);
  height: auto;
  border-radius: 8px;
  border: 1px solid #3A3A42;
}

details {
  font-size: inherit;
}

/* Mobile-specific improvements */
@media only screen and (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .about-intro,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .about-intro h1 {
    font-size: 28px;
  }

  body.schedule-app .view-buttons {
    position: static;
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 10px;
    background: #151519;
    border-bottom: 1px solid #2E2E34;
  }

  #zoomIn,
  #viewTog,
  #downloadMapBtn,
  #fitView,
  #zoomOut {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .schedule-box {
    top: 130px;
    left: 5px;
    padding: 8px 12px;
    max-width: 200px;
    font-size: 12px;
  }

  #maindiv {
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    align-items: stretch;
  }

  #maindiv > * {
    text-align: center;
  }

  #maindiv label {
    margin-bottom: 5px;
    display: block;
    font-weight: bold;
  }

  #maindiv p {
    margin: 8px 0 4px 0;
    font-weight: bold;
  }

  input, select, textarea {
    width: 100%;
    margin: 5px 0;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  #submit,
  .path_button {
    width: 100%;
    margin: 15px 0 10px 0;
    min-height: 48px;
    font-size: 16px;
  }

  textarea {
    min-height: 120px;
  }

  /* Better spacing for the control sections */
  #bottom-part {
    padding: 15px;
    padding-bottom: 80px; /* Space for fixed bottom links */
  }

  /* Improve the color instruction text */
  #bottom-part > div:first-child {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    margin-bottom: 15px;
  }

  #bottom-part > div:first-child p {
    margin: 0;
    font-size: 14px;
  }

  #exampleSched {
    margin-left: 0 !important;
    width: 100%;
    max-width: 200px;
  }

  /* Better navigation links for mobile */
  div[style*="position: fixed; bottom: 0"] {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background-color: #1E1E24;
    padding: 10px;
    border-top: 1px solid #2E2E34;
  }

  div[style*="position: fixed; bottom: 0"] p {
    margin: 0;
    font-size: 12px;
    line-height: 1.3;
  }

  div[style*="position: fixed; bottom: 0"] a {
    display: inline-block;
    margin: 2px 5px;
    padding: 4px 8px;
    background-color: #2E2E34;
    border-radius: 8px;
    text-decoration: none;
  }

  /* Checkbox styling improvements */
  input[type="checkbox"] {
    width: auto;
    margin: 0 8px;
    transform: scale(1.2);
  }

  /* Form layout improvements */
  #scheduleForm {
    margin-top: 10px;
  }

  /* Error message styling */
  #error_message {
    margin: 15px 0;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
  }

  /* Message box improvements */
  .message_box {
    margin: 15px 0;
    text-align: center;
  }

  .message_box p {
    margin: 0;
    padding: 10px;
    background-color: #2E2E34;
    border-radius: 8px;
    font-size: 14px;
  }

  /* Map height adjustment for mobile */
  .map {
    height: 60vh;
    min-height: 300px;
  }

  /* Better touch targets for interactive elements */
  .path_button:active {
    margin-top: 1px;
    transform: scale(0.98);
  }

  button:active {
    transform: translateY(1px) scale(0.98);
  }
}

/* Small mobile devices */
@media only screen and (max-width: 480px) {
  body {
    font-size: 13px;
  }

  .view-buttons {
    gap: 6px;
  }

  #zoomIn,
  #viewTog,
  #downloadMapBtn,
  #fitView,
  #zoomOut {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .schedule-box {
    max-width: 180px;
    font-size: 11px;
    padding: 6px 10px;
  }

  #maindiv {
    padding: 10px;
    gap: 10px;
  }

  #bottom-part {
    padding: 10px;
    padding-bottom: 75px;
  }

  div[style*="position: fixed; bottom: 0"] p {
    font-size: 11px;
  }

  div[style*="position: fixed; bottom: 0"] a {
    margin: 1px 3px;
    padding: 3px 6px;
    font-size: 11px;
  }

  .map {
    height: 55vh;
  }
}

/* Mobile layout pass for the app shell, toolbar, map, legend, and panels. */
body.schedule-app {
  --top-ui-height: 52px;
  height: 100dvh;
  overflow: hidden;
}

body.schedule-app .map {
  height: calc(100dvh - var(--top-ui-height) - var(--panel-height));
}

body.schedule-app.panel-closed .map {
  height: calc(100dvh - var(--top-ui-height));
}

.schedule-route-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}

.schedule-route-button .schedule-pill {
  margin-right: 0;
}

.schedule-route-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media only screen and (max-width: 900px) {
  body.schedule-app {
    --top-ui-height: 106px;
    --panel-height: clamp(300px, 48dvh, 430px);
  }

  body.schedule-app.tool-page {
    --panel-height: clamp(220px, 34dvh, 320px);
  }

  body.schedule-app .app-topbar {
    min-height: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 7px 10px 5px;
  }

  body.schedule-app .app-title {
    min-width: 0;
    width: calc(100% - 128px);
    max-width: none;
  }

  body.schedule-app .app-name {
    font-size: 15px;
    line-height: 1.2;
  }

  body.schedule-app .app-status {
    position: absolute;
    left: auto;
    right: 10px;
    top: 8px;
    max-width: 120px;
    transform: none;
    text-align: right;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.schedule-app .app-nav {
    width: 100%;
    margin-left: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    justify-content: center;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 2px;
    white-space: nowrap;
    scrollbar-width: none;
    position: static;
    max-width: none;
    transform: none;
  }

  body.schedule-app .app-nav::-webkit-scrollbar {
    display: none;
  }

  body.schedule-app .app-nav a {
    flex: 0 0 auto;
    font-size: 12px;
    line-height: 1.2;
  }

  body.schedule-app .view-buttons {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(50px, 0.9fr) minmax(78px, 1.35fr) minmax(48px, 0.8fr) minmax(40px, 0.65fr) minmax(40px, 0.65fr);
    gap: 5px;
    box-sizing: border-box;
    padding: 4px 8px;
    background: #151519;
    border-bottom: 1px solid #2E2E34;
    z-index: 30;
  }

  body.schedule-app #downloadMapBtn,
  body.schedule-app #viewTog,
  body.schedule-app #fitView,
  body.schedule-app #zoomIn,
  body.schedule-app #zoomOut {
    width: 100%;
    min-width: 0;
    min-height: 27px;
    height: 27px;
    border-radius: 8px;
    padding: 0 5px;
    font-size: 10.5px;
    line-height: 1;
    overflow: hidden;
    white-space: nowrap;
  }

  body.schedule-app .map {
    min-height: 0;
    height: calc(100dvh - var(--top-ui-height) - var(--panel-height));
  }

  body.schedule-app.panel-closed .map {
    height: calc(100dvh - var(--top-ui-height));
  }

  body.schedule-app .schedule-box {
    top: calc(var(--top-ui-height) + 8px);
    left: 10px;
    right: auto;
    width: max-content;
    min-width: 188px;
    max-width: min(310px, calc(100vw - 28px));
    max-height: none;
    overflow: visible;
    padding: 0;
    border-radius: 8px;
    font-size: 12px;
  }

  body.schedule-app .schedule-legend-scroll {
    max-height: min(32dvh, 220px);
    padding: 8px 40px 12px 8px;
  }

  body.schedule-app .schedule-box.legend-hidden {
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 0;
    overflow: visible;
  }

  body.schedule-app .schedule-route-button,
  body.schedule-app .schedule-clear-focus {
    max-width: calc(min(310px, calc(100vw - 28px)) - 50px);
  }

  body.schedule-app .schedule-line {
    margin-bottom: 4px;
  }

  body.schedule-app .schedule-clear-focus {
    min-height: 34px;
  }

  body.schedule-app .workflow-panel {
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
    overscroll-behavior: contain;
  }

  body.schedule-app .schedule-form {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body.schedule-app .section-heading {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
  }

  body.schedule-app .section-heading h1 {
    font-size: 19px;
    line-height: 1.15;
  }

  body.schedule-app .panel-kicker,
  body.schedule-app .field-label {
    font-size: 11px;
  }

  body.schedule-app .button,
  body.schedule-app #submit,
  body.schedule-app .path_button,
  body.schedule-app .favorite-room-btn,
  body.schedule-app .swap-route-btn,
  body.schedule-app .tab-button {
    min-height: 38px;
    border-radius: 8px;
    font-size: 12px;
  }

  body.schedule-app .import-actions,
  body.schedule-app .inline-actions,
  body.schedule-app .submit-row {
    gap: 8px;
  }

  body.schedule-app .workflow-panel textarea {
    min-height: 92px;
    max-height: 140px;
    margin-bottom: 8px;
  }

  body.schedule-app .parse-preview {
    min-height: 0;
  }

  body.schedule-app .selector-row,
  body.schedule-app .preview-summary {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.schedule-app .selector-cluster {
    margin-bottom: 10px;
  }

  body.schedule-app .tab-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
    gap: 6px;
  }

  body.schedule-app .tab-button {
    min-width: 0;
    padding: 0 8px;
  }

  body.schedule-app .schedule-settings#maindiv {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.schedule-app .tool-settings#maindiv,
  body.schedule-app .path-settings#maindiv,
  body.schedule-app .tool-settings.single-field#maindiv {
    grid-template-columns: 1fr;
  }

  body.schedule-app .checkbox-field,
  body.schedule-app .settings-action {
    grid-column: 1 / -1;
  }

  body.schedule-app .settings-action #submit {
    width: 100%;
    margin: 0;
  }

  body.schedule-app .bookmarklet-card {
    margin: 6px 0 8px;
    padding: 8px;
  }

  body.schedule-app.panel-closed .workflow-panel {
    bottom: calc(14px - var(--panel-height));
    transform: none;
  }

  body.schedule-app .panel-peek {
    bottom: calc(8px + env(safe-area-inset-bottom));
  }
}

@media only screen and (max-width: 480px) {
  body.schedule-app {
    --top-ui-height: 104px;
    --panel-height: clamp(300px, 48dvh, 370px);
  }

  body.schedule-app.tool-page {
    --panel-height: clamp(220px, 34dvh, 286px);
  }

  body.schedule-app .app-nav {
    gap: 11px;
  }

  body.schedule-app .app-nav a {
    font-size: 11px;
  }

  body.schedule-app .view-buttons {
    grid-template-columns: minmax(48px, 0.9fr) minmax(74px, 1.35fr) minmax(44px, 0.8fr) minmax(38px, 0.6fr) minmax(38px, 0.6fr);
    gap: 4px;
    padding: 4px 7px;
  }

  body.schedule-app #downloadMapBtn,
  body.schedule-app #viewTog,
  body.schedule-app #fitView,
  body.schedule-app #zoomIn,
  body.schedule-app #zoomOut {
    min-height: 26px;
    height: 26px;
    padding: 0 5px;
    font-size: 10px;
  }

  body.schedule-app .schedule-box {
    min-width: 184px;
    max-width: min(286px, calc(100vw - 24px));
    max-height: min(34dvh, 196px);
    font-size: 11px;
  }

  body.schedule-app .schedule-route-button,
  body.schedule-app .schedule-clear-focus {
    max-width: calc(min(286px, calc(100vw - 24px)) - 50px);
  }

  body.schedule-app .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  body.schedule-app .import-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.schedule-app #powerSchoolBtn {
    grid-column: 1 / -1;
  }

  body.schedule-app .workflow-panel {
    padding: 9px 10px calc(11px + env(safe-area-inset-bottom));
  }
}
