:root {
  --ink: #1a1612;
  --ink-soft: #5e564c;
  --paper: #f3eee6;
  --sheet: #fffdf9;
  --line: #e3d8ca;
  --stamp: #c4491d;
  --good: #1d6b45;
  --hold: #8a5a12;
  --full: #8d2b2b;
  --night: #141210;
  --serif: "Fraunces", Georgia, serif;
  --sans: "IBM Plex Sans", "Avenir Next", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
}

body.is-login {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(196, 73, 29, 0.18), transparent 42%),
    var(--night);
  color: #f6f1e8;
}

button, input { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--stamp);
  outline-offset: 2px;
}

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.75rem 0 3.5rem;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.eyebrow {
  margin: 0 0 0.2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stamp);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(2rem, 4vw, 3.1rem);
  letter-spacing: -0.035em;
  line-height: 0.95;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.who {
  margin: 0 0.4rem 0 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.btn {
  border: 1px solid var(--ink);
  background: transparent;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}

.btn:hover { background: #fff; }

.btn.primary {
  background: var(--stamp);
  border-color: var(--stamp);
  color: #fff7f2;
}

.btn.primary:hover { background: #a83b16; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 1.5rem;
  background: var(--line);
  border: 1px solid var(--line);
}

.stats article {
  background: var(--sheet);
  padding: 0.85rem 1rem 0.95rem;
}

.stat-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.stats strong {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--serif);
  font-size: 2.15rem;
  font-weight: 560;
  letter-spacing: -0.04em;
  line-height: 1;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 1.1rem 0 0.75rem;
}

#search {
  width: min(340px, 100%);
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  background: var(--sheet);
}

.meta {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.chip {
  border: 1px solid var(--line);
  background: transparent;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}

.chip:hover { border-color: var(--ink); }

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.chip .count {
  margin-left: 0.4rem;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.banner {
  margin: 0.5rem 0 0.85rem;
  padding: 0.7rem 0.85rem;
  background: #f8e6df;
  color: #6d2414;
}

.sheet { margin-top: 0.25rem; }

.cols {
  display: grid;
  grid-template-columns: 11.5rem minmax(14rem, 1.7fr) 5.2rem 5.2rem 5.2rem 7rem;
  gap: 0.75rem;
  align-items: center;
}

.head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.45rem 0.35rem;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.departure {
  width: 100%;
  padding: 0.72rem 0.35rem;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.departure:hover { background: rgba(255, 253, 249, 0.9); }

.when {
  font-family: var(--mono);
  font-size: 0.82rem;
}

.route-name {
  display: block;
  font-weight: 560;
}

.tag {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.bar {
  display: block;
  height: 3px;
  margin-top: 0.4rem;
  background: #eadfD2;
}

.bar-fill {
  display: block;
  height: 100%;
  background: var(--ink);
}

.num {
  font-variant-numeric: tabular-nums;
  font-weight: 560;
}

.is-hot { color: var(--stamp); }
.is-full { color: var(--full); }
.is-hold { color: var(--hold); }

.fare {
  font-family: var(--mono);
  font-size: 0.82rem;
}

.month {
  margin: 1.15rem 0 0.15rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 560;
}

.empty, .loading {
  padding: 1.5rem 0.2rem;
  color: var(--ink-soft);
}

.back {
  margin-bottom: 1rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(16rem, 0.75fr);
  gap: 1.5rem;
  align-items: start;
}

.poster {
  display: block;
  width: 100%;
  height: 320px;
  object-fit: cover;
  background: #e7dfd2;
}

.kicker {
  margin: 0.9rem 0 0.25rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stamp);
}

.dates, .place, .prose, .guide {
  margin: 0.35rem 0 0;
}

.place, .guide, .ref {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.prose { max-width: 62ch; }

.side {
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 1rem 1rem 1.1rem;
}

.side h2 {
  margin: 1rem 0 0.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.side h2:first-child { margin-top: 0; }
.side .btn { margin-bottom: 0.85rem; }

.live {
  display: inline-block;
  margin: 0 0 0.7rem;
  padding: 0.15rem 0.4rem;
  background: #e7f3ec;
  color: var(--good);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pair {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-top: 1px solid var(--line);
}

.pair span:last-child { font-variant-numeric: tabular-nums; font-weight: 560; }

.note {
  margin: 0.7rem 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0; margin: 0; list-style: none; }
.chips li {
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--line);
  font-size: 0.85rem;
}

.doc { margin-top: 0.45rem; }
.doc summary { cursor: pointer; }
.doc p { white-space: pre-wrap; color: var(--ink-soft); font-size: 0.92rem; }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.pass {
  width: min(420px, 100%);
  background: var(--sheet);
  color: var(--ink);
  padding: 1.4rem 1.4rem 1.2rem;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}

.pass-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px dashed var(--line);
}

.wordmark {
  display: block;
  margin: 0;
  color: inherit;
  text-decoration: none;
}

.wordmark .logo { height: 58px; }

.board-logo {
  display: inline-block;
  margin: 0 0 0.35rem;
  text-decoration: none;
}

.board-logo .logo { height: 42px; }

.pass h1 {
  margin: 1rem 0 0.3rem;
  font-size: 2rem;
}

.lede {
  margin: 0 0 1.1rem;
  color: var(--ink-soft);
}

.pass form { display: grid; gap: 0.8rem; }

.pass label {
  display: grid;
  gap: 0.3rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.pass input {
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--sans);
  font-size: 1rem;
}

.form-error {
  min-height: 1.2em;
  margin: 0;
  color: var(--full);
  font-size: 0.9rem;
}

.hint {
  margin: 0.85rem 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.inbox {
  margin-top: 1.15rem;
  padding-top: 0.2rem;
}

.inbox-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.inbox h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 560;
}

.notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.15rem 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.notice-kicker,
.toast-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stamp);
}

.notice-title,
.toast-title {
  margin: 0.15rem 0 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.82rem;
  text-align: left;
  color: var(--ink);
  word-break: break-all;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 0.18em;
}

.notice-title:hover,
.toast-title:hover {
  color: var(--stamp);
  text-decoration-color: var(--stamp);
}

.notice-title { grid-column: 1 / -1; }

.payload {
  width: min(36rem, calc(100vw - 2rem));
  max-height: min(32rem, calc(100vh - 2rem));
  overflow: auto;
  padding: 1.1rem 1.2rem 1.25rem;
  border: 1px solid var(--line);
  background: var(--sheet);
  color: var(--ink);
}

.payload::backdrop {
  background: rgba(26, 22, 18, 0.45);
}

.payload-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.payload h2 {
  margin: 0.35rem 0 0;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 500;
  word-break: break-all;
}

.payload-list {
  margin: 1rem 0 0;
  display: grid;
  gap: 0.7rem;
}

.payload-list div {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: baseline;
}

.payload-list dt {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.payload-list dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  word-break: break-all;
}

.notice-meta,
.toast-meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.notice-update,
.toast-update {
  grid-column: 1 / -1;
  margin: 0.35rem 0 0;
}

#toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  display: grid;
  gap: 0.6rem;
  width: min(24rem, calc(100% - 2rem));
}

.toast {
  padding: 0.85rem 0.9rem 0.75rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(26, 22, 18, 0.12);
}

.toast-close {
  margin-top: 0.65rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

@media (max-width: 800px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .top { align-items: flex-start; flex-direction: column; }
  .top-actions { justify-content: flex-start; }
  .detail { grid-template-columns: 1fr; }
  .head { display: none; }
  .cols.departure {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.35rem 0.75rem;
    padding: 0.9rem 0;
  }
  .route, .when { grid-column: 1 / -1; }
  .fare { grid-column: 1 / -1; }
  .metric::before {
    content: attr(data-label);
    display: block;
    font-family: var(--mono);
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }
  .poster { height: 200px; }
  .payload-list div { grid-template-columns: 1fr; gap: 0.2rem; }
}

body.is-home {
  background: #101210;
  color: #f6f3ec;
}

.home-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: #171c18;
  color: #f7f4ee;
}

.home-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.home-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 12, 10, 0.42) 0%, rgba(10, 12, 10, 0.08) 38%, rgba(10, 12, 10, 0.78) 100%),
    linear-gradient(90deg, rgba(10, 12, 10, 0.55) 0%, rgba(10, 12, 10, 0.05) 58%);
}

.home-nav,
.home-hero {
  position: relative;
  z-index: 1;
}

.home-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.75rem;
}

.logo {
  display: block;
  height: 52px;
  width: auto;
}

.home-mark {
  display: block;
  width: fit-content;
  text-decoration: none;
  cursor: pointer;
}

.home-mark .logo {
  height: 64px;
  filter: drop-shadow(0 1px 10px rgba(0, 0, 0, 0.45));
}

.home-signin {
  display: inline-flex;
  align-items: center;
  padding: 0.62rem 1rem;
  border-radius: 999px;
  background: #f7f4ee;
  color: #141614;
  font-family: "Instrument Sans", var(--sans);
  font-size: 0.95rem;
  font-weight: 560;
  text-decoration: none;
}

.home-signin:hover { background: #fff; }

button.home-signin {
  border: 0;
  cursor: pointer;
}

.ops-login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: #101210;
  color: #f7f4ee;
}

.ops-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding: 2.5rem 3.25rem;
}

.ops-form .home-mark { margin-bottom: 2.4rem; }

.ops-form h1 {
  margin: 0;
  font-family: "Instrument Sans", var(--sans);
  font-weight: 500;
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  letter-spacing: -0.055em;
  line-height: 0.92;
  color: #f7f4ee;
}

.ops-form form {
  display: grid;
  gap: 0.85rem;
  width: min(22rem, 100%);
  margin-top: 1.5rem;
}

.ops-form label {
  display: grid;
  gap: 0.4rem;
  font-family: "Instrument Sans", var(--sans);
  font-size: 0.72rem;
  font-weight: 560;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(247, 244, 238, 0.72);
}

.ops-form input {
  padding: 0.75rem 0.8rem;
  border: 1px solid rgba(247, 244, 238, 0.45);
  border-radius: 0;
  background: transparent;
  color: #f7f4ee;
  font-family: "Instrument Sans", var(--sans);
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
}

.ops-form .form-error { color: #ffd0c2; }

.ops-photo {
  margin: 0;
  min-height: 100%;
  background: #171c18;
}

.ops-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.ops-photo {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.login-submit {
  justify-self: start;
  margin-top: 0.35rem;
}

.login-hint {
  max-width: 36rem;
  margin: 1rem 0 0;
  font-family: "Instrument Sans", var(--sans);
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(247, 244, 238, 0.72);
}

.home-hero {
  width: min(1120px, 100%);
  padding: 0 1.75rem 3.4rem;
}

.home-kicker {
  margin: 0 0 0.85rem;
  font-family: "Instrument Sans", var(--sans);
  font-size: 0.78rem;
  font-weight: 560;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(247, 244, 238, 0.78);
}

.home-kicker.dark { color: #6d675e; }

.home-hero h1 {
  max-width: 20ch;
  font-family: "Instrument Sans", var(--sans);
  font-weight: 500;
  font-size: clamp(3.4rem, 8vw, 7.1rem);
  letter-spacing: -0.055em;
  line-height: 0.9;
  color: #f7f4ee;
}

.home-lede {
  max-width: 34rem;
  margin: 1.25rem 0 0;
  font-family: "Instrument Sans", var(--sans);
  font-size: 1.15rem;
  line-height: 1.45;
  color: rgba(247, 244, 238, 0.86);
}

.home-band {
  background: #f3eee6;
  color: #171614;
  padding: 4.5rem 1.75rem 3.5rem;
}

.home-band-head {
  width: min(1120px, 100%);
  margin: 0 auto 2rem;
}

.home-band h2 {
  margin: 0;
  max-width: 20ch;
  font-family: "Instrument Sans", var(--sans);
  font-weight: 500;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.home-grid {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
}

.home-grid article {
  padding-top: 1.1rem;
  border-top: 1px solid #d9d0c4;
}

.home-index {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: #8a8176;
}

.home-grid h3 {
  margin: 0.7rem 0 0.4rem;
  font-family: "Instrument Sans", var(--sans);
  font-size: 1.45rem;
  font-weight: 560;
  letter-spacing: -0.03em;
}

.home-grid p:last-child {
  margin: 0;
  color: #4e4943;
  max-width: 28ch;
}

.home-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  background: #141614;
  color: #f7f4ee;
  padding: 1.6rem 1.75rem;
}

.home-strip p {
  margin: 0;
  font-family: "Instrument Sans", var(--sans);
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.home-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: #101210;
  color: rgba(247, 244, 238, 0.7);
  padding: 1.4rem 1.75rem 1.8rem;
  font-family: "Instrument Sans", var(--sans);
}

.home-foot a {
  color: #f7f4ee;
  text-decoration: none;
}

.home-foot .logo { height: 46px; }

.home-foot p { margin: 0; }

.powered-by {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #f6f4ee;
  font: 400 11px/1 sans-serif;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.powered-by img {
  display: block;
  width: 69px;
  height: 22px;
}

@media (prefers-reduced-motion: reduce) {
  .home-video { display: none; }
}

@media (max-width: 800px) {
  .home-mark .logo { height: 46px; }
  .ops-login { grid-template-columns: 1fr; }
  .ops-photo { height: 34vh; order: -1; }
  .ops-form { padding: 1.75rem 1.25rem 2.5rem; }
  .home-hero { padding: 0 1.25rem 2.4rem; }
  .home-nav { padding: 1rem 1.1rem; }
  .home-band, .home-strip, .home-foot { padding-left: 1.25rem; padding-right: 1.25rem; }
  .home-foot { align-items: flex-start; flex-direction: column; }
}
