/* Shrinet Bus. Colours come from the logo: forest green, mustard and cream.
 * Light by default, dark when the phone asks for it; the header stays cream so the logo always reads. */
:root {
  --brand: #3a5550;
  --brand-2: #2e6b5c;
  --accent: #dca24c;
  --accent-ink: #2e2310;
  --cream: #fbf7ee;
  --bg: #f6f1e6;
  --card: #fffdf8;
  --ink: #1f2b28;
  --muted: #5f6b66;
  --line: #e4dccb;
  --soft: #edf2ec;
  --green: #127a3e;
  --green-soft: #e3f5ea;
  --red: #b42318;
  --red-soft: #fdecea;
  --pink: #c2417a;
  --pink-soft: #fbe7f0;
  --radius: 12px;
  --shadow: 0 1px 2px #3a555014, 0 4px 16px #3a55500d;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #2b403c;
    --brand-2: #8cc7b4;
    --bg: #131a18;
    --card: #1b2422;
    --ink: #ece6d8;
    --muted: #a0aaa5;
    --line: #2f3c38;
    --soft: #22302c;
    --green: #4cc480;
    --green-soft: #12301f;
    --red: #ff7b70;
    --red-soft: #3a1714;
    --pink: #f08cb8;
    --pink-soft: #3a1828;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand-2); }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .6rem; }
h3 { font-size: 1rem; margin: 0 0 .4rem; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 40px; min-height: 60vh; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* header */
.top { background: var(--cream); color: var(--brand); border-bottom: 3px solid var(--accent); }
.bar { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; padding: 6px 0; }
.brand img { height: 52px; width: auto; display: block; }
.brand .tag { font-size: .72rem; font-weight: 700; color: #fff; background: var(--brand); border-radius: 6px; padding: 2px 7px; }
.links { margin-left: auto; display: flex; gap: 4px 14px; align-items: center; flex-wrap: wrap; }
.links a, .linkbtn { color: #3a5550; text-decoration: none; font-size: .92rem; font-weight: 600; }
.links a:hover, .linkbtn:hover { color: #9a6a1c; }
.links form { margin: 0; }
.linkbtn { background: none; border: 0; cursor: pointer; padding: 0; font: inherit; font-size: .92rem; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; padding-top: 16px; padding-bottom: 28px; border-top: 1px solid var(--line); }

/* hero + search */
.hero { background: linear-gradient(160deg, var(--brand) 0%, var(--brand) 55%, #4a6b5e 100%); color: #fff; padding: 36px 0 64px; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin-bottom: .3rem; }
.hero p { margin: 0; color: #d9e6df; }
.hero h1 em { font-style: normal; color: var(--accent); }
.searchbox { background: var(--card); color: var(--ink); border-radius: 16px; box-shadow: 0 10px 30px #1a2b273d; padding: 16px; margin-top: 22px;
  display: grid; grid-template-columns: 1fr auto 1fr 180px auto; gap: 10px; align-items: end; }
.searchbox .swap { align-self: end; height: 46px; width: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font-size: 1.1rem; }
.searchbox .go { height: 46px; padding: 0 26px; }
.quickdates { display: flex; gap: 8px; margin-top: 6px; }
.chip { display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 3px 12px; font-size: .82rem; cursor: pointer; text-decoration: none; }
.chip.on { background: var(--soft); border-color: var(--brand-2); color: var(--brand-2); }
.lift { margin-top: -40px; }
@media (max-width: 760px) {
  .searchbox { grid-template-columns: 1fr; }
  .searchbox .swap { justify-self: end; margin: -6px 0; transform: rotate(90deg); }
}

/* forms */
label.f { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .03em; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 46px; }
textarea { min-height: 150px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-2); outline-offset: 0; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; }
.field { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 10px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 10px 18px; min-height: 42px; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; background: var(--accent); color: var(--accent-ink); }
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.blue { background: var(--brand-2); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: .85rem; }
.btn.block { width: 100%; }
.inline { display: inline; margin: 0; }

/* cards, tables, notes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.note { border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; background: var(--soft); }
.note.ok { background: var(--green-soft); color: var(--green); }
.note.bad { background: var(--red-soft); color: var(--red); }
.pill { display: inline-block; font-size: .75rem; font-weight: 650; border-radius: 999px; padding: 1px 9px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.bad { background: var(--red-soft); color: var(--red); }
.pill.warn { background: #fff3d6; color: #8a5a00; }
@media (prefers-color-scheme: dark) { .pill.warn { background: #3a2d10; color: #f6c76b; } }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 650; }
tr.off td { opacity: .5; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.head h1 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 1.35rem; }
.stat span { color: var(--muted); font-size: .8rem; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

/* search results */
.result { display: grid; grid-template-columns: 1.4fr 2fr 1fr; gap: 16px; align-items: center; }
.result .bus b { display: block; font-size: 1.02rem; }
.timeline { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.timeline .t { font-size: 1.25rem; font-weight: 700; }
.timeline .city { font-size: .82rem; color: var(--muted); }
.timeline .dur { text-align: center; font-size: .8rem; color: var(--muted); border-top: 2px dashed var(--line); padding-top: 4px; }
.result .buy { text-align: right; }
.result .price { font-size: 1.3rem; font-weight: 750; }
.amen { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
@media (max-width: 760px) {
  .result { grid-template-columns: 1fr; gap: 10px; }
  .result .buy { text-align: left; display: flex; align-items: center; justify-content: space-between; }
}
.daynav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }

/* seat map */
.booklayout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
@media (max-width: 900px) { .booklayout { grid-template-columns: 1fr; } }
.decks { display: flex; gap: 16px; flex-wrap: wrap; }
.deck { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.deck h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.wheel { width: 22px; height: 22px; border: 3px solid var(--muted); border-radius: 50%; opacity: .6; }
.seatrow { display: flex; gap: 6px; margin-bottom: 6px; }
.gap { width: 22px; flex: none; }
.seat { position: relative; flex: none; width: 46px; height: 44px; }
.seat.sleeper { height: 82px; }
.seat input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seat span { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; border: 1.5px solid var(--green); border-radius: 8px; font-size: .72rem; font-weight: 700; color: var(--green); background: var(--card); line-height: 1.15; }
.seat span small { font-weight: 500; font-size: .62rem; color: var(--muted); }
.seat input:focus-visible + span { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.seat input:checked + span { background: var(--green); color: #fff; }
.seat input:checked + span small { color: #fff; }
.seat.taken span { border-color: var(--line); background: var(--soft); color: var(--muted); cursor: not-allowed; }
.seat.taken.ladies span { border-color: var(--pink); background: var(--pink-soft); color: var(--pink); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--muted); margin: 10px 0 0; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--green); vertical-align: -2px; margin-right: 5px; }
.legend i.sel { background: var(--green); }
.legend i.tk { border-color: var(--line); background: var(--soft); }
.legend i.lady { border-color: var(--pink); background: var(--pink-soft); }
.side { position: sticky; top: 14px; }
.pax { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.pax h3 { display: flex; justify-content: space-between; }
.genders { display: flex; gap: 6px; }
.genders label { flex: 1; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 9px 4px; cursor: pointer; font-size: .85rem; }
.genders input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.genders label:has(input:checked) { background: var(--soft); border-color: var(--brand-2); color: var(--brand-2); font-weight: 650; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.1rem; font-weight: 700; margin: 12px 0; }

/* ticket */
.ticket { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); max-width: 760px; }
.ticket .th { background: var(--cream); color: var(--brand); border-bottom: 3px solid var(--accent); padding: 12px 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.ticket .th img { height: 64px; width: auto; display: block; }
.ticket .th .muted { color: #5f6b66; }
.ticket .th .pnr { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.3rem; font-weight: 700; letter-spacing: .06em; }
.ticket .tb { padding: 18px; display: grid; grid-template-columns: 1fr 150px; gap: 18px; }
.ticket .qr svg { width: 150px; height: 150px; display: block; }
.ticket .tf { border-top: 2px dashed var(--line); padding: 14px 18px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
@media (max-width: 600px) { .ticket .tb { grid-template-columns: 1fr; } .ticket .qr { justify-self: center; } }
.cancelled-stamp { color: var(--red); border: 2px solid var(--red); border-radius: 8px; padding: 2px 10px; font-weight: 800; letter-spacing: .08em; display: inline-block; transform: rotate(-4deg); }
@media print {
  .top, .foot, .noprint { display: none !important; }
  body { background: #fff; color: #000; }
  .ticket { box-shadow: none; border-color: #999; }
  .ticket .th { background: #fff; color: #000; border-bottom: 1px solid #999; }
}

/* back link above every page but the home pages */
.backbar { padding-top: 12px; }
.backlink { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 6px 14px 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; }
.backlink:hover { border-color: var(--brand-2); color: var(--brand-2); }
main.wrap.has-back { padding-top: 12px; }
.backbar + .hero { margin-top: 12px; }

/* route form: one row per stoppage */
.stoplist { counter-reset: stop; }
.stophead, .stoprow { display: grid; grid-template-columns: 28px 1.3fr 1.6fr 110px 110px 116px; gap: 8px; align-items: center; }
.stophead { font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 650; padding: 0 0 6px; }
.stoprow { padding: 6px 0; border-top: 1px solid var(--line); }
.stoprow .num { font-weight: 700; color: var(--brand-2); text-align: center; }
.stoprow input[readonly] { background: var(--soft); color: var(--muted); }
.stoprow .tools { display: flex; gap: 4px; justify-content: flex-end; }
.iconbtn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font-size: .95rem; }
.iconbtn:hover { border-color: var(--brand-2); color: var(--brand-2); }
.iconbtn.del:hover { border-color: var(--red); color: var(--red); }
.iconbtn:disabled { opacity: .35; cursor: not-allowed; }
@media (max-width: 760px) {
  .stophead { display: none; }
  .stoprow { grid-template-columns: 28px 1fr 1fr; grid-template-areas: "n city city" "n point point" "n after fare" "n tools tools";
    background: var(--soft); border: 0; border-radius: 12px; padding: 10px; margin-bottom: 8px; }
  .stoprow .num { grid-area: n; align-self: start; padding-top: 10px; }
  .stoprow [name=city] { grid-area: city; } .stoprow [name=point] { grid-area: point; }
  .stoprow [name=after] { grid-area: after; } .stoprow [name=fare] { grid-area: fare; }
  .stoprow .tools { grid-area: tools; }
}

/* city suggestions under the search boxes */
.ac { position: relative; }
.ac-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px #1a2b2733;
  max-height: 320px; overflow-y: auto; }
.ac-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.ac-list li.on, .ac-list li:hover { background: var(--soft); }
.ac-list li small { font-size: .72rem; font-weight: 650; color: var(--green); background: var(--green-soft); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.ac-list li.ac-none { color: var(--muted); cursor: default; }
.ac-list li.ac-none:hover { background: none; }

/* how to pay, on the seat page */
.paychoice { display: grid; gap: 8px; margin: 4px 0 12px; }
.paychoice label { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.paychoice label:has(input:checked) { border-color: var(--brand-2); background: var(--soft); }
.paychoice input { margin-top: 4px; }
.paychoice small { display: block; color: var(--muted); font-size: .8rem; }
.paybox { max-width: 760px; border-color: var(--accent); }

/* passenger's trips */
.tripcard { display: flex; justify-content: space-between; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.tripcard:hover { border-color: var(--brand-2); }

/* live bus location */
.busbox { max-width: 760px; margin-top: 16px; }
.busmap { height: 340px; border-radius: 10px; border: 1px solid var(--line); margin-top: 8px; z-index: 0; }
.busdot { font-size: 26px; line-height: 34px; text-align: center; filter: drop-shadow(0 1px 2px #0006); }
.warn-text { color: #8a5a00; }
@media (prefers-color-scheme: dark) { .warn-text { color: #f6c76b; } }
