/* Round A polish: one blue, one secondary style, consistent sizes; simpler JOURNEY and MY WORLD. */
:root{--brand:#1684ce;--brand-ink:#0f5f97;--ink:#16374b;--muted:#56707f;--line:#d6e3ec;--r-control:12px;--r-card:16px}
/* Buttons: primary = brand fill; everything else = white with outline. Three sizes only. */
body[data-view] button{border-radius:var(--r-control)}
body[data-view] button.primary,body[data-view] .primary{background:var(--brand);border-color:var(--brand);color:#fff}
body[data-view] button:not(.primary):not(.icon-button):not(.sheet-handle):not(.jb-node-title):not(.leg-toggle):not(.navigation button){background:#fff;border:1px solid var(--line);color:var(--ink)}
body[data-view] .jb-chooser button,body[data-view] .jb-more>div button{border-radius:10px}
body[data-view="plan"] .secondary-tools button,body[data-view="plan"] .jb-tools button{min-height:36px;font-size:13px;padding:6px 12px;border-radius:999px}
/* JOURNEY: compact footer (one line + depart) */
.jb-summary.journey-summary{padding:8px 12px 10px;gap:6px;border-radius:18px}
.jb-summary-line{font-size:12px}
.jb-summary-line strong{font-size:17px}
.jb-summary [data-flow="google"]{display:none}
#journey-depart.primary{min-height:44px;font-size:15px}
.planning{--summary-height:104px}
/* Default sheet height shows origin → transport → first stop */
.planning .sheet{max-height:min(62%,calc(100% - var(--summary-height,104px) - 110px))}
@media(min-width:768px){.planning .sheet{max-height:none}}
/* Single toolbar row above the blocks */
.planning .route-heading.jb-bar{display:flex;align-items:center;gap:8px;margin:2px 0 8px;font-size:12px;color:var(--muted)}
.jb-bar .jb-legend{margin-right:auto}
.jb-bar .jb-count{white-space:nowrap}
.jb-more{position:relative;margin:0;padding:0;background:transparent}
.jb-more>summary{list-style:none;cursor:pointer;width:30px;height:30px;display:grid;place-items:center;border:1px solid var(--line);border-radius:999px;background:#fff;font-size:16px;line-height:1;color:var(--ink)}
.jb-more>summary::-webkit-details-marker{display:none}
.jb-more>div{position:absolute;right:0;top:36px;z-index:5;display:grid;gap:4px;min-width:170px;padding:8px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 8px 24px rgba(22,55,75,.12)}
body[data-view="plan"] .jb-more>div button{min-height:34px;font-size:13px;text-align:left;padding:6px 10px;border:0;background:#fff}
body[data-view="plan"] .jb-more>div button:hover{background:#eaf4fb}
/* Route bar status chip */
.jb-route-state{font-weight:650;color:#0f6a5c}
.jb-route-state[data-state="unverified"]{color:#9a6a00}
.jb-route-state[data-state="pending"]{color:#b4232c}
/* Tools row: just export + share, note as small print */
.jb-tools{margin-top:12px}
.jb-tools .actions{display:flex;gap:8px}
.jb-tools .data-note{font-size:11px;color:var(--muted);margin:8px 0 0}
/* Map status bar only when location has been used */
.journey-flow-status[hidden]{display:none}
/* Search form inside the route bar: fewer rows */
.jb-route .journey-departure{display:grid;grid-template-columns:1fr 1fr;gap:8px}
/* MY WORLD: globe takes less of the first screen, stats come up */
body[data-view="mine"] #globe{inset:0 0 auto;height:40vh;max-height:320px}
body[data-view="mine"] .profile-sheet{max-height:62%}
body[data-view="mine"] .profile-sheet.open{max-height:90%}
body[data-view="mine"] .world-note{display:none}
.world-account-small{font-size:11px;color:var(--muted);padding:4px 0 10px}
.world-account-small button{min-height:28px;font-size:12px;padding:2px 10px}
.world-journey-tools .actions{display:flex;flex-wrap:wrap;gap:8px}
.world-journey-tools .actions button{min-height:34px;font-size:13px;padding:6px 12px;border-radius:999px}
.world-journey-tools .quiet-note{font-size:11px;margin:8px 0 0}
/* Round B: Taiwan transit system badges everywhere a leg is shown */
.sys-badge{width:34px;height:34px;border-radius:50%;display:inline-grid;place-items:center;background:var(--sys,#5a7a8f);color:#fff;flex-shrink:0;box-shadow:0 2px 6px #0000001f}.sys-badge .ui-icon{width:18px;height:18px;color:#fff;stroke-width:1.9}
.leg-mode-symbol .sys-badge{width:30px;height:30px}.leg-mode-symbol .sys-badge .ui-icon{width:16px;height:16px}.mini-mode .sys-badge{width:32px;height:32px}
.jb-chooser button .sys-badge,#modal .jb-chooser .sys-badge,#modal [data-nested="conn-gap-mode"] .sys-badge{width:28px;height:28px}
/* Round C: spider support chooser floating over the map */
.support-spider{position:absolute;left:12px;right:12px;bottom:calc(var(--summary-height,104px) + 66px);z-index:7;background:#ffffffee;backdrop-filter:blur(18px);border:1px solid #fff;border-radius:18px;box-shadow:0 10px 30px #1b304622;padding:10px 12px 12px;display:grid;gap:8px}
.support-spider header{display:flex;align-items:center;gap:8px}.support-spider header strong{font-size:.95rem}.support-spider header>span{flex:1;font-size:11px;color:#55707f;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.support-spider header .icon-button{width:30px;height:30px;min-height:0;padding:0}
.support-spider p{margin:0;font-size:12px;color:#38586a}
.spider-chips{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}.spider-chips::-webkit-scrollbar{display:none}
.spider-chip{flex:0 0 auto;display:flex;align-items:center;gap:8px;padding:6px 10px 6px 6px;border-radius:14px;min-height:0;max-width:220px;text-align:left}
.spider-chip b{width:24px;height:24px;border-radius:50%;background:#078b7a;color:#fff;display:grid;place-items:center;font-size:12px;flex-shrink:0}.spider-chip.active b{background:#1684ce}.spider-chip.active{border-color:#1684ce}
.spider-chip span{display:grid;min-width:0}.spider-chip strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.spider-chip small{font-size:11px;color:#55707f}
.planning:has(.support-spider) #pocket-mini{display:none}
@media(min-width:768px){.support-spider{left:auto;right:calc(var(--panel-width,370px) + 36px);bottom:24px;width:360px}}
@media(min-width:1000px){.support-spider{left:440px;right:auto;bottom:24px;width:380px}}
/* Leg details inside a transport row: one tidy column, no squeezed grid */
.jb-leg-details .leg{display:flex!important;flex-direction:column;gap:8px;grid-template-columns:none!important;margin-top:8px;padding:12px;border-radius:14px;background:#f4f8fb;border:1px solid #e3ebf1}
.jb-leg-details .leg>.leg-main{display:flex;flex-direction:column;gap:8px;min-width:0}
.jb-leg-details .leg-main>p{margin:0;font-size:12px;color:#55707f;line-height:1.5}
.jb-leg-details .leg-main>p:first-of-type{display:none}
.jb-leg-details .state-pill{align-self:flex-start;font-size:11px;padding:3px 9px}
.jb-leg-details .leg-primary-actions{display:flex;flex-wrap:wrap;gap:6px;margin:0}
.jb-leg-details .leg-primary-actions button{flex:1 1 auto;justify-content:center;font-size:12px;padding:8px 10px;min-height:38px}
.jb-leg-details .leg-tools{border:0;padding:0;margin:0}.jb-leg-details .leg-tools>summary{font-size:12px;color:#1684ce;cursor:pointer;padding:2px 0}
.jb-leg-details .leg-tools>div,.jb-leg-details .leg-confirmation{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 0}
.jb-leg-details .leg-tools button{font-size:12px;padding:7px 10px;min-height:36px}
.jb-leg-details .leg-tools .leg-reminder{margin-top:6px}
.jb-leg-details [data-flow="google"]{align-self:flex-start;font-size:12px;padding:7px 10px;min-height:36px}
.jb-leg-details .leg-fare{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:#55707f;padding-top:8px;border-top:1px dashed #d9e3ea;margin:0}
.jb-leg-details .leg-fare strong{font-size:13px;color:#16303f}
/* Native-looking checkbox/radio everywhere (the 44px input rule was never meant for them) */
input[type=checkbox],input[type=radio]{width:20px;height:20px;min-height:0;min-width:0;padding:0;margin:0 8px 0 0;accent-color:#1684ce;vertical-align:middle;flex-shrink:0}
label:has(>input[type=checkbox]),label:has(>input[type=radio]){display:flex;align-items:center;gap:0}
.jb-leg-details .leg-toggle{display:none!important}.jb-leg-details .leg-fare span{display:inline}
/* Safety layer: deviation / alert cards and help panel */
.safety-card{position:relative;z-index:8;margin:0 0 10px;padding:12px 14px;border-radius:18px;background:#fff8ec;border:1px solid #f3c98a;box-shadow:0 10px 30px #7a4a0022;display:grid;gap:8px;color:#16303f}
.planning .map-shell>.safety-card{position:absolute;left:12px;right:12px;top:64px;margin:0;z-index:30}
.safety-card.alert{background:#fff1f0;border-color:#f2a19b}
.safety-card header{display:grid;gap:4px}.safety-card header strong{font-size:1rem}
.safety-tag{font-size:10px;letter-spacing:.1em;padding:2px 8px;border-radius:999px;background:#d98a1c;color:#fff;justify-self:start}.safety-tag.warn{background:#c0392b}
.safety-card ul{margin:0;padding-left:18px;font-size:.85rem}.safety-card p{margin:0;font-size:.85rem;color:#55707f}
.safety-actions{display:flex;flex-wrap:wrap;gap:6px}.safety-actions button{font-size:12px;padding:8px 10px;min-height:38px}
.safety-alert{display:grid;gap:3px;padding:10px 12px;border-radius:12px;background:#ffffffb8;border:1px solid #f2c4c0}.safety-alert b{font-size:11px;color:#c0392b}.safety-alert strong{font-size:.95rem}.safety-alert p{font-size:.82rem;color:#3c5566;margin:0}.safety-alert .instruction{color:#16303f;font-weight:500}.safety-alert small{font-size:.7rem;color:#7a8c97}
.help-panel .help-position{padding:10px 12px;border-radius:12px;background:#f4f7f9;border:1px solid #e3ebf1;font-size:.9rem}.help-position p{margin:2px 0}
.number-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0}
.number{display:grid;gap:2px;padding:12px;border-radius:14px;background:#fff;border:1px solid #dbe3e9;text-decoration:none;color:#16303f;min-height:64px}.number strong{font-size:1rem}.number small{font-size:.7rem;color:#55707f}.number.hot{border-color:#e8762b;background:#fff3ea;grid-column:1/-1}.number.hot strong{color:#b44f0f}
.help-rescue{display:grid;gap:6px;font-size:.85rem;margin:8px 0}.help-tools{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}.help-tools a{align-self:center;font-size:12px}
.help-alerts{display:grid;gap:8px;margin:10px 0}.help-open-spaces{margin:12px 0}.help-open-spaces ul{list-style:none;margin:6px 0 0;padding:0}.help-open-spaces li{display:flex;align-items:center;gap:10px;padding:8px 0;border-top:1px solid #e5ebf0}.help-open-spaces li a,.help-links a{font-size:12px;white-space:nowrap}.help-links{display:grid;gap:4px;justify-items:end}.help-links button{font-size:12px;padding:6px 8px;min-height:32px}
dialog:has(.help-panel){background:#fdfdfb!important;color:#142b40!important;border-color:#dbe3e9;color-scheme:light}dialog:has(.help-panel) p{color:#506779}dialog:has(.help-panel) button:not(.primary){background:#fff;border:1px solid #dbe3e9;color:#16303f}dialog:has(.help-panel) h2,dialog:has(.help-panel) strong{color:#16303f}dialog:has(.help-panel) a{color:#1684ce}
/* 3D preview: oriented vehicles and the player bar */
.map-transport-marker.oriented{width:auto;height:auto;filter:drop-shadow(0 4px 4px #1b304633);pointer-events:none}
.map-transport-marker.oriented .vehicle-heading{transform-origin:center;will-change:transform}
.map-transport-marker.oriented svg{display:block}
.preview-bar{position:absolute;left:12px;right:12px;bottom:calc(var(--summary-height,104px) + 66px);z-index:9;background:#ffffffee;backdrop-filter:blur(18px);border:1px solid #fff;border-radius:18px;box-shadow:0 10px 30px #1b304622;padding:10px 12px;display:grid;gap:8px}
.preview-head{display:flex;align-items:center;gap:8px}.preview-head strong{flex:1;font-size:.9rem;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.preview-head button{width:30px;height:30px;min-height:0;padding:0;border-radius:50%}
.preview-track{display:flex;gap:4px;height:26px}
.preview-seg{position:relative;min-width:18px;min-height:0;padding:0;border-radius:8px;overflow:hidden;background:#e3ebf1!important;border:0!important}
.preview-seg i{position:absolute;left:0;top:0;bottom:0;width:0;background:#1684ce;opacity:.85;transition:width .1s linear}
.preview-seg span{position:relative;display:grid;place-items:center;height:100%;color:#16303f}.preview-seg.active span{color:#fff}.preview-seg .ui-icon{width:14px;height:14px}
.preview-controls{display:flex;align-items:center;gap:6px}.preview-controls button{font-size:12px;padding:6px 10px;min-height:32px}.preview-note{flex:1;text-align:right;font-size:10px;color:#7a8c97}
.planning:has(.preview-bar) .journey-flow-status button{display:none}
.planning:has(.preview-bar) #pocket-mini{display:none}
@media(min-width:768px){.preview-bar{left:auto;right:calc(var(--panel-width,370px) + 36px);bottom:24px;width:380px}}
@media(min-width:1000px){.preview-bar{left:440px;right:auto;bottom:24px;width:420px}}
/* presenter demo mode (?demo=1) */
#demo-fab{padding:0;white-space:nowrap;letter-spacing:.5px;position:fixed;right:14px;bottom:calc(92px + env(safe-area-inset-bottom));z-index:61;width:52px;height:52px;border-radius:50%;border:1px solid #f3c98a;background:#fff8ecf2;color:#7a4a00;font-weight:800;font-size:13px;box-shadow:0 10px 26px #7a4a0033;backdrop-filter:blur(10px);cursor:pointer}
#demo-fab:active{transform:scale(.94)}
@media (min-width:1000px){#demo-fab{bottom:24px;right:24px}}
.demo-sheet .settings-list button{display:grid;justify-items:start;text-align:left;gap:2px}
.demo-sheet .settings-list button small{display:block;font-weight:400;font-size:12px;opacity:.72;line-height:1.35}
.safety-card.alert .safety-tag.warn:first-child:where(:not(:empty)){white-space:nowrap}
body>.safety-card{position:fixed;left:12px;right:12px;top:calc(var(--header,64px) + 8px);margin:0;z-index:70;max-height:calc(100vh - var(--header,64px) - 120px);overflow:auto}
@media (min-width:1000px){body>.safety-card{left:auto;right:24px;width:420px}}
