:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #fbfcff;
  --surface-tint: #fff7fa;
  --ink: #2b303b;
  --ink-soft: #4f5a68;
  --muted: #7a8493;
  --line: #e4e8f0;
  --line-strong: #cfd7e6;
  --rose: #e76f93;
  --rose-deep: #cf5478;
  --rose-soft: #ffe7f0;
  --mint: #36a98b;
  --mint-soft: #e3f7f1;
  --blue: #4f74d8;
  --route-blue: #1d4ed8;
  --blue-soft: #eaf0ff;
  --violet: #8470d4;
  --violet-soft: #f0ecff;
  --amber: #b16a22;
  --amber-soft: #fff0dc;
  --red: #c84b42;
  --red-soft: #ffe7e4;
  --green: #238461;
  --shadow: 0 18px 42px rgba(47, 58, 79, 0.08);
  --shadow-soft: 0 8px 22px rgba(47, 58, 79, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, #fff5fa 0, #f2fbf8 360px, var(--bg) 820px);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--muted);
}

.boot-mark {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--mint));
  box-shadow: var(--shadow);
  font-size: 22px;
  font-weight: 900;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(230px, auto) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(228, 232, 240, 0.88);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--rose), #f6a0b7);
  box-shadow: 0 10px 22px rgba(231, 111, 147, 0.25);
  font-weight: 900;
}

.brand-copy {
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.15;
  font-weight: 880;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.event-switch {
  width: min(260px, 100%);
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.event-switch span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.event-switch select {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 760;
}

.rail-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 92px));
  gap: 8px;
}

.rail-status div {
  min-width: 0;
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.rail-status span,
.rail-status small {
  color: var(--muted);
  font-size: 11px;
}

.rail-status strong {
  color: var(--ink);
  font-size: 17px;
  line-height: 1;
  font-weight: 900;
}

.nav-tabs {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink-soft);
  background: transparent;
  white-space: nowrap;
  font-weight: 760;
  text-decoration: none;
}

.nav-button:hover {
  color: var(--rose-deep);
  background: var(--rose-soft);
}

.nav-button.is-active {
  color: #fff;
  border-color: var(--rose);
  background: var(--rose);
  box-shadow: 0 10px 20px rgba(231, 111, 147, 0.22);
}

.nav-link {
  border-color: rgba(79, 116, 216, 0.22);
  color: var(--blue);
  background: var(--blue-soft);
}

.page {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px;
}

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

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 22px 24px;
  border: 1px solid rgba(228, 232, 240, 0.95);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 248, 251, 0.98) 0%, rgba(243, 251, 248, 0.96) 62%, rgba(246, 248, 255, 0.98) 100%);
  box-shadow: var(--shadow-soft);
}

.page-intro-copy {
  min-width: 0;
}

.page-intro h2 {
  margin: 0;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.12;
  font-weight: 920;
  overflow-wrap: anywhere;
}

.page-intro p:last-child {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.page-intro-chips {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 48%;
}

.page-intro-chips span {
  min-height: 34px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(228, 232, 240, 0.96);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 780;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-board,
.side-board,
.panel,
.item-card,
.metric-tile,
.form-strip,
.route-visual,
.empty-state,
.error-box {
  border-radius: 8px;
}

.event-board {
  min-height: 620px;
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  background:
    linear-gradient(135deg, #fff8fb 0%, #f0fbf7 58%, #edf3ff 100%);
  border: 1px solid rgba(228, 232, 240, 0.95);
  box-shadow: var(--shadow);
}

.event-main {
  min-width: 0;
  padding: 28px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--rose-deep);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.event-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.event-title-row h2 {
  margin: 0;
  max-width: 100%;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.15;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.6;
}

.event-meta span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(228, 232, 240, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.status-pill,
.mini-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--green);
  background: var(--mint-soft);
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

.status-pill.warn {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-pill.danger {
  color: var(--red);
  background: var(--red-soft);
}

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

.metric-tile {
  min-width: 0;
  min-height: 108px;
  display: grid;
  align-content: start;
  padding: 14px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(228, 232, 240, 0.95);
  box-shadow: none;
}

.metric-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.metric-value {
  display: block;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.metric-sub {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.meter {
  height: 5px;
  display: block;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f6;
}

.meter i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--mint));
}

.route-visual {
  position: relative;
  min-height: 100%;
  padding: 0 28px 28px;
  border-top: 1px solid rgba(228, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.28);
}

.route-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.route-head strong {
  color: var(--rose-deep);
  font-size: 14px;
}

.route-head a {
  color: var(--route-blue);
  text-decoration: none;
  font-weight: 850;
}

.route-head-secondary {
  margin-top: 14px;
}

.route-map-shell {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef5f2;
}

.route-map {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  background: #f2efe7;
}

.route-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(228, 232, 240, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
}

.route-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.route-legend i {
  width: 18px;
  height: 5px;
  border-radius: 3px;
  display: inline-block;
}

.route-legend small {
  color: var(--muted);
  font-weight: 700;
}

.official-course {
  margin: 0;
}

.official-course-scroll {
  overflow: hidden;
  max-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #63b7a8;
}

.official-course-frame {
  display: block;
  height: 220px;
  overflow: hidden;
}

.official-course img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
}

.official-course figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.official-course figcaption a {
  color: var(--route-blue);
  text-decoration: none;
  white-space: nowrap;
}

.official-stations {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.official-station {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(228, 232, 240, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.official-station strong {
  color: var(--route-blue);
  font-size: 14px;
  font-weight: 920;
}

.official-station span {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.official-station i {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--blue-soft);
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
}

.source-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(228, 232, 240, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.source-links span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.source-links a {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(29, 78, 216, 0.18);
  border-radius: 999px;
  color: var(--route-blue);
  background: rgba(234, 240, 255, 0.76);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.raster-map-base,
.raster-route-overlay {
  position: absolute;
  inset: 0;
}

.raster-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  user-select: none;
  -webkit-user-drag: none;
}

.raster-route-overlay {
  z-index: 3;
  pointer-events: none;
}

.raster-route-overlay polyline {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.raster-route-overlay .route-halo {
  stroke: #fff;
  stroke-width: 16;
  opacity: 0.95;
}

.raster-route-overlay .route-line {
  stroke: var(--route-blue);
  stroke-width: 9;
  filter: drop-shadow(0 2px 5px rgba(29, 78, 216, 0.28));
}

.raster-marker {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -115%);
}

.raster-scale {
  position: absolute;
  left: 12px;
  bottom: 34px;
  z-index: 5;
  min-width: 112px;
  display: inline-flex;
  justify-content: center;
  padding-top: 3px;
  border-top: 2px solid #2f3a4f;
  border-left: 1px solid #2f3a4f;
  border-right: 1px solid #2f3a4f;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 780;
}

.map-status-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(228, 232, 240, 0.95);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
  font-size: 12px;
  font-weight: 850;
}

.map-provider {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 8;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--rose-deep);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(228, 232, 240, 0.86);
  font-size: 11px;
  font-weight: 850;
}

.live-marker {
  pointer-events: auto;
}

.map-loading,
.map-fallback {
  min-height: 340px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: linear-gradient(135deg, #fff8fb, #effaf6);
  font-size: 13px;
  text-align: center;
}

.map-fallback {
  align-content: center;
  gap: 4px;
  padding: 10px;
}

.map-fallback p {
  margin: 0;
}

.map-marker {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--rose);
  border: 2px solid #fff;
  box-shadow: 0 8px 18px rgba(47, 58, 79, 0.22);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.map-marker.mini {
  min-height: 24px;
  color: var(--ink);
  background: #fff;
  border-color: var(--mint);
}

.map-marker.timing {
  min-height: 24px;
  color: #fff;
  background: #8d79db;
  border-color: #fff;
}

.map-marker.water,
.map-marker.station {
  min-height: 24px;
  color: var(--ink);
  background: #fff;
  border-color: var(--mint);
}

.map-marker.station {
  border-color: #f7bd71;
}

.route-sketch {
  width: 100%;
  height: 144px;
  display: block;
}

.route-sketch path {
  fill: none;
  stroke: var(--route-blue);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-sketch circle {
  fill: #fff;
  stroke: var(--mint);
  stroke-width: 4;
}

.route-sketch text {
  fill: var(--ink-soft);
  font-size: 12px;
  font-weight: 850;
}

.checkpoint-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.checkpoint-strip span {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-size: 11px;
}

.checkpoint-strip strong {
  color: var(--ink);
  font-size: 12px;
}

.station-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
  padding-bottom: 0;
}

.station-strip span {
  min-width: 0;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid rgba(228, 232, 240, 0.95);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

.station-strip strong {
  color: var(--ink);
  font-size: 12px;
}

.station-strip .timing {
  border-color: rgba(141, 121, 219, 0.28);
  background: #f6f3ff;
}

.station-strip .water {
  border-color: rgba(64, 183, 153, 0.26);
  background: #f3fbf8;
}

.station-strip .station {
  border-color: rgba(247, 189, 113, 0.32);
  background: #fff8ee;
}

.route-segments {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.route-leg {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid rgba(228, 232, 240, 0.95);
  border-radius: 8px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.88);
  font-size: 12px;
}

.route-leg strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.route-leg span {
  line-height: 1.55;
}

.route-leg.outbound {
  color: var(--rose-deep);
  background: #fff5f8;
}

.route-leg.turnaround {
  color: #6858ba;
  background: #f6f3ff;
}

.route-leg.returning,
.route-leg.reverse {
  color: #387f71;
  background: #f3fbf8;
}

.route-note {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.route-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.side-board,
.panel,
.item-card,
.form-strip,
.empty-state,
.error-box {
  border: 1px solid rgba(228, 232, 240, 0.95);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.side-board {
  min-width: 0;
  padding: 18px;
}

.quick-fields {
  display: grid;
  gap: 10px;
}

.event-manager-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.4fr) auto;
  gap: 10px;
  align-items: end;
}

.event-paths {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.event-paths span {
  overflow-wrap: anywhere;
}

.event-paths a {
  color: var(--blue);
  font-weight: 780;
  text-decoration: none;
}

.history-layout {
  align-items: start;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 12px;
}

.history-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.history-card.is-active {
  border-color: rgba(231, 111, 147, 0.45);
  background: #fff8fb;
}

.history-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.history-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 880;
  overflow-wrap: anywhere;
}

.history-card-head p,
.history-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-meta span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

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

.history-metric {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 9px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.history-metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.history-metric strong {
  color: var(--ink);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-metric i {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.history-metric b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--mint));
}

.history-paths {
  margin-top: 0;
  padding-top: 10px;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-actions .primary-button[disabled] {
  opacity: 0.62;
  cursor: default;
}

.history-summary {
  display: grid;
  gap: 10px;
}

.field,
.inline-field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.field span,
.inline-field span,
.form-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.field input,
.field select,
.field textarea,
.inline-field input,
.inline-field select,
.inline-field textarea,
.compact-input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.field textarea,
.inline-field textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.55;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.inline-field input:focus,
.inline-field select:focus,
.inline-field textarea:focus,
.compact-input:focus {
  border-color: rgba(231, 111, 147, 0.55);
  box-shadow: 0 0 0 3px rgba(231, 111, 147, 0.13);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.main-stack,
.side-stack {
  display: grid;
  gap: 16px;
  align-content: start;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 850;
}

.panel-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.list {
  display: grid;
  gap: 10px;
}

.item-card {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 12px;
  box-shadow: none;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}

.item-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.item-card.is-done {
  background: #fbfdfc;
}

.item-card.is-done .item-title {
  color: #7c8593;
  text-decoration: line-through;
}

.check {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  appearance: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
}

.check:checked {
  border-color: var(--rose);
  background: var(--rose);
}

.check:checked::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translateY(-1px) rotate(-45deg);
}

.item-title {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.item-meta span:not(.status-pill) {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #f3f6fb;
}

.item-note {
  margin: 8px 0 0;
  color: var(--ink-soft);
  line-height: 1.5;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.icon-button,
.text-button,
.primary-button,
.secondary-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  background: #fff;
  font-weight: 760;
}

.primary-button {
  border-color: var(--rose);
  color: #fff;
  background: var(--rose);
  box-shadow: 0 10px 18px rgba(231, 111, 147, 0.18);
}

.primary-button:hover {
  background: var(--rose-deep);
}

.secondary-button {
  border-color: rgba(79, 116, 216, 0.22);
  color: var(--blue);
  background: var(--blue-soft);
}

.text-button {
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}

.icon-button {
  width: 36px;
  padding: 0;
}

.icon-button svg,
.button-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.delete-button {
  color: var(--red);
}

.form-strip {
  margin-bottom: 14px;
  padding: 14px;
  box-shadow: none;
  background: var(--surface-soft);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.log-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
}

.log-form-grid .primary-button {
  min-width: 82px;
}

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

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
}

.phase-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.phase-button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-weight: 760;
}

.phase-button.is-active {
  color: var(--rose-deep);
  border-color: #ffd3e0;
  background: #fff;
  box-shadow: 0 4px 12px rgba(47, 58, 79, 0.06);
}

.gear-category {
  display: grid;
  gap: 8px;
}

.gear-category + .gear-category {
  margin-top: 20px;
}

.category-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 0 2px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 850;
}

.gear-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 90px 102px 102px auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.gear-row:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.gear-name {
  min-width: 0;
}

.gear-name strong {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.35;
}

.gear-name small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.toggle-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  white-space: nowrap;
}

.toggle-check input {
  width: 34px;
  height: 20px;
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #edf1f7;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.toggle-check input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(47, 58, 79, 0.22);
  transition: transform 0.16s ease;
}

.toggle-check input:checked {
  border-color: var(--mint);
  background: var(--mint);
}

.toggle-check input:checked::after {
  transform: translateX(14px);
}

.pace-table,
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.pace-table th,
.pace-table td,
.data-table th,
.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

.pace-table th,
.data-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 800;
}

.pace-table tr:last-child td,
.data-table tr:last-child td {
  border-bottom: 0;
}

.pace-ok {
  color: var(--green);
  font-weight: 850;
}

.pace-risk {
  color: var(--red);
  font-weight: 850;
}

.timeline {
  position: relative;
  display: grid;
  gap: 10px;
}

.schedule-card {
  display: grid;
  grid-template-columns: 72px auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.schedule-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.schedule-card.is-done .item-title {
  color: #7c8593;
  text-decoration: line-through;
}

.time-chip {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  border-radius: 8px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 13px;
  font-weight: 850;
}

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

.log-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.log-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

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

.review-grid .wide {
  grid-column: 1 / -1;
}

.empty-state {
  padding: 22px;
  color: var(--muted);
  background: var(--surface-soft);
  text-align: center;
}

.error-box {
  width: min(680px, calc(100% - 32px));
  margin: 40px auto;
  padding: 20px;
  border-color: rgba(200, 75, 66, 0.25);
  color: var(--red);
  background: var(--red-soft);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  min-width: 220px;
  max-width: calc(100vw - 36px);
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: #2b303b;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1260px) {
  .topbar {
    grid-template-columns: minmax(230px, auto) auto;
  }

  .nav-tabs {
    grid-column: 1 / -1;
    justify-self: start;
    width: 100%;
  }

  .summary-band,
  .content-grid,
  .event-board {
    grid-template-columns: 1fr;
  }

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

  .page-intro-chips {
    justify-content: flex-start;
    max-width: 100%;
  }

  .route-visual {
    border-top: 1px solid rgba(228, 232, 240, 0.9);
  }

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

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

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

  .page {
    padding: 16px;
  }

  .event-main,
  .page-intro,
  .panel,
  .side-board {
    padding: 16px;
  }

  .route-visual {
    padding: 0 16px 16px;
  }

  .route-map-shell,
  .route-map,
  .map-loading,
  .map-fallback {
    min-height: 280px;
  }

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

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

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

  .event-title-row h2 {
    font-size: 27px;
  }

  .page-intro h2 {
    font-size: 26px;
  }

  .form-grid,
  .form-grid.three,
  .form-grid.two,
  .event-manager-grid,
  .review-grid {
    grid-template-columns: 1fr;
  }

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

  .gear-row {
    grid-template-columns: 1fr 80px 102px 102px auto;
  }
}

@media (max-width: 680px) {
  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .page {
    padding: 12px;
  }

  .event-main,
  .page-intro,
  .panel,
  .side-board {
    padding: 14px;
  }

  .route-visual {
    padding: 0 14px 14px;
  }

  .event-title-row h2 {
    font-size: 23px;
  }

  .event-meta span {
    width: 100%;
  }

  .page-intro-chips span {
    max-width: 100%;
    white-space: normal;
  }

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

  .checkpoint-strip {
    grid-template-columns: 1fr;
  }

  .station-strip,
  .route-segments,
  .official-stations {
    grid-template-columns: 1fr;
  }

  .route-map-shell,
  .route-map,
  .map-loading,
  .map-fallback {
    min-height: 230px;
  }

  .official-course img {
    min-width: 0;
  }

  .official-course-scroll,
  .official-course-frame {
    max-height: 170px;
    height: 170px;
  }

  .log-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .log-form .field textarea {
    min-height: 118px;
  }

  .item-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .item-card .icon-button {
    grid-column: 2;
    justify-self: end;
  }

  .gear-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .schedule-card {
    grid-template-columns: 64px minmax(0, 1fr) auto;
  }

  .schedule-card .check {
    grid-column: 2;
  }

  .pace-table,
  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
