:root {
  --ink: #172b2a;
  --ink-soft: #526562;
  --pine: #1f5c52;
  --pine-deep: #123d37;
  --mint: #dff2eb;
  --mint-soft: #f1f8f5;
  --amber: #efb640;
  --amber-soft: #fff3d8;
  --coral: #df6a4f;
  --coral-soft: #fbe9e3;
  --page: #eef3ef;
  --paper: #fbfcfa;
  --white: #ffffff;
  --line: #d8e2dc;
  --line-strong: #bfcfc7;
  --muted: #73827f;
  --shadow: 0 10px 28px rgba(27, 60, 52, 0.08);
  --shadow-tight: 0 4px 14px rgba(27, 60, 52, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(31, 92, 82, 0.035) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(rgba(31, 92, 82, 0.035) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--page);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(239, 182, 64, 0.65);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 56px);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 20px;
  background: rgba(251, 252, 250, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--pine-deep);
  box-shadow: var(--shadow-tight);
}

.brand-mark .icon {
  width: 21px;
  height: 21px;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 18px;
  letter-spacing: 0;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
}

.mode-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.mode-button,
.text-button,
.primary-button,
.secondary-button,
.period-tab,
.direction-option,
.stepper-button,
.slot-button,
.table-action,
.table-check {
  border: 0;
  cursor: pointer;
}

.mode-button {
  min-width: 112px;
  min-height: 38px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.mode-button .icon {
  width: 16px;
  height: 16px;
}

.mode-button:hover {
  color: var(--pine);
  background: var(--mint-soft);
}

.mode-button.is-active {
  color: var(--white);
  background: var(--pine);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.live-clock {
  color: var(--ink-soft);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.demo-badge > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
}

.text-button {
  min-height: 36px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.text-button:hover {
  color: var(--coral);
  background: var(--coral-soft);
}

.text-button .icon {
  width: 15px;
  height: 15px;
}

.page-shell {
  width: min(1380px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 30px;
}

.view {
  animation: view-in 260ms ease-out both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-heading,
.operator-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.view-heading > div:first-child,
.operator-heading > div:first-child {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--pine);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.13;
  letter-spacing: -0.03em;
}

h2 {
  margin-bottom: 6px;
  font-size: 18px;
  line-height: 1.3;
}

.subcopy {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

.next-bus {
  min-width: 218px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow-tight);
}

.next-bus-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--amber-soft);
  color: #8b5d02;
}

.next-bus-icon .icon {
  width: 19px;
  height: 19px;
}

.next-bus div:last-child {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 9px;
}

.next-bus span,
.next-bus small {
  color: var(--muted);
  font-size: 10px;
}

.next-bus strong {
  font-size: 25px;
  line-height: 1.15;
}

.next-bus small {
  grid-column: 1 / -1;
}

.student-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.student-workspace {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.form-block {
  padding: 24px 26px 27px;
  border-bottom: 1px solid var(--line);
}

.form-block:last-child {
  border-bottom: 0;
}

.compact-block {
  padding-bottom: 24px;
}

.block-heading,
.section-heading-row,
.people-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.block-heading {
  margin-bottom: 17px;
}

.block-heading > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.block-heading h2 {
  margin-bottom: 0;
  font-size: 16px;
}

.step-index {
  color: var(--coral);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.block-note {
  color: var(--muted);
  font-size: 10px;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.date-field {
  margin-bottom: 19px;
}

.date-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.date-button {
  flex: 1 0 78px;
  min-height: 54px;
  padding: 7px 9px;
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
}

.date-button:hover {
  border-color: var(--pine);
  background: var(--mint-soft);
}

.date-button.is-selected {
  border-color: var(--pine);
  background: var(--mint);
  color: var(--pine-deep);
  box-shadow: inset 0 0 0 1px var(--pine);
}

.date-button strong {
  font-size: 11px;
}

.date-button span {
  color: var(--muted);
  font-size: 9px;
}

.date-button .date-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 17px;
  padding: 1px 5px;
  justify-self: start;
  border-radius: 4px;
  background: var(--mint-soft);
  color: var(--pine);
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}

.date-button.is-selected .date-count {
  background: var(--pine);
  color: var(--white);
}

.date-button.is-selected span {
  color: var(--pine);
}

.direction-label {
  margin-bottom: 8px;
}

.class-time-block {
  margin-bottom: 16px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--mint-soft);
}

.class-time-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.class-time-heading .field-label {
  margin-bottom: 0;
  color: var(--pine-deep);
}

.class-time-heading > span:last-child {
  color: var(--muted);
  font-size: 9px;
}

.class-time-chips {
  display: flex;
  gap: 7px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.class-time-chips button {
  min-width: 92px;
  min-height: 46px;
  padding: 6px 9px;
  display: grid;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--white);
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
}

.class-time-chips button:hover {
  border-color: var(--pine);
}

.class-time-chips button.is-selected {
  border-color: var(--pine);
  background: var(--pine-deep);
  color: var(--white);
}

.class-time-chips strong {
  font-size: 12px;
}

.class-time-chips span {
  color: var(--muted);
  font-size: 9px;
}

.class-time-chips button.is-selected span {
  color: #c9e4dc;
}

.direction-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.direction-option {
  min-height: 78px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink-soft);
  text-align: left;
}

.direction-option:hover {
  border-color: var(--pine);
  background: var(--mint-soft);
}

.direction-option.is-active {
  border-color: var(--pine);
  background: var(--mint);
  color: var(--pine-deep);
  box-shadow: inset 0 0 0 1px var(--pine);
}

.direction-terminal {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.route-arrow {
  min-width: 38px;
  display: flex;
  align-items: center;
  color: var(--pine);
}

.route-arrow span {
  width: 100%;
  height: 1px;
  background: currentColor;
}

.route-arrow .icon {
  width: 14px;
  height: 14px;
  margin-left: -1px;
}

.period-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.period-tab {
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 6px;
  background: var(--white);
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.period-tab:hover {
  color: var(--pine);
  border-color: var(--line-strong);
}

.period-tab.is-active {
  background: var(--pine-deep);
  border-color: var(--pine-deep);
  color: var(--white);
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.slot-button {
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  display: grid;
  gap: 4px;
  text-align: left;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.slot-button:hover {
  border-color: var(--pine);
  transform: translateY(-1px);
}

.slot-button.is-selected {
  border-color: var(--pine);
  background: var(--mint);
  box-shadow: inset 0 0 0 1px var(--pine);
}

.slot-time {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.slot-meta {
  color: var(--muted);
  font-size: 10px;
}

.slot-button.is-selected .slot-meta {
  color: var(--pine);
  font-weight: 700;
}

.slot-button.is-peak:not(.is-selected)::after {
  content: "高峰";
  justify-self: start;
  padding: 2px 5px;
  border-radius: 4px;
  color: #7c5506;
  background: var(--amber-soft);
  font-size: 9px;
  font-weight: 800;
}

.slot-help {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.people-row {
  min-height: 50px;
}

.people-row p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.stepper-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--mint-soft);
  color: var(--pine);
}

.stepper-button:hover:not(:disabled) {
  background: var(--mint);
}

.stepper-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.stepper .icon {
  width: 15px;
  height: 15px;
}

.people-input {
  width: 92px;
  min-height: 32px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  appearance: textfield;
}

.people-input::-webkit-outer-spin-button,
.people-input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.people-input:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
  border-radius: 4px;
}

.people-unit {
  margin-left: -10px;
  color: var(--muted);
  font-size: 11px;
}

.booking-panel {
  position: sticky;
  top: 94px;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.summary-top h2 {
  margin-bottom: 0;
  font-size: 21px;
}

.summary-route {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 23px 0 18px;
}

.route-station {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.station-dot {
  width: 9px;
  height: 9px;
  border: 2px solid var(--pine);
  border-radius: 50%;
  background: var(--white);
}

.station-dot-end {
  border-color: var(--coral);
  background: var(--coral);
}

.summary-line {
  height: 1px;
  min-width: 28px;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 4px, transparent 4px 8px);
}

.summary-list {
  margin: 0;
  border-top: 1px solid var(--line);
}

.summary-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.summary-list dt {
  color: var(--muted);
  font-size: 11px;
}

.summary-list dd {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.notice-line {
  margin: 17px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.notice-line .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: var(--coral);
}

.primary-button,
.secondary-button {
  min-height: 42px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  color: var(--white);
  background: var(--pine-deep);
  box-shadow: 0 6px 18px rgba(18, 61, 55, 0.16);
}

.primary-button:hover:not(:disabled) {
  background: #0d332e;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.primary-button .icon {
  width: 15px;
  height: 15px;
}

.booking-panel > .primary-button {
  width: 100%;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--pine-deep);
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--pine);
  background: var(--mint-soft);
}

.secondary-button .icon {
  width: 15px;
  height: 15px;
}

.submission-state {
  margin-top: 14px;
  padding: 12px;
  display: flex;
  gap: 10px;
  border: 1px solid #bfdecf;
  border-radius: 7px;
  background: #edf8f1;
}

.submission-check {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: #31855e;
  flex: 0 0 auto;
}

.submission-check .icon {
  width: 14px;
  height: 14px;
}

.submission-state strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
}

.submission-state p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

.schedule-section {
  margin-top: 24px;
  padding: 25px 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-tight);
}

.section-heading-row {
  margin-bottom: 18px;
}

.section-heading-row h2 {
  margin-bottom: 0;
}

.status-chip,
.table-status {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 9px;
  border-radius: 5px;
  background: var(--amber-soft);
  color: #7a5507;
  font-size: 10px;
  font-weight: 900;
}

.status-chip.is-published,
.table-status.is-published {
  background: #e5f5eb;
  color: #27724e;
}

.schedule-body {
  min-height: 112px;
}

.schedule-empty,
.notification-strip {
  display: flex;
  align-items: center;
  gap: 14px;
}

.schedule-empty {
  min-height: 104px;
  padding: 17px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: var(--white);
}

.empty-icon,
.notification-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--mint);
  color: var(--pine);
  flex: 0 0 auto;
}

.empty-icon .icon,
.notification-icon .icon {
  width: 19px;
  height: 19px;
}

.schedule-empty strong,
.notification-strip strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.schedule-empty p,
.notification-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.schedule-list {
  display: grid;
  gap: 8px;
}

.schedule-row {
  display: grid;
  grid-template-columns: 90px 1fr 112px;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
}

.schedule-row time {
  font-size: 17px;
  font-weight: 900;
}

.schedule-row span {
  color: var(--ink-soft);
  font-size: 11px;
}

.schedule-row strong {
  justify-self: end;
  color: var(--pine);
  font-size: 10px;
}

.notification-strip {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid #bfdecf;
  border-radius: 7px;
  background: #edf8f1;
}

.notification-strip.is-alert {
  border-color: #f0c4b7;
  background: var(--coral-soft);
}

.notification-strip.is-alert .notification-icon {
  color: var(--coral);
  background: var(--white);
}

.operator-heading {
  align-items: center;
}

.operator-datebar {
  margin-bottom: 16px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-tight);
}

.operator-datebar .field-label {
  margin-bottom: 9px;
}

.date-strip-compact .date-button {
  min-height: 48px;
}

.operator-direction-toggle {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.operator-direction-toggle button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.operator-direction-toggle button:hover {
  border-color: var(--pine);
  color: var(--pine);
}

.operator-direction-toggle button.is-active {
  border-color: var(--pine);
  background: var(--mint);
  color: var(--pine-deep);
}

.shared-overview {
  margin: 11px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

.shared-overview strong {
  color: var(--pine-deep);
  font-size: 12px;
}

.operator-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.extra-time-control {
  min-height: 42px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
}

.extra-time-control span {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.extra-time-control input {
  width: 94px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.extra-time-control input:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 4px;
}

.operator-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi {
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow-tight);
}

.kpi > span,
.kpi > small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.kpi strong {
  display: block;
  margin: 8px 0 5px;
  font-size: 31px;
  line-height: 1;
}

.kpi-warning {
  border-color: #efcdb9;
  background: #fffaf6;
}

.kpi-warning strong {
  color: var(--coral);
}

.operator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.demand-panel,
.logic-panel,
.schedule-table-section,
.ops-log {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-tight);
}

.demand-panel {
  padding: 22px 24px 18px;
}

.logic-panel {
  padding: 22px;
  background: var(--pine-deep);
  color: var(--white);
}

.logic-panel .eyebrow {
  color: #a9d5c8;
}

.logic-panel h2 {
  color: var(--white);
}

.chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.chart-legend span {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--pine);
}

.demand-chart {
  height: 225px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: clamp(8px, 1.5vw, 18px);
  align-items: end;
  padding: 16px 5px 0;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0 44px, rgba(31, 92, 82, 0.08) 44px 45px);
}

.bar-column {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 7px;
  align-items: end;
}

.bar-track {
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: stretch;
}

.bar {
  width: 100%;
  min-height: 6px;
  border-radius: 4px 4px 0 0;
  background: var(--pine);
  transition: height 280ms ease;
}

.bar-column.is-peak .bar {
  background: var(--coral);
}

.bar-labels {
  display: grid;
  gap: 2px;
  text-align: center;
}

.bar-labels strong {
  font-size: 10px;
}

.bar-labels span {
  color: var(--muted);
  font-size: 9px;
}

.logic-equation {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: baseline;
  padding: 14px 0 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.logic-equation span {
  color: #b8d9cf;
  font-size: 10px;
}

.logic-equation b {
  font-size: 18px;
}

.logic-equation strong {
  color: var(--amber);
  font-size: 25px;
}

.logic-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
}

.logic-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  font-size: 10px;
}

.logic-list li span {
  color: #b8d9cf;
}

.logic-list li strong {
  color: var(--white);
  text-align: right;
}

.logic-note {
  margin: 14px 0 0;
  color: #b8d9cf;
  font-size: 10px;
  line-height: 1.6;
}

.logic-note.is-warning {
  color: #ffc8b8;
  font-weight: 700;
}

.schedule-table-section,
.published-trips-section,
.ops-log {
  padding: 22px 24px;
  margin-bottom: 20px;
}

.published-trips-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-tight);
}

.published-trip-list {
  display: grid;
  gap: 7px;
}

.published-trip-empty {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.published-trip-row {
  min-height: 48px;
  padding: 8px 11px;
  display: grid;
  grid-template-columns: 78px minmax(110px, 1fr) 88px auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.published-trip-row:first-child {
  border-top: 0;
}

.published-trip-row time {
  font-size: 15px;
  font-weight: 900;
}

.published-trip-row span {
  color: var(--ink-soft);
  font-size: 10px;
}

.trip-badge {
  justify-self: start;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--mint);
  color: var(--pine) !important;
  font-size: 8px !important;
  font-weight: 800;
}

.trip-badge.is-extra {
  background: var(--coral-soft);
  color: var(--coral) !important;
}

.cancel-extra {
  min-height: 29px;
  padding: 5px 8px;
  border: 1px solid #e5c0b4;
  border-radius: 5px;
  background: var(--white);
  color: #9b442f;
  font-size: 8.5px;
  font-weight: 800;
  cursor: pointer;
}

.cancel-extra:hover {
  background: var(--coral-soft);
}

.schedule-table {
  width: 100%;
}

.schedule-table-empty {
  padding: 22px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: var(--white);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.schedule-table-head,
.schedule-table-row {
  display: grid;
  grid-template-columns: 112px minmax(150px, 1.2fr) 92px 92px minmax(150px, 1fr) 86px;
  gap: 10px;
  align-items: center;
}

.schedule-table-head {
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 9px;
}

.schedule-table-row {
  min-height: 56px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: var(--white);
}

.schedule-table-row:last-child {
  border-radius: 0 0 7px 7px;
}

.schedule-table-row time {
  font-size: 14px;
  font-weight: 900;
}

.schedule-table-row span {
  color: var(--ink-soft);
  font-size: 10px;
}

.schedule-table-row b {
  font-size: 12px;
}

.table-check {
  justify-self: end;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--white);
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
}

.table-check:hover {
  border-color: var(--pine);
  color: var(--pine);
}

.table-check.is-adopted {
  border-color: #a9d6bd;
  background: #e8f6ee;
  color: #27724e;
}

.row-actions {
  display: grid;
  gap: 4px;
  justify-self: stretch;
}

.row-actions .table-check {
  width: 100%;
  justify-self: stretch;
}

.table-action {
  min-height: 28px;
  padding: 5px 7px;
  border: 1px solid #e5c0b4;
  border-radius: 5px;
  background: var(--coral-soft);
  color: #9b442f;
  font-size: 8.5px;
  font-weight: 800;
  white-space: nowrap;
}

.table-action:hover:not(:disabled) {
  border-color: var(--coral);
  background: #f8ddd4;
}

.table-action:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.log-list {
  display: grid;
  gap: 0;
}

.log-row {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.log-row:first-child {
  border-top: 0;
}

.log-row time {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.log-row span {
  color: var(--ink-soft);
  font-size: 11px;
}

.log-row strong {
  color: var(--pine);
  font-size: 9px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pine);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 50;
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 16px;
  transform: translate(-50%, 18px);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--ink);
  color: var(--white);
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 12px 32px rgba(23, 43, 42, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.page-footer {
  width: min(1380px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 28px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 9px;
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .mode-switch {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
  }

  .student-grid {
    grid-template-columns: minmax(0, 1fr) 310px;
  }

  .slot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .operator-grid {
    grid-template-columns: 1fr;
  }

  .schedule-table-head,
  .schedule-table-row {
    grid-template-columns: 98px minmax(140px, 1.2fr) 76px 76px minmax(130px, 1fr) 78px;
  }
}

@media (max-width: 840px) {
  .page-shell {
    width: min(100% - 24px, 720px);
    padding-top: 26px;
  }

  .topbar {
    padding-inline: 14px;
  }

  .brand-copy small,
  .demo-badge {
    display: none;
  }

  .live-clock {
    font-size: 9.5px;
  }

  .view-heading,
  .operator-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 20px;
  }

  .next-bus {
    width: 100%;
  }

  .student-grid {
    grid-template-columns: 1fr;
  }

  .booking-panel {
    position: static;
  }

  .operator-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-table-head {
    display: none;
  }

  .schedule-table-row {
    grid-template-columns: 76px 1fr auto;
    gap: 6px 12px;
    padding-block: 12px;
  }

  .schedule-table-row > :nth-child(3),
  .schedule-table-row > :nth-child(4) {
    grid-row: 2;
    justify-self: start;
  }

  .schedule-table-row > :nth-child(5) {
    grid-column: 2;
    grid-row: 3;
  }

  .schedule-table-row > :nth-child(6) {
    grid-column: 3;
    grid-row: 1 / 3;
  }

  .page-footer {
    width: min(100% - 24px, 720px);
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 620px) {
  .topbar {
    gap: 10px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-copy strong {
    font-size: 16px;
  }

  .text-button {
    padding-inline: 8px;
  }

  .mode-switch {
    width: 100%;
  }

  .mode-button {
    flex: 1;
  }

  h1 {
    font-size: 31px;
    letter-spacing: -0.02em;
  }

  .form-block,
  .booking-panel,
  .schedule-section,
  .demand-panel,
  .logic-panel,
  .schedule-table-section,
  .ops-log {
    padding: 19px 16px;
  }

  .direction-control {
    grid-template-columns: 1fr;
  }

  .slot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .slot-button {
    min-height: 60px;
    padding: 7px;
  }

  .slot-time {
    font-size: 12px;
  }

  .slot-meta {
    font-size: 9px;
  }

  .people-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .stepper {
    align-self: stretch;
    justify-content: space-between;
  }

  .summary-route {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .summary-line {
    width: 1px;
    height: 18px;
    margin-left: 4px;
    background: repeating-linear-gradient(180deg, var(--line-strong) 0 4px, transparent 4px 8px);
  }

  .route-station {
    font-size: 11px;
  }

  .operator-kpis {
    gap: 8px;
  }

  .kpi {
    padding: 14px;
  }

  .kpi strong {
    font-size: 27px;
  }

  .operator-actions {
    width: 100%;
    justify-content: stretch;
  }

  .operator-actions button {
    flex: 1 1 100%;
  }

  .demand-chart {
    height: 190px;
    gap: 7px;
  }

  .bar-labels strong,
  .bar-labels span {
    font-size: 8px;
  }

  .schedule-row {
    grid-template-columns: 78px 1fr;
  }

  .schedule-row strong {
    grid-column: 2;
    justify-self: start;
  }

  .log-row {
    grid-template-columns: 62px 1fr;
  }

  .log-row strong {
    grid-column: 2;
  }

  .published-trip-row {
    grid-template-columns: 64px 1fr auto;
    gap: 7px;
  }

  .published-trip-row > span:nth-child(2) {
    grid-column: 2;
  }

  .published-trip-row .trip-badge {
    grid-column: 2;
  }

  .published-trip-row .cancel-extra {
    grid-column: 3;
    grid-row: 1 / 3;
  }
}

@media (max-width: 390px) {
  .slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .next-bus {
    min-width: 0;
  }

  .operator-kpis {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
