/* =====================================================================================
   DHAKA METRO LIVE · app.css
   Layout: a full-bleed white studio table holds the 3D model. Quiet frosted controls float at the
   edges; one dark LED station board docks at the bottom as the single loud element.
   Colours are the variables in :root below.
   ===================================================================================== */
:root {
  /* Layout: a full-bleed white studio table holds the 3D model. Quiet frosted controls float at the
     edges; one dark LED station board docks at the bottom as the single loud element. */
  --paper: #ffffff;
  --table: #f4f7f5;
  --ink: #14201b;
  --ink-2: #46544e;
  --ink-3: #82918a;
  --hair: #e1e8e4;
  --hair-strong: #c9d3ce;
  --glass: rgba(255, 255, 255, 0.86);
  --sheet: rgba(255, 255, 255, 0.975);
  --glass-edge: rgba(20, 32, 27, 0.09);
  --line6: #006747;
  --line6-soft: #e2f1ea;
  --to-mj: #0b8457;
  --to-un: #d93b40;
  --warn-bg: #fff2dc;
  --warn-ink: #7f5400;
  --led-bg: #0c1311;
  --led: #ffb648;
  --led-soft: #e3a24a;
  --led-ink: #e6f2ec;
  --led-mute: #9fb6ad;
  --led-go: #5ee3a1;
  --alert-bg: #fde9e8;
  --alert-ink: #8a1f22;
  --font-display: "Anek Bangla", "Noto Sans Bengali", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-led: "Doto", "IBM Plex Mono", ui-monospace, monospace;
  --shadow: 0 1px 2px rgba(20, 32, 27, 0.06), 0 8px 24px rgba(20, 32, 27, 0.08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-display); font-size: 14px; line-height: 1.35;
  overflow: hidden; overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--line6); outline-offset: 2px; }
svg { display: block; }

/* 3D stage */
#stage { position: fixed; inset: 0; z-index: 0; background: var(--paper); }
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.label-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.nogl { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--ink-2); }

/* Station pins */
.pin { width: 0; height: 0; pointer-events: none; transition: opacity 0.25s ease; }
.pin-inner { position: absolute; left: 0; bottom: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.pin-card {
  position: relative; display: flex; flex-direction: column; align-items: center; line-height: 1.05;
  background: rgba(255, 255, 255, 0.94); border: 1px solid var(--glass-edge); border-radius: 10px;
  padding: 4px 9px 5px; box-shadow: 0 2px 10px rgba(20, 32, 27, 0.12); white-space: nowrap;
}
.pin-card b { font-size: 12.5px; font-weight: 700; font-stretch: 88%; }
.pin-card span { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.pin-stem { width: 1.5px; height: 16px; background: linear-gradient(var(--ink-3), rgba(130, 145, 138, 0)); }
.pin.is-sel .pin-card { background: var(--line6); color: #fff; border-color: transparent; }
.pin.is-sel .pin-card span { color: rgba(255, 255, 255, 0.78); }
.pin.is-compact .pin-card span { display: none; }
.pin.is-off { opacity: 0; }
.pin.is-minor .pin-card { background: rgba(255, 255, 255, 0.8); color: var(--ink-2); }
.pin.is-minor .pin-card b { font-weight: 600; font-size: 11.5px; }
/* A station being built (the Kamalapur extension): dashed, with when it opens */
.pin.is-soon .pin-card { background: rgba(255, 255, 255, 0.86); border: 1.5px dashed var(--line6); }
.pin.is-soon .pin-card small { margin-top: 2px; font-size: 9.5px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--line6); }
.pin.is-soon.is-compact .pin-card small { display: block; }
.pin.is-soon.is-sel .pin-card { background: var(--line6); border-color: rgba(255, 255, 255, 0.7); }
.pin.is-soon.is-sel .pin-card small { color: rgba(255, 255, 255, 0.85); }
.pin-live { position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: #2fd38a; box-shadow: 0 0 0 2px #fff; display: none; }
.pin.is-boarding .pin-live { display: block; animation: ping 1.6s ease-out infinite; }
.tlabel { width: 0; height: 0; pointer-events: none; }
.tlabel-inner {
  position: absolute; left: 0; bottom: 0; transform: translateX(-50%); white-space: nowrap;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(20, 32, 27, 0.25);
}
.tlabel-inner small { font-weight: 500; opacity: 0.75; margin-left: 6px; }

/* Overlay UI */
#ui {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; gap: 8px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
  padding-bottom: 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.glass {
  background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
}
.top { display: flex; align-items: center; gap: 8px; }
.brand { pointer-events: auto; display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; min-width: 0; flex: 0 1 auto; overflow: hidden; }
.brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 430px) { .brand-name { display: none; } .brand { padding-right: 5px; } }
.line-pill { flex: none; background: var(--line6); color: #fff; font-weight: 700; font-size: 13px; font-stretch: 92%; padding: 4px 10px; border-radius: 999px; letter-spacing: 0.01em; }
.brand-name { font-weight: 650; font-size: 14px; line-height: 1.05; white-space: nowrap; }
.brand-name small { display: block; font-size: 11px; font-weight: 500; color: var(--ink-3); margin-top: 2px; }
.clock { pointer-events: auto; margin-left: auto; flex: none; display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; white-space: nowrap; }
.clock .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--to-mj); animation: pulse 2s ease-out infinite; }
.clock.is-preview .dot { background: var(--led); animation: none; }
.clock-mode { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.clock-time { font-family: var(--font-mono); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
/* The sun or the moon (tonight's phase) beside the time */
.sky-glyph { width: 16px; height: 16px; flex: none; margin-left: -1px; }
.sky-glyph.is-sun circle { fill: #f0b03e; }
.sky-glyph.is-sun line { stroke: #f0b03e; stroke-width: 1.7; stroke-linecap: round; }
.sky-glyph.is-moon circle { fill: #d3d9e3; }
.sky-glyph.is-moon path { fill: #f0c24a; }
.sun-times { display: flex; align-items: flex-start; gap: 8px; margin: 10px 2px 0; font-size: 12px; line-height: 1.4; color: var(--ink-3); }
.sun-times .sky-glyph { margin-top: 1px; }

.rail {
  pointer-events: auto; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px)));
  padding: 2px max(16px, env(safe-area-inset-right, 0px)) 4px max(16px, env(safe-area-inset-left, 0px));
  scroll-padding-inline: 40px;
}
.rail::-webkit-scrollbar { display: none; }
.rail button { flex: none; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.rail button[aria-pressed="true"] { background: var(--line6); color: #fff; border-color: transparent; }

.middle { flex: 1; min-height: 0; position: relative; container-type: size; }
@container (max-height: 60px) { .compass, .sound-btn { visibility: hidden; } }   /* panel pulled right up: no room */
.strip { pointer-events: auto; position: absolute; right: -6px; top: 56px; bottom: 4px; width: 44px; border-radius: 22px; touch-action: none; user-select: none; -webkit-user-select: none; }
.strip svg { width: 100%; height: 100%; }
.toast {
  position: absolute; left: 50%; top: 6px; transform: translateX(-50%); max-width: calc(100% - 124px);
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: var(--shadow); pointer-events: none;
}
/* An announcement's words while it plays (sound on): Bangla above English, like a train's information display. */
.toast.is-caption { display: grid; gap: 1px; justify-items: center; text-align: center; white-space: normal; border-radius: 16px; padding: 7px 14px 8px; width: max-content; }
.toast.is-caption span { max-width: 100%; white-space: normal; text-wrap: balance; }
.toast.is-caption span:first-child { font-weight: 600; font-size: 13.5px; }
.toast.is-caption span + span { font-size: 12px; opacity: 0.82; }

.dock { pointer-events: auto; align-self: center; display: flex; gap: 2px; padding: 4px; border-radius: 999px; }
.dock button { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dock button[aria-pressed="true"] { background: var(--ink); color: #fff; }
@media (max-width: 380px) { .dock button { padding: 9px 11px; } .dock button span { display: none; } }

/* Bottom panel. On phones it lies over the bottom of the screen and .sheet-space keeps the room it takes
   at rest; the script (Sheet in ui.js) sets both heights and slides the panel with GPU transforms while it
   moves, so dragging never re-lays-out the page. data-size="peek" shows only the search row and credit
   line; half and full are 42% and 76% of the screen. The values here apply until the script runs. */
.sheet-space { flex: none; height: 42vh; pointer-events: none; }
.sheet {
  pointer-events: auto; display: flex; flex-direction: column; min-height: 0;
  position: absolute; left: 0; right: 0; bottom: 0; height: 42vh;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 12px) max(16px, env(safe-area-inset-left, 0px));
  border-radius: 22px 22px 0 0; border-bottom: 0;
  /* solid, not frosted: blurring the moving 3D view behind a big panel is what makes phones stutter */
  background: var(--sheet); -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: 0 -1px 0 rgba(20, 32, 27, 0.04), 0 -6px 24px rgba(20, 32, 27, 0.10);
  will-change: transform; contain: layout style;
}
.dock { will-change: transform; }
.sheet[data-drag] { -webkit-user-select: none; user-select: none; }
.sheet[data-size="peek"] .sheet-body { flex: 0 0 0px; overflow: hidden; }
/* A wide, easy-to-grab strip with the usual grey bar in the middle. */
.sheet-handle {
  flex: none; align-self: stretch; height: 28px; margin: 0 -16px; display: grid; place-items: center;
  cursor: grab; touch-action: none; border-radius: 22px 22px 0 0;
}
.sheet-handle::before { content: ""; width: 40px; height: 5px; border-radius: 5px; background: var(--hair-strong); transition: background 0.12s ease, width 0.12s ease; }
.sheet-handle:hover::before, .sheet[data-drag] .sheet-handle::before { background: var(--ink-3); width: 48px; }
.sheet[data-drag] .sheet-handle { cursor: grabbing; }
.sheet-handle:focus-visible { outline-offset: -4px; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

@media (min-width: 860px), (orientation: landscape) and (max-height: 560px) {
  .sheet-space { display: none; }
  .sheet {
    left: max(16px, env(safe-area-inset-left, 0px)); right: auto; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); height: auto;
    width: min(400px, 46vw); margin: 0; padding: 0 16px 14px; border-radius: 20px; border-bottom: 1px solid var(--glass-edge);
    max-height: calc(100% - 178px);           /* leaves the compass (upper left) uncovered */
    box-shadow: var(--shadow); will-change: auto; contain: none;
  }
  .sheet-handle { border-radius: 20px 20px 0 0; }
  .dock { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); right: calc(max(16px, env(safe-area-inset-right, 0px)) + 58px); will-change: auto; }
}

/* Shared bits */
.row { display: flex; align-items: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--line6-soft); color: var(--line6); white-space: nowrap; }
.chip.is-warn { background: var(--warn-bg); color: var(--warn-ink); }
.mini { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--hair-strong); background: #fff; white-space: nowrap; }
.mini[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: transparent; }
.mini.is-primary { background: var(--line6); color: #fff; border-color: transparent; }
.mini:disabled { opacity: 0.45; cursor: default; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--table); flex: none; }
.muted { color: var(--ink-3); }
.note { color: var(--ink-3); font-size: 12px; line-height: 1.45; margin: 12px 0 2px; }
.h-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }

/* Line status */
.status-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 10px; }
.status-head h2 { margin: 0; font-size: 18px; font-weight: 700; font-stretch: 92%; text-wrap: balance; }
/* Three number tiles in a row (My Card's month at a glance) */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--table); border-radius: 14px; padding: 9px 11px; min-width: 0; }
.stat b { display: block; font-family: var(--font-mono); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { font-size: 11.5px; color: var(--ink-2); }

/* The list of trains from a train count, numbered as on the map */
.tl-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; margin: 2px 0 8px; }
.tl-head h2 { margin: 0; font-size: 18px; font-weight: 700; font-stretch: 92%; }
.tl-head small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.tl-list { list-style: none; margin: 0; padding: 0; display: grid; }
.tl-row { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 9px 2px; background: none; border: 0; border-top: 1px solid var(--hair); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.tl-list li:first-child .tl-row { border-top: 0; }
.tl-row:hover { background: var(--table); }
.tl-row > .ico { width: 15px; height: 15px; opacity: 0.45; transform: rotate(-90deg); }
.tl-n, .tmark b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-family: var(--font-mono); font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tl-n.is-mj, .tmark.is-mj b { background: var(--to-mj); }
.tl-n.is-un, .tmark.is-un b { background: var(--to-un); }
.tl-text { min-width: 0; display: grid; gap: 1px; }
.tl-text b { font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-text small { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Their marks on the map */
.tmark { pointer-events: none; z-index: 1000000 !important; }   /* above the station names (the label layer sorts by distance) */
.tmark b { box-shadow: 0 0 0 2.5px #fff, 0 4px 12px rgba(12, 19, 17, 0.28); animation: tmark-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.tmark b::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; animation: tmark-ring 2.4s ease-out 0.4s 2; }
.tmark.is-mj b { color: #fff; }
.tmark b { position: relative; }
.tmark.is-mj b::after { border-color: var(--to-mj); }
.tmark.is-un b::after { border-color: var(--to-un); }
@keyframes tmark-in { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes tmark-ring { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(2.1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tmark b, .tmark b::after { animation: none; } }
/* Pickers that look like text: a native list (best on phones) laid invisibly over a label with a caret. */
.picker { position: relative; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; max-width: 100%; }
.picker select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; border: 0; margin: 0; appearance: none; -webkit-appearance: none; }
.picker:focus-within { outline: 2px solid var(--line6); outline-offset: 2px; border-radius: 8px; }
.picker-caret { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.chip.picker { padding: 4px 8px 4px 10px; }
.chip.picker:hover { box-shadow: inset 0 0 0 1px currentColor; }
.dep-all { grid-column: 1 / -1; display: grid; gap: 5px; margin-top: 2px; padding: 9px 11px; background: var(--table); border-radius: 12px; font-family: var(--font-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dep-hour { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.dep-hour b { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.dep-hour span { display: flex; flex-wrap: wrap; gap: 3px 10px; }
.dep-hour i { font-style: normal; }
.dep-hour i.is-past { opacity: 0.38; }
.stat.is-time b { font-size: 19px; white-space: nowrap; }
.stat.is-time b small { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.closed { background: var(--table); border-radius: 16px; padding: 14px; display: grid; gap: 8px; }
.closed b { font-size: 15px; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--warn-bg); color: var(--warn-ink); border-radius: 14px; padding: 9px 12px; font-size: 12.5px; font-weight: 600; margin-bottom: 10px; }
.banner.is-day { background: var(--line6-soft); color: var(--line6); }

/* The overview: the fare card (above), the line's state in two lines, then the departure board */
.ls-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; row-gap: 2px; margin: 0 0 8px; }
.ls-head h2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ls-dot { width: 9px; height: 9px; margin-left: 5px; border-radius: 50%; flex: none; background: var(--hair-strong); }   /* room for its pulse ring */
.ls-head.is-on .ls-dot { background: var(--to-mj); animation: pulse 2s ease-out infinite; }
.ls-head.is-alert .ls-dot { background: var(--to-un); }
.ls-sub { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; margin: 3px 0 0 2px; font-size: 13px; color: var(--ink-2); }
.ls-count { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; }
.ls-count b { font-weight: 750; }
.ls-count .ico { width: 15px; height: 15px; flex: none; color: var(--line6); }
.ls-count .ico:last-child { width: 12px; height: 12px; stroke-width: 2.8; transform: rotate(-90deg); margin-left: -2px; }
.ls-count:hover { text-decoration: underline; text-underline-offset: 3px; }
.ls-every { color: var(--ink-3); }
.ls-sub .ls-preview { font-size: inherit; font-weight: 650; }
.ls-head .chip.picker { flex: none; gap: 4px; padding: 4px 8px 4px 8px; }
.chip.picker > .ico { width: 13px; height: 13px; stroke-width: 2.2; margin-right: 1px; }
/* The departure board: the trains from one station (the trip's From), a row per direction; tap a row for every departure */
.deps-board { margin: 12px 0 0; border-radius: 18px; background: #fff; border: 1px solid var(--hair); overflow: hidden; }
.db-from { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 14px 10px 12px; }
.db-from > .ico { width: 30px; height: 21px; flex: none; color: var(--line6); stroke-width: 2.1; }
.db-from > span { min-width: 0; display: grid; }
.db-from small { font-size: 10px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.db-from b { font-size: 16.5px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-from .picker-caret { width: 15px; height: 15px; margin-top: 12px; color: var(--line6); }
.db-dir { --dir: var(--to-mj); --tint: #eef7f2; border-top: 1px solid var(--hair); }
.db-dir.is-un { --dir: var(--to-un); --tint: #fdf1f0; }
.db-row {
  width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 15px; grid-template-areas: "ico dest time chev" "ico then when chev";
  column-gap: 10px; row-gap: 3px; align-items: center; padding: 10px 12px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
  transition: background 0.15s ease;
}
.db-row:hover, .db-dir.is-open .db-row { background: var(--tint); }
.db-row:disabled { cursor: default; background: none; }
.db-row:focus-visible { outline: 2px solid var(--dir); outline-offset: -2px; }
.db-ico { grid-area: ico; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--dir); color: #fff; box-shadow: 0 3px 8px color-mix(in srgb, var(--dir) 30%, transparent); }
.db-ico .ico { width: 16px; height: 16px; stroke-width: 2.6; }
.db-dest { grid-area: dest; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.db-dest small { font-size: 13px; color: var(--ink-3); }
.db-dest b { font-weight: 750; }
/* The times after the next one: as many whole times as fit (the rest wrap onto a hidden second line). */
.db-then { grid-area: then; min-width: 0; display: flex; flex-wrap: wrap; gap: 0 6px; height: 17px; line-height: 17px; overflow: hidden; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.db-then b { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.db-time { grid-area: time; justify-self: end; font-family: var(--font-mono); font-size: 22px; font-weight: 600; line-height: 1.05; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-time small { margin-left: 4px; font-family: var(--font-display); font-size: 12px; font-weight: 650; letter-spacing: 0; color: var(--ink-2); }
.db-time.is-none { color: var(--ink-3); }
.db-when { grid-area: when; justify-self: end; padding: 1px 7px; border-radius: 999px; background: var(--tint); color: var(--dir); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.db-row:hover .db-when, .db-dir.is-open .db-when { background: #fff; }
.db-when.is-now, .db-row:hover .db-when.is-now, .db-dir.is-open .db-when.is-now { background: var(--dir); color: #fff; }
.db-chev { grid-area: chev; display: grid; place-items: center; color: var(--ink-3); }
.db-chev .ico { width: 15px; height: 15px; stroke-width: 2.4; transition: transform 0.2s ease; }
.db-dir.is-open .db-chev .ico { transform: rotate(180deg); }
.db-row:disabled .db-chev { visibility: hidden; }
.db-all { padding: 0 14px 12px 52px; background: var(--tint); }
.db-all > small { display: block; margin: 0 0 5px; font-size: 11.5px; color: var(--ink-3); }
.db-all .dep-all { margin: 0; padding: 0; background: none; }
.db-count { display: inline-flex; align-items: center; gap: 5px; margin: 0 0 8px; padding: 0; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 650; color: var(--dir); cursor: pointer; }
.db-count b { font-weight: 800; }
.db-count .ico { width: 15px; height: 15px; flex: none; }
.db-count .ico:last-child { width: 12px; height: 12px; stroke-width: 2.8; transform: rotate(-90deg); }
.db-count:hover { text-decoration: underline; text-underline-offset: 3px; }
.ls-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.ls-fact { min-width: 0; padding: 8px 10px; border-radius: 14px; background: var(--table); }
.ls-fact b { display: block; font-family: var(--font-mono); font-size: 15px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ls-fact span { font-size: 11.5px; color: var(--ink-2); }
.ls-note { margin: 12px 0 2px; }
.ls-note summary { display: flex; align-items: center; gap: 6px; width: max-content; max-width: 100%; font-size: 12px; color: var(--ink-3); cursor: pointer; list-style: none; }
.ls-note summary::-webkit-details-marker { display: none; }
.ls-note summary .ico { width: 14px; height: 14px; flex: none; }
.ls-note summary:hover { color: var(--ink-2); }
.ls-note p { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-3); }
@media (max-width: 350px) { .db-time { font-size: 20px; } .db-dest { font-size: 14px; } .db-row { column-gap: 8px; } }

/* A station being built (Kamalapur): what, when, how far along, and its announcements */
.fs { display: grid; gap: 10px; }
.fs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fs-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); font-size: 11.5px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
.fs-tag .ico { width: 15px; height: 15px; }
.fs-name { margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 26px; font-weight: 750; font-stretch: 92%; line-height: 1.1; }
.fs-name small { font-size: 17px; font-weight: 600; color: var(--ink-3); }
.fs-aka { margin: -8px 0 0; font-size: 13px; color: var(--ink-3); }
.fs-when { margin: -4px 0 0; font-size: 13.5px; color: var(--ink-2); }
.fs-when b { color: var(--line6); }
.fs .ls-facts { margin: 0; }
.fs-progress { margin: 0; padding: 9px 12px; border-radius: 12px; background: var(--table); font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.fs-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fs-actions .mini { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.fs-actions a.mini { color: var(--ink); }
.fs-actions a.mini .ico { color: var(--line6); }
.fs-actions .ico { width: 16px; height: 16px; }
.fs-hear.is-on { opacity: 0.8; }
.fs-note { margin: 0; font-size: 12px; line-height: 1.45; color: var(--ink-3); }
.rail button.is-soon { border-style: dashed; border-color: var(--line6); }
.rail button.is-soon small { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--line6-soft); color: var(--line6); font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; vertical-align: 1px; }
.rail button.is-soon[aria-pressed="true"] small { background: rgba(255, 255, 255, 0.22); color: #fff; }
.search-item.is-soon .search-dot { background: var(--paper); border: 1.5px dashed var(--line6); }
.search-soon { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--line6-soft); color: var(--line6); font-size: 11px; font-weight: 750; white-space: nowrap; }

/* LED station board */
.pids { background: var(--led-bg); color: var(--led); border-radius: 16px; padding: 10px 12px 6px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 12px 30px rgba(12, 19, 17, 0.22); }
.pids-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 2px 2px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.pids-title b { color: var(--led-ink); font-size: 18px; font-weight: 700; font-stretch: 92%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pids-title span { color: var(--led-mute); font-size: 15px; white-space: nowrap; }
.plat { padding: 9px 2px 9px; border-bottom: 1px dashed rgba(255, 182, 72, 0.18); }
.plat:last-child { border-bottom: 0; }
.plat-head { display: flex; align-items: center; gap: 8px; color: var(--led-ink); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.plat-num { background: var(--line6); color: #fff; border-radius: 6px; padding: 1px 6px; font-family: var(--font-mono); letter-spacing: 0; }
.plat-main { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 4px; font-family: var(--font-led); }
.plat-state { font-size: 17px; font-weight: 900; letter-spacing: 0.04em; }
.plat-count { font-size: 30px; font-weight: 900; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(255, 182, 72, 0.35); white-space: nowrap; }
.plat.is-boarding .plat-state, .plat.is-boarding .plat-count { color: var(--led-go); text-shadow: 0 0 12px rgba(94, 227, 161, 0.35); }
.plat-where { color: var(--led-mute); font-size: 12.5px; margin-top: 1px; }
.plat-next { display: flex; justify-content: space-between; gap: 10px; font-family: var(--font-led); font-size: 15px; font-weight: 700; color: var(--led-soft); margin-top: 6px; }
.plat-last { color: var(--led-mute); font-size: 11.5px; margin-top: 3px; }
.plat-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.plat-actions button { color: var(--led-ink); font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.16); }
.plat-actions button:disabled { opacity: 0.4; cursor: default; }

/* Google-Maps-style trip timeline */
.trip-head { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.trip-glyph { width: 30px; height: 30px; border-radius: 8px; background: var(--table); display: grid; place-items: center; flex: none; }
.trip-dest { font-size: 22px; font-weight: 700; font-stretch: 92%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.trip-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; color: var(--ink-3); font-size: 13px; }
.trip-sub .spacer { flex: 1; }
.tabs { display: flex; border-bottom: 1px solid var(--hair); margin-top: 10px; }
.tabs button { flex: 1; padding: 9px 4px; font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--line6); }
.trip-live { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.trip-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--hair-strong); flex: none; }
.trip-live i.is-on { background: var(--to-mj); animation: pulse 2s ease-out infinite; }
.prev-toggle { display: flex; align-items: center; gap: 10px; padding: 10px 2px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); width: 100%; }
.tl { position: relative; }
.tl-line { position: absolute; left: 15px; width: 7px; border-radius: 4px; background: #2f8a5f; }
.tl-line.done { background: #1d5a3e; }
.tl-row { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; height: 58px; }
.tl-row + .tl-row::before { content: ""; position: absolute; left: 38px; right: 0; top: 0; border-top: 1px solid var(--hair); }
.tl-dot { width: 7px; height: 7px; border-radius: 50%; background: #c8eedb; justify-self: center; position: relative; left: -0.5px; }
.tl-dot.is-ref { width: 13px; height: 13px; background: #fff; box-shadow: 0 0 0 2px #1d5a3e; }
.tl-name { font-size: 15px; font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-status { font-size: 12.5px; color: var(--ink-3); }
.tl-row.is-past .tl-name, .tl-row.is-past .tl-time { color: var(--ink-3); }
.tl-row.is-here .tl-status { color: var(--to-mj); font-weight: 650; }
.tl-time { font-family: var(--font-mono); font-size: 13.5px; font-variant-numeric: tabular-nums; text-align: right; }
.tl-time.is-ref { font-size: 20px; font-weight: 600; }
.tl-train { position: absolute; left: 4px; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 3px #fff, 0 4px 12px rgba(20, 32, 27, 0.3); transition: top 0.25s linear; z-index: 1; }
.tl-train .ico { width: 15px; height: 15px; stroke-width: 1.9; }
.prev-toggle .ico { transition: transform 0.2s ease; }
.prev-toggle[aria-expanded="true"] .ico { transform: rotate(180deg); }

/* Clock popover */
.backdrop { position: fixed; inset: 0; pointer-events: auto; background: transparent; }
.pop {
  pointer-events: auto; position: absolute; z-index: 3; right: max(16px, env(safe-area-inset-right, 0px));
  top: calc(env(safe-area-inset-top, 0px) + 58px); width: min(320px, calc(100% - 32px)); border-radius: 18px; padding: 12px; display: grid; gap: 8px;
}
.opt { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--hair); }
.opt b { font-size: 14px; }
.opt span { font-size: 12px; color: var(--ink-3); }
.opt[aria-pressed="true"] { border-color: var(--line6); background: var(--line6-soft); }
.speeds { display: flex; gap: 6px; align-items: center; }
.speeds .h-eyebrow { margin-right: auto; }
.speeds.starts { flex-wrap: wrap; row-gap: 6px; margin-top: 8px; }
.speeds.starts .h-eyebrow { flex-basis: 100%; }

/* The green line badge is a button: it opens the list of Dhaka metro lines. */
.line-btn { display: inline-flex; align-items: center; gap: 2px; padding-right: 6px; cursor: pointer; transition: background 0.15s ease; }
.line-btn:hover, .line-btn[aria-expanded="true"] { background: #00553a; }
.line-caret { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; transition: transform 0.2s ease; }
.line-btn[aria-expanded="true"] .line-caret { transform: rotate(180deg); }
.pop.pop-lines { left: max(16px, env(safe-area-inset-left, 0px)); right: auto; width: min(360px, calc(100% - 32px)); background: rgba(255, 255, 255, 0.97); }
.line-opt { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 10px; text-align: left; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--hair); }
.line-opt.is-current { border-color: var(--line6); background: var(--line6-soft); }
.line-opt:disabled { cursor: default; border-color: transparent; background: var(--table); }
.line-opt:disabled .line-text b { color: var(--ink-2); }
.line-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--hair-strong); align-self: start; margin-top: 4px; }
.line-text { min-width: 0; display: grid; gap: 1px; }
.line-text b { font-size: 14px; font-weight: 700; }
.line-text span { font-size: 12px; line-height: 1.3; color: var(--ink-3); }
.line-text em { font-style: normal; font-size: 11px; font-weight: 650; color: var(--ink-3); opacity: 0.85; }
.pop-lines { max-height: calc(100vh - 90px); overflow-y: auto; }
.pop-lines .note { margin: 2px 2px 0; }

/* Loading and error screen, shown until the first frame is drawn */
#boot { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; background: var(--paper); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); transition: opacity 0.4s ease; }
#boot.is-done { opacity: 0; pointer-events: none; }
.boot-card { display: grid; justify-items: center; gap: 10px; text-align: center; max-width: 320px; }
.boot-card b { font-size: 18px; font-weight: 700; }
.boot-step { color: var(--ink-3); font-size: 13px; }
.boot-bar { display: block; width: 160px; height: 3px; border-radius: 3px; background: var(--hair); overflow: hidden; }
.boot-bar i { display: block; width: 40%; height: 100%; background: var(--line6); border-radius: 3px; animation: slide 1.2s ease-in-out infinite; }
.boot-error { margin: 0; color: var(--to-un); font-size: 13px; line-height: 1.45; word-break: break-word; }
/* Owner notices and live status, under the station pills */
.notices { pointer-events: auto; display: grid; gap: 6px; }
.notice { display: flex; align-items: flex-start; gap: 9px; padding: 9px 8px 9px 12px; border-radius: 14px; font-size: 13px; line-height: 1.35; box-shadow: var(--shadow); }
.notice > .ico { margin-top: 1px; }
.notice.is-info { background: #e6f4ed; color: #0b4a35; border: 1px solid rgba(0, 103, 71, 0.2); }
.notice.is-warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid rgba(127, 84, 0, 0.2); }
.notice.is-alert { background: var(--alert-bg); color: var(--alert-ink); border: 1px solid rgba(138, 31, 34, 0.22); }
.notice-text { flex: 1; min-width: 0; display: grid; gap: 2px; text-align: left; font-size: inherit; line-height: inherit; color: inherit; }
.notice-text b { font-weight: 700; }
button.notice-text span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notice.is-open button.notice-text span { display: block; -webkit-line-clamp: unset; }
.notice-close { width: 28px; height: 28px; margin: -4px -2px -4px 0; border-radius: 50%; display: grid; place-items: center; flex: none; opacity: 0.75; }
.notice-close .ico { width: 14px; height: 14px; }

/* Credit line at the bottom of the panel */
.sheet-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--hair); font-size: 12px; color: var(--ink-3); }
.sheet-foot .credit { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credit-name { color: var(--ink); font-weight: 650; }
a.credit-name { text-decoration: underline; text-decoration-color: var(--hair-strong); text-underline-offset: 2px; }
.foot-link { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 4px 2px; font-size: 12px; font-weight: 650; color: var(--ink-2); }
.foot-link .ico { width: 14px; height: 14px; }

/* Suspended service */
.closed.is-alert { background: var(--alert-bg); }
.closed.is-alert b { color: var(--alert-ink); }
.plat.is-suspended .plat-state { color: #ff8a80; text-shadow: 0 0 12px rgba(255, 110, 100, 0.35); }

/* About box: the creator card */
.backdrop.is-dim { z-index: 3; background: rgba(12, 19, 17, 0.3); }
.about {
  pointer-events: auto; position: fixed; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 32px)); max-height: calc(100% - 40px); overflow-y: auto; overscroll-behavior: contain;
  border-radius: 24px; padding: 14px 20px 16px; background: #fff; border: 1px solid var(--glass-edge);
  box-shadow: 0 24px 60px rgba(12, 19, 17, 0.22);
}
.about-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.about-app { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; row-gap: 2px; padding-top: 3px; }
.about h2 { margin: 0; font-size: 22px; line-height: 1.15; font-weight: 750; font-stretch: 92%; }
.about-date { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.about p.about-desc { margin: 6px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
/* The creator: name, bio and contact icons in one column on the left, the photo on the right. */
.creator { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: start; margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--hair); }
.avatar-wrap { position: relative; flex: none; border-radius: 9999px; margin-top: 4px; grid-column: 2; grid-row: 1; }
.avatar { display: block; width: 72px; height: 72px; border-radius: 9999px; object-fit: cover; background: var(--table); box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--hair); }
.creator-body { grid-column: 1; grid-row: 1; min-width: 0; container-type: inline-size; }
.creator-tag { display: block; font-size: 12.5px; line-height: 1.3; color: var(--ink-3); }
.about h3.creator-name { margin: 2px 0 0; font-size: 18px; line-height: 1.2; font-weight: 700; font-stretch: 92%; text-wrap: balance; }
@media (max-width: 340px) { .creator { column-gap: 12px; } .avatar { width: 56px; height: 56px; } }
.about p { margin: 8px 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.about p.note { font-size: 12.5px; color: var(--ink-3); }
.about p.bio { margin: 10px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink); text-wrap: pretty; }

/* "Contact me": round icons only (no labels), soft green like the line colour */
.contact { margin: 16px 0 4px; }
.about .contact h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--ink); }
.contact-icons { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.contact-btn {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; text-decoration: none;
  background: var(--line6-soft); border: 1.5px solid #a7d3bd; color: #0d4d36;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.contact-btn .ico { width: 21px; height: 21px; stroke-width: 1.9; }
.contact-btn .glyph-text { font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1; letter-spacing: -0.02em; font-stretch: 100%; transform: translateY(-1px); }
.contact-btn .glyph-text.is-f { font-size: 24px; transform: translateY(1px); }
.contact-btn .contact-pic { width: 26px; height: 26px; object-fit: contain; }
/* Four icons always fit on one line beside the photo, even on narrow phones. */
@supports (width: 1cqi) { .creator-body .contact-btn { width: min(48px, calc((100cqi - 31px) / 4)); height: min(48px, calc((100cqi - 31px) / 4)); } }
.contact-btn:hover, .contact-btn:focus-visible { background: var(--line6); border-color: var(--line6); color: #fff; outline: none; }
.contact-btn:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--line6); }
.contact-btn:active { transform: scale(0.95); }
.about p.contact-help { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-3); }
.contact-help a, .link-btn { color: var(--line6); font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.link-btn { font-size: inherit; }
.about-more { margin-top: 16px; padding-top: 4px; border-top: 1px solid var(--hair); }
.about-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.about-actions .mini { padding: 9px 14px; font-size: 13.5px; }
.about p.disclaimer { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--hair); font-size: 12px; line-height: 1.45; color: var(--ink-3); }
.disclaimer a { color: var(--ink-2); }

/* Compass, upper left of the 3D view */
.compass { pointer-events: auto; position: absolute; left: -2px; top: 4px; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; }
.compass svg { width: 48px; height: 48px; overflow: visible; }
#compass-rose { transform-box: view-box; transform-origin: 0 0; }
.compass-ticks line { stroke: var(--hair-strong); stroke-width: 1.2; stroke-linecap: round; }
.needle-n { fill: var(--to-un); }
.needle-s { fill: #c3ccc7; }
.compass text { font-size: 7.6px; font-weight: 700; fill: var(--ink-2); text-anchor: middle; dominant-baseline: central; font-family: var(--font-display); }
.compass text.cn { fill: var(--to-un); font-size: 9.4px; font-weight: 800; }
.compass .hub { fill: #fff; stroke: var(--ink-2); stroke-width: 0.8; }
.compass-sky circle { fill: #f4ac2f; stroke: #fff; stroke-width: 0.9; }
.compass-sky .halo { fill: rgba(244, 172, 47, 0.28); stroke: none; }
.compass-sky.is-moon circle { fill: #e9e4d2; stroke: #7d8aa0; stroke-width: 0.7; }
.compass-sky.is-moon .halo { fill: rgba(190, 205, 235, 0.3); stroke: none; }
.compass:hover { background: #fff; }

/* Sound on/off, upper right of the 3D view (opposite the compass, above the line map) */
.sound-btn { pointer-events: auto; position: absolute; right: -6px; top: 4px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); transition: background 0.15s ease, color 0.15s ease; }
.sound-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.sound-btn .spk { fill: currentColor; fill-opacity: 0.12; }
.sound-btn:hover { background: #fff; }
.sound-btn.is-on, .sound-btn.is-on:hover { color: var(--line6); background: var(--line6-soft); border-color: rgba(0, 103, 71, 0.28); }
.sound-btn.is-playing .w1 { animation: wave 1.4s ease-in-out infinite; }
.sound-btn.is-playing .w2 { animation: wave 1.4s ease-in-out 0.25s infinite; }
@keyframes wave { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* "Where to?" bar at the top of the panel */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.whereto { flex: none; display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.whereto-bar { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 999px; background: var(--table); border: 1px solid var(--hair); text-align: left; }
.whereto-bar .ico { width: 18px; height: 18px; color: var(--ink); stroke-width: 2.1; }
.whereto-bar:hover { border-color: var(--hair-strong); }
.whereto-hints { position: relative; flex: 1; min-width: 0; height: 20px; overflow: hidden; pointer-events: none; }   /* taps land on the bar itself */
.whereto-hint { position: absolute; left: 0; right: 0; top: 0; line-height: 20px; color: #94a3b8; font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.whereto-hint.is-in { animation: hint-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.whereto-hint.is-out { animation: hint-out 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
/* My Card beside the search bar: a small card drawing and the balance (or "My Card") */
.card-pill { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 15px 0 10px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; transition: background 0.15s ease, transform 0.1s ease; }
.card-pill:hover { background: #24332d; }
.card-pill:active { transform: scale(0.97); }
.card-pill .card-glyph { width: 27px; height: 18px; }
.card-pill.is-recharge .ico { width: 18px; height: 18px; color: #7ee2b4; stroke-width: 2; }

/* The planned trip: From ⇄ To, fares, next train */
.route { display: grid; gap: 9px; margin: 0 0 12px; padding: 10px; border-radius: 18px; background: #fff; border: 1px solid var(--hair); }
.route-pills { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.pick { position: relative; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 4px; padding: 6px 9px 7px 12px; border-radius: 14px; background: var(--table); cursor: pointer; }
.pick-label { grid-column: 1; font-size: 10px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.pick-value { grid-column: 1; font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick .ico { grid-column: 2; grid-row: 1 / span 2; width: 14px; height: 14px; color: var(--ink-3); }
.pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; -webkit-appearance: none; appearance: none; }
.pick:focus-within { outline: 2px solid var(--line6); outline-offset: 1px; }
.swap { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1px solid var(--hair-strong); }
.swap .ico { width: 15px; height: 15px; }
.icon-btn.route-x { width: 30px; height: 30px; }
.route-x .ico { width: 14px; height: 14px; }
.route-fare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: stretch; gap: 8px; }
.fare { min-width: 0; display: grid; align-content: center; gap: 1px; padding: 6px 9px; border-radius: 12px; background: var(--table); }
.fare b { font-family: var(--font-mono); font-size: 20px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fare span { font-size: 10.5px; line-height: 1.2; color: var(--ink-3); }
@media (max-width: 380px) {
  .pick { padding: 6px 8px 7px 10px; }
  .pick .ico { display: none; }
  .pick-value { font-size: 13.5px; }
}
.fare.is-pass b { color: var(--line6); }
.route-fare .card-pill { height: auto; min-height: 44px; padding: 0 13px 0 11px; }
.route-meta { font-size: 12.5px; color: var(--ink-2); }
.route-next { font-size: 12.5px; font-weight: 650; color: var(--to-mj); }
.route-next.is-alert { color: var(--alert-ink); }

/* Station search, full screen on phones */
.backdrop.search-backdrop { z-index: 3; }
.search {
  pointer-events: auto; position: fixed; z-index: 4; inset: 0; display: flex; flex-direction: column; background: var(--paper);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) max(12px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(12px, env(safe-area-inset-left, 0px));
}
@media (min-width: 640px) {
  .search { inset: auto; left: 50%; top: 10vh; transform: translateX(-50%); width: min(520px, calc(100% - 32px)); max-height: 76vh; padding: 12px; border-radius: 22px; box-shadow: 0 24px 60px rgba(12, 19, 17, 0.22); }
}
.search-head { flex: none; display: flex; align-items: center; gap: 8px; }
.search-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 999px; background: var(--table); border: 1px solid var(--hair); }
.search-field:focus-within { background: #fff; border-color: var(--line6); }
.search-field .ico { width: 18px; height: 18px; stroke-width: 2.1; }
.search-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font: inherit; font-size: 16px; color: var(--ink); }
.search-field input::placeholder { color: #94a3b8; }
.search-from { flex: none; margin: 10px 6px 4px; font-size: 12.5px; color: var(--ink-3); }
.search-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; list-style: none; margin: 0; padding: 0 0 12px; }
.search-item { width: 100%; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 12px; text-align: left; }
.search-item.is-active { background: var(--table); }
.search-dot { width: 11px; height: 11px; border-radius: 50%; border: 2.5px solid var(--line6); background: #fff; justify-self: center; }
.search-name { min-width: 0; }
.search-name b { display: block; font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-name small { font-size: 12.5px; color: var(--ink-3); }
.search-fare { font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.search-empty { margin: 0; padding: 18px 8px; color: var(--ink-3); }

/* Recharge drawer: a bottom sheet on phones, a card at the right on wide screens */
.drawer {
  pointer-events: auto; position: fixed; z-index: 4; left: 0; right: 0; bottom: 0; max-height: min(92%, 860px);
  display: flex; flex-direction: column; background: #fff; border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 44px rgba(12, 19, 17, 0.22); animation: drawer-up 0.28s ease both;
}
@media (min-width: 760px) {
  .drawer { left: auto; top: 16px; right: 16px; bottom: auto; width: min(440px, calc(100% - 32px)); max-height: calc(100% - 32px); border-radius: 22px; animation-name: drawer-in; }
  .drawer-body { padding-bottom: 18px; }
}
.drawer-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--hair); }
.drawer-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 17px; font-weight: 700; }
.drawer-badge { width: 36px; height: 32px; display: grid; place-items: center; flex: none; }
.drawer-badge .card-glyph { width: 36px; height: 24px; filter: drop-shadow(0 2px 4px rgba(0, 103, 71, 0.25)); }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 12px; padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 16px); }
.drawer-route { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--line6-soft); color: #0b4a35; }
.drawer-route b { font-size: 15px; }
.drawer-route span { font-size: 13px; }
.topups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.topups button { height: 42px; border-radius: 12px; border: 1px solid var(--hair-strong); background: #fff; font-family: var(--font-mono); font-size: 14px; font-weight: 600; }
.topups button[aria-checked="true"] { background: var(--ink); color: #fff; border-color: transparent; }
.drawer-body p.topup-note { margin: -4px 2px 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.drawer-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.drawer-steps b { color: var(--ink); }
.drawer-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 18px;
  border-radius: 999px; background: var(--line6); color: #fff; font-size: 15.5px; font-weight: 700; text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 103, 71, 0.22); transition: background 0.15s ease, transform 0.1s ease;
}
.drawer-cta .ico { width: 18px; height: 18px; stroke-width: 2; }
.drawer-cta:hover { background: #005a3e; }
.drawer-cta:active { transform: scale(0.98); }
.drawer-cta:focus-visible { outline: 2px solid var(--line6); outline-offset: 3px; }
.drawer-body p.note { margin: -2px 2px 0; }

/* ------------------------------ My Card ------------------------------ */
/* The small card drawing (original art: no official logos) */
.card-glyph { display: block; flex: none; width: 30px; height: 20px; overflow: visible; }
.card-glyph .cg-body { fill: #0b8457; stroke: rgba(255, 255, 255, 0.35); stroke-width: 1; }
.card-glyph.is-rapid .cg-body { fill: #2563c9; }
.card-glyph .cg-line { fill: none; stroke: rgba(255, 255, 255, 0.5); stroke-width: 1.6; stroke-linecap: round; }
.card-glyph .cg-wave { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }

.mycard .drawer-head { gap: 8px; padding-bottom: 10px; border-bottom: 0; }
.mc-person-chip { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px; border-radius: 999px; border: 1px solid var(--hair-strong); background: #fff; font-size: 13px; font-weight: 650; }
.mc-person-chip > span { min-width: 0; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-person-chip[aria-expanded="true"] { border-color: var(--line6); background: var(--line6-soft); }
.mc-avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; font-style: normal; font-size: 12.5px; font-weight: 800; }
.mc-avatar.is-empty { background: var(--table); color: var(--ink-2); }
.mc-avatar .ico { width: 15px; height: 15px; }
.mc-tabs { flex: none; margin: 0 16px; }
.mc-tabs button { font-family: var(--font-display); font-size: 14px; font-weight: 600; padding: 8px 4px 10px; }
.mycard .drawer-body { display: flex; flex-direction: column; gap: 14px; padding-top: 14px; }
.mycard .drawer-body > * { flex: none; }   /* a column that scrolls: nothing in it is squeezed */

/* The card */
.mc-cards { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: -2px -16px 0; padding: 2px 16px 8px; position: relative; }
.mc-cards::-webkit-scrollbar { display: none; }
.pass-card {
  position: relative; flex: 0 0 min(88%, 360px); aspect-ratio: 1.586; scroll-snap-align: center; overflow: hidden; isolation: isolate;
  display: grid; grid-template-rows: auto 1fr auto; padding: 14px 16px 13px; border-radius: 18px; color: #fff;
  background: radial-gradient(130% 150% at 0% 0%, #15a573 0%, #0a7d54 44%, #054e36 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 26px rgba(5, 78, 54, 0.28);
}
.pass-card.is-rapid { background: radial-gradient(130% 150% at 0% 0%, #4a86ea 0%, #2159c2 44%, #12306f 100%); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 26px rgba(18, 48, 111, 0.3); }
.pass-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(115deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0) 62%, rgba(255, 255, 255, 0.08) 100%); }
.pc-art { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.pc-route { fill: none; stroke: rgba(255, 255, 255, 0.22); stroke-width: 7; stroke-linecap: round; }
.pc-stop { fill: rgba(255, 255, 255, 0.5); }
.pc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pc-type { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 7px; align-items: center; }
.pc-type b { font-size: 17px; font-weight: 750; letter-spacing: 0.01em; }
.pc-type small { grid-column: 2; font-size: 12px; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-wave { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; opacity: 0.9; }
.pc-menu { width: 32px; height: 32px; margin: -5px -6px 0 0; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.16); color: #fff; flex: none; }
.pc-menu .ico { width: 20px; height: 20px; stroke-width: 3.2; }
.pc-menu:hover { background: rgba(255, 255, 255, 0.26); }
.pc-bal { align-self: center; display: grid; gap: 1px; }
.pc-bal span { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.78; }
.pc-bal b { font-family: var(--font-mono); font-size: clamp(28px, 9vw, 36px); font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.pc-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; opacity: 0.9; white-space: nowrap; }
.pc-foot > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 650; }
.pc-foot i { font-style: normal; font-family: var(--font-mono); margin-left: 8px; letter-spacing: 0.04em; opacity: 0.85; }
.pc-sample { position: absolute; right: 52px; top: 16px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.22); font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.mc-cards:not(.is-many) .pass-card { flex-basis: 100%; }
.mc-strip-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: -8px; min-height: 28px; }
.mc-strip-foot .mc-hint { font-size: 12px; }
.mc-add-card { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; text-decoration: none; padding: 4px 0; }
.mc-add-card .ico { width: 15px; height: 15px; stroke-width: 2.2; }
.mc-add-card:hover { text-decoration: underline; }
.mc-dots { display: flex; justify-content: center; gap: 6px; }
.mc-dots button { width: 7px; height: 7px; border-radius: 4px; background: var(--hair-strong); transition: width 0.2s ease, background 0.2s ease; }
.mc-dots button[aria-current="true"] { width: 18px; background: var(--line6); }

/* What to do: scan, set the balance, add a trip */
.mc-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mc-act { display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 62px; padding: 9px 6px; border-radius: 16px; background: var(--table); font-size: 12.5px; font-weight: 650; text-align: center; transition: background 0.15s ease, transform 0.1s ease; }
.mc-act .ico { width: 20px; height: 20px; }
.mc-act:hover { background: var(--line6-soft); }
.mc-act:active { transform: scale(0.97); }
.mc-act.is-primary { background: var(--line6); color: #fff; box-shadow: 0 6px 16px rgba(0, 103, 71, 0.22); }
.mc-act.is-primary:hover { background: #005a3e; }
.mc-act[aria-expanded="true"] { background: var(--line6-soft); box-shadow: inset 0 0 0 1.5px var(--line6); color: var(--line6); }

/* Small forms: add a card, set the balance, add a trip or top-up */
.mc-form { display: grid; gap: 10px; padding: 12px; border-radius: 16px; border: 1px solid var(--hair); background: #fff; box-shadow: 0 6px 18px rgba(20, 32, 27, 0.06); animation: drawer-up 0.2s ease both; }
.mc-form-title { font-size: 14.5px; }
.mc-field { display: grid; gap: 4px; }
.mc-field > span:first-child { font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.mc-field input, .mc-inline input { width: 100%; min-width: 0; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--hair-strong); background: #fff; font: inherit; font-size: 16px; color: var(--ink); }
.mc-field input:focus, .mc-inline input:focus { outline: 2px solid var(--line6); outline-offset: 0; border-color: transparent; }
.mc-money { position: relative; display: block; }
.mc-money i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-weight: 650; color: var(--ink-3); pointer-events: none; }
.mc-money input { padding-left: 30px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.mc-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 13px; background: var(--table); }
.mc-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 6px 8px; border-radius: 10px; font-size: 13px; font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.mc-seg button[aria-checked="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 32, 27, 0.14); }
.mc-seg .card-glyph { width: 22px; height: 15px; }
.mc-route { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.mc-form-btns { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.mc-form-btns .mini { padding: 9px 15px; font-size: 13.5px; }
.mc-hint { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
.mini.is-danger { background: var(--to-un); color: #fff; border-color: transparent; }

/* This month, and what the balance is good for */
.mycard .banner { margin: 0; }
.mc-low { background: var(--alert-bg); color: var(--alert-ink); }
.mc-usual { margin: -4px 2px 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.mc-stats .stat b { font-size: 19px; }
.mc-stats .stat span { font-size: 11px; }

/* History rows */
.mc-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.mc-sec-head h3, .mc-backup h3 { margin: 0; font-size: 15px; font-weight: 700; }
.mc-list { list-style: none; margin: 0; padding: 0; display: grid; }
.mc-entry { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--hair); }
.mc-list .mc-entry:first-child { border-top: 0; }
.mc-entry-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--table); color: var(--ink-2); font-style: normal; }
.mc-entry-ico .ico { width: 17px; height: 17px; }
.mc-entry.is-topup .mc-entry-ico { background: #def3e8; color: var(--to-mj); }
.mc-entry.is-set .mc-entry-ico { background: var(--warn-bg); color: var(--warn-ink); }
.mc-entry-text { min-width: 0; display: grid; gap: 1px; }
.mc-entry-text b { font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-entry-text small { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-entry-amt { display: grid; justify-items: end; gap: 1px; }
.mc-entry-amt b { font-family: var(--font-mono); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mc-entry-amt b.is-in { color: var(--to-mj); }
.mc-entry-amt small { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.mc-entry-x { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); }
.mc-entry-x .ico { width: 13px; height: 13px; }
.mc-entry-x:hover { background: var(--table); color: var(--to-un); }
.mc-sum { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 14px; background: var(--table); }
.mc-sum .card-glyph { width: 36px; height: 24px; }
.mc-sum > span { min-width: 0; display: grid; gap: 1px; }
.mc-sum b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-sum small { font-size: 12.5px; color: var(--ink-2); }
.mc-filter { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.mc-chips button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--hair-strong); background: #fff; font-size: 12.5px; font-weight: 650; }
.mc-chips button[aria-checked="true"] { background: var(--ink); color: #fff; border-color: transparent; }
.mc-month { display: grid; }
.mc-month-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 4px 0 2px; border-bottom: 1px solid var(--hair-strong); }
.mc-month-head h3 { margin: 0; font-size: 14px; font-weight: 700; }
.mc-month-head span { font-size: 12px; color: var(--ink-3); text-align: right; }
.mc-backup { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--hair); }

/* People and card menus */
.mc-pop-backdrop { position: absolute; inset: 0; z-index: 2; border-radius: inherit; background: rgba(12, 19, 17, 0.08); }
.mc-pop {
  position: absolute; z-index: 3; top: 56px; right: 12px; width: min(310px, calc(100% - 24px)); max-height: calc(100% - 68px); overflow-y: auto;
  display: grid; gap: 8px; padding: 12px; border-radius: 18px; background: #fff; border: 1px solid var(--glass-edge);
  box-shadow: 0 18px 44px rgba(12, 19, 17, 0.2); animation: drawer-up 0.18s ease both;
}
.mc-person { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; text-align: left; }
.mc-person:hover { background: var(--table); }
.mc-person.is-current { background: var(--line6-soft); }
.mc-person .mc-avatar { width: 28px; height: 28px; }
.mc-person > span { min-width: 0; display: grid; }
.mc-person b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-person small { font-size: 12px; color: var(--ink-3); }
.mc-person > .ico { color: var(--line6); stroke-width: 2.4; }
.mc-pop-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mc-pop-actions .ico, .mc-filter .mini .ico { width: 14px; height: 14px; }
.mc-inline { display: flex; gap: 6px; }
.mc-inline input { height: 40px; border-radius: 11px; }
.mc-confirm { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--alert-bg); color: var(--alert-ink); font-size: 13px; line-height: 1.4; }
.mc-pop-link { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-radius: 10px; color: var(--to-un); font-size: 13px; font-weight: 650; }
.mc-pop-link:hover { background: var(--alert-bg); }

/* No card yet */
.mc-empty { display: grid; justify-items: center; gap: 6px; padding: 16px 14px 18px; text-align: center; border: 1.5px dashed var(--hair-strong); border-radius: 20px; }
.mc-empty b { font-size: 16.5px; font-weight: 700; }
.mc-empty span { font-size: 13px; line-height: 1.45; color: var(--ink-2); max-width: 300px; }
.mc-empty.is-small { border: 0; padding: 26px 10px; }
.mc-empty.is-small .mini { margin-top: 6px; }
/* Two cards fanned out: Rapid Pass behind, MRT Pass in front */
.mc-empty-art { position: relative; width: 252px; max-width: 100%; height: 138px; margin: 2px 0 6px; }
.card-art { position: absolute; display: block; width: 156px; height: auto; aspect-ratio: 172 / 108; border-radius: 9px; overflow: visible; }
.card-art.is-photo { object-fit: cover; border-radius: 10px; }
.mc-empty-art .card-art.is-rapid { left: 2px; top: 6px; transform: rotate(-8deg); filter: drop-shadow(0 8px 14px rgba(17, 48, 110, 0.26)); }
.mc-empty-art .card-art.is-mrt { right: 2px; top: 26px; transform: rotate(5deg); filter: drop-shadow(0 10px 18px rgba(5, 72, 47, 0.3)); }
.card-art text { fill: #fff; font-family: var(--font-display); }
.card-art .ca-name { font-size: 15px; font-weight: 750; letter-spacing: 0.01em; }
.card-art .ca-kind { font-size: 7.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; fill-opacity: 0.72; }
.card-art .ca-num { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.08em; fill-opacity: 0.82; }
.card-art .ca-route { fill: none; stroke: rgba(255, 255, 255, 0.24); stroke-width: 4.6; stroke-linecap: round; stroke-linejoin: round; }
.card-art .ca-stop { fill: rgba(255, 255, 255, 0.6); }
.card-art .ca-ring { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 9; }
.card-art .ca-edge { fill: none; stroke: rgba(255, 255, 255, 0.32); stroke-width: 1; }
.card-art .ca-wave path { fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; opacity: 0.92; }
.card-art .ca-mode * { fill: none; stroke: #fff; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.86; }
.card-art .ca-mode circle { fill: #fff; stroke: none; }

/* How to read a card */
.mc-help { border-radius: 16px; background: var(--table); padding: 2px 12px; }
.mc-help summary { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13.5px; font-weight: 650; cursor: pointer; list-style: none; }
.mc-help summary::-webkit-details-marker { display: none; }
.mc-help summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg) translateY(-3px); transition: transform 0.2s ease; }
.mc-help[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.mc-help summary .ico { color: var(--line6); width: 18px; height: 18px; }
.mc-help-body { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 0 0 12px; }
.mc-help-body ol { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.mc-help-body .mc-hint { grid-column: 1 / -1; margin-top: 6px; }

/* Recharge steps */
.mc-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: step; }
.mc-steps li { display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 12px 10px 8px; border-radius: 16px; background: var(--table); }
.mc-steps li > div { display: grid; gap: 2px; }
.mc-steps b { font-size: 14px; }
.mc-steps b::before { counter-increment: step; content: counter(step) ". "; color: var(--line6); }
.mc-steps span { font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }

/* Line drawings */
.mc-art { width: 70px; height: 58px; overflow: visible; }
.mc-art .art-phone { fill: #fff; stroke: var(--ink-2); stroke-width: 2.2; }
.mc-art .art-thin { fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; }
.mc-art .art-card { fill: var(--to-mj); }
.mc-art .art-card-line { fill: none; stroke: rgba(255, 255, 255, 0.6); stroke-width: 2; stroke-linecap: round; }
.mc-art .art-waves path { fill: none; stroke: var(--line6); stroke-width: 2.6; stroke-linecap: round; }
.mc-art .art-screen { fill: var(--line6-soft); stroke: var(--ink-3); stroke-width: 1.5; }
.mc-art .art-reader { fill: #fff; stroke: var(--ink-2); stroke-width: 2; }
.mc-art .art-taka { font-family: var(--font-display); font-size: 24px; font-weight: 700; fill: var(--line6); }
.mc-art .art-ok { fill: var(--to-mj); }
.mc-art .art-tick { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.mc-art.is-live .art-card-slide { animation: card-hold 2.2s ease-in-out infinite; }
.mc-art.is-live .art-waves path { animation: wave 1.4s ease-in-out infinite; }
.mc-art.is-live .art-waves path:nth-child(2) { animation-delay: 0.2s; }
.mc-art.is-live .art-waves path:nth-child(3) { animation-delay: 0.4s; }
@keyframes card-hold { 0%, 100% { transform: translateX(-12px); } 40%, 70% { transform: none; } }

/* Reading a card */
.mc-scan { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 24px; border-radius: inherit; background: rgba(255, 255, 255, 0.96); animation: drawer-up 0.2s ease both; }
.mc-scan-card { display: grid; justify-items: center; gap: 8px; max-width: 330px; text-align: center; }
.mc-scan-card .mc-art { width: 150px; height: 124px; margin-bottom: 6px; }
.mc-scan-card > b { font-size: 18px; font-weight: 700; text-wrap: balance; }
.mc-scan-card > span { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.mc-scan-card .mc-form-btns { justify-content: center; margin-top: 8px; }
.mc-done { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--to-mj); color: #fff; font-style: normal; margin-bottom: 6px; box-shadow: 0 10px 24px rgba(11, 132, 87, 0.3); animation: tmark-in 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.mc-done .ico { width: 34px; height: 34px; stroke-width: 2.6; }
@media (min-width: 760px) { .drawer.mycard { width: min(460px, calc(100% - 32px)); } }

/* Loading screen credit and no-JavaScript message */
.boot-credit { position: absolute; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); margin: 0; text-align: center; font-size: 12.5px; color: var(--ink-3); }
.boot-credit b { color: var(--ink-2); font-weight: 650; }
.noscript { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; background: var(--paper); color: var(--ink-2); }

@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@keyframes hint-in { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes hint-out { from { transform: none; opacity: 1; } to { transform: translateY(-100%); opacity: 0; } }
@keyframes drawer-up { from { transform: translateY(48px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes drawer-in { from { transform: translateX(48px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(11, 132, 87, 0.45); } 70% { box-shadow: 0 0 0 7px rgba(11, 132, 87, 0); } 100% { box-shadow: 0 0 0 0 rgba(11, 132, 87, 0); } }
@keyframes ping { 0% { box-shadow: 0 0 0 2px #fff, 0 0 0 2px rgba(47, 211, 138, 0.6); } 100% { box-shadow: 0 0 0 2px #fff, 0 0 0 10px rgba(47, 211, 138, 0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
