/* 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 (tools4.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; }
.bus-result { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.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; }
.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 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; color: var(--ink); text-decoration: none; }
a.bus-no:hover { color: var(--accent); }
.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(--ink); }
.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 */
.bus-dir { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; }
.bus-dir summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; cursor: pointer; font-weight: 800; }
.bus-dir summary small { font-weight: 500; color: var(--soft); }
.bus-route { margin: 0; padding: 0 14px 10px; list-style: none; }
.bus-route li { position: relative; padding: 8px 0 8px 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: 15px; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 3px solid var(--night); }
.bus-route li:first-child::before { top: 18px; }
.bus-route li:last-child::before { bottom: calc(100% - 18px); }
.bus-route small { display: block; color: var(--soft); font-size: .8rem; }

/* 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; }
.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); }
.taxi-facts a { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.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); }
}

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