/* 回報地圖 PoC 樣式：token 取自 docs/civic-report-design-spec-2026-11-30.html（v1.1），請勿在此改色碼，改 spec 後再同步 */
:root {
  /* 品牌主色「赤陶」：陶盆、紅磚的暖紅褐。只用在主要動作與品牌標記，不大面積鋪色 */
  --brand-50:  #fdf3ee;
  --brand-100: #fbe9df;  /* 杏色：tonal 按鈕、選取底色 */
  --brand-200: #f5d2c1;
  --brand-300: #e9ad92;
  --brand-400: #d98263;
  --brand-500: #c76645;
  --brand-600: #b5532f;  /* 主要按鈕、FAB（白字 4.95:1） */
  --brand-700: #9c4526;  /* 品牌文字、hover（白底 6.38:1） */
  --brand-800: #7f3720;
  --brand-900: #5e2a19;

  /* 中性色「燕麥」：暖白到暖墨，取代冷灰 */
  --neutral-0:   #ffffff;
  --neutral-25:  #fdfbf8;
  --neutral-50:  #fbf7f1;
  --neutral-100: #f4efe6;
  --neutral-200: #e8e0d3;
  --neutral-300: #d6ccbc;
  --neutral-400: #a89d8f;
  --neutral-500: #7a6f63;
  --neutral-600: #6e645a;
  --neutral-700: #4e453c;
  --neutral-800: #39312a;
  --neutral-900: #2e2924;

  /* 語意色 */
  --success-50: #ebf1e2; --success-600: #4f6b3c;
  --warning-50: #fbf0d6; --warning-600: #8a5a0f;
  --error-50:   #fdeeee; --error-600:   #c93434; --error-700: #b12c2c;
  --info-50:    #e5eff3; --info-600:    #3e6a80;

  /* 案件狀態色：實色用於地圖圖釘與圓點 */
  --st-new:        #d9982a;  --st-new-bg:        #fbf0d6;  /* 蜂蜜 */
  --st-stale:      #c4415f;  --st-stale-bg:      #f8e4ea;  /* 莓紅 */
  --st-progress:   #4f86a0;  --st-progress-bg:   #e5eff3;  /* 湖藍灰 */
  --st-repdone:    #8e5a8b;  --st-repdone-bg:    #f3e8f1;  /* 梅紫 */
  --st-closed:     #6f8f5a;  --st-closed-bg:     #ebf1e2;  /* 鼠尾草 */
  --st-ended:      #a39a8f;  --st-ended-bg:      #f1ece5;  /* 暖灰 */
  /* 徽章文字專用（淡底上 ≥ 4.5:1，實測 4.9–5.7）；圖釘仍用上面的實色 */
  --st-new-ink: #8a5a0f; --st-stale-ink: #a3304c; --st-progress-ink: #3e6a80;
  --st-repdone-ink: #7a4a78; --st-closed-ink: #4f6b3c; --st-ended-ink: #6e645a;

  /* 角色語意 */
  --bg-main: var(--neutral-0);
  --bg-surface: var(--neutral-50);
  --bg-subtle: var(--neutral-100);
  --bg-canvas: var(--neutral-100);
  --bg-atmosphere: radial-gradient(ellipse at 8% 92%, #fbe6d8 0, transparent 52%), radial-gradient(ellipse at 96% 6%, #f3ecd9 0, transparent 40%), #fbf7f1;
  --bg-brand: var(--brand-600);
  --bg-brand-subtle: var(--brand-50);
  --text-primary: var(--neutral-900);
  --text-secondary: var(--neutral-600);
  --text-tertiary: var(--neutral-500);
  --text-disabled: var(--neutral-400);
  --text-brand: var(--brand-700);
  --text-inverse: #fff;
  --border-main: var(--neutral-200);
  --border-subtle: var(--neutral-100);
  --border-field: var(--neutral-500);
  --highlight-subtle: var(--brand-100);
  --fill-hover: rgba(58, 42, 30, .06);
  --fill-pressed: rgba(58, 42, 30, .10);
  --online: var(--st-closed);

  /* 動作按鈕 */
  --action-primary-fill: linear-gradient(180deg, #c25f3a 0%, var(--brand-600) 100%);
  --action-primary-fill-hover: linear-gradient(180deg, var(--brand-600) 0%, var(--brand-700) 100%);
  --action-primary-pressed: var(--brand-700);
  --action-primary-shadow: inset 0 1px 0 #ffffff2e, 0 1px 2px #5e2a1933, 0 4px 12px -4px #b5532f59;
  --action-primary-shadow-hover: inset 0 1px 0 #ffffff2e, 0 1px 2px #5e2a1940, 0 6px 16px -4px #b5532f66;
  --action-primary-shadow-pressed: inset 0 1px 3px #4a1e0f40, 0 1px 2px #3a2a1e33;
  --action-fab-glow: 0 12px 28px -10px #b5532f80;
  --action-secondary: var(--neutral-100);
  --action-secondary-hover: var(--neutral-200);
  --action-secondary-pressed: var(--neutral-300);
  --action-tonal: var(--brand-100);
  --action-tonal-hover: var(--brand-200);
  --action-tonal-text: var(--brand-700);
  --action-danger-hover: #fadcdc;
  --star: #e0a43a;

  /* 字型 */
  --font-sans: "Lato", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --type-display:     700 28px/36px var(--font-sans);
  --type-title:       700 22px/30px var(--font-sans);
  --type-heading:     700 18px/26px var(--font-sans);
  --type-body:        400 16px/26px var(--font-sans);
  --type-body-strong: 700 16px/24px var(--font-sans);
  --type-body-sm:     400 14px/22px var(--font-sans);
  --type-label:       700 13px/18px var(--font-sans);
  --type-caption:     400 12px/16px var(--font-sans);
  --tracking-tight: -.01em;

  /* 間距（4 的倍數） */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px;
  --margin-phone: 16px; --margin-desktop: 24px;

  /* 尺寸 */
  --control-lg: 48px;   /* 主要 CTA */
  --control-md: 44px;   /* 一般按鈕、輸入框、觸控下限 */
  --control-sm: 36px;   /* 篩選 chip、工具列 */
  --touch-target: 44px;
  --icon-sm: 16px; --icon-md: 20px; --icon-lg: 24px; --icon-stroke: 1.75;
  --rail-width: 72px; --list-width: 352px; --sidebar-width: 256px;

  /* 圓角 */
  --radius-xs: 8px;     /* 輸入框、選單項目 */
  --radius-sm: 12px;    /* 列表列、小卡、縮圖 */
  --radius-card: 16px;  /* 卡片 */
  --radius-dialog: 20px;/* 對話框 */
  --radius-sheet: 24px; /* 底部面板 */
  --radius-device: 32px;
  --radius-pill: 999px; /* 所有按鈕、chip、分段控制 */

  /* 陰影（皆帶暖褐色調 #3a2a1e，不用純黑） */
  --shadow-raised:   0 0 0 .5px #3a2a1e0f, 0 1px 2px #3a2a1e1a, 0 2px 6px -2px #3a2a1e14;
  --shadow-resting:  0 1px 2px #3a2a1e0a, 0 6px 18px -10px #3a2a1e1f;
  --shadow-floating: 0 0 0 .5px #3a2a1e1a, 0 1px 2px #3a2a1e0d, 0 12px 32px -14px #3a2a1e30;
  --shadow-overlay:  0 2px 6px #3a2a1e0f, 0 24px 64px -20px #3a2a1e47;
  --shadow-sheet:    0 0 0 1px #3a2a1e0f, 0 1px 2px #3a2a1e0a, 0 16px 40px -20px #3a2a1e33;
  --shadow-card-hover: 0 2px 4px #3a2a1e12, 0 20px 44px -14px #3a2a1e40;
  --shadow-modal:    0 32px 120px #2a1f1626;
  --shadow-pin:      0 4px 10px -2px #3a2a1e55;
  --shadow-recessed: inset 0 .5px 1px #3a2a1e14;
  --scrim: #2a1f1652;
  --focus-outline: 2px solid var(--brand-700);
  --focus-halo: 0 0 0 3px var(--brand-200);

  /* 材質（玻璃）：只用在「浮在地圖上」的元件 */
  --glass-1-bg: rgba(251, 247, 241, .58);
  --glass-1-filter: blur(56px) saturate(1.15);
  --glass-1-edge: inset 0 1px 2px #ffffff59, inset 0 -1px 2px #ffffff1a;
  --glass-2-bg: rgba(255, 253, 249, .64);
  --glass-2-filter: blur(44px) saturate(1.6);
  --glass-2-edge: inset 0 0 0 .5px #3a2a1e14, inset 0 1.5px 1px #fffffff2, inset 0 -1.5px 2px #3a2a1e12;
  --pane-bg: rgba(253, 251, 248, .76);
  --pane-filter: blur(24px);

  /* 示意地圖（規格頁用；正式版底圖需降彩度到同一調性） */
  --map-land: linear-gradient(135deg, #efe8da, #ebe5d3 45%, #e3e7e2);
  --map-road: #ffffffb0;

  /* 動效 */
  --dur-xs: 70ms;   /* 顏色、透明度微變 */
  --dur-sm: 140ms;  /* 按鈕 hover / press */
  --dur-md: 240ms;  /* 卡片、列表、頁面進場 */
  --dur-lg: 320ms;  /* 面板、對話框 */
  --dur-xl: 480ms;  /* 大區塊、強調動畫、hover 光暈淡出 */
  --ease-enter: cubic-bezier(.2, .2, .2, 1);       /* 進場、hover 進入 */
  --ease-exit: cubic-bezier(.6, .1, .7, .7);        /* 離場 */
  --ease-change: cubic-bezier(.4, .1, .2, 1);       /* 狀態改變、hover 返回 */
  --ease-dramatic: cubic-bezier(.8, 0, .13, 1);     /* 大幅位移（全頁切換） */
  --ease-overshoot: cubic-bezier(0, .4, .45, 1.5);  /* 趣味：圖釘、+1、修好了 */
  --ease-anticipation: cubic-bezier(.25, -.5, .1, 1);
  --card-hover-y: -6px;
}

/* ---------- 基礎 ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: var(--type-body); color: var(--text-primary); background: var(--bg-surface); -webkit-font-smoothing: antialiased; }
#map { position: fixed; inset: 0; background: var(--neutral-100); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
a { color: var(--text-brand); }
.muted { color: var(--text-secondary); font: var(--type-body-sm); }
.err { color: var(--error-600); font: var(--type-caption); margin: 0; }
.row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.stack > * + * { margin-top: var(--space-3); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- 材質 ---------- */
.glass { background: var(--glass-2-bg); backdrop-filter: var(--glass-2-filter); -webkit-backdrop-filter: var(--glass-2-filter); box-shadow: var(--glass-2-edge), var(--shadow-floating); }
.pane { background: var(--pane-bg); backdrop-filter: var(--pane-filter); -webkit-backdrop-filter: var(--pane-filter); box-shadow: var(--shadow-sheet); }
@supports not (backdrop-filter: blur(1px)) { .glass, .pane { background: var(--bg-main); } }

/* ---------- 頂列、篩選 ---------- */
.topbar {
  position: fixed; z-index: 5; top: calc(env(safe-area-inset-top) + 12px); left: 12px; right: 12px; height: 48px;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: 0 6px 0 var(--space-4); border-radius: var(--radius-pill);
}
.brand { font: var(--type-heading); letter-spacing: var(--tracking-tight); color: var(--text-primary); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.brand::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-600); }
.brand small { font: var(--type-caption); color: var(--text-tertiary); }
.top-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand, .topbar .chip { white-space: nowrap; flex: none; }
@media (max-width: 420px) { .brand small { display: none; } }
.filters { position: fixed; z-index: 4; top: calc(env(safe-area-inset-top) + 70px); left: 12px; display: flex; gap: 4px; padding: 4px; border-radius: var(--radius-pill); }

/* ---------- 表單控制 ---------- */
select, input, textarea, button { font: inherit; color: inherit; }
select {
  height: var(--control-sm); padding: 0 32px 0 14px; border: 0; border-radius: var(--radius-pill); appearance: none; -webkit-appearance: none;
  background: var(--fill-hover) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236e645a' stroke-width='2'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E") no-repeat right 12px center;
  font: var(--type-label); color: var(--text-primary); cursor: pointer; transition: background-color var(--dur-sm) var(--ease-enter);
}
select:hover { background-color: var(--fill-pressed); }
input[type=text], textarea {
  width: 100%; height: var(--control-md); padding: 0 var(--space-3); border: 1px solid var(--border-main); border-radius: var(--radius-xs);
  background: var(--bg-main); font: var(--type-body); color: var(--text-primary);
  transition: border-color var(--dur-sm) var(--ease-enter), box-shadow var(--dur-sm) var(--ease-enter);
}
textarea { height: auto; min-height: 96px; padding: var(--space-3); resize: vertical; }
input[type=text]:hover, textarea:hover { border-color: var(--neutral-300); }
input[type=text]:focus, textarea:focus, select:focus-visible { outline: none; border-color: var(--brand-700); box-shadow: var(--focus-halo); }
input[type=file] { font: var(--type-body-sm); color: var(--text-secondary); }
input[type=file]::file-selector-button { height: var(--control-sm); padding: 0 var(--space-4); margin-right: var(--space-3); border: 0; border-radius: var(--radius-pill); background: var(--action-secondary); font: var(--type-label); color: var(--text-primary); cursor: pointer; }
input[type=checkbox] { accent-color: var(--brand-600); width: 18px; height: 18px; vertical-align: -3px; }
label { font: var(--type-body-sm); }
.field label { display: block; font: var(--type-label); color: var(--text-secondary); margin-bottom: 6px; }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--control-md); padding: 0 var(--space-6); border: 0; border-radius: var(--radius-pill);
  font: 700 15px/20px var(--font-sans); letter-spacing: var(--tracking-tight); white-space: nowrap; text-decoration: none; cursor: pointer; user-select: none;
  background: var(--action-secondary); color: var(--text-primary);
  transition: background var(--dur-sm) var(--ease-enter), box-shadow var(--dur-sm) var(--ease-enter), color var(--dur-sm) var(--ease-enter), scale var(--dur-sm) var(--ease-enter);
}
.btn:hover { background: var(--action-secondary-hover); }
.btn:active { background: var(--action-secondary-pressed); scale: .97; }
.btn:focus-visible, .chip:focus-visible, .fab:focus-visible, .locate:focus-visible { outline: var(--focus-outline); outline-offset: 2px; }
.btn.lg { height: var(--control-lg); padding: 0 28px; }
.btn.sm { height: var(--control-sm); padding: 0 var(--space-4); font: 700 13px/18px var(--font-sans); }
.btn.block { width: 100%; }
.btn.primary { background: var(--brand-600); background-image: var(--action-primary-fill); color: #fff; box-shadow: var(--action-primary-shadow); }
.btn.primary:hover { background-image: var(--action-primary-fill-hover); box-shadow: var(--action-primary-shadow-hover); }
.btn.primary:active { background-image: none; background: var(--action-primary-pressed); box-shadow: var(--action-primary-shadow-pressed); }
.btn.tonal { background: var(--action-tonal); color: var(--action-tonal-text); }
.btn.tonal:hover { background: var(--action-tonal-hover); }
.btn.ghost { background: transparent; color: var(--text-secondary); }
.btn.ghost:hover { background: var(--fill-hover); color: var(--text-primary); }
.btn.ghost:active { background: var(--fill-pressed); }
.btn.danger { background: var(--error-50); color: var(--error-700); }
.btn.danger:hover { background: var(--action-danger-hover); }
.btn.icon { width: var(--control-md); padding: 0; }
.btn.icon.sm { width: var(--control-sm); }
.btn.btn[disabled] { background: var(--bg-subtle); background-image: none; color: var(--text-disabled); box-shadow: none; cursor: not-allowed; scale: 1; }

/* 底部導覽列：浮動玻璃膠囊（模擬液態玻璃；不支援 backdrop-filter 或要求減少透明度時改實色） */
:root {
  --lg-bg: rgba(255, 252, 247, .52);
  --lg-filter: blur(20px) saturate(1.8) brightness(1.04);
  --lg-edge: inset 0 0 0 .5px rgba(255,255,255,.7), inset 0 1.5px 1px rgba(255,255,255,.9), inset 0 -1px 2px rgba(58,42,30,.08);
  --lg-shadow: 0 1px 3px rgba(58,42,30,.10), 0 10px 28px -8px rgba(58,42,30,.30);
  --lg-lens: rgba(255, 255, 255, .72);
  --lg-lens-edge: inset 0 0 0 .5px rgba(58,42,30,.06), inset 0 1px 0 #fff, 0 2px 8px -2px rgba(58,42,30,.18);
  --lg-edge-on-color: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -1px 2px rgba(74,30,15,.25);
  --nav-height: 62px;
  --dock-bottom: calc(env(safe-area-inset-bottom) + 14px);
  --dock-clear: calc(var(--dock-bottom) + var(--nav-height) + 12px); /* 其他浮動元件要留在導覽列上方的距離 */
}
.navdock { position: fixed; z-index: 5; left: 12px; right: 12px; bottom: var(--dock-bottom); display: flex; gap: 8px; align-items: center;
  transition: transform var(--dur-md) var(--ease-change), opacity var(--dur-md) var(--ease-change); }
.navdock.away { transform: translateY(130%); opacity: 0; transition-duration: var(--dur-sm); transition-timing-function: var(--ease-exit); pointer-events: none; }
.navbar { position: relative; flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); height: var(--nav-height); padding: 4px; border-radius: var(--radius-pill);
  background: var(--lg-bg); backdrop-filter: var(--lg-filter); -webkit-backdrop-filter: var(--lg-filter); box-shadow: var(--lg-edge), var(--lg-shadow); }
.navbar button { position: relative; z-index: 1; min-width: 0; border: 0; background: none; display: grid; place-items: center; padding: 0; border-radius: var(--radius-pill);
  color: var(--text-secondary); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: color var(--dur-md) var(--ease-change), scale var(--dur-sm) var(--ease-enter); }
.navbar button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; transition: stroke-width var(--dur-md) var(--ease-change); }
.navbar button:active { scale: .9; }
/* 「我」：登入後顯示頭像（28px），選中時加品牌色外圈 */
.tab-me { display: grid; place-items: center; }
.av.s28 { width: 28px; height: 28px; font-size: 12px; }
.tab-me .av { transition: box-shadow var(--dur-md) var(--ease-change); }
.navbar button[aria-selected="true"] .tab-me .av { box-shadow: 0 0 0 2px var(--bg-main), 0 0 0 3.5px var(--brand-600); }
.navbar button[aria-selected="true"] { color: var(--text-brand); }
.navbar button[aria-selected="true"] svg { stroke-width: 2.25; }
.navbar button:focus-visible { outline: var(--focus-outline); outline-offset: -2px; }
.navbar .lens { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 4); border-radius: var(--radius-pill);
  background: var(--lg-lens); box-shadow: var(--lg-lens-edge); transition: transform var(--dur-lg) var(--ease-spring); }
.navbar .lens.moving { animation: lens-stretch var(--dur-lg) var(--ease-change); }
@keyframes lens-stretch { 40% { scale: 1.14 .9; } }
@supports not (backdrop-filter: blur(1px)) { .navbar { background: var(--bg-main); } }
@media (prefers-reduced-transparency: reduce) { .navbar { background: var(--bg-main); backdrop-filter: none; -webkit-backdrop-filter: none; } }

/* 回報按鈕：手機＝62px 圓鈕（只有 ＋）；桌機＝56px 膠囊 FAB（＋ 回報問題） */
.fab {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: var(--nav-height); height: var(--nav-height); padding: 0;
  border: 0; border-radius: 50%; font: 700 16px/20px var(--font-sans); letter-spacing: var(--tracking-tight); color: #fff; cursor: pointer;
  background: var(--brand-600); background-image: var(--action-primary-fill); box-shadow: var(--lg-edge-on-color), var(--action-primary-shadow), var(--action-fab-glow);
  transition: background var(--dur-sm) var(--ease-enter), scale var(--dur-sm) var(--ease-enter);
}
.fab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.fab .fab-label { display: none; }
.fab:hover { background-image: var(--action-primary-fill-hover); }
.fab:active { scale: .92; }
@media (min-width: 768px) {
  .navdock { left: auto; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 16px); gap: 12px; }
  .navbar { flex: none; width: 320px; }
  .fab { width: auto; height: 56px; padding: 0 var(--space-6) 0 var(--space-5); border-radius: var(--radius-pill); }
  .fab svg { width: 20px; height: 20px; }
  .fab .fab-label { display: inline; }
}

/* 定位鈕外框：在 MapLibre 右下控制欄內，與圖資標示右緣對齊、上下留 8px */
.maplibregl-ctrl.locate-ctrl { margin: 0 10px 8px 0; }
/* 回到目前位置（Google Maps 式）：48px 毛玻璃圓鈕，疊在「回報問題」上方；定位中轉圈、已置中時準心填色 */
.locate {
  position: relative; width: 48px; height: 48px;
  display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--text-secondary); cursor: pointer;
  transition: scale var(--dur-sm) var(--ease-enter), opacity var(--dur-sm) var(--ease-exit), translate var(--dur-sm) var(--ease-exit), color var(--dur-sm) var(--ease-change);
}
.locate svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.locate .dot { fill: none; }
.locate:active { scale: .94; }
.locate:focus-visible { outline: var(--focus-outline); outline-offset: 2px; }
.locate.on { color: var(--info-600); }
.locate.on .dot { fill: currentColor; stroke: none; }
.locate.busy svg { animation: locate-spin 1s linear infinite; }
@keyframes locate-spin { to { rotate: 360deg; } }
.locate.away { opacity: 0; translate: 0 8px; pointer-events: none; }
/* 目前位置圖釘：藍點＋白邊＋精度圈（與案件圖釘明顯不同，避免誤認為案件） */
.me-dot { position: relative; width: 18px; height: 18px; border-radius: 50%; background: var(--info-600); border: 3px solid #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .3); }
.me-dot::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; background: var(--info-600); opacity: .25; animation: me-pulse 2s var(--ease-exit) infinite; }
@keyframes me-pulse { from { scale: .5; opacity: .35; } to { scale: 1.6; opacity: 0; } }
.me-acc { border-radius: 50%; background: color-mix(in srgb, var(--info-600) 12%, transparent); border: 1px solid color-mix(in srgb, var(--info-600) 35%, transparent); pointer-events: none; }

/* chip（36px） */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: var(--control-sm); padding: 0 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-main); background: var(--bg-main); color: var(--text-secondary); font: var(--type-label); text-decoration: none; cursor: pointer;
  transition: background var(--dur-sm) var(--ease-enter), border-color var(--dur-sm) var(--ease-enter), color var(--dur-sm) var(--ease-enter), scale var(--dur-sm) var(--ease-enter);
}
.chip:hover { background: var(--bg-surface); color: var(--text-primary); }
.chip:active { scale: .97; }
.chip[aria-pressed="true"] { background: var(--highlight-subtle); border-color: transparent; color: var(--text-brand); }
.topbar .chip { border-color: transparent; background: transparent; }
.topbar .chip:hover { background: var(--fill-hover); }

/* ---------- 底部面板 ---------- */
.sheet {
  position: fixed; z-index: 6; left: 6px; right: 6px; bottom: 6px; max-height: 72vh; overflow: auto; overscroll-behavior: contain;
  border-radius: var(--radius-sheet); padding: var(--space-5) var(--space-5) calc(env(safe-area-inset-bottom) + var(--space-5));
}
@media (max-width: 767px) {
  body:not(.dock-away) .sheet { bottom: calc(var(--dock-clear) - 6px); max-height: calc(100vh - var(--dock-clear) - 80px); max-height: calc(100dvh - var(--dock-clear) - 80px); }
}
@media (min-width: 768px) {
  .sheet { left: 24px; right: auto; top: 124px; bottom: 24px; width: 420px; max-height: none; border-radius: var(--radius-card); }
  .sheet-nav .grabber { visibility: hidden; }
}
/* 面板頂端導覽列：返回（有上一頁才出現）、拖曳把手、關閉；捲動時固定在頂端 */
.sheet-nav { position: sticky; top: calc(-1 * var(--space-5)); z-index: 4; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  margin: calc(-1 * var(--space-5)) calc(-1 * var(--space-5)) var(--space-2); padding: var(--space-2) var(--space-3);
  background: var(--pane-bg); backdrop-filter: var(--pane-filter); -webkit-backdrop-filter: var(--pane-filter); border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; }
.sheet-nav > :last-child { justify-self: end; }
.sheet-nav .grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--neutral-300); }
.sheet-nav .back { justify-self: start; gap: 4px; max-width: 100%; padding: 0 12px 0 6px; color: var(--text-brand); }
.sheet-nav .back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet h2 { font: var(--type-display); letter-spacing: -.02em; margin: var(--space-2) 0 var(--space-1); }
.sheet h3 { font: var(--type-heading); margin: var(--space-6) 0 var(--space-3); }

/* ---------- 徽章 ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: var(--radius-pill); font: 700 12px/16px var(--font-sans); white-space: nowrap; flex: none; vertical-align: middle; }
.badge svg { width: 14px; height: 14px; flex: none; } /* 14px 只放 1–2 筆畫的簡單形狀，見 spec「留白與圖示尺寸」 */
.s-new { color: var(--st-new-ink); background: var(--st-new-bg); }
.s-stale { color: var(--st-stale-ink); background: var(--st-stale-bg); }
.s-claimed, .s-in_progress { color: var(--st-progress-ink); background: var(--st-progress-bg); }
.s-rep_done { color: var(--st-repdone-ink); background: var(--st-repdone-bg); }
.s-closed { color: var(--st-closed-ink); background: var(--st-closed-bg); }
.s-duplicate, .s-unresolvable, .s-withdrawn, .s-review { color: var(--st-ended-ink); background: var(--st-ended-bg); }
.s-lead { color: #fff; background: var(--brand-600); padding: 0 10px; }

/* ---------- 卡片、列表 ---------- */
.card { background: var(--bg-main); border: 1px solid var(--border-main); border-radius: var(--radius-card); padding: var(--space-4); box-shadow: var(--shadow-raised); }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.list a { color: inherit; text-decoration: none; }
.row-item {
  display: block; padding: 10px 12px; border-radius: var(--radius-sm); color: inherit; text-decoration: none;
  transition: background var(--dur-md) var(--ease-enter), opacity var(--dur-md) var(--ease-enter);
}
.row-item:hover { background: var(--fill-hover); opacity: 1; }
.row-item:active { background: var(--fill-pressed); }
.row-item.ended { opacity: .6; }
.row-item .t { font: var(--type-body-strong); font-size: 15px; margin: 4px 0 2px; }
.dup { border-color: transparent; background: var(--st-new-bg); box-shadow: none; }
.dup .row-item { background: var(--bg-main); }

/* ---------- 照片、時間軸 ---------- */
.photos { display: flex; gap: var(--space-2); overflow-x: auto; scroll-snap-type: x mandatory; }
.photos figure { margin: 0; scroll-snap-align: start; }
.photos img { width: 128px; height: 128px; object-fit: cover; border-radius: var(--radius-sm); background: var(--bg-subtle); display: block; }
.photo-tag { font: var(--type-caption); color: var(--text-tertiary); text-align: center; margin-top: 4px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 var(--space-4); border-left: 2px solid var(--border-main); }
.timeline li { position: relative; padding: 0 0 var(--space-4) var(--space-2); }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--st-progress); border: 2px solid var(--bg-main); }
.timeline li.done::before { background: var(--st-repdone); }
.timeline li.reopened::before { background: var(--st-stale); }
.timeline img { max-width: 160px; border-radius: var(--radius-xs); display: block; margin-top: 6px; }

/* ---------- 統計 ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-2); margin-top: var(--space-3); }
.stat { background: var(--bg-surface); border-radius: var(--radius-sm); padding: var(--space-3); font: var(--type-caption); color: var(--text-tertiary); }
.stat b { display: block; font: var(--type-title); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.dist { display: grid; grid-template-columns: 36px 1fr 24px; gap: 6px var(--space-2); align-items: center; font: var(--type-caption); color: var(--text-secondary); margin-top: var(--space-3); }
.dist .bar { height: 8px; border-radius: 4px; background: var(--star); min-width: 2px; }

/* ---------- 星等 ---------- */
.stars { display: flex; gap: 2px; margin: 6px 0; }
.stars button { width: 40px; height: 40px; border: 0; border-radius: var(--radius-pill); background: none; font-size: 26px; color: var(--neutral-300); cursor: pointer; transition: color var(--dur-xs) var(--ease-enter), scale var(--dur-md) var(--ease-overshoot); }
.stars button:hover { background: var(--fill-hover); }
.stars button.on { color: var(--star); }
.stars button.pop { scale: 1.25; }

/* ---------- 1999 ---------- */
.gov pre { white-space: pre-wrap; font: 12px/18px var(--font-mono); background: var(--bg-surface); color: var(--text-secondary); padding: var(--space-3); border-radius: var(--radius-xs); margin: 0; }

/* ---------- Toast（sonner 參數） ---------- */
.toast-stack { position: fixed; z-index: 20; left: 50%; bottom: var(--dock-clear); translate: -50% 0; display: grid; gap: var(--space-2); justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px var(--space-4); border-radius: var(--radius-sm); background: var(--neutral-900); color: #fff; font: var(--type-body-sm); box-shadow: var(--shadow-overlay); animation: toast-in var(--dur-md) var(--ease-enter) both; }
.toast.out { animation: toast-out var(--dur-sm) var(--ease-exit) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.8); } }
@keyframes toast-out { to { opacity: 0; transform: scale(.8); } }

/* ---------- 地圖上的元件 ---------- */
.village-label { color: var(--text-secondary); font: var(--type-label); text-shadow: 0 0 3px var(--neutral-50), 0 0 3px var(--neutral-50); pointer-events: none; }
.new-pin { width: 32px; height: 32px; border-radius: 50% 50% 50% 4px; background: var(--brand-600); transform: rotate(-45deg); border: 3px solid #fff; box-shadow: var(--shadow-pin); cursor: grab; }

/* ---------- 資訊層級元件（spec v1.2「資訊層級」「留白與圖示尺寸」） ---------- */
.ico { display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.av { position: relative; display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--neutral-200); color: var(--neutral-700); font-weight: 700; }
.av.s24 { width: 24px; height: 24px; font-size: 11px; }
.av.s40 { width: 40px; height: 40px; font-size: 16px; }
.av.wait { background: var(--bg-subtle); color: var(--text-tertiary); box-shadow: inset 0 0 0 1.5px var(--neutral-300); }
.stackav { display: inline-flex; }
.stackav .av { box-shadow: 0 0 0 2px var(--bg-main); }
.stackav .av + .av { margin-left: -8px; }
.cat-tile { display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--neutral-100); color: var(--brand-700); flex: none; }

.case-hero .cat-tile { height: 150px; border-radius: var(--radius-card); }
.case-hero .photos img { width: 200px; height: 150px; border-radius: var(--radius-card); }
.status-lg { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px 0 10px; border-radius: var(--radius-pill); font: 700 14px/18px var(--font-sans); }
.status-lg .ico { width: 16px; height: 16px; }
.status-lg svg { width: 16px; height: 16px; flex: none; }
.gov-pre { white-space: pre-wrap; font: 12px/18px var(--font-mono); background: var(--bg-surface); color: var(--text-secondary); padding: var(--space-3); border-radius: var(--radius-xs); margin: 0; }
.btn .ico { width: 16px; height: 16px; }
.reason { font: var(--type-body-sm); color: var(--text-secondary); margin: 8px 0 0; }
.stepper { --step: var(--st-progress); --step-ink: var(--st-progress-ink); display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 12px; }
.stepper .st { position: relative; padding-top: 14px; font: var(--type-caption); color: var(--text-tertiary); text-align: center; }
.stepper .st::before { content: ""; position: absolute; top: 4px; left: 0; right: 0; height: 3px; border-radius: 2px; background: var(--neutral-200); }
.stepper .st.done::before, .stepper .st.now::before { background: var(--step); }
.stepper .st.done { color: var(--text-secondary); }
.stepper .st.now { color: var(--step-ink); font-weight: 700; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font: var(--type-body-sm); color: var(--text-secondary); }
.meta > span { display: inline-flex; align-items: center; gap: 6px; }
.meta .ico { color: var(--text-tertiary); }

.blk { margin-top: var(--space-6); }
.handler { display: flex; align-items: center; gap: 12px; padding: 12px var(--space-4); border-radius: var(--radius-card); background: var(--bg-main); border: 1px solid var(--border-main); box-shadow: var(--shadow-raised); }
.handler .who { flex: 1; min-width: 0; }
.handler .who > a, .handler .who > b { display: block; font: var(--type-body-strong); color: var(--text-primary); text-decoration: none; }
.handler .who .row { gap: 6px; margin-top: 2px; }
.handler .kpi { text-align: right; font: var(--type-caption); color: var(--text-tertiary); flex: none; }
.handler .kpi b { display: block; font: 700 15px/20px var(--font-sans); color: var(--st-closed-ink); font-variant-numeric: tabular-nums; }
.handler .kpi.slow b { color: var(--text-secondary); }
.handler-others { display: flex; align-items: center; gap: 8px; margin-top: 10px; font: var(--type-caption); color: var(--text-tertiary); }
.case-actions { display: flex; gap: var(--space-2); align-items: center; margin-top: 12px; }
.case-actions .tonal { flex: 1; }

.alert { display: flex; align-items: center; gap: 10px; padding: 12px var(--space-4); border-radius: var(--radius-sm); font: var(--type-body-sm); margin-bottom: var(--space-4); }
.alert .ico { width: 20px; height: 20px; }
.alert.stale { background: var(--st-stale-bg); color: var(--st-stale-ink); }
.alert.review { background: var(--st-ended-bg); color: var(--st-ended-ink); }
.alert b { font-weight: 700; }
.alert .btn { margin-left: auto; }

.tl2 { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.tl2 li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; position: relative; }
.tl2 li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 40px; bottom: -16px; width: 2px; border-radius: 1px; background: var(--border-main); }
.tl2 .head { display: flex; justify-content: space-between; gap: 8px; font: var(--type-body-strong); font-size: 15px; }
.tl2 .head time { font: var(--type-caption); color: var(--text-tertiary); flex: none; }
.tl2 .txt { font: var(--type-body-sm); margin-top: 2px; }
.tl2 img { max-width: 180px; border-radius: var(--radius-sm); display: block; margin-top: 8px; }
.node { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.n-progress { background: var(--st-progress-bg); color: var(--st-progress-ink); }
.n-repdone { background: var(--st-repdone-bg); color: var(--st-repdone-ink); }
.n-stale { background: var(--st-stale-bg); color: var(--st-stale-ink); }
.byline { display: flex; align-items: center; gap: 6px; margin-top: 6px; font: var(--type-caption); color: var(--text-tertiary); }

.fold { padding: 0; }
.fold > summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 var(--space-4); cursor: pointer; list-style: none; font: var(--type-body-strong); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .ico { width: 20px; height: 20px; color: var(--text-brand); }
.fold > summary .badge { margin-left: auto; }
.fold > .fold-body { padding: 0 var(--space-4) var(--space-4); }

.confirm-card { border: 0; background: var(--st-repdone-bg); box-shadow: none; margin-top: var(--space-4); }
.confirm-card h3 { margin: 0 0 var(--space-3); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-bottom: var(--space-4); }
.compare img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.compare .after img { outline: 3px solid var(--st-closed); outline-offset: -3px; }
.rate-row { display: flex; align-items: center; gap: 12px; padding: var(--space-3) 0; border-top: 1px solid rgba(58,42,30,.08); }
.rate-row:first-of-type { border-top: 0; }
.rate-row .who { flex: 1; min-width: 0; font: var(--type-body-strong); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }

.actionbar { position: sticky; bottom: calc(-1 * (env(safe-area-inset-bottom) + var(--space-5))); z-index: 2; margin: var(--space-6) calc(-1 * var(--space-5)) calc(-1 * (env(safe-area-inset-bottom) + var(--space-5)));
  padding: var(--space-3) var(--space-5) calc(env(safe-area-inset-bottom) + var(--space-3)); background: var(--pane-bg); backdrop-filter: var(--pane-filter); -webkit-backdrop-filter: var(--pane-filter); border-top: 1px solid var(--border-subtle); }
.actionbar .btns { display: flex; gap: var(--space-2); }
.actionbar .btns .btn { flex: 1; }
.actionbar form { margin-bottom: var(--space-3); }
.actionbar select { width: 100%; }

.footnote { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: var(--space-6); padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); font: var(--type-caption); color: var(--text-tertiary); }
.footnote .copy { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: var(--radius-pill); background: var(--bg-subtle); color: var(--text-secondary); font: var(--type-caption); cursor: pointer; }
.footnote .copy::after { content: ""; position: absolute; inset: -6px 0; }
.footnote .copy .ico { width: 14px; height: 14px; }
.footnote .note-i { display: inline-flex; align-items: center; gap: 6px; flex-basis: 100%; }
.footnote .note-i .ico { width: 14px; height: 14px; }
.more { position: relative; margin-left: auto; }
.more > summary { list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more[open] > .more-body { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 3; width: 280px; padding: var(--space-4); border-radius: var(--radius-card); background: var(--bg-main); box-shadow: var(--shadow-overlay); display: grid; gap: var(--space-3); }

/* 回報表單 */
.photo-pick { display: flex; gap: var(--space-2); align-items: flex-start; }
.photo-pick .photos img { width: 96px; height: 96px; }
.field .photo-add { margin: 0; flex: none; width: 96px; height: 96px; display: grid; place-items: center; align-content: center; gap: 6px; border-radius: var(--radius-sm);
  border: 1.5px dashed var(--neutral-300); background: var(--bg-surface); color: var(--text-brand); font: var(--type-label); cursor: pointer; transition: background var(--dur-sm) var(--ease-enter); }
.field .photo-add:hover { background: var(--fill-hover); }
.field .photo-add:focus-within { outline: var(--focus-outline); outline-offset: 2px; }
.chip .ico { color: var(--text-tertiary); }
.chip[aria-pressed="true"] .ico { color: var(--text-brand); }
.dup { margin-top: var(--space-4); }

/* 政治履歷 */
.av.s72 { width: 72px; height: 72px; font-size: 28px; }
.profile-head { display: flex; align-items: center; gap: var(--space-4); }
.profile-head h2 { margin: 0 0 6px; }
.kpi-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-top: var(--space-5); }
.kpi-card { display: grid; gap: 2px; padding: var(--space-4); border-radius: var(--radius-card); background: var(--bg-main); border: 1px solid var(--border-main); box-shadow: var(--shadow-raised); font: var(--type-caption); color: var(--text-secondary); }
.kpi-card .ico { color: var(--st-closed-ink); margin-bottom: 6px; }
.kpi-card b { font: var(--type-title); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.bio { font: var(--type-body); margin: var(--space-5) 0 0; }
.contact { margin-top: var(--space-3); }
.contact-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-primary); text-decoration: none; }
.contact-row .ico { color: var(--text-brand); }
.contact-row b { display: block; font: var(--type-body-strong); }
a.contact-row:hover { background: var(--fill-hover); }
.terms { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.term { padding: var(--space-4); border-radius: var(--radius-card); background: var(--bg-main); border: 1px solid var(--border-main); }
.term-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font: var(--type-body-strong); margin-bottom: 6px; }

/* ⓘ 更多資訊彈窗 */
.h-info { position: relative; display: flex; align-items: center; gap: 4px; }
.info { display: inline-flex; } /* 彈窗相對於整個標題列定位，與標題同寬，不會被面板裁掉 */
.info-btn { position: relative; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-tertiary); cursor: pointer; transition: background var(--dur-sm) var(--ease-enter), color var(--dur-sm) var(--ease-enter); }
.info-btn::after { content: ""; position: absolute; inset: -6px; } /* 可點範圍 44px */
.info-btn:hover, .info-btn[aria-expanded="true"] { background: var(--fill-hover); color: var(--text-brand); }
.info-btn:focus-visible { outline: var(--focus-outline); outline-offset: 2px; }
.info-pop { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; right: 0; max-width: 420px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--neutral-900); color: #fff; font: var(--type-body-sm); font-weight: 400; letter-spacing: 0; box-shadow: var(--shadow-overlay); animation: fade-up var(--dur-md) var(--ease-enter) both; }
.info-pop[hidden] { display: none; }

/* 民代工作台 */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin: var(--space-4) 0; }
.kpi-btn { display: grid; gap: 2px; justify-items: start; padding: 12px; border: 1px solid var(--border-main); border-radius: var(--radius-card); background: var(--bg-main); cursor: pointer; text-align: left; font: var(--type-caption); color: var(--text-secondary);
  transition: background var(--dur-sm) var(--ease-enter), border-color var(--dur-sm) var(--ease-enter), scale var(--dur-sm) var(--ease-enter); }
.kpi-btn:hover { background: var(--bg-surface); }
.kpi-btn:active { scale: .97; }
.kpi-btn b { font: var(--type-title); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.kpi-btn .ico { width: 16px; height: 16px; }
.kpi-btn[aria-pressed="true"] { background: var(--highlight-subtle); border-color: transparent; color: var(--text-brand); }
.kpi-btn.warn b { color: var(--st-stale-ink); }
.desk-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; padding: 12px; border-radius: var(--radius-sm); color: inherit; text-decoration: none; transition: background var(--dur-md) var(--ease-enter), opacity var(--dur-md) var(--ease-enter); }
.desk-row:hover { background: var(--fill-hover); opacity: 1; }
.desk-row.ended { opacity: .6; }
.desk-row .thumb { width: 48px; height: 48px; border-radius: var(--radius-sm); object-fit: cover; }
.desk-row .t { font: var(--type-body-strong); font-size: 15px; margin: 6px 0 4px; }
.desk-row .side { font: var(--type-caption); color: var(--text-tertiary); text-align: right; display: grid; gap: 2px; align-content: start; }
.overdue { display: flex; align-items: center; gap: 6px; font: 700 13px/18px var(--font-sans); color: var(--st-stale-ink); margin-bottom: 4px; }
.overdue .ico { width: 14px; height: 14px; }

/* ---------- 動畫（spec「頁面切換」「趣味時刻」） ---------- */
.t-sheet-in  { animation: sheet-in  var(--dur-lg) var(--ease-enter) both; }
.t-sheet-out { animation: sheet-out var(--dur-md) var(--ease-exit) both; }
.t-push-in   { animation: push-in   var(--dur-md) var(--ease-enter) both; }
.t-pop-in    { animation: pop-in    var(--dur-md) var(--ease-enter) both; }
.t-fade-in   { animation: fade-up   var(--dur-md) var(--ease-enter) both; }
@keyframes sheet-in  { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@media (min-width: 768px) {
  @keyframes sheet-in  { from { transform: translateX(-24px); opacity: 0; } }
  @keyframes sheet-out { to { transform: translateX(-24px); opacity: 0; } }
}
@keyframes push-in { from { transform: translateX(32px); opacity: 0; } }
@keyframes pop-in  { from { transform: translateX(-32px); opacity: 0; } }
@keyframes fade-up { from { transform: translateY(6px); opacity: 0; } }
.pin-drop { animation: pin-drop var(--dur-xl) var(--ease-overshoot) both; }
@keyframes pin-drop { from { transform: translateY(-40px) rotate(-45deg); opacity: 0; } to { transform: rotate(-45deg); opacity: 1; } }
.bump { display: inline-block; animation: bump var(--dur-lg) var(--ease-overshoot); }
@keyframes bump { 40% { transform: scale(1.35); } }
/* ---------- 「修好了」時刻（A 進度走完＋C 插圖被修好＋D 鄰居一起等到了） ----------
   靜態時直接顯示最終畫面；外層加上 .celebrate 才播一次動畫。 */
.av.s32 { width: 32px; height: 32px; font-size: 13px; }
.av.anon { background: var(--st-closed-bg); color: var(--st-closed-ink); }
/* A：狀態膠囊的圖示換成勾並彈一下，進度條最後一段填滿 */
.celebrate .status-lg { animation: fx-pill var(--dur-lg) var(--ease-change) both; }
@keyframes fx-pill { from { background: var(--st-repdone-bg); color: var(--st-repdone-ink); } }
.celebrate .status-lg svg { animation: fx-pop var(--dur-xl) var(--ease-overshoot) var(--dur-md) both; }
@keyframes fx-pop { from { transform: scale(0) rotate(-40deg); } }
.celebrate .stepper .st.now::before { transform-origin: left center; animation: fx-fill var(--dur-md) var(--ease-enter) var(--dur-sm) both; }
@keyframes fx-fill { from { transform: scaleX(0); } }
/* C：分類插圖被修好 */
.fx-hero { position: relative; display: grid; place-items: center; height: 150px; border-radius: var(--radius-card); background: var(--st-closed-bg); color: var(--st-closed-ink); overflow: hidden; }
.fx-hero .fx-art { width: 88px; height: 88px; overflow: visible; }
.fx-art .ln { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.fx-art .fx-bulb { fill: var(--star); stroke: currentColor; stroke-width: 2.5; stroke-linejoin: round; }
.fx-art .fx-beam { fill: var(--star); opacity: .3; }
.fx-art .fx-hole { fill: var(--neutral-500); opacity: 0; }
.fx-art .fx-mark { fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
.fx-art .fx-litter { fill: var(--neutral-500); opacity: 0; }
.fx-hero .fx-generic { display: grid; place-items: center; }
.fx-hero .fx-spark { position: absolute; width: 14px; height: 14px; color: var(--star); }
.fx-hero .fx-cap { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font: var(--type-label); }
.celebrate .fx-hero { animation: fx-bg var(--dur-xl) var(--ease-change) both; }
@keyframes fx-bg { from { background: var(--neutral-100); color: var(--brand-700); } }
.celebrate .fx-bulb { animation: fx-bulb var(--dur-md) var(--ease-enter) 380ms both; }
@keyframes fx-bulb { from { fill: var(--neutral-300); } }
.celebrate .fx-beam { animation: fx-beam var(--dur-xl) var(--ease-enter) 460ms both; }
@keyframes fx-beam { from { opacity: 0; transform: scaleY(.6); transform-origin: top center; } }
.celebrate .fx-hole { animation: fx-hole var(--dur-xl) var(--ease-change) both; transform-box: fill-box; transform-origin: center; }
@keyframes fx-hole { 0%, 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.2, 0); } }
.celebrate .fx-mark { animation: fx-mark var(--dur-md) var(--ease-enter) 420ms both; }
@keyframes fx-mark { from { opacity: 0; } }
.celebrate .fx-litter { animation: fx-litter 640ms var(--ease-exit) both; transform-box: fill-box; transform-origin: center; }
@keyframes fx-litter { 0%, 25% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-6px) scale(.6); } }
.celebrate .fx-generic { animation: fx-hop var(--dur-xl) var(--ease-overshoot) 200ms both; }
@keyframes fx-hop { 40% { transform: translateY(-8px); } }
.celebrate .fx-spark { animation: fx-pop var(--dur-xl) var(--ease-overshoot) both; }
.celebrate .fx-spark:nth-of-type(2) { animation-delay: 120ms; }
.celebrate .fx-spark:nth-of-type(3) { animation-delay: 240ms; }
.celebrate .fx-cap { animation: fx-up var(--dur-md) var(--ease-enter) 520ms both; }
@keyframes fx-up { from { opacity: 0; transform: translateY(6px); } }
/* D：鄰居一起等到了 */
.neighbors { position: relative; display: flex; align-items: center; gap: 10px; margin-top: var(--space-3); font: var(--type-body-sm); color: var(--st-closed-ink); font-weight: 700; }
.neighbors .stackav .av { box-shadow: 0 0 0 2px var(--bg-main); }
.neighbors .hearts { position: absolute; left: 8px; bottom: 100%; display: none; pointer-events: none; }
.neighbors .hearts i { position: absolute; font-style: normal; font-size: 14px; color: var(--brand-400); opacity: 0; }
.celebrate .neighbors .hearts { display: block; }
.celebrate .neighbors .hearts i { animation: fx-heart 1.4s ease-out both; }
.celebrate .neighbors .hearts i:nth-child(2) { left: 18px; animation-delay: .18s; }
.celebrate .neighbors .hearts i:nth-child(3) { left: 36px; animation-delay: .36s; }
@keyframes fx-heart { 0% { opacity: 0; transform: translateY(8px) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-40px) scale(1); } }
.celebrate .neighbors .stackav .av { animation: fx-hop var(--dur-xl) var(--ease-overshoot) both; }
.celebrate .neighbors .stackav .av:nth-child(2) { animation-delay: 120ms; }
.celebrate .neighbors .stackav .av:nth-child(3) { animation-delay: 240ms; }
.skel { border-radius: var(--radius-xs); background: linear-gradient(90deg, var(--bg-subtle) 0, var(--bg-surface) 40%, var(--bg-subtle) 80%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }

@media (prefers-reduced-motion: reduce) {
  .me-dot::after, .locate.busy svg { animation: none; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* 我的回報／追蹤／我 */
.empty { display: grid; justify-items: center; gap: var(--space-3); text-align: center; padding: var(--space-8) var(--space-4); color: var(--text-secondary); }
.empty .cat-tile { width: 64px; height: 64px; border-radius: 50%; }
.empty b { font: var(--type-heading); color: var(--text-primary); }
.group-h { display: flex; align-items: center; gap: 8px; font: var(--type-label); color: var(--text-secondary); margin: var(--space-5) 0 var(--space-1); }
.group-h .n { font-variant-numeric: tabular-nums; color: var(--text-tertiary); }
.group-h.attn { color: var(--text-brand); }
.kpi-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin-top: var(--space-5); }
.kpi-trio a.kpi-card { text-decoration: none; transition: background var(--dur-md) var(--ease-enter); }
.kpi-trio a.kpi-card:hover { background: var(--fill-hover); }
.kpi-trio .kpi-card .ico { color: var(--text-brand); }
.menu { list-style: none; margin: var(--space-6) 0 0; padding: 0; border-radius: var(--radius-card); background: var(--bg-surface); }
.menu > li + li { border-top: 1px solid var(--border-subtle); }
.menu-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; color: var(--text-primary); text-decoration: none; font: var(--type-body); }
.menu-row .ico { color: var(--text-secondary); }
.menu-row .end { margin-left: auto; color: var(--text-tertiary); }
.menu-row .nw { white-space: nowrap; }
.menu-row select { margin-left: auto; min-width: 0; flex: 0 1 auto; }
/* 地圖縮放鈕與圖資標示讓到導覽列上方 */
.maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { bottom: var(--dock-clear); }
@media (min-width: 768px) { .maplibregl-ctrl-bottom-left { bottom: 0; } }

/* ---------- 我的民代與政治履歷（docs/civic-report-rep-directory-ui-spec-2026-12-02.html） ---------- */
/* 分段控制：照 design spec「Chip、分段控制、輸入」；.block 撐滿寬度 */
.seg { position: relative; display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--radius-pill); background: var(--bg-subtle); box-shadow: var(--shadow-recessed); }
.seg button { position: relative; z-index: 1; height: 32px; padding: 0 var(--space-4); border: 0; background: none; border-radius: var(--radius-pill); font: var(--type-label); color: var(--text-secondary); cursor: pointer; transition: color var(--dur-md) var(--ease-change); }
.seg button[aria-selected="true"] { color: var(--text-primary); }
.seg button:focus-visible { outline: var(--focus-outline); outline-offset: 2px; }
.seg .thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; border-radius: var(--radius-pill); background: var(--bg-main); box-shadow: var(--shadow-raised);
  transition: transform var(--dur-lg) var(--ease-change), width var(--dur-lg) var(--ease-change); }
.seg.block { display: flex; width: 100%; }
.seg.block button { flex: 1 1 0; min-width: 0; padding: 0 var(--space-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 表單下拉：spec 的 .select 欄位（44px、外框、8px 圓角），箭頭沿用全站 select 的 chevron */
.field select, .item-row select { display: block; width: 100%; height: var(--control-md); padding: 0 36px 0 var(--space-3); border: 1px solid var(--border-field); border-radius: var(--radius-xs);
  background-color: var(--bg-main); background-position: right 14px center; font: var(--type-body); color: var(--text-primary); }
.field select:hover, .item-row select:hover { background-color: var(--bg-main); border-color: var(--neutral-700); }
.field select:disabled { border-color: var(--border-main); background-color: var(--bg-subtle); color: var(--text-disabled); cursor: not-allowed; }
.field .help { display: block; margin-top: 6px; font: var(--type-caption); color: var(--text-tertiary); }
.fields { display: grid; gap: var(--space-4); }
.check-row { display: flex; align-items: center; gap: 10px; min-height: var(--touch-target); font: var(--type-body); color: var(--text-primary); cursor: pointer; }

/* 「我」頁：地區＋民代頭像列 */
.places { padding: var(--space-1) var(--space-4); border-radius: var(--radius-card); background: var(--bg-surface); }
.place { padding: var(--space-3) 0; }
.place + .place { border-top: 1px solid var(--border-subtle); }
.place-head { display: flex; align-items: center; gap: var(--space-2); }
.place-head > div { min-width: 0; }
.place-head .k { display: block; font: var(--type-caption); color: var(--text-tertiary); }
.place-head b { font: var(--type-body-strong); }
.place-head .btn { margin-left: auto; }
.reel { display: flex; gap: var(--space-3); overflow-x: auto; margin: var(--space-3) calc(-1 * var(--space-4)) 0; padding: 2px var(--space-4) 4px; scrollbar-width: none; scroll-snap-type: x proximity; }
.reel::-webkit-scrollbar { display: none; }
.reel a { display: grid; justify-items: center; gap: 4px; width: 56px; flex: none; color: var(--text-secondary); font: var(--type-caption); text-decoration: none; scroll-snap-align: start; border-radius: var(--radius-xs); }
.reel a:focus-visible { outline: var(--focus-outline); outline-offset: 2px; }
.reel a > span:last-child { max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av.more-av { background: var(--bg-main); color: var(--text-secondary); box-shadow: inset 0 0 0 1px var(--border-main); font-size: 13px; }
.av.ok::after { content: ""; position: absolute; z-index: 1; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 2px var(--bg-surface); }
.av.s72.ok::after { width: 16px; height: 16px; right: 2px; bottom: 2px; box-shadow: 0 0 0 3px var(--bg-main); }

/* 名單 */
.lvl { margin-top: var(--space-4); }
.lvl-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font: var(--type-label); color: var(--text-secondary); }
.lvl-h .n { font-weight: 400; color: var(--text-tertiary); }
.rep-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.rep-row > .rep-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.rep-row .t { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font: var(--type-body-strong); }
.rep-row .s { font: var(--type-body-sm); color: var(--text-secondary); }
.rep-row .btn.nophone { color: var(--text-disabled); }
.lvl-pending { padding: 10px 0; font: var(--type-body-sm); color: var(--text-tertiary); border-bottom: 1px solid var(--border-subtle); }
.lvl .btn.sm.ghost { margin-top: 4px; color: var(--text-brand); }
.s-ok { color: var(--st-closed-ink); background: var(--st-closed-bg); }
.s-wait { color: var(--st-ended-ink); background: var(--st-ended-bg); }
/* 出處標籤：官方紀錄（藍）與本人提供（赤陶）一眼分得出來 */
.src-official { color: var(--info-600); background: var(--info-50); font-weight: 700; }
.src-self { color: var(--brand-700); background: var(--brand-100); font-weight: 700; }

/* 履歷 */
.sec-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sec-h .badge { font-size: 11px; height: 22px; padding: 0 8px; }
.card.pinned { background: var(--bg-brand-subtle); border-color: var(--brand-100); box-shadow: none; }
.kv { display: grid; grid-template-columns: 3em minmax(0, 1fr); gap: 10px 12px; margin: 0; font: var(--type-body-sm); }
.kv dt { color: var(--text-tertiary); }
.kv dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.tlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tlist li { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 12px; font: var(--type-body-sm); }
.tlist time { color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.tlist a { color: var(--text-brand); }
.official-was { display: block; font: var(--type-caption); color: var(--text-tertiary); }
.profile-head .row .muted { font: var(--type-body-sm); }
.claim-line { margin-top: var(--space-8); text-align: center; font: var(--type-body-sm); color: var(--text-tertiary); }
.claim-line button { padding: 0; border: 0; background: none; font: var(--type-label); color: var(--text-brand); cursor: pointer; }

/* 民代編輯履歷 */
.menu-row.locked { color: var(--text-disabled); }
.menu-row .tier { margin-left: auto; font: var(--type-caption); color: var(--text-tertiary); white-space: nowrap; }
.menu-row.locked .tier { color: var(--text-tertiary); }
.edit-form { display: grid; gap: var(--space-4); }
.item-row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.item-row.with-url { grid-template-columns: 6.5em minmax(0, 1fr) auto; }
.item-row .url { grid-column: 2 / 3; }
.count { font: var(--type-caption); color: var(--text-tertiary); text-align: right; }
.kpi-trio.compact .kpi-card b { font: var(--type-heading); white-space: nowrap; }

/* 民代頭像照片：載入中用 .skel 的微光掃過，載入完成從模糊、微放大淡入；載入失敗由 JS 拿掉圖片，退回姓氏 */
.av .av-i { transition: opacity var(--dur-md) var(--ease-change); }
.av.has-img:not(.loaded) { background: linear-gradient(90deg, var(--neutral-200) 0, var(--neutral-100) 40%, var(--neutral-200) 80%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.av.has-img .av-i { opacity: 0; }
.av-img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; opacity: 0; transform: scale(1.08); filter: blur(6px);
  transition: opacity var(--dur-lg) var(--ease-enter), transform var(--dur-xl) var(--ease-enter), filter var(--dur-lg) var(--ease-enter); }
.av.loaded .av-img { opacity: 1; transform: none; filter: none; }
