/* Transport tools (/bus/, /mrt/, /taxi/, /carpark/). Uses the colours of site css (--ink, --soft, --line, --wash, --night, --accent, --link).
   Cloudflare keeps static files for up to 31 days, so rename this file (tools8.css) whenever it changes. */
.bus-layout { --go: #12805c; --amber: #9a5b00; display: grid; gap: 28px; }
.bus-tool { min-width: 0; }
.bus-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bus-title { font-size: clamp(1.45rem, 4.5vw, 1.9rem); margin: 0 0 2px; }
.bus-sub { color: var(--soft); font-size: .95rem; margin: 0 0 14px; }
.bus-label { display: flex; align-items: center; gap: 6px; margin: 22px 0 8px; font-size: .78rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--soft); }
.bus-note { color: var(--soft); font-size: .95rem; }
.bus-down { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: #fff4d6; color: #5c3b00; font-size: .92rem; }

/* Search and near me */
.bus-search { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 6px 0 14px; border: 2px solid var(--line); border-radius: 12px; color: var(--soft); }
.bus-search:focus-within { border-color: var(--link); }
.bus-search input { flex: 1; min-width: 0; min-height: 44px; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); }
.bus-search button { min-height: 40px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 700; cursor: pointer; }
.bus-near { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; margin: 12px 0 6px; border-radius: 12px; background: var(--accent); color: #fff; font-size: 1.05rem; font-weight: 800; text-decoration: none; }
.bus-near:hover { color: #fff; background: #b5212d; }
.bus-status { min-height: 1.5em; margin: 0; color: var(--soft); font-size: .9rem; }
/* Every link must look like one: list links are cards with a chevron, titles are in link blue. */
.bus-result { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; box-shadow: 0 1px 2px rgba(15, 42, 67, .06); }
.bus-result > span:first-child { flex: 1; min-width: 0; }
.bus-result b { color: var(--link); }
.bus-result:hover { border-color: #b9c2cc; background: var(--wash); color: var(--ink); }
.bus-chevron { flex-shrink: 0; color: var(--soft); }
.bus-result small { display: block; color: var(--soft); }
.bus-chip, .bus-chips b, .bus-mini b { display: inline-block; min-width: 2.4em; padding: 0 6px; margin-right: 6px; border-radius: 6px; background: var(--night); color: #fff; text-align: center; font-size: .85rem; }

/* Saved and recent */
.bus-saved { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.bus-saved-row { display: block; padding: 10px 12px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.bus-saved-row:first-child { border-top: 0; }
.bus-saved-row small { color: var(--soft); }
.bus-mini { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: .92rem; color: var(--ink); }
.bus-mini strong, .bus-chips strong { color: var(--go); }
.bus-recent { margin: 14px 0 0; color: var(--soft); font-size: .9rem; }
.bus-help { margin-top: 18px; font-size: .92rem; }
.bus-help summary { cursor: pointer; font-weight: 700; color: var(--link); min-height: 44px; display: flex; align-items: center; }

/* Page head */
.bus-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.bus-back { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; margin-left: -10px; color: var(--ink); border-radius: 8px; }
.bus-head > div:first-of-type { flex: 1; min-width: 0; }
.bus-acts { display: flex; gap: 6px; }
@media (max-width: 719px) {  /* phones: Save, Share and Directions as one full-width row under the stop name */
  .bus-head { flex-wrap: wrap; }
  .bus-acts { flex-basis: 100%; }
  .bus-acts .bus-act { flex: 1; justify-content: center; }
}
.bus-act { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; }
.bus-act[aria-pressed="true"] { color: #8a6400; border-color: #e7c66a; background: #fff8e1; }

/* The board */
.bus-board { border-top: 1px solid var(--line); }
.bus-row { display: grid; grid-template-columns: 4.2rem repeat(3, minmax(0, 1fr)); align-items: start; gap: 4px 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bus-no { justify-self: start; font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; color: var(--ink); text-decoration: none; }
/* A bus number that opens its route is a chip, so it reads as something to tap. */
a.bus-no { display: inline-flex; align-items: center; justify-content: center; min-width: 3.3rem; min-height: 40px; padding: 0 8px; border-radius: 8px; background: var(--night); color: #fff; font-size: 1.25rem; }
a.bus-no:hover { background: var(--accent); color: #fff; }
.bus-eta { font-size: 1.3rem; font-weight: 800; line-height: 1.15; }
.bus-eta small { font-size: .75rem; font-weight: 600; }
.bus-eta.is-now { color: var(--go); }
.bus-load, .bus-sched { display: block; margin-top: 3px; font-size: .78rem; font-weight: 700; color: var(--soft); }
.bus-load::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 4px; }
.bus-load.is-sea::before { background: var(--go); border-radius: 50%; }
.bus-load.is-sda::before { background: var(--amber); border-radius: 1px; }
.bus-load.is-lsd::before { background: var(--accent); transform: rotate(45deg); }
.bus-sched { font-weight: 600; font-style: italic; }
.bus-tags { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.bus-tags span { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: var(--wash); color: var(--soft); font-size: .78rem; font-weight: 700; }
.bus-row.is-off .bus-no { color: var(--soft); }
.bus-row .bus-note { grid-column: 2 / -1; padding-top: 6px; }
.bus-fresh { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; color: var(--soft); font-size: .85rem; }
.bus-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--go); }
.bus-refresh { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-left: auto; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.bus-services { margin-top: 16px; color: var(--soft); font-size: .92rem; }

/* Near me */
.bus-stop { padding: 12px 0; border-bottom: 1px solid var(--line); }
.bus-stop-name { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; margin: 0; font-size: 1rem; }
.bus-stop-name a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.bus-stop-name small { font-weight: 500; color: var(--soft); font-size: .85rem; }
.bus-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 6px 10px; margin: 8px 0 0; font-size: .92rem; }

/* Service route: one direction at a time, chosen at the top. */
.bus-seg { display: none; }
@supports selector(:has(*)) {
  .bus-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 0 16px; padding: 4px; border: 0; border-radius: 12px; background: var(--wash); }
  .bus-seg label { position: relative; display: flex; align-items: center; justify-content: center; min-height: 48px; margin: 0; padding: 6px 10px; border-radius: 9px; color: var(--soft); font-weight: 700; line-height: 1.25; text-align: center; cursor: pointer; }
  .bus-seg input { position: absolute; opacity: 0; pointer-events: none; }
  .bus-seg label:has(input:checked) { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 42, 67, .18); }
  .bus-seg label:has(input:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; }
  .bus-dirs:has(#bus-dir-1:checked) .bus-way[data-dir="2"], .bus-dirs:has(#bus-dir-2:checked) .bus-way[data-dir="1"] { display: none; }
}
.bus-way + .bus-way { margin-top: 28px; }
.bus-way-title { margin: 0 0 10px; font-size: 1.15rem; }
.bus-way-title small { display: block; font-size: .9rem; font-weight: 500; color: var(--soft); }
.bus-facts { display: grid; gap: 4px 20px; padding: 2px 14px 12px; border: 1px solid var(--line); border-radius: 12px; }
@media (min-width: 560px) { .bus-facts { grid-template-columns: 1fr 1fr; } }
.bus-facts .bus-label { margin: 12px 0 6px; }
.bus-facts dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: .92rem; }
.bus-facts dt { color: var(--soft); font-weight: 500; }
.bus-facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.bus-route { margin: 0; padding: 0; list-style: none; }
.bus-route li { position: relative; padding-left: 26px; }
.bus-route li::before { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 3px; background: var(--line); }
.bus-route li::after { content: ""; position: absolute; left: 1px; top: 50%; width: 13px; height: 13px; margin-top: -7px; border-radius: 50%; background: #fff; border: 3px solid var(--night); }
.bus-route li:first-child::before { top: 50%; }
.bus-route li:last-child::before { bottom: 50%; }
.bus-route li:first-child::after, .bus-route li:last-child::after { background: var(--night); }
.bus-route a, .bus-route li > span { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 4px 6px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.bus-route a > span:first-child, .bus-route li > span { flex: 1; min-width: 0; }
.bus-route a b { color: var(--link); }
.bus-route a:hover { background: var(--wash); }
.bus-route a:hover b { text-decoration: underline; }
.bus-route small { display: block; color: var(--soft); font-size: .82rem; font-variant-numeric: tabular-nums; }

/* Outdoor weather. Every level says its word too, never colour alone. */
.wx-verdict { margin: 4px 0 8px; padding: 14px 16px; border-radius: 14px; border: 1px solid; }
.wx-verdict h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.3rem; }
.wx-verdict ul { margin: 8px 0 0; padding-left: 1.2em; }
.wx-verdict li + li { margin-top: 4px; }
.wx-verdict p { margin: 6px 0 0; }
.wx-verdict.is-good { background: #e8f6ef; border-color: #b5e0c9; color: #0b4f37; }
.wx-verdict.is-care { background: #fff4d6; border-color: #f0d58c; color: #5c3b00; }
.wx-verdict.is-no { background: #fde8ea; border-color: #f2b8be; color: #7a1520; }
.wx-acts { display: grid; gap: 10px; }
@media (min-width: 720px) { .wx-acts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.wx-act { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.wx-act h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 6px; font-size: 1rem; }
.wx-act ul { margin: 0; padding-left: 1.1em; font-size: .92rem; }
.wx-act li + li { margin-top: 4px; }
.wx-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.wx-pill.is-good { background: #e8f6ef; color: #0b4f37; }
.wx-pill.is-care { background: #fff4d6; color: #5c3b00; }
.wx-pill.is-no { background: #fde8ea; color: #7a1520; }
.wx-read { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 8px; margin: 0; }
.wx-read > div { padding: 10px 12px; border-radius: 10px; background: var(--wash); }
.wx-read dt { display: flex; align-items: center; gap: 6px; color: var(--soft); font-size: .82rem; font-weight: 700; }
.wx-read dd { margin: 2px 0 0; font-weight: 800; }
.wx-read small { display: block; font-weight: 500; color: var(--soft); font-size: .8rem; }
.wx-find { margin: 14px 0 4px; }
.wx-areas li[hidden] { display: none; }
.wx-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.wx-areas a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; }
.wx-areas a b { color: var(--link); }
.wx-areas a:hover { background: var(--wash); border-color: #b9c2cc; }

/* After the tool: stories, then the one ad */
.bus-side .bus-label:first-child { margin-top: 0; }
.bus-story { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.bus-story b { display: block; font-size: .95rem; line-height: 1.3; color: var(--link); }
.bus-story:hover b { text-decoration: underline; }
.bus-story small { color: var(--soft); font-size: .8rem; }
.bus-story img { width: 88px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--wash); }
.bus-promo { display: inline-block; margin-bottom: 2px; padding: 1px 6px; border-radius: 4px; background: #fff4d6; color: #7a4d00; font-size: .75rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.tool-ad { margin-top: 18px; }
.tool-ad small { display: block; margin-bottom: .4rem; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6b6b6b; }
.tool-ad img { display: block; width: 300px; max-width: 100%; height: auto; margin: 0 auto; border-radius: 6px; }
.bus-credit { margin: 28px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--soft); font-size: .8rem; }

/* MRT status and crowds */
.mrt-ok { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 10px; background: #e7f5ee; color: #0b5c3f; font-weight: 700; }
.mrt-alert { margin: 12px 0; padding: 12px 14px 12px 18px; border-radius: 10px; background: #fff6f5; box-shadow: inset 5px 0 0 var(--tone); }
.mrt-alert h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 1.05rem; color: #9b1c1c; }
.mrt-alert p { margin: 4px 0; font-size: .95rem; }
.mrt-message { margin: 8px 0; padding: 10px 12px; border-radius: 8px; background: var(--wash); font-size: .95rem; }
.mrt-message small { display: block; color: var(--soft); }
.mrt-lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
/* A whole row is the link: a card with an edge, a chevron and a hover/press state, so it reads as something to tap. */
.mrt-line { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; box-shadow: 0 1px 2px rgba(15, 42, 67, .06); }
.mrt-line:hover { border-color: #b9c2cc; background: var(--wash); color: var(--ink); }
.mrt-line:active { background: #e9edf1; }
.mrt-line-name { flex: 1; min-width: 0; font-weight: 700; }
.mrt-go { color: var(--soft); flex-shrink: 0; }
.mrt-line:hover .mrt-go { color: var(--ink); }
.mrt-pill { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.mrt-pill.is-good { background: #e7f5ee; color: #0b5c3f; }
.mrt-pill.is-bad { background: #fdecea; color: #9b1c1c; }
.mrt-lines--compact { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.mrt-lines--compact .mrt-line { min-height: 48px; }
.mrt-dot { width: 12px; height: 12px; flex-shrink: 0; border-radius: 50%; background: var(--tone); }
.mrt-dot-inline { display: inline-block; margin-right: 6px; vertical-align: -1px; }
.mrt-good, .mrt-bad { margin-left: auto; font-size: .8rem; font-weight: 800; }
.mrt-good { color: var(--go); }
.mrt-bad { color: #b42318; }
.mrt-crowd { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: .92rem; }
.mrt-crowd th, .mrt-crowd td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.mrt-crowd thead th { font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; color: var(--soft); }
.mrt-crowd tbody th { font-weight: 700; }
.mrt-crowd small { color: var(--soft); font-weight: 500; }
.mrt-later { color: var(--soft); font-size: .85rem; }
.mrt-level { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; }
.mrt-level::before { content: ""; width: 9px; height: 9px; display: inline-block; }
.mrt-level.is-l::before { background: var(--go); border-radius: 50%; }
.mrt-level.is-m::before { background: var(--amber); border-radius: 1px; }
.mrt-level.is-h::before { background: var(--accent); transform: rotate(45deg); }

/* Taxis and carparks */
.taxi-count { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 4px; }
.taxi-count p { margin: 0; padding: 14px; border-radius: 12px; background: var(--wash); font-size: .9rem; color: var(--soft); }
.taxi-count b { display: block; font-size: 2rem; line-height: 1.1; color: var(--ink); }
.taxi-facts { margin: 4px 0 0; font-size: .9rem; color: var(--soft); }
.bus-act--small { min-height: 40px; margin-top: 8px; font-size: .85rem; color: var(--link); }
a.bus-act { text-decoration: none; }
a.bus-act:hover { border-color: #b9c2cc; background: var(--wash); }
.carpark { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.carpark-lots { padding: 8px 4px; border-radius: 10px; background: #e7f5ee; color: #0b5c3f; text-align: center; font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.carpark-lots small { display: block; font-size: .75rem; font-weight: 700; }
.carpark-lots.is-full { background: #fdecea; color: #9b1c1c; }

/* Busy states: a dimmed board while new times load, and a button that cannot be pressed twice */
.bus-board[aria-busy="true"] { opacity: .6; transition: opacity .2s; }
.bus-refresh:disabled, .bus-near[aria-busy="true"] { opacity: .7; cursor: progress; }
@media (prefers-reduced-motion: reduce) { .bus-board[aria-busy="true"] { transition: none; } }

/* The tool you are on, marked in the Tools menu (tool pages load this file) */
.tool-link[aria-current="page"] { background: var(--wash); }
.tool-link[aria-current="page"] b { color: var(--accent); }

/* MRT crowd table on phones: each station is a small block, every value labelled, nothing scrolls sideways */
@media (max-width: 559px) {
  .mrt-crowd thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .mrt-crowd tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .mrt-crowd th, .mrt-crowd td { padding: 0; border: 0; }
  .mrt-crowd tbody th { grid-column: 1 / -1; }
  .mrt-crowd td[colspan] { grid-column: span 3; }
  .mrt-crowd td::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 600; color: var(--soft); }
}

/* Stop page: what is coming first, a quieter board, and help finding the right stop */
.bus-next { margin: 4px 0 14px; padding: 12px; border-radius: 14px; background: var(--night); color: #fff; }
.bus-next-label { margin: 0 0 8px; font-size: .78rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #c9d4de; }
.bus-next-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.bus-next-item { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 72px; padding: 8px 4px; border-radius: 10px; background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; text-align: center; }
.bus-next-item:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.bus-next-no { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.bus-next-eta { font-size: .95rem; font-weight: 700; color: #dbe5ee; }
.bus-next-item.is-now { background: var(--go); }
.bus-next-item.is-now .bus-next-eta { color: #fff; }
.bus-eta.is-scheduled { color: var(--soft); }
.bus-tags .is-warn { background: #fff4d6; color: #5c3b00; }
.bus-off { margin: 10px 0 0; color: var(--soft); font-size: .92rem; }
.bus-off a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 8px; margin: 2px 0; border: 1px solid var(--line); border-radius: 6px; color: var(--link); font-weight: 700; text-decoration: none; }
.bus-off a:hover { background: var(--wash); }
.bus-legend { margin: 12px 0 0; color: var(--soft); font-size: .82rem; }

@media (min-width: 1024px) {
  .bus-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
  .bus-tool { max-width: 720px; }
}
