/* v2 路線動態（templates/v2/route.html）：設計稿 mockups/route.html 與 route-sheets.html（功能抽屜）的頁面樣式。
 * class 用頁名前綴 .route-*、功能抽屜 .rs-*；v2-* 共用元件不改（在 ../app.css）；顏色只用 tokens。
 * 桌機格線：欄 1200 − 左右 24×2 ＝ 1152 ＝ 左欄 600 ＋ 間距 16 ＋ 地圖 536。
 * 桌機黏住：路線標頭（top＝頂列 56）→ 方向列（top＝56＋標頭實測高，JS 寫 --route-head-h）；地圖整欄 sticky。
 * 平板／手機：只有方向列黏住（top＝頂列），往下捲時方向列左邊補出路線號；「清單／地圖」兩段切換。
 * 正式版跟設計稿不同：地圖改 Leaflet＋國土測繪中心底圖（.route-lf-*）；設計稿的示意變體、樣本說明、票價全表不搬。
 * 不寫 inline style（CSP 預備）：骨架尺寸、錯誤區間距都寫成 class。 */
.route{--route-head-h:0px;--route-top:var(--topbar)}
.route-right{align-self:stretch}                 /* 讓右欄等高，地圖才黏得住 */
.route-left{min-width:0}

/* 1. 路線標頭 */
.route-head{background:var(--ground);padding-bottom:12px}
.route-title{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 12px;margin:0;color:var(--on-primary);font-size:var(--fz-xl);font-weight:700;line-height:var(--lh-tight)}   /* 放在滿版標題色帶 .route-band（同其他頁 .v2-pagehead） */
.route-title .v2-routeno--lg{color:var(--on-primary)}
.route-title__name{min-width:0;overflow-wrap:anywhere}
/* 2026-10-27 使用者：標題色帶最右邊「回到路線查詢」 */
.route-band{flex-direction:row;align-items:center}   /* 手機也同一行（.v2-pagehead 手機是直排）：返回鈕留在右邊 */
.route-band__h{flex:1 1 auto;min-width:0}
.route-band__back{display:grid;place-items:center;flex:none;width:var(--touch);height:var(--touch);margin:-6px -12px -6px 0;border-radius:50%;background:rgb(255 255 255 / .18);color:var(--on-primary);transition:background-color var(--dur-fast) var(--ease)}
.route-band__back:hover{background:rgb(255 255 255 / .3)}
.route-band__back:focus-visible{outline:2px solid var(--on-primary);outline-offset:2px}
.route-band__back .v2-ico{width:1.5rem;height:1.5rem;--ico-2:currentColor;--ico-2-op:.4}   /* 桃紅色帶上：底層改白色 40%，桃紅會看不見 */
/* 2026-10-28 使用者：業者這行、方向頁籤的字，左緣對齊上面色帶裡的路線號（色帶左右內距 28px，手機 20px）；arterial 外觀的黃色帶內距相同 */
.route{--band-x:28px}
@media (max-width:640px){ .route{--band-x:20px} }
.route-sub{display:flex;flex-wrap:wrap;align-items:center;gap:2px 0;margin-top:6px;margin-left:calc(var(--band-x) - 27px);clip-path:inset(0 0 0 27px);font-size:var(--fz-sm);line-height:1.5;color:var(--muted)}
.route-sub > span{display:inline-flex;align-items:center;gap:4px}
/* 每段前面都有分隔點；整行左移 27px（點 3＋左右 10＋間距 4）再裁掉，換行後落在行首的點就看不到 */
.route-sub > span::before{content:"";width:3px;height:3px;margin:0 10px;border-radius:50%;background:var(--faint)}
.route-fn{margin-top:12px}

/* 2. 方向列（頁籤＋手機的清單／地圖） */
.route-bar{background:var(--ground)}
.route-bar__row{display:flex;align-items:flex-end;gap:8px 16px;flex-wrap:wrap}
.route-bar__tabs{display:flex;align-items:flex-end;gap:12px;flex:1 1 16rem;min-width:0;padding-left:max(0px, var(--band-x) - 6px);border-bottom:1px solid var(--border)}   /* 頁籤字在鈕內有 6px 內距 */
.route-bar__tabs .v2-tabs{flex:1;min-width:0;border-bottom:0}
.route-bar__tabs--skel{height:var(--touch);align-items:center;gap:24px}
.route-skel-tab{width:6rem}
.route-bar__no{display:none;align-self:center;padding-bottom:2px}
.route-view{display:none;flex:none}
.route-tab .v2-tag{margin-left:0}

/* 3. 我的站釘選卡 */
.route-mine{margin-top:16px}
.route-mine__top{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px 12px}
.route-mine__id{flex:1 1 9rem;display:flex;align-items:center;gap:12px;min-height:var(--touch)}   /* 名稱放不下兩顆鈕時，鈕換到下一行（不把站名擠成直排） */
.route-mine__acts{display:flex;gap:8px;margin-left:auto}
.route-ring{position:relative;flex:none;width:24px;height:24px;border-radius:50%;background:var(--brand-strong)}
.route-ring::after{content:"";position:absolute;left:50%;top:50%;width:12px;height:12px;translate:-50% -50%;border-radius:50%;background:var(--surface)}
.route-mine__name{margin:0;font-size:var(--fz-lg);font-weight:700;line-height:var(--lh-tight);overflow-wrap:anywhere}
.route-mine__jump{padding:0;font-weight:700}   /* 站名＋「第 N 站・往 X」整塊是按鈕（≥44px），卡片高度不變 */
.route-mine__jump:hover{text-decoration:none}
.route-mine__jump:hover .route-mine__nm{text-decoration:underline;text-underline-offset:3px}
.route-mine__meta{display:block;margin-top:2px;font-size:var(--fz-sm);font-weight:400;color:var(--muted);line-height:1.4}
.route-mine__answer{display:flex;flex-wrap:wrap;align-items:flex-end;gap:16px 28px;margin-top:16px}
.route-mine__evidence{display:flex;flex-wrap:wrap;align-items:center;gap:2px 10px;margin-top:14px;font-size:var(--fz-md);line-height:1.5}
.route-mine__note{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:0 6px;margin-top:4px;font-size:var(--fz-sm);line-height:1.5}   /* 圖示｜文字（可換行）｜說明 */
.route-mine__note > .v2-ico{color:var(--notice-ink)}
.route-mine .v2-iconbtn{flex:none}
.route-skel-name{width:8rem}
.route-skel-answer{height:3.25rem;width:7rem}
/* 最近兩班（第一班＝大字膠囊；第二班第一期只有站數，R7） */
/* 同路線收藏兩站以上：卡片上方頁籤切換（2026-10-27 使用者；取代原本的小路線圖） */
.route-mtabs{display:flex;justify-content:center;margin:-12px 0 4px}   /* 2026-10-28 改成小圓點：比原本頁籤矮一半以上 */
.route-mtab{display:grid;place-items:center;width:28px;height:24px;padding:0;border:0;border-radius:var(--radius-pill);background:none;cursor:pointer}   /* 點擊範圍 28×24（WCAG 2.5.8 ≥24px），看得到的點只有 8px */
.route-mtab::before{content:"";width:8px;height:8px;border-radius:var(--radius-pill);background:#8A8D92;transition:width var(--dur-fast) var(--ease),background-color var(--dur-fast) var(--ease)}   /* 未選的點 3.3:1（非文字元件 ≥3:1） */
.route-mtab:hover::before{background:var(--muted)}
.route-mtab[aria-selected="true"]::before{width:22px;background:var(--brand-strong)}
.route-mtab:focus-visible{outline:2px solid var(--text);outline-offset:-2px}
@media (forced-colors:active){   /* 高對比模式會把背景色換成底色：點要改用系統色才看得到（2026-10-28 審查） */
  .route-mtab::before{background:CanvasText}
  .route-mtab[aria-selected="true"]::before{background:Highlight}
}
.route-two{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px 28px;margin:0}
.route-two dt{font-size:var(--fz-sm);line-height:1.4;color:var(--muted)}
.route-two dd{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;min-height:3.25rem;margin:4px 0 0}
.route-two__val{font-size:var(--fz-lg);line-height:var(--lh-tight);white-space:nowrap}
.route-two__note{font-size:var(--fz-sm);color:var(--muted)}
.route-nw{white-space:nowrap}   /* 站序、往 X 各自不斷行，只在「・」處換行 */
/* 小脊線：公車到我的站之間的站（同一套脊線語言，橫放；車點同清單的 .v2-car） */
.route-hint{margin-top:16px;flex-wrap:nowrap;align-items:flex-start}
.route-hint .route-ring{margin-top:3px;width:16px;height:16px}
.route-hint .route-ring::after{width:6px;height:6px}
.route-mine__stale{display:flex;align-items:center;gap:6px;margin-top:8px;font-size:var(--fz-sm);color:var(--notice-ink)}

/* 4. 更新列、班次異動 */
.route-status{display:flex;flex-wrap:wrap;padding-left:var(--band-x);align-items:center;column-gap:8px;margin-top:8px}   /* 更新列｜「說明」；2026-10-28 時間左緣也對齊路線號 */
/* 2026-10-28 審查（兩輪）：更新列（時間、倒數線、暫停、更新）跟「說明」攤平成同一排一起換行（display:contents，
   元件本身沒有 role，讀屏播報在裡面另一個 span，不受影響）；倒數線可以縮到 1.5rem。窄螢幕最多兩行，不再有「更新」單獨一行 */
.route-status > #route-refresh,.route-status .v2-refresh{display:contents}
.route-status .v2-refresh__bar{min-width:1.5rem}
.route-status > [data-act="stall"]{margin-left:auto}
.route-notice:not(:empty){margin-top:8px}

/* 6. 站序脊線清單 */
.route-listcard{container-type:inline-size;container-name:routelist}
.route-listcard > :first-child{border-radius:var(--radius-card) var(--radius-card) 0 0}
.route-listcard .v2-spine-list{border-radius:0 0 var(--radius-card) var(--radius-card)}   /* 卡片不裁切（合併膠囊的清單要能浮出卡片），圓角改由清單自己收 */
.route-listcard:has(#route-legend:empty) .v2-spine-list > li:last-child{border-radius:0 0 var(--radius-card) var(--radius-card)}
.route-listcard__busy{margin:0}
.route-listcard .v2-legend{padding:12px 16px 16px;border-top:1px solid var(--rule)}
.route-listcard .v2-legend p{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:12px}   /* 文字｜說明（按鈕固定在右欄） */
/* K6 全部狀態說明抽屜 */
.route-stall{font-size:var(--fz-md);line-height:var(--lh-body)}
.route-stall__h{margin:24px 0 0;padding-bottom:6px;border-bottom:1px solid var(--rule);font-size:var(--fz-sm);font-weight:700;line-height:var(--lh-tight);color:var(--muted)}   /* 分組標題比各狀態名小一級 */
.route-stall__h:first-child{margin-top:0}
.route-stall dl{margin:0}
.route-stall dt{margin-top:12px;font-weight:700}
.route-stall dd{margin:2px 0 0}
.route-stall dd p{margin:0}
.route-stall__do{color:var(--muted)}
/* 脊線車點與地圖連動（車點可 hover；地圖點車 → 脊線車點閃一下） */
.route-spine .v2-car{pointer-events:auto}
.route-spine .v2-car.route-flash{outline:2px solid var(--text);outline-offset:2px;animation:route-flash 400ms var(--ease) 4 alternate}
@keyframes route-flash{to{outline-color:transparent}}
html.v2-paused .route-flash{animation:none}
@media (prefers-reduced-motion:reduce){ .route-flash{animation:none} }

/* 載入骨架（平的灰條，尺寸照正式內容） */
.route-skelrow{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;border-bottom:1px solid var(--rule)}
.route-skelrow:last-child{border-bottom:0}
.route-skelrow > i{display:block;justify-self:center;width:var(--spine-w);height:100%;background:var(--active)}
.route-skelmap{display:flex;align-items:center;justify-content:center;min-height:20rem;color:var(--muted);font-size:var(--fz-sm)}
.route-err__more{margin-top:8px}

/* 地圖（Leaflet）：.route-map＝外框（v2-mapbox），裡面 .route-lf 給 Leaflet、.route-maptools 疊在右上 */
.route-mapwrap{position:sticky;top:calc(var(--topbar) + 16px)}
.route-mapslot:not(:empty){margin-top:16px}
.route-map{height:min(62dvh, 34rem)}   /* 平板／手機由 JS 依路線外框比例改高（280px～60vh） */
.route-lf{position:absolute;inset:0;z-index:0;background:var(--surface);font-family:var(--font-sans);font-size:var(--fz-xs)}
/* 2026-10-27 機關意見（地圖彩度過高）＋使用者裁示：資訊較少的灰階圖層（route_map.js EMAP01）＋刷白（白底上降透明度） */
.route-lf .leaflet-tile-pane{opacity:.55}
.route-maptools{z-index:1}
.route-maptools .v2-btn{width:var(--touch);height:var(--touch);padding:0;background:var(--surface)}
.route-lf .leaflet-control-attribution{font-size:var(--fz-xs);line-height:1.4}
/* 2026-10-27 使用者：路線與底圖對比不夠、路線與站點顏色太近 → 路線深桃紅＋白色外框（先畫 casing 再畫線），站點白心墨色框 */
.route-lf-casing{fill:none;stroke:var(--surface);stroke-width:5;stroke-opacity:.7;stroke-linecap:round;stroke-linejoin:round}
.route-lf-line{fill:none;stroke:var(--brand);stroke-width:3;stroke-opacity:.5;stroke-linecap:round;stroke-linejoin:round}   /* 2026-10-27 使用者（比照高雄）：路線變細、刷淡，站圈當主角 */
.route-lf-stop{fill:var(--surface);fill-opacity:1;stroke:var(--brand-ink);stroke-width:3}   /* 站圈桃紅、加粗；2026-10-29 使用者選 A 案加深 #A8175B（對刷淡底圖 6.1:1，原 #CE1C6F 4.5:1） */
.route-lf-stop--end{stroke-width:4}
.route-lf-halo{fill:var(--brand-tint);fill-opacity:1;stroke:var(--brand-strong);stroke-width:2}
.route-lf-sel{fill:var(--brand);fill-opacity:.3;stroke:var(--brand);stroke-width:2;transform-box:fill-box;transform-origin:center;animation:route-breathe 2s ease-in-out infinite}   /* 選中的站（點站名開抽屜時）：比照我的站光圈，亮粉紅＋呼吸光暈；高彩見 skin-arterial.css（2026-11-17 使用者） */
@keyframes route-breathe{0%,100%{transform:scale(.85);opacity:.6}50%{transform:scale(1.25);opacity:1}}
@media (prefers-reduced-motion:reduce){ .route-lf-sel{animation:none} }   /* 系統設定減少動態：光暈不動 */
.route-lf-me{fill:var(--text);fill-opacity:1;stroke:var(--surface);stroke-width:3}
.route-lf .route-lf-label{padding:0 4px;border:0;border-radius:var(--radius-chip);background:var(--surface);color:var(--text);font-size:var(--fz-xs);line-height:1.5;box-shadow:none}   /* taste-skill-ignore：Leaflet 預設陰影歸零 */
.route-lf .route-lf-label::before{display:none}
.route-lf .route-lf-label--mine{font-weight:700}
.route-lf .route-lf-label--key{padding:1px 8px;border-radius:var(--radius-pill);background:var(--brand-strong);color:var(--on-primary);font-weight:700}   /* 起訖站、折返點：桃紅底白字（白字 5.2:1），膠囊圓角同地圖車牌（2026-11-06 使用者） */
.route-lf .route-lf-label--sel{background:var(--brand-ink)}   /* 選中的站：首末站同格式（膠囊、白色粗體），深粉紅 #A8175B 跟首末站的桃紅分開（白字 7.2:1）（2026-11-17 使用者） */
/* 地圖上的車：三層（§2.1、R5）＝在途實心墨色、首末站與場站灰色、位置延遲空心虛線；相近的車合成數字（縮放 <16 才合） */
.route-lf .route-mapcar{background:none;border:0}
.route-mapcar svg{display:block;overflow:visible}
.route-mapcar__body,.route-mapcar__arrow{fill:var(--bus)}   /* 2026-10-28 使用者：墨黑太重 → 藍（同清單車點以外的地圖車輛） */
.route-mapcar__dot{fill:var(--surface)}
.route-mapcar--rest .route-mapcar__body,.route-mapcar--rest .route-mapcar__arrow{fill:var(--faint)}
.route-mapcar--stale .route-mapcar__body{fill:var(--surface);stroke:var(--bus);stroke-width:1.5;stroke-dasharray:3 2}
.route-mapcar--stale .route-mapcar__dot{fill:var(--muted)}
.route-mapcar__n{fill:var(--on-primary);font-size:var(--fz-xs);font-weight:700}
.route-mapcar--stale .route-mapcar__n{fill:var(--bus)}
.route-mapcar__ring{display:none;fill:none;stroke:var(--bus);stroke-width:2}
.route-mapcar.is-hot .route-mapcar__ring{display:inline}
.route-mapcar[data-spine]{cursor:pointer}
.route-mapcar:focus-visible{outline:2px solid var(--text);outline-offset:2px;border-radius:50%}
/* 2026-10-27 機關＋使用者裁示：地圖車要有車牌與官方無障礙圖示；保留方向箭頭；合併成數字圈時每台車牌都留（上下疊） */
.route-mapcar__icon{position:absolute;inset:0}
.route-mapcar__glyph{fill:var(--surface)}   /* Font Awesome 公車（白），圓底墨色；方向箭頭在圓外 */
.route-mapcar--stale .route-mapcar__glyph{fill:var(--bus)}
.route-mapcar__plates{position:absolute;left:30px;top:50%;translate:0 -50%;display:flex;flex-direction:column;gap:3px;pointer-events:none}
/* 避讓（route_map.js placePlates）：右（預設）、左、上、下 */
.route-mapcar__plates[data-side="l"]{left:auto;right:30px;align-items:flex-end}
.route-mapcar__plates[data-side="t"]{top:auto;bottom:30px;left:50%;translate:-50% 0;align-items:center}
.route-mapcar__plates[data-side="b"]{top:30px;left:50%;translate:-50% 0;align-items:center}
/* 2026-10-28 使用者：車牌比高雄小、黑底配官方無障礙藍對比差 → 白底藍框墨字、16px（高雄 16px、高 32px）；官方圖示在白底上 8:1 */
.route-mapcar__plate{display:inline-flex;align-items:center;gap:4px;padding:2px 9px;border:1.5px solid var(--bus);border-radius:var(--radius-pill);background:var(--surface);color:var(--text);font-size:var(--fz-md);font-weight:600;line-height:1.5;white-space:nowrap;font-variant-numeric:tabular-nums;box-shadow:0 1px 3px rgb(0 0 0 / .18)}
.route-mapcar__plate .v2-accimg{width:1em;height:1em}
.route-mapcar--rest .route-mapcar__plate{border-color:#B9BCC1;background:#E4E6E9;color:var(--muted);box-shadow:none}   /* 2026-10-28 使用者：停在首末站的車牌灰底刷淡（墨灰字 5.7:1、官方無障礙藍仍 >6:1） */
.route-mapcar--rest .route-mapcar__icon{opacity:.85}   /* 只淡化車標；整顆半透明會讓車牌字對比掉到 4.1:1（2026-10-28 審查） */
.route-mapcar--stale .route-mapcar__plate{border-style:dashed}
.route-mapcar--group .route-mapcar__plate{gap:3px;padding:0 6px;border-width:1px;font-size:var(--fz-xs);font-weight:700;line-height:1.5}   /* 合成數字圈：疊好幾張車牌，縮回原本的小尺寸（2026-10-28 使用者） */
.route-mapcar--group .route-mapcar__plates{gap:2px}
.route-mapcar--group .route-mapcar__more{font-size:var(--fz-xs)}
/* 2026-10-27 折返線後段：前段開過來的車（地圖淡色、清單上方提示列、車牌欄淡字） */
.route-mapcar--front .route-mapcar__icon{opacity:.6}   /* 2026-10-28 審查：只淡化車標；整顆淡化會讓白底車牌半透明、車牌字對比掉到 2.8:1 */
.route-mapcar--front .route-mapcar__body,.route-mapcar--front .route-mapcar__arrow{fill:var(--faint)}
.route-mapcar--front .route-mapcar__plate{border-color:var(--faint);color:var(--muted)}
.route-incoming{display:flex;align-items:center;gap:8px;margin:0;padding:10px 8px 10px 16px;border-bottom:1px solid var(--rule);background:var(--raised);font-size:var(--fz-sm);line-height:1.5}
.route-incoming__ico{width:14px;height:14px;color:var(--muted)}
.route-incoming__txt{flex:1;min-width:0}
.route-mapcar__more{padding:0 6px;border-radius:var(--radius-pill);background:var(--surface);color:var(--text);font-size:var(--fz-sm);line-height:1.5;box-shadow:0 1px 3px rgb(0 0 0 / .18)}
.route-maplegend{margin-top:8px;font-size:var(--fz-sm);line-height:1.5;color:var(--muted)}
.route-maplegend__all{margin:0;color:var(--text)}
.route-maplegend ul{display:flex;flex-wrap:wrap;gap:2px 16px;margin:2px 0 0;padding:0;list-style:none}
.route-maplegend li{display:inline-flex;align-items:center;gap:6px}
.route-maplegend svg{flex:none;width:16px;height:16px;overflow:visible}

/* 站牌抽屜 */
.route-dr__map{position:relative;height:10.5rem;margin:0 0 16px;border:1px solid var(--border);border-radius:var(--radius-control);overflow:hidden}   /* 手機／平板站牌抽屜的定位小地圖（方案三）；裡面的 .route-lf 絕對定位撐滿 */
@media (min-width:1024px){ #route-stop .v2-drawer__scrim{background:rgb(35 31 32 / .16)} }   /* 桌機站牌抽屜：遮罩調淡（--scrim 同色，.40→.16），看得到後面地圖選中的站、注意力仍在抽屜（2026-11-17 使用者） */
.route-dr__h{margin:0 0 4px;font-size:var(--fz-md);font-weight:700;line-height:var(--lh-tight)}
.route-dr .v2-list{margin:0 calc(var(--pad) * -1) 20px}
.route-dr .v2-list-row{padding-inline:var(--pad)}
.route-dr details{margin-top:4px}
.route-dr summary{display:flex;align-items:center;gap:6px;min-height:var(--touch);color:var(--text);font-size:var(--fz-sm);cursor:pointer}
.route-dr summary::-webkit-details-marker{display:none}
.route-dr summary .v2-ico{transition:rotate var(--dur-base) var(--ease)}
.route-dr details[open] summary .v2-ico{rotate:180deg}
.route-dr__busy{margin-bottom:20px}
.route-dr__tr .v2-transit__list{margin:8px 0 0}   /* 轉乘清單不出血（上面 .route-dr .v2-list 的負邊距是給路線列用的） */

/* 2026-10-27 使用者：路線頁也比照其他頁左右留白（內容欄 --col-max）；1024 起站序與地圖並排 */
@media (min-width:1024px) and (max-width:1099px){
  .v2-grid--route{grid-template-columns:minmax(0,520px) minmax(0,1fr)}
}
/* 桌機：標頭＋方向列黏住，地圖整欄黏住 */
@media (min-width:1024px){
  .route-head{position:sticky;top:var(--topbar);z-index:6}
  .route-bar{position:sticky;top:calc(var(--topbar) + var(--route-head-h));z-index:6}
  .route-map{height:calc(100dvh - var(--topbar) - 7rem)}
}
/* 平板以下：只黏方向列；清單／地圖兩段切換 */
@media (max-width:1023px){
  .route-mapwrap{position:static}
  .route-bar{position:sticky;top:var(--route-top);z-index:6;margin-inline:calc(var(--pad) * -1);padding:4px var(--pad) 0}
  .route-bar.is-stuck .route-bar__no{display:inline-block}
  .route-view{display:inline-flex}
  .route[data-view="map"] .route-listblock,.route[data-view="map"] .route-notice{display:none}
  .route-right{display:none}
}
@media (max-width:640px){
  .route{--route-top:52px}
  /* 第一屏多露站：清單／地圖縮在方向頁籤同一列；放不下（連黏住時補的路線號一起算，JS fitBar）才整列換到下一行 */
  .route-bar__row{flex-wrap:nowrap;gap:0 12px}
  .route-bar__tabs{flex:1 1 auto}
  .route-view{align-self:center}
  .route-view > button{padding:0 10px}
  .route-bar__row.is-stack{flex-wrap:wrap}
  .route-bar__row.is-stack .route-view{flex:1 1 100%;display:flex;margin-bottom:8px}
  .route-sub > .route-sub__ops{display:none}
  .route-mine__answer{gap:12px 16px}
}

/* ===== 功能抽屜（.rs-*，設計稿 route-sheets.html）：時刻、票價（查價）、資訊、簡圖、分享 ===== */
#rs-time .v2-drawer__panel,#rs-fare .v2-drawer__panel{width:min(720px,100%)}   /* 時刻表桌機加寬（去返兩欄並排） */
.rs-sub{margin-bottom:12px;font-size:var(--fz-sm);color:var(--muted);line-height:1.5}
.rs-sub b{color:var(--text);font-weight:700}
.rs-block + .rs-block{margin-top:16px}
.rs-h3{font-size:var(--fz-sm);font-weight:700;color:var(--text);margin-bottom:4px}
.rs-skelrow{display:grid;grid-template-columns:2.5rem minmax(0,1fr);gap:12px;align-items:center;min-height:2.5rem;border-bottom:1px solid var(--rule)}
.rs-off{margin-bottom:12px}

/* 時刻：日曆（自有路線過去 3 天＋未來 7 天）＋依小時多欄網格 */
.rs-sheet-time .v2-drawer__body{display:flex;flex-direction:column;overflow:hidden;padding-bottom:0}
.rs-tt{container-type:inline-size;container-name:rstt;display:flex;flex-direction:column;flex:1;min-height:0}
.rs-days{display:flex;flex:none;gap:4px;overflow-x:auto;scrollbar-width:thin;margin:0 calc(var(--pad) * -1);padding:0 var(--pad);scroll-padding-inline:var(--pad)}
.rs-day{flex:1 0 3.25rem;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-height:var(--touch);padding:6px 2px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--surface);color:var(--text);font-size:var(--fz-sm);line-height:1.2;cursor:pointer}
.rs-day:hover{background:var(--ground)}
.rs-day.is-past{background:var(--ground);color:var(--muted)}
.rs-day[aria-pressed="true"]{background:var(--active);border-color:var(--text);color:var(--text);font-weight:700}
.rs-day__k{font-size:var(--fz-xs);color:var(--muted);font-weight:400}
.rs-day .v2-skel{width:70%}
.rs-tt__meta{display:flex;flex-wrap:wrap;align-items:center;gap:2px 14px;margin:10px 0 8px;font-size:var(--fz-sm);color:var(--muted);line-height:1.5}
.rs-lg{display:inline-flex;align-items:center;gap:4px;white-space:nowrap}
.rs-lg .rs-m{min-width:0;padding:0 3px;line-height:1.4}
.rs-tt__seg{display:none;margin-bottom:8px}
.rs-tt__scroll{position:relative;flex:1;min-height:0;overflow:auto;margin:0 calc(var(--pad) * -1);padding:0 var(--pad) 16px;border-top:1px solid var(--border)}
.rs-tt__scroll:focus-visible{outline-offset:-2px}
.rs-days :focus-visible{outline-offset:-4px}
.rs-tt__table{width:100%;border-collapse:collapse;table-layout:fixed}
.rs-tt__table thead th{position:sticky;top:0;z-index:1;background:var(--surface);padding:10px 8px 8px;border-bottom:1px solid var(--control);text-align:left;vertical-align:top;font-weight:400;font-size:var(--fz-sm);color:var(--muted)}
.rs-tt__table thead th.rs-tt__hh{width:2.75rem;text-align:right;padding-right:12px}
.rs-tt__dir{display:flex;align-items:center;gap:4px;color:var(--text);font-weight:700;font-size:var(--fz-md);line-height:1.3}
.rs-tt__from{display:block;line-height:1.4}
.rs-tt__next{display:block;margin-top:2px;color:var(--text);line-height:1.4}
.rs-tt__next b{font-size:var(--fz-lg);font-weight:700}
/* 班距發車（外部路線）：表格第一列列出時段；每段的兩塊各自不斷行 */
.rs-tt__hwrow th{font-size:var(--fz-sm);line-height:1.4}
.rs-tt__hwb{display:block;color:var(--text);line-height:1.5}
.rs-tt__hwb>span{white-space:nowrap}
.rs-tt__table tbody th{width:2.75rem;padding:6px 12px 6px 0;text-align:right;vertical-align:top;font-weight:700;color:var(--text);line-height:1.75rem}
.rs-tt__table tbody tr.is-gone th{color:var(--faint);font-weight:400}
.rs-tt__nd{display:block;font-size:var(--fz-xs);font-weight:400;line-height:1.2;color:var(--muted)} /* 夜間路線午夜後的時段（route_sheets.js clock，D14a） */
.rs-tt__table td{padding:6px 8px;vertical-align:top;line-height:1.75rem}
.rs-tt__table tbody tr + tr > *{border-top:1px solid var(--rule)}
.rs-tt__table .rs-col-1{border-left:1px solid var(--rule)}
.rs-ms{display:flex;flex-wrap:wrap;gap:2px 4px}
.rs-m{display:inline-block;min-width:2.25rem;padding:0 4px;border-radius:var(--radius-chip);text-align:center;color:var(--text)}
.rs-m.is-past{color:var(--faint)}
.rs-m.is-next{background:var(--sched-bg);color:var(--sched-ink);font-weight:700}
/* 時刻表「異動」標記（2026-11-11；route_sheets.js ttCell、V2.ttMark）：按下「異動」鈕後，只在當日那一頁出現。
   取消的班補回原位：分鐘加刪除線＋右下角小「!」（--chg-del）；加開的班：右下角同樣大小的「!」（--chg-add）。
   有標記的班次是按鈕：手機沒有滑鼠，點一下在表格上方的說明列看是取消、加開還是改時間。
   高彩外觀（arterial）的「!」改成色塊黑字，見 skin-arterial.css。 */
.rs-chgbtn{margin-left:auto}
/* 「異動」鈕縮小（2026-11-12 使用者）：跟一般小標籤同高；手機外觀一樣小，觸控範圍用透明 ::before 延伸到 44px（同 .v2-car--group） */
.rs-tt__meta .rs-chgbtn{position:relative;height:1.5rem;padding:0 8px;font-size:var(--fz-xs)}
@media (max-width:640px){
  .rs-tt__meta .rs-chgbtn{min-height:0}
  .rs-tt__meta .rs-chgbtn::before{content:"";position:absolute;inset:-11px -2px}   /* 24px 高的 padding box 上下各延伸 11＝觸控 44（1px 邊框不算） */
}
.rs-chg{margin:0 0 8px;padding:6px 10px;border-left:3px solid var(--control);background:var(--ground);color:var(--text);font-size:var(--fz-sm);line-height:1.5}
button.rs-m{position:relative;min-width:2.5rem;padding:0 10px 0 4px;border:0;background:none;font:inherit;line-height:inherit;cursor:pointer}
button.rs-m.is-next{background:var(--sched-bg)}
.rs-m .rs-x{position:absolute;right:2px;bottom:2px;font-size:.75rem;font-weight:700;line-height:1}
.rs-m.is-del{color:var(--muted);font-weight:400}
.rs-m.is-del .rs-x{color:var(--chg-del)}
.rs-m.is-add .rs-x{color:var(--chg-add)}
button.rs-m--chg[aria-pressed="true"]{background:var(--active);color:var(--text)}   /* 點選的班次：整格反白、不加框線（2026-11-12 使用者）；寫 button. 才蓋得過「下一班」的底色 */
.rs-m--chg:focus-visible{outline-offset:-2px}
@media (prefers-contrast:more){ .rs-m--chg{box-shadow:inset 0 0 0 1px currentColor} }   /* 要求高對比：有標記的班次加框，不只靠「!」的顏色 */
.rs-tt__note{display:block;margin-top:2px;color:var(--muted);font-size:var(--fz-sm);line-height:1.5}
.rs-tt__none{color:var(--muted);font-size:var(--fz-sm)}
@container rstt (max-width:33.99rem){
  .rs-tt__seg{display:flex}
  .rs-tt[data-dir="0"] .rs-col-1,.rs-tt[data-dir="1"] .rs-col-0{display:none}
  .rs-tt[data-dir="0"] tbody tr.rs-no-0,.rs-tt[data-dir="1"] tbody tr.rs-no-1{display:none}   /* 只看一個方向：不列這個方向沒車的小時（route_sheets.js ttNoCls） */
  .rs-tt__table .rs-col-1{border-left:0}
  .rs-tt__dir{display:none}
  .rs-days{gap:3px}
  .rs-day{flex-basis:2.75rem;padding:6px 0;font-size:var(--fz-xs)}
  .rs-tt__seg > button{height:auto;min-height:var(--touch);white-space:normal;line-height:1.25;text-align:center}
}

/* 票價（「查價」getFare 單筆；「全表」E5 getFareTable，照設計稿 route-sheets.html 第二輪） */
.rs-fare__fields{display:grid;gap:12px;max-width:30rem}
.rs-fare__res{margin-top:16px;padding-top:14px;border-top:1px solid var(--border)}
.rs-fare__od{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;font-size:var(--fz-md);font-weight:700;line-height:1.4}
.rs-fare__od .v2-meta{font-weight:400}
.rs-fare__table{width:100%;margin-top:8px;border-collapse:collapse}
.rs-fare__table th,.rs-fare__table td{padding:8px 0;border-bottom:1px solid var(--rule);text-align:left;vertical-align:baseline;font-weight:400}
.rs-fare__table thead th{padding-top:0;font-size:var(--fz-sm);color:var(--muted);border-bottom-color:var(--border)}
.rs-fare__table .num{text-align:right;white-space:nowrap}
.rs-fare__table tbody tr:last-child > *{border-bottom:0}
.rs-fare__lead td{font-size:var(--fz-sm)}
.rs-fare__lead td b{font-size:var(--fz-xl);font-weight:700;line-height:1}
.rs-fare__table tbody th{font-size:var(--fz-md);color:var(--text)}
.rs-fare__note{display:block;font-size:var(--fz-sm);color:var(--muted);line-height:1.4}
.rs-fare__mode{align-self:flex-start;flex:none;margin-bottom:14px}

/* 票價「全表」（fare-table.md §4）：列表＝選上車站→到後面各站（同價合併）；表格＝上車站 × 下車站三角表 */
#rs-fare.is-grid .v2-drawer__panel{width:min(1152px,100%)}   /* 全表・表格：整個內容欄寬的大抽屜（48×48 的表在 720px 只看得到 7 列 × 13 欄） */
.rs-sheet-fare.is-fill .v2-drawer__body{display:flex;flex-direction:column;overflow:hidden;padding-bottom:0}
.rs-ft{container:rsft / inline-size;display:flex;flex-direction:column;flex:1;min-height:0}
.rs-ft__bar{display:flex;flex:none;flex-wrap:wrap;align-items:flex-end;gap:10px 16px;margin-bottom:10px}
.rs-ft__bar .v2-field{flex:1 1 14rem;min-width:0;max-width:24rem}
.rs-ft__bar .v2-seg{flex:none}
.rs-ft__lead{margin:0 0 8px;font-size:var(--fz-sm);color:var(--muted);line-height:1.5}
.rs-ft__list,.rs-ft__grid{display:flex;flex-direction:column;flex:1;min-height:0}
.rs-ft[data-view="grid"] .rs-ft__list{display:none}
.rs-ft__scroll{position:relative;flex:1;min-height:0;overflow:auto;margin:0 calc(var(--pad) * -1);padding:0 var(--pad);border-top:1px solid var(--border)}
.rs-ft__scroll:focus-visible{outline-offset:-2px}
.rs-ft__foot{flex:none;padding:10px 0 14px;border-top:1px solid var(--border);margin:0 calc(var(--pad) * -1);padding-inline:var(--pad)}
.rs-ft__foot p + p{margin-top:2px}
.rs-ft__foot--flow{margin-top:12px}
.rs-ft__note{margin-bottom:10px}
/* 列表 */
.rs-fl{width:100%;border-collapse:collapse}
.rs-fl thead th{position:sticky;top:0;z-index:1;background:var(--surface);padding:10px 0 6px 8px;border-bottom:1px solid var(--control);font-size:var(--fz-sm);font-weight:400;color:var(--muted);text-align:right;vertical-align:bottom;white-space:nowrap}
.rs-fl thead th:first-child{padding-left:0;text-align:left}
.rs-fl__est{display:block;font-size:var(--fz-xs);line-height:1.3}
.rs-fl tbody th,.rs-fl td{padding:8px 0 8px 8px;border-bottom:1px solid var(--rule);vertical-align:top;line-height:1.5}
.rs-fl tbody th{padding-left:0;text-align:left;font-weight:400;color:var(--text)}
.rs-fl td{width:3.5rem;text-align:right;font-size:var(--fz-md)}
.rs-fl tbody tr:last-child > *{border-bottom:0}
.rs-fl__to{display:block}
.rs-fl__seq{display:block;font-size:var(--fz-sm);color:var(--muted)}
.rs-fl tr.is-mine > *{background:var(--brand-tint)}
.rs-fl tr.is-mine .v2-tag{color:var(--muted)}
/* 表格（三角表）：表頭列與第一欄固定，只在表格容器裡捲 */
.rs-fg{border-collapse:separate;border-spacing:0;font-size:var(--fz-sm)}
.rs-fg th,.rs-fg td{border-right:1px solid var(--rule);border-bottom:1px solid var(--rule);white-space:nowrap}
.rs-fg thead th{position:sticky;top:0;z-index:2;background:var(--surface);min-width:3rem;padding:6px 4px;border-bottom-color:var(--control);font-weight:400;color:var(--muted);text-align:center;vertical-align:bottom}
.rs-fg__cno{display:block;line-height:1.3}
.rs-fg__cnm{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;width:3.25em;margin:2px auto 0;font-size:var(--fz-xs);line-height:1.3;color:var(--text);white-space:normal;overflow-wrap:anywhere}   /* 站名兩行截斷，全名在 title 與讀屏 */
.rs-fg tbody th{position:sticky;left:0;z-index:1;background:var(--surface);max-width:10rem;padding:0 10px 0 0;border-right-color:var(--control);font-weight:400;color:var(--text);text-align:left;overflow:hidden;text-overflow:ellipsis}
.rs-fg thead th.rs-fg__corner{left:0;z-index:3;text-align:left;padding-left:0;border-right-color:var(--control);color:var(--muted)}
/* 固定的第一欄停在捲動區內距那條線上：往左補一塊同底色，橫向捲動時左邊距裡不會露出底下的格子 */
.rs-fg tbody th,.rs-fg thead th.rs-fg__corner{box-shadow:calc(var(--pad) * -1) 0 0 var(--surface)}   /* taste-skill-ignore：實心色塊補邊距，不是浮起陰影 */
.rs-fg tr.is-mine > th{box-shadow:calc(var(--pad) * -1) 0 0 var(--brand-tint)}   /* taste-skill-ignore：同上 */
.rs-fg__no{display:inline-block;min-width:1.75rem;color:var(--muted)}
.rs-fg__cov{display:block;padding-left:1.75rem;font-size:var(--fz-xs);line-height:1.3;color:var(--muted)}
.rs-fg--stage tbody th{padding-top:4px;padding-bottom:4px}
.rs-fg td{height:2.25rem;padding:0 4px;text-align:center;cursor:pointer}
.rs-fg td:focus-visible{outline:2px solid var(--text);outline-offset:-2px}
/* 變價格：粗字＋左邊 2px 線（inset 陰影，不改欄寬），一列一列看出票價階梯 */
.rs-fg td.is-step,.rs-fg__lgstep{font-weight:700;box-shadow:inset 2px 0 0 var(--faint)}   /* taste-skill-ignore：2px 實線（不改欄寬；滑過換底色時不會被 background 蓋掉），不是陰影 */
.rs-fg__lg{flex:none;margin-top:8px}
.rs-fg__lgstep{display:inline-block;min-width:2.25rem;margin-right:6px;padding:0 4px;text-align:center;color:var(--text);border:1px solid var(--rule);line-height:1.5}
.rs-fg td.rs-fg__x{background:var(--ground);cursor:default}
.rs-fg tbody tr:hover > td:not(.rs-fg__x),.rs-fg td.is-col:not(.rs-fg__x){background:var(--ground)}
.rs-fg td.is-sel{outline:2px solid var(--text);outline-offset:-2px;font-weight:700}
.rs-fg tr.is-mine > th,.rs-fg tr.is-mine > td:not(.rs-fg__x){background:var(--brand-tint)}
.rs-ft__read{min-height:1.5rem;margin:0 0 8px;font-size:var(--fz-sm);color:var(--muted);line-height:1.5}
.rs-ft__read b{color:var(--text)}
/* 單一票價 */
.rs-fs{padding:2px 0 14px}
.rs-fs__lead{font-size:var(--fz-md);line-height:1.5}
.rs-fs__lead b{font-size:var(--fz-xl);font-weight:700;line-height:1.2}
.rs-fs__p{margin-top:6px;font-size:var(--fz-sm);color:var(--muted);line-height:1.6}
.rs-fs + .rs-h3{margin-top:4px}
/* 窄（手機、平板窄抽屜）：一律列表，不出「列表／表格」與票種切換 */
@container rsft (max-width:33.99rem){
  .rs-ft__view,.rs-ft__cls,.rs-ft[data-view="grid"] .rs-ft__grid{display:none}
  .rs-ft[data-view="grid"] .rs-ft__list{display:flex}
  .rs-ft__bar .v2-field{max-width:none}
}

/* 資訊（含站址，B8） */
.rs-ops{list-style:none;margin:0;padding:0}
.rs-op{padding:8px 0;border-bottom:1px solid var(--rule)}
.rs-op:first-child{padding-top:0}
.rs-op__name{font-size:var(--fz-md);font-weight:700;line-height:1.4}
.rs-op__name span{font-weight:400}
.rs-tels{list-style:none;margin:2px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:0 20px}
.rs-tels li{display:flex;flex-wrap:wrap;align-items:center;gap:0 6px}
.rs-tel{display:inline-flex;align-items:center;min-height:2rem;color:var(--text);text-decoration:underline;text-underline-offset:3px;text-decoration-color:var(--control)}
.rs-tel:hover{text-decoration-color:currentColor}
.rs-dl{display:grid;grid-template-columns:5.5rem minmax(0,1fr);margin:0;font-size:var(--fz-md)}
.rs-dl dt,.rs-dl dd{margin:0;padding:6px 0;border-bottom:1px solid var(--rule);line-height:1.5}
.rs-dl dt{color:var(--muted);font-size:var(--fz-sm);padding-top:8px}
.rs-dl dd{display:flex;align-items:center;gap:6px;flex-wrap:wrap;white-space:pre-line}
.rs-dl dt:last-of-type,.rs-dl dd:last-of-type{border-bottom:0}
.rs-block--addr{margin-top:16px}
.rs-addr{list-style:none;margin:4px 0 0;padding:0}
.rs-addr li{display:grid;grid-template-columns:2rem minmax(0,1fr);gap:8px;padding:6px 0;border-bottom:1px solid var(--rule);line-height:1.5}
.rs-addr li:last-child{border-bottom:0}
.rs-addr__seq{color:var(--muted);font-size:var(--fz-sm);text-align:right;padding-top:1px}
.rs-addr__name{display:block;font-size:var(--fz-md)}
.rs-addr__txt{display:block;font-size:var(--fz-sm);color:var(--muted)}

/* 簡圖 */
.rs-diag{margin-top:4px}
.rs-diag svg{display:block;width:100%;height:auto}
.rs-diag__seg{margin-bottom:12px}
.rs-orig{margin:0}
.rs-orig a{display:block}
.rs-orig img{display:block;max-width:100%;height:auto;border:1px solid var(--border);border-radius:var(--radius-card)}
.rs-orig figcaption{margin-top:8px;font-size:var(--fz-sm);color:var(--muted);line-height:1.5}

/* 分享（QR 碼由伺服器端產生 SVG，views_v2.share_qr；.rs-qr* 照設計稿 route-sheets.html，示意框改成載不到時的說明框） */
.rs-urlrow{display:flex;gap:8px}
.rs-url{flex:1;min-width:0;font-size:var(--fz-sm)}
.rs-check{display:flex;align-items:center;gap:10px;min-height:var(--touch);font-size:var(--fz-md);cursor:pointer}
.rs-check input{width:1.125rem;height:1.125rem;margin:0;accent-color:var(--primary)}
.rs-copied{min-height:1.25rem;font-size:var(--fz-sm);color:var(--muted)}
.rs-copied:empty{min-height:0}
.rs-block--qr{margin-top:16px}
.rs-qr{display:flex;flex-direction:column;gap:8px;margin-top:4px}
.rs-qr__img{display:block;width:10rem;height:10rem}
.rs-qr__slot{width:10rem;display:flex;align-items:center;justify-content:center;aspect-ratio:1;padding:12px;border:1px dashed var(--control);border-radius:var(--radius-control);font-size:var(--fz-sm);color:var(--muted);text-align:center;line-height:1.4}
.rs-qr__txt{font-size:var(--fz-sm);color:var(--muted);line-height:1.6;overflow-wrap:anywhere}

@media (max-width:640px){
  .rs-sheet-time .v2-drawer__panel{height:85dvh}   /* 底部抽屜：時刻表在抽屜裡捲，抽屜本身固定高 */
  /* 票價全表在手機：整個抽屜一起捲（控制列捲走，列表多出空間），表頭黏在抽屜頂端 */
  .rs-sheet-fare.is-fill .v2-drawer__body{display:block;overflow:auto;padding-bottom:16px}
  .rs-sheet-fare .rs-ft__list .rs-ft__scroll{overflow:visible;margin:0;padding:0;border-top:0}
  .rs-sheet-fare.is-fill .rs-ft__foot{margin:0;padding-inline:0}
}
