:root {
  --paper: #F7F9F6;
  --surface: #FFFFFF;
  --ink: #1C2622;
  --muted: #5A6A62;
  --line: #D8E0DA;
  --accent: #1E7A5A;
  --accent-press: #14573F;
  --accent-soft: #DCEEE5;
  --taken: #C4CFC8;
  --warn: #A8632B;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141F1A;
    --surface: #1B2A23;
    --ink: #E2EAE4;
    --muted: #93A69B;
    --line: #2A3B32;
    --accent: #3FBF8F;
    --accent-press: #6FD9AF;
    --accent-soft: #21382D;
    --taken: #35453C;
    --warn: #D89158;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
}
.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1rem; }

header.site { background: var(--accent); color: #fff; }
header.site .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 0.25rem; padding-top: 0.9rem; padding-bottom: 0.9rem;
}
.brand { font-weight: 800; letter-spacing: 0.08em; font-size: 1.05rem; }
.brand em { font-style: normal; font-weight: 400; opacity: 0.85; }
.tag { font-size: 0.75rem; opacity: 0.85; letter-spacing: 0.04em; }

h1 { font-size: 1.7rem; margin: 1.6rem 0 0.8rem; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 1.25rem; margin: 2rem 0 0.6rem; letter-spacing: -0.01em; }
.hint { color: var(--muted); font-size: 0.9rem; max-width: 60ch; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
}

form.search, form.lookup {
  display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: end;
}
form label {
  display: flex; flex-direction: column; gap: 0.25rem;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted);
  flex: 1 1 10rem;
}
select, input {
  font: inherit; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.5rem 0.6rem;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn {
  font: inherit; font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 7px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-press); }
.btn.primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.link { background: none; border: none; color: var(--accent); padding: 0.4rem 0; }
#reserve-btn { margin: 1rem 0 2rem; }
#paynow-link { margin: 0.6rem 0; }

.schedule-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin: 0.7rem 0;
}
.schedule-card .times { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.schedule-card .meta { color: var(--muted); font-size: 0.85rem; }
.schedule-card .fare { font-weight: 700; font-size: 1.05rem; margin-left: auto; }
.schedule-card .fare small { display: block; font-weight: 400; color: var(--muted); text-align: right; }

.seatmap-wrap { margin: 1rem 0; }
.seatmap {
  display: grid;
  grid-template-columns: auto repeat(2, 2.6rem) 1.4rem repeat(2, 2.6rem);
  gap: 0.45rem;
  justify-content: center;
  align-items: center;
}
.rownum { font-size: 0.72rem; color: var(--muted); text-align: right; padding-right: 0.3rem; font-variant-numeric: tabular-nums; }
.seat {
  height: 2.4rem;
  border-radius: 7px 7px 4px 4px;
  border: 1px solid var(--line);
  background: var(--paper);
  font: inherit; font-size: 0.72rem; font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.seat.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.seat.taken { background: var(--taken); border-color: var(--taken); color: var(--muted); cursor: not-allowed; }
.legend { display: flex; gap: 1.4rem; justify-content: center; margin-top: 1rem; font-size: 0.8rem; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.seat-demo { width: 1rem; height: 1rem; border-radius: 4px; display: inline-block; border: 1px solid var(--line); }
.seat-demo.available { background: var(--paper); }
.seat-demo.selected { background: var(--accent); border-color: var(--accent); }
.seat-demo.taken { background: var(--taken); border-color: var(--taken); }

.pax-row { display: flex; gap: 0.8rem; align-items: end; margin: 0.6rem 0; flex-wrap: wrap; }
.pax-row .seatchip {
  font-weight: 700; background: var(--accent-soft); color: var(--accent-press);
  border-radius: 6px; padding: 0.45rem 0.7rem; font-variant-numeric: tabular-nums;
}
.pax-row label { flex: 1 1 14rem; }

#summary table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
#summary td { padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
#summary tr:last-child td { border-bottom: none; font-weight: 700; }
#summary td:last-child { text-align: right; }

.ticket {
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 8px 8px 0;
  padding: 0.6rem 1rem;
  margin: 0.5rem 0;
}
.ticket .tno { font-family: ui-monospace, Consolas, monospace; font-weight: 700; }
.ticket .who { color: var(--muted); font-size: 0.9rem; }

#toast {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  border-radius: 8px; padding: 0.7rem 1.2rem;
  font-size: 0.9rem; max-width: 90vw;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
#toast.show { opacity: 1; }
#toast.warn { background: var(--warn); color: #fff; }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

footer.site {
  margin-top: 3.5rem; padding-top: 1.2rem; padding-bottom: 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.82rem;
}
