/* 桃園公車動態 v2：共用元件
 * 載入順序：tokens.css → app.css → fonts-notosans.css（最後，定義 --font-sans）
 * 所有 class 一律 v2- 前綴，避免和現行 .ty-／Bootstrap 衝突。逐條說明見 assets/README.md。
 * 規則：字級一律 rem（--fz-*）；只用 400/700；數字 tabular-nums；不用漸層；陰影只給抽屜與下拉選單。
 * 斷點：手機 ≤640、平板 641–1099、桌機 ≥1100。
 */

/* ---------- 0. 尺寸別名（不是新顏色） ---------- */
:root{
  --fz-xs:.75rem;    /* 12px，對 --fs-xs */
  --fz-sm:.875rem;   /* 14px，對 --fs-sm */
  --fz-md:1rem;      /* 16px，對 --fs-md */
  --fz-lg:1.25rem;   /* 20px，對 --fs-lg */
  --fz-xl:1.75rem;   /* 28px，對 --fs-xl */
  --fz-answer:2.25rem; /* 36px，對 --fs-answer */
  --eta-w:5.5rem;    /* ETA 膠囊固定寬 88px（D-43），跟著字級放大 */
  --plate-w:120px;   /* 車牌／狀態欄（D-30） */
  --spine-col:48px;  /* 脊線欄寬 */
  --seq-w:2.5rem;    /* 站序欄寬 */
  /* --float-shadow、--scrim 在 tokens.css（--text 加透明度） */
}

/* ---------- 1. 基底 ---------- */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;
  /* 焦點與錨點捲動時讓開 sticky 頂列（WCAG 2.4.11）；頁面另有 sticky 標頭時在 :root 設 --v2-sticky-h（例：route.html 的路線標頭＋方向頁籤） */
  scroll-padding-top:calc(var(--topbar) + var(--v2-sticky-h, 0px) + 8px)}
body{
  margin:0;background:var(--ground);color:var(--text);
  font-family:var(--font-sans, system-ui, sans-serif);
  font-size:var(--fz-md);line-height:var(--lh-body);font-weight:var(--w-regular);
  font-variant-numeric:tabular-nums;   /* 全站數字等寬（含時間、站序、車牌） */
}
img,svg{display:block;max-width:100%}
a{color:inherit}
button,input,select,textarea{font:inherit;color:inherit;font-variant-numeric:tabular-nums}
h1,h2,h3,h4,p,ul,ol,figure{margin:0}
.v2-num{font-variant-numeric:tabular-nums;white-space:nowrap}

/* 焦點：2px 墨色外框＋2px offset（深色底元件也看得到，因為外框落在外側淺色上） */
:focus{outline:none}
:focus-visible{outline:2px solid var(--text);outline-offset:2px}
.v2-focus-demo{outline:2px solid var(--text);outline-offset:2px}
/* 橫捲容器（頁籤、手機功能鈕列、膠囊列）會裁掉往外畫的焦點框 → 改內縮 4px（WCAG 2.4.7）；可點膠囊常放在橫捲列，一律內縮 */
.v2-btnrow--scroll :focus-visible,.v2-chips :focus-visible,button.v2-chip:focus-visible,a.v2-chip:focus-visible{outline-offset:-4px}
.v2-tabs :focus-visible{outline-offset:-2px}   /* 頁籤沒有框：框貼邊，和字留 4px */

/* 只給螢幕閱讀器 */
.v2-vh{position:absolute !important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
/* 跳到主要內容 */
.v2-skip{position:absolute;left:16px;top:-100px;z-index:100;padding:8px 16px;background:var(--surface);color:var(--text);border:2px solid var(--text);border-radius:var(--radius-control);text-decoration:none}
.v2-skip:focus{top:8px}

/* 圖示：inline SVG，1.5px 線、currentColor */
.v2-ico{width:1.25rem;height:1.25rem;flex:none;fill:currentColor}
/* 雙色底層（2026-11-16 使用者定案：品牌桃紅 60%）；放在品牌色底上的地方把 --ico-2 改成 currentColor，否則底層會看不見 */
.v2-ico__2{fill:var(--ico-2,var(--brand));opacity:var(--ico-2-op,.6)}
.v2-btn--primary .v2-ico{--ico-2:currentColor;--ico-2-op:.4}   /* 桃紅實心按鈕：底層桃紅會看不見，改白色 40% */
.v2-ico--sm{width:1rem;height:1rem}
.v2-ico--img{object-fit:contain}   /* 高鐵、YouBike 標誌圖：放進同一格、等比例（YouBike 是橫的） */
.v2-ico--fill{--ico-2:currentColor;--ico-2-op:1}   /* 實心：底層跟線條同色、不透明 */

/* ---------- 2. 版面骨架 ---------- */
.v2-shell{min-height:100dvh;display:flex;flex-direction:column}
.v2-shell > main{flex:1 0 auto}
.v2-col{width:100%;max-width:var(--col-max);margin-inline:auto;padding-inline:var(--pad)}
.v2-main{padding-top:24px;padding-bottom:16px}

/* 頂列 */
.v2-topbar{position:sticky;top:0;z-index:40;background:var(--surface);border-bottom:1px solid transparent;transition:border-color var(--dur-base) var(--ease)}
.v2-topbar.is-scrolled{border-bottom-color:var(--border)}
.v2-topbar__in{max-width:var(--col-max);margin-inline:auto;padding-inline:var(--pad);height:var(--topbar);display:flex;align-items:center;gap:16px}
.v2-brand{display:flex;align-items:center;gap:8px;flex:none;color:var(--text);text-decoration:none;min-height:var(--touch)}
.v2-brand img{height:28px;width:auto}   /* 2026-10-28 使用者：完整橫式標誌太雜亂，回到小標誌＋站名＋三方塊（兩種外觀共用） */
.v2-brand__name{font-size:var(--fz-md);font-weight:700;line-height:1.2;white-space:nowrap}
/* CI 三顆小方塊（黃左上、藍右、綠左下，階梯排列）：只在標誌旁與頁尾 */
/* 外觀開關（2026-10-28）：兩種外觀各有自己的標誌等元件，只顯示目前外觀那一份（display:none 讀屏也不唸，不會唸兩次） */
html:not([data-skin="arterial"]) .v2-skin-arterial,html[data-skin="arterial"] .v2-skin-city{display:none !important}
.v2-squares{display:inline-grid;grid-template-columns:6px 6px;grid-template-rows:6px 6px 6px;flex:none}
.v2-squares i{display:block}
.v2-squares i:nth-child(1){grid-area:1/1;background:var(--ci-yellow)}
.v2-squares i:nth-child(2){grid-area:2/2;background:var(--ci-blue)}
.v2-squares i:nth-child(3){grid-area:3/1;background:var(--ci-green)}

.v2-nav{display:flex;align-items:center;gap:4px;margin-left:8px}
.v2-nav ul{display:flex;gap:4px;list-style:none;margin:0;padding:0}
.v2-nav a{display:inline-flex;align-items:center;height:36px;padding:0 14px;border-radius:var(--radius-pill);color:var(--muted);text-decoration:none;font-size:var(--fz-md);white-space:nowrap}
.v2-nav a:hover{color:var(--text)}
.v2-nav a[aria-current="page"]{background:var(--brand-tint);color:var(--brand-ink);font-weight:700}  /* 2026-10-27 主色階梯：目前頁淡粉底深桃紅字（--brand-ink 在 --brand-tint 上 6.6:1） */

.v2-topbar__tools{margin-left:auto;display:flex;align-items:center;gap:8px;min-width:0}
.v2-topbar__compact{display:none;margin-left:auto;align-items:center;gap:4px}
.v2-topsearch{position:relative;flex:1 1 13rem;min-width:9rem;max-width:16rem}
.v2-topsearch .v2-input{height:36px;padding-left:36px;font-size:var(--fz-sm)}
.v2-topsearch .v2-ico{position:absolute;left:10px;top:50%;translate:0 -50%;color:var(--muted);pointer-events:none}
/* 頂列搜尋建議（2026-10-28）：比搜尋框寬，往左展開；樣子同路線查詢頁的建議（pages/routes.css .routes-pop*） */
.v2-pop.v2-topsug{left:auto;right:0;width:24rem;max-width:calc(100vw - 32px);max-height:min(30rem,70vh);overflow:auto}   /* 兩個 class：要蓋過後面 .v2-pop 的 left:0（不然往右撐出畫面） */
.v2-topsug .v2-ico{position:static;translate:none;pointer-events:auto}
.v2-topsug .v2-pop__item > .v2-meta:last-child{flex:none}   /* 站名列最後一格「N 條路線經過」不縮；路線列最後一格是名稱，要能縮成「…」 */
.v2-topsug__name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.v2-topsug__more{color:var(--text);font-size:var(--fz-sm)}
.v2-topsug__hint{padding:4px 16px 12px;font-size:var(--fz-sm);color:var(--muted)}
.v2-topsug__sep{height:1px;margin:4px 0;background:var(--rule)}
/* 手機搜尋面板（base.html #v2-search，頁首「搜尋」打開）：建議清單在輸入框下方直接展開；最近搜尋在下面（2026-10-29 搜尋回到頁首） */
.v2-sdrawer .v2-pop{position:static;margin-top:8px;padding:0;max-height:none;overflow:visible;border:0;border-radius:0;box-shadow:none;background:none}
.v2-sdrawer .v2-pop__item > .v2-meta:last-child{flex:none}
.v2-sdrawer .v2-pop:not([hidden]) ~ .v2-recent{display:none}   /* 正在打字、建議展開時先收起最近搜尋 */
.v2-recent{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:20px}
.v2-recent__body{display:contents}
.v2-recent__h{flex:0 0 100%;margin:0;font-size:var(--fz-sm);font-weight:400;color:var(--muted)}
.v2-recent .v2-chips{flex-wrap:wrap;min-width:0}
.v2-recent a.v2-chip{max-width:100%;gap:6px}
.v2-recent a.v2-chip > span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis}
.v2-recent__no{font-weight:700}
.v2-recent__name{min-width:0;overflow:hidden;text-overflow:ellipsis;color:var(--muted)}

/* 底部導覽（第二輪 B2：1099px 以下都顯示，平板也有；五項＝首頁、路線、站牌、收藏、消息） */
.v2-bottombar{display:none;position:fixed;left:0;right:0;bottom:0;z-index:40;background:var(--surface);border-top:1px solid var(--border);padding-bottom:env(safe-area-inset-bottom)}
.v2-bottombar ul{display:grid;grid-template-columns:repeat(5,1fr);height:var(--bottombar);margin:0;padding:0;list-style:none}
.v2-bottombar a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;height:100%;color:var(--muted);text-decoration:none;font-size:var(--fz-xs);line-height:1.2}
.v2-bottombar__ico{display:flex;align-items:center;justify-content:center;width:3.5rem;height:1.75rem;border-radius:var(--radius-pill)}
.v2-bottombar a[aria-current="page"]{color:var(--brand-ink);font-weight:700}
.v2-bottombar a[aria-current="page"] .v2-bottombar__ico{background:var(--brand-tint)}

/* 頁尾 */
.v2-footer{margin-top:48px;background:var(--foot-bg);color:#FFFFFF;font-size:var(--fz-md);line-height:1.8}   /* 2026-10-27 比照市府網站頁尾：近黑底、白字、16px */
.v2-footer__in{max-width:var(--col-max);margin-inline:auto;padding:24px var(--pad) 32px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:16px 32px;align-items:start}
.v2-footer__mark{display:flex;align-items:center;gap:8px}
.v2-footer__mark img{width:auto;height:40px}   /* 機關 D-15 原為 84px 寬（字只剩約 10px 高）；2026-10-27 使用者：比例不美 → 改 36px 高，官方標誌原圖不加任何東西 */
.v2-footer__org{color:#FFFFFF;font-weight:700}
.v2-footer__links{display:flex;flex-wrap:wrap;gap:0;margin:0 0 6px -13px;list-style:none;padding:0;clip-path:inset(0 0 0 13px)}
.v2-footer__links li{border-left:1px solid var(--foot-link)}   /* 市府網站：連結之間桃紅直線。每項都畫、整排左移 13px（線 1＋內距 12）再裁掉：換行後落在行首的線看不到（2026-10-28 審查：平板英文換行時行首多一條線） */
.v2-footer__links a{display:inline-flex;align-items:center;min-height:32px;padding:0 12px;color:var(--foot-link);font-weight:700;text-decoration:none}
.v2-footer__links a:hover{text-decoration:underline}
.v2-footer__meta{text-align:right;white-space:nowrap}
.v2-footer__visits .v2-ico{display:inline-block;margin-right:4px;vertical-align:-2px}   /* 訪客人數前的長條圖示 */
.v2-footer__meta b{color:var(--ci-yellow);font-weight:400}   /* 市府網站頁尾的黃（CI 黃在 #1A1A1A 上 11:1） */
/* 地址連到地圖（2026-10-28 使用者：比照市府網站，黃字底線＋地圖小圖示） */
.v2-footer__addr{color:var(--ci-yellow);text-decoration:underline;text-underline-offset:3px}
/* 地圖小圖示畫在連結最後一個字後面（非獨立元素）：圖示類元素前後一定可以換行（CSS Text 規格），會單獨掉到下一行；
   空的行內偽元素沒有斷點，永遠黏著最後一個字。顏色跟字色（遮罩＋currentColor），圖檔 static/v2/img/pin.svg */
.v2-footer__addr::after{content:"";padding-left:1.1em;margin-left:3px;background:currentColor;-webkit-mask:url("../img/pin.svg") no-repeat center/1em;mask:url("../img/pin.svg") no-repeat center/1em;forced-color-adjust:none}
.v2-footer__addr:hover{text-decoration-thickness:2px}
html:not([data-skin="arterial"]) .v2-footer :focus-visible{outline-color:#FFFFFF}   /* 深色頁尾：全站墨色焦點框在 #1A1A1A 上看不到（2026-10-28 審查） */
@media (forced-colors:active) and (prefers-color-scheme:light){   /* 高對比淺色：頁尾底被換成白，白色「桃」字會看不見 → 反相成黑（2026-10-28 審查） */
  html:not([data-skin="arterial"]) .v2-footer__mark img{filter:invert(1)}
}

/* 字級（比照市府網站）：桃紅「A」圓鈕＋深灰小面板三個 A（小、中、大）；A 的大小用 px，不跟著字級變 */
input[type="search"].v2-input{border-color:var(--brand);border-radius:var(--radius-pill)}   /* 比照市府網站：搜尋框桃紅外框（3.45:1，元件邊界 ≥3:1）；2026-10-28 使用者：圓角太小 → 膠囊 */
.v2-sizepop{position:relative;flex:none}
.v2-sizepop__btn{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border:0;border-radius:50%;background:var(--brand-band);color:var(--on-primary);font-size:20px;font-weight:700;line-height:1;cursor:pointer}
.v2-sizepop__btn:focus-visible{outline:3px solid var(--text);outline-offset:2px}
.v2-sizepop__panel{position:absolute;right:0;top:calc(100% + 8px);z-index:60;display:flex;gap:4px;padding:6px;border-radius:var(--radius-control);background:#50595D;box-shadow:var(--float-shadow)}   /* 市府網站的深灰（白字 7.2:1） */
.v2-sizepop__panel[hidden]{display:none}
.v2-sizepop__panel button{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border:0;border-radius:var(--radius-control);background:transparent;color:var(--on-primary);font-weight:700;line-height:1;cursor:pointer}
.v2-sizepop__panel button:hover{background:rgb(255 255 255 / .14)}
.v2-sizepop__panel [aria-pressed="true"]{background:var(--brand-band)}
.v2-sizepop__s{font-size:13px !important}.v2-sizepop__m{font-size:17px !important}.v2-sizepop__l{font-size:22px !important}
/* 網站版本（頁首原「舊版」位置；2026-10-30 比照字級面板）：按鈕顯示目前選項，面板同字級的深灰盒，三個文字項 */
.v2-skinpop{position:relative;flex:none}
.v2-skinpop__panel{position:absolute;right:0;top:calc(100% + 8px);z-index:60;display:flex;gap:4px;padding:6px;border-radius:var(--radius-control);background:#50595D;box-shadow:var(--float-shadow)}
.v2-skinpop__panel[hidden]{display:none}
.v2-skinpop__panel a{display:inline-flex;align-items:center;justify-content:center;min-width:3.5rem;height:40px;padding:0 12px;border-radius:var(--radius-control);color:#FFFFFF;font-weight:700;line-height:1;white-space:nowrap;text-decoration:none}
.v2-skinpop__panel a:hover{background:rgb(255 255 255 / .14)}
.v2-skinpop__panel a[aria-current]{background:var(--brand-band)}
.v2-skinpop__panel :focus-visible{outline-color:#FFFFFF}

/* 格線 */
.v2-grid{display:grid;gap:var(--gap);align-items:start}
.v2-grid--2{grid-template-columns:repeat(2,minmax(0,1fr))}
.v2-grid--3{grid-template-columns:repeat(3,minmax(0,1fr))}
.v2-grid--main{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}   /* 約 2/3＋1/3 */
.v2-grid--route{grid-template-columns:minmax(0,600px) minmax(0,1fr)} /* 路線頁：左清單＋右地圖 */
.v2-grid--stretch{align-items:stretch}
.v2-stack{display:flex;flex-direction:column;gap:var(--gap)}
.v2-sticky{position:sticky;top:calc(var(--topbar) + 16px)}

/* ---------- 3. 標題列 ---------- */
.v2-pagehead{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:24px;padding:16px 28px;border-radius:999px;background:var(--brand-band);color:var(--on-primary)}   /* 2026-10-27 比照市府網站：頁面標題整條桃紅色帶 */
.v2-pagehead h1,.v2-h1{font-size:var(--fz-xl);font-weight:700;line-height:var(--lh-tight);margin:0}
.v2-pagehead__sub{display:none}   /* 2026-10-27 使用者：標題色帶不放副標說明 */
/* 色帶裡的返回連結、更新列（時間、暫停、更新）一律白字，進度條改白（桃紅底上看得到） */
.v2-pagehead a:not(.v2-btn),.v2-pagehead .v2-btn--text,.v2-pagehead .v2-refresh,.v2-pagehead .v2-refresh__msg,.v2-pagehead .v2-refresh[data-state="error"] .v2-refresh__msg{color:var(--on-primary)}
.v2-pagehead .v2-btn--text:hover{background:rgb(255 255 255 / .16)}
.v2-pagehead .v2-refresh__bar{background:rgb(255 255 255 / .35)}
.v2-pagehead .v2-refresh__fill{background:var(--on-primary)}
.v2-pagehead__aside{flex:0 1 auto;display:flex;align-items:center;gap:8px}   /* 可縮到內容最窄（不設 min-width:0）：單站頁設了提醒時更新列才會換行，不撐出橫向捲動 */
.v2-h2{font-size:var(--fz-md);font-weight:700;line-height:var(--lh-tight)}
.v2-meta{font-size:var(--fz-sm);color:var(--muted)}
.v2-dash{color:var(--faint)}

/* ---------- 4. 卡片 ---------- */
.v2-card{background:var(--surface);border:1px solid transparent;border-radius:var(--radius-card);padding:var(--card-pad)}   /* 2026-10-27 比照市府網站：白卡浮在灰底，不加框 */
.v2-card--flush{padding:0}
.v2-card--flush > .v2-card__head{padding:16px var(--card-pad) 12px;margin:0}
.v2-card__head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:12px;padding-bottom:10px;border-bottom:6px solid var(--brand-tint)}   /* 市府網站：標題下淡粉粗線 */
.v2-card__title{font-size:var(--fz-md);font-weight:700;line-height:var(--lh-tight);color:var(--brand-strong);letter-spacing:.06em}   /* 2026-10-27 市府網站：區塊標題桃紅（#CE1C6F 白底 5.2:1） */
.v2-card__link{font-size:var(--fz-sm);color:var(--brand-ink);text-decoration:none;white-space:nowrap;display:inline-flex;align-items:center;gap:2px;min-height:32px}
.v2-card__link:hover{text-decoration:underline}

/* ---------- 5. 按鈕 ---------- */
.v2-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;flex:none;height:var(--control-h);padding:0 18px;border:1px solid transparent;border-radius:999px;background:transparent;color:var(--text);font-size:var(--fz-md);line-height:1;white-space:nowrap;text-decoration:none;cursor:pointer;transition:background-color var(--dur-fast) var(--ease),opacity var(--dur-fast) var(--ease)}
.v2-btn:active{translate:0 1px}
.v2-btn[disabled],.v2-btn[aria-disabled="true"]{cursor:not-allowed;color:var(--muted);background:var(--active);border-color:var(--active)}
.v2-btn--primary{background:var(--brand-band);border-color:var(--brand-band);color:var(--on-primary)}   /* 整頁只能有一個；2026-10-27 比照市府網站的桃紅鈕 */
.v2-btn--primary:hover{opacity:.88}
.v2-btn--secondary{background:var(--btn-bg);border-color:var(--btn-bg);color:var(--btn-ink)}   /* 2026-10-27 比照市府網站灰色膠囊鈕 */
.v2-btn--secondary:hover{background:var(--btn-bg-hover)}
.v2-btn--text{padding:0 8px}
.v2-btn--text:hover{background:var(--active)}
.v2-btn--sm{height:32px;font-size:var(--fz-sm)}
/* 圖示＋兩字（路線功能鈕等），44px 高 */
.v2-iconbtn{display:inline-flex;align-items:center;justify-content:center;gap:6px;flex:none;height:var(--touch);padding:0 16px;border:1px solid var(--btn-bg);border-radius:999px;background:var(--btn-bg);color:var(--btn-ink);font-size:var(--fz-sm);white-space:nowrap;text-decoration:none;cursor:pointer;transition:background-color var(--dur-fast) var(--ease)}
.v2-iconbtn:hover{background:var(--btn-bg-hover)}
.v2-iconbtn:active{translate:0 1px}
.v2-iconbtn--plain{border-color:transparent;background:transparent}
.v2-iconbtn--plain:hover{background:var(--active)}
.v2-iconbtn[aria-disabled="true"]{cursor:not-allowed;color:var(--muted)}
.v2-iconbtn[aria-pressed="true"] .v2-ico{color:var(--brand-strong);--ico-2:currentColor;--ico-2-op:1}   /* 已收藏：星星實心（我的站＝資料色） */
.v2-btnrow{display:flex;gap:8px;flex-wrap:wrap}
/* 外觀像文字的按鈕（站名、列表標題）：整格可點 */
.v2-linkbtn{display:block;width:100%;min-height:var(--touch);padding:0;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer;text-decoration:none}
.v2-linkbtn:hover{text-decoration:underline;text-underline-offset:3px}

/* ---------- 6. 輸入 ---------- */
.v2-field{display:flex;flex-direction:column;gap:8px}
.v2-label{font-size:var(--fz-sm);color:var(--text)}
.v2-hint{font-size:var(--fz-sm);color:var(--muted)}
.v2-input,.v2-select{display:block;width:100%;height:var(--control-h);padding:0 12px;border:1px solid var(--control);border-radius:var(--radius-control);background:var(--surface);color:var(--text);font-size:var(--fz-md)}
.v2-input::placeholder{color:var(--faint);opacity:1}
.v2-input:hover,.v2-select:hover{border-color:var(--muted)}
.v2-select{appearance:none;padding-right:36px;cursor:pointer}
.v2-selectwrap{position:relative}
.v2-selectwrap > .v2-ico{position:absolute;right:10px;top:50%;translate:0 -50%;pointer-events:none;color:var(--muted)}
/* 大搜尋框 48px（首頁、路線頁） */
.v2-search{position:relative;display:block}
.v2-search .v2-input{height:48px;padding-left:44px;padding-right:44px;font-size:var(--fz-md)}
.v2-search > .v2-ico{position:absolute;left:14px;top:50%;translate:0 -50%;color:var(--muted);pointer-events:none}
.v2-search__clear{position:absolute;right:2px;top:50%;translate:0 -50%;width:44px;height:44px;display:flex;align-items:center;justify-content:center;border:0;background:none;color:var(--muted);cursor:pointer;border-radius:var(--radius-control)}

/* ---------- 7. 分段切換、底線分頁、膠囊 ---------- */
.v2-seg{display:inline-flex;align-items:center;gap:2px;padding:3px;background:var(--active);border-radius:var(--radius-card)}
.v2-seg > button,.v2-seg > a{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:2.75rem;height:34px;padding:0 14px;border:1px solid transparent;border-radius:var(--radius-control);background:transparent;color:var(--muted);font-size:var(--fz-sm);white-space:nowrap;text-decoration:none;cursor:pointer}
.v2-seg > :hover{color:var(--text)}
.v2-seg > [aria-pressed="true"],.v2-seg > [aria-checked="true"],.v2-seg > [aria-selected="true"],.v2-seg > [aria-current]{background:var(--brand-tint);border-color:var(--brand);color:var(--brand-ink);font-weight:700}
.v2-seg--lg > button,.v2-seg--lg > a{height:40px;font-size:var(--fz-md);padding:0 18px}
.v2-seg--full{display:flex}
.v2-seg--full > *{flex:1}

.v2-tabs{display:flex;gap:16px;border-bottom:1px solid var(--border);overflow-x:auto;scrollbar-width:none}
.v2-tabs::-webkit-scrollbar{display:none}
.v2-tab{position:relative;flex:none;display:inline-flex;align-items:center;gap:6px;height:var(--touch);padding:0 6px;border:0;background:none;color:var(--muted);font-size:var(--fz-md);white-space:nowrap;text-decoration:none;cursor:pointer}   /* 左右 6px 留給內縮焦點框；字距仍是 16＋6＋6＝28 */
.v2-tab:hover{color:var(--text)}
.v2-tab[aria-selected="true"],.v2-tab[aria-current]{color:var(--brand-ink);font-weight:700}
.v2-tab[aria-selected="true"]::after,.v2-tab[aria-current]::after{content:"";position:absolute;left:4px;right:4px;bottom:0;height:3px;background:var(--brand-strong)}
.v2-tab__count{font-size:var(--fz-sm);font-weight:400;color:var(--muted)}

/* 膠囊／標籤：類別文字、範圍篩選。不擠壓、不換行 */
.v2-chip{display:inline-flex;align-items:center;gap:4px;flex:none;height:1.5rem;padding:0 8px;border-radius:var(--radius-chip);background:var(--active);color:var(--muted);font-size:var(--fz-xs);line-height:1;white-space:nowrap}
.v2-chip--outline{background:var(--surface);border:1px solid var(--border)}
button.v2-chip,a.v2-chip{height:2rem;padding:0 12px;border:1px solid var(--control);border-radius:var(--radius-pill);background:var(--surface);color:var(--text);font-size:var(--fz-sm);text-decoration:none;cursor:pointer}
button.v2-chip[aria-pressed="true"],a.v2-chip[aria-current]{background:var(--active);border-color:var(--text);font-weight:700}
.v2-chips{display:flex;flex-wrap:wrap;gap:8px}
/* 小標：折返、首站、末站 */
.v2-tag{display:inline-flex;align-items:center;flex:none;height:1.25rem;padding:0 6px;margin-left:6px;border:1px solid var(--control);border-radius:var(--radius-chip);color:var(--muted);font-size:var(--fz-xs);line-height:1;white-space:nowrap;vertical-align:.125em}

/* 路線號：700、等寬數字、固定寬欄（長的如 502(大溪站發車) 會在欄內換行） */
.v2-routeno{display:inline-block;flex:none;width:5rem;padding:4px 6px;border-radius:var(--radius-control);background:var(--brand-tint);font-size:var(--fz-md);font-weight:700;line-height:1.2;color:var(--brand-ink);text-align:center;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}   /* 2026-10-27 主色階梯：路線號淡粉標章 */
.v2-routeno--auto{width:auto}
.v2-routeno--lg{width:auto;padding:0;background:none;font-size:var(--fz-xl);line-height:var(--lh-tight)}
/* 無障礙圖示（路線級 2 實心、1 外框；車輛級 1 實心） */
.v2-acc{display:inline-flex;color:var(--muted);vertical-align:middle}
.v2-accimg{display:inline-block;width:1.125em;height:1.125em;flex:none;vertical-align:-.15em}   /* 舊站官方圖檔（static/images/Accessibility*.png），不自己畫 */

/* ---------- 8. ETA 狀態膠囊（DESIGN-BRIEF §7） ---------- */
.v2-eta{display:inline-flex;align-items:center;justify-content:center;gap:6px;flex:none;width:var(--eta-w);min-height:1.75rem;padding:2px 6px;border:1px solid transparent;border-radius:var(--radius-chip);background:transparent;font-size:var(--fz-md);line-height:1.2;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;font-variant-numeric:tabular-nums}   /* 2026-10-28 14→16px（高雄時間欄 16px 粗體；使用者：高雄看起來比較大） */
.v2-eta:lang(en){white-space:normal;font-size:var(--fz-xs);line-height:1.15}
/* 粗體＝即時預估（進站中、即將進站、15 分內）；其餘 400 */
.v2-eta--arriving{background:var(--brand-strong);border-color:var(--brand-strong);color:var(--on-primary)}   /* 2026-10-28 使用者：進站中、即將進站、分鐘都不用粗體（字已放大到 16px） */
.v2-eta__pulse{width:6px;height:6px;flex:none;border-radius:50%;background:currentColor;animation:v2-blink 1.4s var(--ease) infinite}
/* 2026-10-27 評審意見：分級不能只靠顏色 → 進站中實底／即將進站淡底粗框／15 分內細黑框／更久無框，轉灰階也分得出來 */
.v2-eta--soon{background:var(--brand-tint);color:var(--brand-ink)}   /* 2026-10-27 拿掉外框：各種時間同一個形狀，只用底色分（比照高雄） */
.v2-eta--mid{background:var(--ground);color:var(--text)}
.v2-eta--far{color:var(--muted)}
.v2-eta--scheduled,.v2-eta--headway,.v2-eta--split{background:var(--sched-bg);color:var(--sched-ink)}
.v2-eta--reservation{background:var(--surface);border:1px dashed var(--control);color:var(--muted)}
.v2-eta--ended{background:var(--ended-bg);color:var(--ended-ink)}
.v2-eta--inactive{color:var(--inactive-ink)}
/* 晚發／停趟：兩行，上「尚未發車／路線偏離…」、下本站表定 */
.v2-eta--late,.v2-eta--suspended{flex-direction:column;gap:0;min-height:2.5rem;padding:2px 4px}
.v2-eta__main{color:var(--inactive-ink);font-size:var(--fz-sm);line-height:1.2}
.v2-eta__sub{color:var(--sched-ink);font-size:var(--fz-xs);line-height:1.2}
/* 前方壅塞（S11，2026-11-05）：兩行，上時間（照分級底色）、下狀態字；車牌／狀態欄開著時狀態放那欄、膠囊只印時間 */
.v2-eta--hold{flex-direction:column;gap:0;min-height:2.5rem;padding:2px 4px}
.v2-eta__hold{font-size:var(--fz-xs);line-height:1.2}
/* --inactive-ink 只能放白底：放在我的站列（--brand-tint）、選取列時改 --muted */
.v2-on-tint .v2-eta--inactive,.v2-on-tint .v2-eta__main,.v2-on-tint .v2-status,
.v2-spine-row--mine .v2-eta--inactive,.v2-spine-row--mine .v2-eta__main,.v2-spine-row--mine .v2-status,
.v2-list-row--selected .v2-eta--inactive,.v2-list-row--selected .v2-eta__main{color:var(--muted)}
/* 大字版（我的站釘選卡）：36px */
.v2-eta--answer{width:auto;min-width:var(--eta-w);min-height:3.25rem;padding:4px 14px;font-size:var(--fz-answer);line-height:1.1;border-radius:var(--radius-control)}
.v2-eta--answer:lang(en){font-size:var(--fz-xl);line-height:1.15}   /* :lang(en) 的 12px 規則比 --answer 權重高，大字版要補回（route.html 回報） */
.v2-eta--answer.v2-eta--late .v2-eta__main,.v2-eta--answer.v2-eta--suspended .v2-eta__main{font-size:var(--fz-lg)}
.v2-eta--answer.v2-eta--late .v2-eta__sub,.v2-eta--answer.v2-eta--suspended .v2-eta__sub{font-size:var(--fz-md)}
.v2-eta--answer .v2-eta__hold{font-size:var(--fz-md)}
/* 車牌／狀態欄的狀態字 */
.v2-status{color:var(--inactive-ink);font-size:var(--fz-sm)}

/* ---------- 9. 站序脊線清單（簽名元素） ---------- */
.v2-spine-list{position:relative;list-style:none;margin:0;padding:0;background:var(--surface);container-type:inline-size;container-name:v2spine}
.v2-spine-row{position:relative;display:grid;grid-template-columns:var(--spine-col) minmax(0,1fr) var(--eta-w);column-gap:12px;align-items:center;min-height:var(--row);padding-right:16px}
.v2-spine-list--plate .v2-spine-row{grid-template-columns:var(--spine-col) minmax(0,1fr) var(--plate-w) var(--eta-w)}   /* 站名｜車牌｜時間（2026-10-27 時間放最右，比照高雄） */
.v2-spine-row::after{content:"";position:absolute;left:var(--spine-col);right:0;bottom:0;height:1px;background:var(--rule)}  /* 分隔線從文字欄開始，脊線不斷 */
.v2-spine-row:last-child::after{display:none}
.v2-spine-row__seq{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}   /* 2026-10-27 站序欄拿掉（比照高雄）：只留給讀屏；站序改在地圖、票價、站牌抽屜顯示 */
.v2-spine-row__name{min-width:0;font-size:var(--fz-md);font-weight:400;line-height:var(--lh-tight);overflow-wrap:anywhere}  /* D-40 站名不粗體 */
.v2-spine-row__name .v2-linkbtn{display:flex;flex-direction:column;justify-content:center;padding:6px 0}
.v2-spine-row__sub{display:none;font-size:var(--fz-sm);color:var(--muted);line-height:1.3;margin-top:2px}
.v2-spine-row__sub--on{display:block}   /* 車牌欄關時的擁擠／末班車字（取代車點角標） */
.v2-spine-row__eta{display:flex;justify-content:flex-end}
.v2-spine-row__plate{font-size:var(--fz-sm);line-height:1.3;display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0}
.v2-spine-row__plate .v2-plate{display:inline-flex;align-items:center;gap:4px;white-space:nowrap}
.v2-spine-row--mine{background:var(--brand-tint)}
.v2-spine-row--selected{background:var(--active)}

/* 脊線欄：8px 粉紅線貫穿，站點＝粉色鼓起＋白心（TAB 站點比例） */
.v2-spine{grid-column:1;align-self:stretch;position:relative;pointer-events:none}
.v2-spine::before{content:"";position:absolute;left:50%;top:0;bottom:0;width:var(--spine-w);margin-left:calc(var(--spine-w) / -2);background:var(--brand)}
.v2-spine__node{position:absolute;left:50%;top:50%;width:var(--spine-ring);height:var(--spine-ring);translate:-50% -50%;border-radius:50%;background:var(--brand)}
.v2-spine__node::after{content:"";position:absolute;left:50%;top:50%;width:var(--spine-dot);height:var(--spine-dot);translate:-50% -50%;border-radius:50%;background:var(--surface)}
/* 2026-10-27 使用者：首末站的線不能凸出圓圈（才看得出開始與結束）→ 首站的線從圓心往下、末站從上到圓心為止 */
.v2-spine-row--first .v2-spine::before{top:50%}
.v2-spine-row--last .v2-spine::before{bottom:50%}
.v2-spine-row--first.v2-spine-row--last .v2-spine::before{display:none}
.v2-spine-row--first .v2-spine__node,.v2-spine-row--last .v2-spine__node{width:calc(var(--spine-ring) + 4px);height:calc(var(--spine-ring) + 4px)}
.v2-spine-row--first .v2-spine__node::after,.v2-spine-row--last .v2-spine__node::after{width:calc(var(--spine-dot) + 3px);height:calc(var(--spine-dot) + 3px)}
/* 折返點：白心改墨色小點，旁邊加「折返」小標 */
.v2-spine-row--turn .v2-spine__node::after{background:var(--text)}
/* 我的站：放大圓環（封面圓環比例），--brand-strong */
.v2-spine-row--mine .v2-spine__node{width:24px;height:24px;background:var(--brand-strong)}
.v2-spine-row--mine .v2-spine__node::after{width:12px;height:12px}
/* 進站中：實心 --brand-strong＋脈動圈 */
.v2-spine-row--arriving .v2-spine__node{width:26px;height:26px;background:var(--brand-strong)}   /* 2026-10-27 評審：進站中站圈換成公車圖示（高雄做法），站名照 D-40 不加粗 */
.v2-spine__bus{position:absolute;left:50%;top:50%;translate:-50% -50%;width:13px;height:13px;color:var(--on-primary)}
.v2-spine-row--arriving .v2-spine__node::after{display:none}
.v2-spine-row--arriving .v2-spine__node::before{content:"";position:absolute;inset:-5px;border-radius:50%;border:3px solid var(--brand-strong);animation:v2-ring 1.4s var(--ease) infinite}   /* 2026-10-27 機關：波紋看不出來 → 加粗加大 */
/* 修正輪：我的站、進站中的站點疊在車點（z-index 3）之上，車點夾在 0.3–0.7 時也不會把它們蓋成一彎月牙；合併清單（6）仍在最上 */
.v2-spine-row--mine .v2-spine__node,.v2-spine-row--arriving .v2-spine__node{z-index:4}

/* 公車膠囊：畫在兩站之間（列的上緣或下緣），車形圖示的圓心對齊脊線 */
.v2-bus{position:absolute;z-index:2;left:calc(var(--spine-col) / 2 - 11px);display:inline-flex;align-items:center;gap:4px;min-height:22px;padding:0 8px 0 3px;border-radius:var(--radius-pill);background:var(--text);color:var(--on-primary);font-size:var(--fz-xs);font-weight:700;line-height:1;white-space:nowrap;pointer-events:none;translate:0 -50%;transition:transform var(--dur-move) var(--ease)}
.v2-bus__ico{display:flex;align-items:center;justify-content:center;width:16px;height:16px;flex:none}
.v2-bus__ico .v2-ico{width:16px;height:16px}
.v2-bus--next{top:100%}      /* 剛離開本站、往下一站 */
.v2-bus--prev{top:0}         /* 正在進本站（進站中／即將進站） */
.v2-bus--at{top:50%}         /* 停在首站 */
.v2-bus--solo{padding-right:3px}

/* 公車膠囊單獨展示（圖鑑、說明） */
.v2-bus--static{position:static;translate:none}

/* ---------- 10. 更新列 ---------- */
.v2-refresh{display:flex;align-items:center;gap:12px;min-height:var(--touch);font-size:var(--fz-sm);color:var(--muted)}
.v2-refresh__msg{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.v2-refresh__bar{position:relative;flex:1;height:2px;min-width:3rem;background:var(--rule);overflow:hidden;border-radius:1px}
.v2-refresh__fill{position:absolute;left:0;top:0;bottom:0;width:0;background:var(--text);transition:width 1s linear}
.v2-refresh[data-state="loading"] .v2-refresh__fill{width:100%;transition:none}
.v2-refresh[data-state="error"] .v2-refresh__msg{color:var(--text);white-space:normal}
.v2-refresh[data-state="error"] .v2-refresh__msg .v2-ico{color:var(--negative)}
.v2-refresh[data-state="error"] .v2-refresh__fill{width:0}

/* ---------- 11. 抽屜（桌機右側、手機底部）與下拉選單：只有這兩種可有陰影 ---------- */
.v2-drawer{position:fixed;inset:0;z-index:60;display:flex;justify-content:flex-end}
.v2-drawer[hidden]{display:none}
.v2-drawer__scrim{position:absolute;inset:0;background:var(--scrim)}
.v2-drawer__panel{position:relative;display:flex;flex-direction:column;width:min(420px,100%);height:100%;background:var(--surface);box-shadow:var(--float-shadow)}
.v2-drawer__head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:var(--topbar);padding:0 8px 0 var(--pad);border-bottom:1px solid var(--border)}
.v2-drawer__title{font-size:var(--fz-lg);font-weight:700;line-height:var(--lh-tight)}
.v2-drawer__body{flex:1;overflow:auto;padding:16px var(--pad) 24px}
.v2-drawer__foot{display:flex;gap:8px;padding:12px var(--pad);border-top:1px solid var(--border)}
.v2-drawer__grip{display:none}
/* 靜態展示（圖鑑、route-sheets 並排五個抽屜）：留在版面裡，不疊在畫面上；不加陰影 */
.v2-drawer--inline{position:static;display:block;z-index:auto}
.v2-drawer--inline .v2-drawer__scrim{display:none}
.v2-drawer--inline .v2-drawer__panel{width:100%;height:auto;border:1px solid var(--border);border-radius:var(--radius-card);box-shadow:none}
/* 下拉選單（搜尋建議等） */
.v2-pop{position:absolute;z-index:50;left:0;right:0;margin-top:4px;padding:4px 0;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-card);box-shadow:var(--float-shadow)}
.v2-pop__group{padding:8px 16px 4px;font-size:var(--fz-xs);color:var(--muted)}
.v2-pop__item{display:flex;align-items:center;gap:12px;min-height:var(--touch);padding:0 16px;color:var(--text);text-decoration:none}
.v2-pop__item > :last-child{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.v2-pop__item:hover,.v2-pop__item[aria-selected="true"]{background:var(--active)}

/* 選單抽屜（頁殼內建；menu.html 可再加內容） */
.v2-drawer .v2-menu__block{margin-top:20px}
.v2-menu__nav .v2-list-row[aria-current]{background:var(--active);font-weight:700}

/* ---------- 12. 清單列（56px） ---------- */
.v2-list{list-style:none;margin:0;padding:0}
.v2-list-row{display:flex;align-items:center;gap:12px;min-height:var(--row);padding:8px 16px;border-bottom:1px solid var(--rule);color:var(--text);text-decoration:none}
button.v2-list-row{width:100%;border-width:0 0 1px;border-style:solid;border-color:var(--rule);background:none;font:inherit;text-align:start;cursor:pointer}
button.v2-list-row:hover .v2-list-row__main{text-decoration:underline;text-underline-offset:3px}
.v2-list > :last-child > .v2-list-row,.v2-list > .v2-list-row:last-child{border-bottom:0}
.v2-list-row__main{flex:1;min-width:0}
.v2-list-row__title{display:block;font-size:var(--fz-md);line-height:var(--lh-tight);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.v2-list-row__title--wrap{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.v2-list-row__sub{display:block;margin-top:2px;font-size:var(--fz-sm);line-height:1.3;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.v2-list-row__end{flex:none;display:flex;align-items:center;gap:8px;font-size:var(--fz-sm);color:var(--muted)}
a.v2-list-row:hover .v2-list-row__title{text-decoration:underline;text-underline-offset:3px}
/* A+／A++ 或英文時字變長：清單列與下拉建議的標題、副標改成換行，不用省略號截掉（WCAG 1.4.4） */
html:is([data-size],[lang="en"]) :is(.v2-list-row__title,.v2-list-row__sub,.v2-pop__item > :last-child){white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
html:is([data-size],[lang="en"]) .v2-list-row__title--wrap{display:block;-webkit-line-clamp:none}
.v2-list-row--selected{background:var(--active)}
.v2-list-row--saved{background:var(--raised)}
.v2-list-row--muted .v2-routeno,.v2-list-row--muted .v2-list-row__title{color:var(--muted)}

/* ---------- 13. 載入、空、錯誤、離線、公告 ---------- */
.v2-skel{display:block;height:1rem;border-radius:var(--radius-chip);background:var(--active)}   /* 平的灰條，不閃爍 */
.v2-skel--sm{height:.875rem}
.v2-skel--eta{width:var(--eta-w);height:1.75rem}
.v2-skel--w30{width:30%}.v2-skel--w50{width:50%}.v2-skel--w70{width:70%}.v2-skel--w90{width:90%}
.v2-skel--no{width:3rem}

.v2-empty{display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px;min-height:38px;padding:12px 16px;border:1px dashed var(--control);border-radius:var(--radius-card);color:var(--muted);font-size:var(--fz-sm);line-height:1.5}
.v2-empty a{color:var(--text)}
.v2-error{display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-height:var(--touch);font-size:var(--fz-sm);color:var(--text)}
.v2-error > .v2-ico{color:var(--negative)}
.v2-offline,.v2-notice{display:flex;align-items:flex-start;gap:8px;padding:10px 12px;border:1px solid var(--notice-border);border-radius:var(--radius-control);background:var(--notice-bg);color:var(--notice-ink);font-size:var(--fz-sm);line-height:1.5}
.v2-offline > .v2-ico,.v2-notice > .v2-ico{margin-top:2px}
.v2-notice__body{flex:1;min-width:0}
.v2-notice__close{flex:none;display:flex;align-items:center;justify-content:center;width:32px;height:32px;margin:-6px -6px -6px 0;border:0;background:none;color:inherit;border-radius:var(--radius-control);cursor:pointer}
.v2-legend{font-size:var(--fz-sm);color:var(--muted);line-height:1.6}

/* ---------- 14. 地圖（SVG 示意） ---------- */
.v2-mapbox{position:relative;overflow:hidden;background:var(--ground);border:1px solid var(--border);border-radius:var(--radius-card)}
.v2-map{display:block;width:100%;height:auto}
.v2-map__bg{fill:var(--ground)}
.v2-map__route{fill:none;stroke:var(--brand);stroke-width:4;stroke-linecap:round;stroke-linejoin:round}
.v2-map__stop{fill:var(--surface);stroke:var(--brand);stroke-width:2}
.v2-map__stop--end{stroke-width:3}
.v2-map__halo{fill:var(--brand-tint);stroke:var(--brand-strong);stroke-width:2}
.v2-map__bus{fill:var(--text)}
.v2-map__bus-dot{fill:var(--surface)}
.v2-map__note{font-size:var(--fz-xs);fill:var(--muted);paint-order:stroke;stroke:var(--surface);stroke-width:3px;stroke-linejoin:round}
.v2-mapbox__tools{position:absolute;right:12px;top:12px;display:flex;flex-direction:column;gap:8px}

/* ---------- 15. 平板（641–1099） ---------- */
@media (max-width:1099px){
  .v2-nav,.v2-topbar__tools{display:none}
  .v2-topbar__compact{display:flex}
  /* B2：底部導覽到 1099px；選單抽屜就不重複列導覽 */
  .v2-bottombar{display:block}
  .v2-shell{padding-bottom:calc(var(--bottombar) + env(safe-area-inset-bottom))}
  .v2-menu__nav{display:none}
  .v2-drawer .v2-menu__nav + .v2-menu__block{margin-top:0}
  /* 焦點與錨點捲動時讓開固定的底部導覽（WCAG 2.4.11） */
  html{scroll-padding-bottom:calc(var(--bottombar) + env(safe-area-inset-bottom) + 8px)}
  .v2-grid--main,.v2-grid--route{grid-template-columns:minmax(0,1fr)}
  .v2-sticky{position:static}
  .v2-footer__in{grid-template-columns:auto minmax(0,1fr)}
  .v2-footer__meta{grid-column:2;text-align:left}
}

/* 大字級時桌機頂列放不下全部項目：改用平板的精簡頂列（字級、語言、導覽都在選單裡） */
@media (max-width:1599px){
  html[data-size="l"] .v2-nav,html[data-size="l"] .v2-topbar__tools{display:none}
  html[data-size="l"] .v2-topbar__compact{display:flex}
}

/* ---------- 16. 手機（≤640） ---------- */
@media (max-width:640px){
  :root{--pad:16px}
  .v2-topbar__in{height:52px;gap:8px}
  .v2-brand__name{font-size:var(--fz-md)}
  .v2-footer__links{gap:0 20px;margin-left:0;clip-path:none}
  .v2-footer__links li{border-left:0}   /* 手機：不畫分隔線，改用間距 */
  .v2-footer__links a{padding:0}
  .v2-main{padding-top:16px}
  .v2-pagehead{flex-direction:column;align-items:stretch;gap:8px;margin-bottom:16px;padding:14px 20px;border-radius:var(--radius-card)}   /* 手機兩行：色帶改大圓角 */
  .v2-pagehead h1,.v2-h1{font-size:var(--fz-lg)}
  .v2-pagehead__sub{font-size:var(--fz-sm)}
  .v2-grid--2,.v2-grid--3{grid-template-columns:minmax(0,1fr)}
  .v2-card:not(.v2-card--flush){padding:16px}
  .v2-card--flush > .v2-card__head{padding:14px 16px 10px}
  .v2-btn{min-height:var(--touch)}
  .v2-seg > button,.v2-seg > a{height:var(--touch)}
  .v2-btnrow--scroll{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin-inline:calc(var(--pad) * -1);padding-inline:var(--pad)}
  .v2-btnrow--scroll::-webkit-scrollbar{display:none}
  .v2-drawer{align-items:flex-end}
  .v2-drawer__panel{width:100%;height:auto;max-height:85dvh;border-radius:var(--radius-card) var(--radius-card) 0 0;padding-bottom:env(safe-area-inset-bottom)}
  .v2-drawer__grip{display:block;width:36px;height:4px;margin:8px auto 0;border-radius:2px;background:var(--control)}
  .v2-sdrawer .v2-drawer__panel{height:85dvh}   /* 手機搜尋面板固定高度：建議出現、收起時輸入框不會上下跳 */
  .v2-recent a.v2-chip{height:auto;min-height:var(--touch)}
  .v2-footer__in{grid-template-columns:minmax(0,1fr);padding-bottom:24px}
  .v2-footer__meta{grid-column:auto;white-space:normal}
  /* 2026-10-28 使用者：手機 city 頁尾只留「桃」字標誌＋「桃園市政府交通局 版權所有」一行（政策連結在選單「政策與聲明」）；arterial 不變 */
  html:not([data-skin="arterial"]) .v2-footer__in{display:flex;align-items:center;gap:12px;padding-block:16px}
  html:not([data-skin="arterial"]) .v2-footer__mark img{height:32px}
  html:not([data-skin="arterial"]) .v2-footer__body{font-size:var(--fz-sm);line-height:1.5}
  html:not([data-skin="arterial"]) :is(.v2-footer__links,.v2-footer__body > p:not(:first-of-type),.v2-footer__meta){display:none}
  /* 英文或 A+／A++ 時頂列放不下「圖示＋字」：字改成只給螢幕閱讀器（規格 §4 手機頂列本來就是搜尋圖示＋選單鈕；route.html 回報） */
  html:is([lang="en"],[data-size="l"],[data-size="xl"]) .v2-topbar__compact .v2-btn{min-width:var(--touch);padding:0 8px}
  html:is([lang="en"],[data-size="l"],[data-size="xl"]) .v2-topbar__compact .v2-btn > span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  /* 觸控目標 ≥44px（DESIGN-BRIEF §4）：外觀不變的用負 margin 抵銷 */
  .v2-card__link{min-height:var(--touch);min-width:var(--touch);justify-content:flex-end;margin-block:-6px}
  .v2-footer__links a{min-height:var(--touch)}
  .v2-empty a{display:inline-flex;align-items:center;min-height:var(--touch);margin-block:-11px}
  .v2-input,.v2-select{height:var(--touch)}
  .v2-notice__close{width:var(--touch);height:var(--touch);margin:-12px -12px -12px 0}
  button.v2-chip,a.v2-chip{height:auto;min-height:var(--touch)}
}
/* 脊線清單依「清單本身」的寬度變形（container query），放在手機、抽屜、窄欄都對：
   ≥560px：車牌／狀態欄在右，膠囊上不重印車牌（同一台車牌只出現一次）
   <560px：站序欄縮窄；車牌／狀態欄收起，改站名下第二行（§9 #17），車牌改印在公車膠囊上 */
@container v2spine (min-width:560px){
  .v2-spine-list--plate .v2-bus__plate{display:none}
  .v2-spine-list--plate .v2-bus{padding-right:3px}
}
@container v2spine (max-width:559.98px){
  .v2-spine-row,.v2-spine-list--plate .v2-spine-row{grid-template-columns:var(--spine-col) minmax(0,1fr) var(--eta-w);column-gap:8px;padding-right:8px}
  .v2-spine-row__seq{font-size:var(--fz-xs)}
  .v2-spine-row__plate{display:none}
  .v2-spine-list--plate .v2-spine-row__sub{display:block}
}

/* ---------- 17. 動態：只做回饋；進站中脈動＋車平移是唯二持續動態 ---------- */
@keyframes v2-blink{0%,100%{opacity:1}50%{opacity:.3}}
@keyframes v2-ring{0%{transform:scale(.8);opacity:1}100%{transform:scale(2.1);opacity:0}}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none !important;transition:none !important;scroll-behavior:auto !important}
  .v2-spine-row--arriving .v2-spine__node::before{display:none}
}

/* ---------- 18. 高對比（tokens.css 已把淡底改白；這裡補描邊） ---------- */
@media (prefers-contrast:more){
  .v2-eta--scheduled,.v2-eta--headway,.v2-eta--split,.v2-eta--ended,.v2-eta--far,.v2-eta--inactive,.v2-eta--late,.v2-eta--suspended{border-color:currentColor}
  .v2-eta--soon{border-color:var(--brand-ink)}
  .v2-eta--mid{border-color:var(--text)}
  .v2-chip{border:1px solid currentColor}
  .v2-spine-row--mine{outline:2px solid var(--brand-strong);outline-offset:-2px}
}

/* ---------- 19. 第二輪（2026-10-26）共用元件 ---------- */
/* 19.1 更新列：暫停／繼續（B4）、已設提醒（§2.3）；換行時提醒字自成一行 */
.v2-refresh{flex-wrap:wrap;column-gap:12px;row-gap:0}
.v2-refresh__pause{gap:4px;padding:0 8px}
.v2-refresh[data-paused] .v2-refresh__pause{background:var(--active)}   /* K2：不用 aria-pressed，看更新列的 data-paused */
.v2-refresh__remind{display:inline-flex;align-items:center;gap:4px;min-height:var(--touch);color:var(--text);white-space:nowrap}
.v2-refresh__remind[hidden]{display:none}
/* B5：暫停時進站脈動、車點平移一起停（系統「減少動態」在第 17 節另外處理） */
html.v2-paused .v2-eta__pulse{animation:none}
html.v2-paused .v2-spine-row--arriving .v2-spine__node::before{display:none}
html.v2-paused .v2-car{transition:none}

/* 19.2 脊線車點（multi-bus.md §5 方案 A）：20px 墨色圓＋2px 白邊，依比例放在區間起點列的圓心往下 --r×列高 */
/* 修正輪：車點總寬 20px（含 2px 白邊，照 §2.1「20px」）；比例夾 0.3–0.7 時圓心離站點 16.8px，和 16px 站點圓環幾乎不碰 */
.v2-car{position:absolute;z-index:3;left:calc(var(--spine-col) / 2 - 10px);top:calc(50% + var(--r, 0) * 100%);display:flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:2px solid var(--surface);border-radius:var(--radius-pill);background:var(--text);color:var(--on-primary);translate:0 -50%;pointer-events:none;transition:transform var(--dur-move) var(--ease)}
.v2-car .v2-ico{width:11px;height:11px}
.v2-fa{display:block;width:1em;height:1em;flex:none;fill:currentColor}   /* Font Awesome 實心圖示（V2.faBus），顏色跟字色 */
.v2-car .v2-fa{width:10px;height:10px}
.v2-car--stale{border:1.5px dashed var(--text);background:var(--surface);color:var(--muted)}   /* 位置延遲：空心虛線、圖示灰（V1） */
/* 合併膠囊：車形＋數字，按鈕；觸控範圍透明延伸到 44px 高 */
.v2-car--group{left:calc(var(--spine-col) / 2 - 14px);width:auto;min-width:44px;gap:2px;padding:0 8px 0 5px;font:inherit;font-size:var(--fz-xs);font-weight:700;line-height:1;pointer-events:auto;cursor:pointer}
.v2-car--group::before{content:"";position:absolute;inset:-14px -2px}   /* 觸控延伸 44×44：::before 以 padding box 為準（16px 高＋上下 14＝44；2px 白邊不算） */
.v2-car--group[aria-expanded="true"]{background:var(--text)}
.v2-car--enter{animation:v2-fade 150ms var(--ease)}
.v2-car--static{position:relative;left:auto;top:auto;translate:none;display:inline-flex;flex:none}
.v2-car--merged{opacity:0;pointer-events:none}   /* 進站中：站圈已畫成公車，這台車的車點不再畫（讀屏照唸位置） */
.v2-at-0{--r:0}.v2-at-5{--r:0.05}.v2-at-10{--r:0.1}.v2-at-15{--r:0.15}.v2-at-20{--r:0.2}.v2-at-25{--r:0.25}.v2-at-30{--r:0.3}.v2-at-35{--r:0.35}.v2-at-40{--r:0.4}.v2-at-45{--r:0.45}.v2-at-50{--r:0.5}.v2-at-55{--r:0.55}.v2-at-60{--r:0.6}.v2-at-65{--r:0.65}.v2-at-70{--r:0.7}.v2-at-75{--r:0.75}.v2-at-80{--r:0.8}.v2-at-85{--r:0.85}.v2-at-90{--r:0.9}.v2-at-95{--r:0.95}.v2-at-100{--r:1}
/* 長段（≥3km）：多一列空白；車點的 100% 是兩列高，圓心在上面那列中間 */
.v2-spine-row--long{grid-template-rows:minmax(var(--row),auto) var(--row)}
.v2-spine-row--long .v2-spine{grid-row:1 / span 2}
.v2-spine-row--long .v2-spine__node{top:calc((100% - var(--row)) / 2)}
.v2-spine-row--first.v2-spine-row--long .v2-spine::before{top:calc((100% - var(--row)) / 2)}   /* 首站剛好是長段：線從站圈圓心起（原本 top:50% 是兩列合計的一半，落在站圈下方，線會斷一截；2026-11-02 使用者回報 T200） */
.v2-spine-row--long .v2-car,.v2-spine-row--long .v2-carpop{top:calc((100% - var(--row)) / 2 + var(--r, 0) * 100%)}
.v2-spine-row__dist{grid-row:2;grid-column:2 / -1;align-self:center;font-size:var(--fz-sm);color:var(--muted)}
/* 合併膠囊點開的清單（浮起的下拉，可有陰影） */
.v2-carpop{position:absolute;z-index:6;left:calc(var(--spine-col) / 2 - 12px);top:calc(50% + var(--r, 0) * 100% + 18px);width:min(20rem, calc(100% - 16px));padding:4px 12px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-card);box-shadow:var(--float-shadow);font-size:var(--fz-sm);line-height:1.4}
.v2-carpop[hidden]{display:none}
.v2-carpop__list{list-style:none;margin:0;padding:0}
.v2-carpop__item{display:flex;flex-direction:column;gap:4px;padding:8px 0;border-bottom:1px solid var(--rule)}
.v2-carpop__item:last-child{border-bottom:0}
.v2-carpop__plate{display:inline-flex;align-items:center;gap:4px;font-weight:700}
.v2-carpop__where,.v2-carpop__note,.v2-carpop__more{color:var(--muted)}
.v2-carpop__eta{display:flex;align-items:center;justify-content:space-between;gap:8px}
.v2-carpop__more{padding:4px 0 8px}
.v2-plate__age{margin-left:4px;font-size:var(--fz-xs);color:var(--muted)}
.v2-spine-row__plate .v2-crowd{margin-top:2px}

/* 19.3 路段壅塞（預留，status-crowd.md §3.4）：脊線上疊墨色硬邊斜紋（SVG pattern，不是漸層）＋文字，不用桃紅、不靠顏色 */
.v2-defs{position:absolute;width:0;height:0;overflow:hidden}
.v2-cong__ink{fill:var(--text)}
.v2-spine__cong{position:absolute;left:50%;width:var(--spine-w);margin-left:calc(var(--spine-w) / -2);top:0;bottom:0}
.v2-spine__cong--in{bottom:50%}
.v2-spine__cong--out{top:50%}
.v2-spine-row--long .v2-spine__cong--in{bottom:auto;height:calc((100% - var(--row)) / 2)}
.v2-spine-row--long .v2-spine__cong--out{top:calc((100% - var(--row)) / 2)}
.v2-spine-row__note{display:flex;align-items:center;gap:4px;margin-top:2px;font-size:var(--fz-sm);line-height:1.3;color:var(--notice-ink)}

/* 19.4 擁擠度（預留，§3.3）：3 格人形，實心格數＝程度；文字一定在畫面上 */
.v2-crowd{display:inline-flex;align-items:center;gap:6px;font-size:var(--fz-sm);line-height:1.3;color:var(--text)}
.v2-crowd__m{display:inline-flex;gap:1px}
.v2-crowd__p{width:10px;height:12px;fill:none;stroke:var(--muted);stroke-width:1.5}
.v2-crowd__p.is-on{fill:var(--text);stroke:var(--text)}
.v2-crowd--dark{color:var(--on-primary)}
.v2-crowd--dark .v2-crowd__p{stroke:var(--on-primary)}
.v2-crowd--dark .v2-crowd__p.is-on{fill:var(--on-primary)}
.v2-crowd .v2-linkbtn{display:inline-flex;align-items:center;width:auto;min-height:var(--touch);text-decoration:underline dotted;text-underline-offset:3px}

/* 19.5 狀態說明：可點的膠囊、狀態字、抽屜內容（§3.5） */
.v2-etabtn{display:inline-flex;padding:0;border:0;border-radius:var(--radius-chip);background:none;color:inherit;font:inherit;cursor:pointer}
.v2-etabtn:hover .v2-eta > span:not(.v2-vh){text-decoration:underline;text-underline-offset:2px}
.v2-linkbtn.v2-status{display:inline-flex;align-items:center;width:auto;text-decoration:underline dotted;text-underline-offset:3px}
.v2-stdoc{font-size:var(--fz-md);line-height:var(--lh-body)}
.v2-stdoc__sample{display:flex;align-items:center;gap:8px;min-height:3.5rem;padding:8px 12px;border-radius:var(--radius-control);background:var(--ground)}
.v2-stdoc__h{margin-top:16px;font-size:var(--fz-md);font-weight:700;line-height:var(--lh-tight)}
.v2-stdoc p{margin-top:4px}
.v2-stdoc__meta{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 12px;margin:16px 0 0;font-size:var(--fz-sm)}
.v2-stdoc__meta dt{color:var(--muted)}
.v2-stdoc__meta dd{margin:0}
.v2-stdoc__fb{margin-top:16px;padding-top:12px;border-top:1px solid var(--rule);font-size:var(--fz-sm);color:var(--muted)}
.v2-stdoc__resolved{display:block;font-size:var(--fz-sm);font-weight:400;color:var(--muted)}
.v2-stdoc__cong{display:inline-flex;align-items:center;gap:12px}
.v2-stdoc__stripe{width:8px;height:2.5rem}
.v2-stdoc__pink{fill:var(--brand)}
.v2-legend p{display:flex;flex-wrap:wrap;align-items:center;column-gap:4px}

/* 19.6 到站提醒第一期（§2.3）：抽屜、已設狀態、頁內橫幅 */
.v2-iconbtn.is-on .v2-ico{--ico-2:currentColor;--ico-2-op:1}
.v2-remind__sub{font-weight:700;margin-bottom:16px}
.v2-remind__desc{margin-top:16px;line-height:var(--lh-body)}
.v2-remind__hint{margin-top:8px;padding:8px 12px;border-radius:var(--radius-control);background:var(--ground);font-size:var(--fz-sm);line-height:1.5}
.v2-remind__hint[hidden]{display:none}
.v2-drawer .v2-hint{display:block;margin-top:12px}
.v2-alertbar{position:fixed;z-index:55;left:50%;top:calc(var(--topbar) + 8px);translate:-50% 0;display:flex;align-items:center;gap:12px;width:min(36rem, calc(100% - 32px));padding:8px 8px 8px 16px;border-radius:var(--radius-card);background:var(--text);color:var(--on-primary);font-weight:700;line-height:1.4;box-shadow:var(--float-shadow)}
.v2-alertbar__t{flex:1;min-width:0}
.v2-alertbar__close{border-color:var(--on-primary);color:var(--on-primary)}
.v2-alertbar__close:hover{opacity:.85}
.v2-alertbar--inline{position:static;translate:none;width:auto;margin:0 0 16px;box-shadow:none}   /* 抽屜開著時，抽屜本文最上面那一份 */

/* 19.7 鄰近運具（tdx-nearby.md §3.5）：中性灰線條圖示，不套各系統代表色 */
.v2-trico{display:inline-flex;align-items:center;gap:2px;margin-left:6px;color:var(--muted);vertical-align:-.15em}
.v2-trico__more{font-size:var(--fz-xs);line-height:1}
.v2-transit__list{margin-top:8px}
.v2-transit__row{display:flex;align-items:center;gap:12px;min-height:var(--row);padding:8px 0;border-bottom:1px solid var(--rule)}
.v2-transit__row:last-child{border-bottom:0}
.v2-transit__row > .v2-ico{color:var(--muted)}
.v2-transit__name{flex:1;min-width:0}
.v2-transit__dist{font-size:var(--fz-sm);color:var(--muted);white-space:nowrap}
.v2-transit__note{margin-top:8px;font-size:var(--fz-sm);color:var(--muted)}
@keyframes v2-fade{from{opacity:0}to{opacity:1}}
@media (max-width:640px){
  .v2-refresh__remind{flex-basis:100%;order:9;min-height:32px}
  .v2-alertbar{top:calc(52px + 8px)}
}

/* ===== 正式版補充（2026-10-27，移植到 Django 時加；設計稿 assets/app.css 沒有） ===== */
/* 頂列語言切換改成 Django set_language 表單：表單本身不佔版面，按鈕照舊是 .v2-topbar__tools 的 flex 子項 */
.v2-langform{display:contents}

@media (max-width:360px){   /* 320px 寬（400% 縮放）時「選單」被擠出畫面：頂列鈕只留圖示，字給讀屏；站名可以縮成「…」（英文＋大字級時最寬）（2026-10-28 審查） */
  .v2-topbar__compact .v2-btn{min-width:var(--touch);padding:0 8px}
  .v2-topbar__compact .v2-btn > span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .v2-brand{flex:0 1 auto;min-width:0}
  .v2-brand__name{min-width:0;overflow:hidden;text-overflow:ellipsis}
  .v2-bottombar__ico{width:min(3.5rem,100%)}   /* 大字級時五格 × 3.5rem＝350px，比 350 窄會切到最右一格 */
}
