:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --border: #dde3ea;
  --text: #17202e;
  --muted: #5d6b7d;
  --brand: #13213c;
  --accent: #1f6feb;
  --accent-weak: #e7f0ff;
  --record: #d92d3a;
  --ok: #2f8f4e;
  --ok-weak: #e6f4ea;
  --warn: #a15c00;
  --warn-weak: #fff4dc;
  --error: #b42318;
  --error-weak: #fdecea;
  --mark: #ffe58a;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --radius: 12px;
  --font: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", "Heiti TC", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141c;
    --surface: #171e29;
    --surface-2: #1e2734;
    --border: #2c3747;
    --text: #e6ebf2;
    --muted: #9aa8bb;
    --brand: #c9d6ee;
    --accent: #5b9bff;
    --accent-weak: #1b2a44;
    --record: #ff5c66;
    --ok: #5cc27e;
    --ok-weak: #15301f;
    --warn: #f0b04a;
    --warn-weak: #33270f;
    --error: #ff7b72;
    --error-weak: #3a1a18;
    --mark: #6b5a12;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141c; --surface: #171e29; --surface-2: #1e2734; --border: #2c3747; --text: #e6ebf2; --muted: #9aa8bb;
  --brand: #c9d6ee; --accent: #5b9bff; --accent-weak: #1b2a44; --record: #ff5c66; --ok: #5cc27e; --ok-weak: #15301f;
  --warn: #f0b04a; --warn-weak: #33270f; --error: #ff7b72; --error-weak: #3a1a18; --mark: #6b5a12; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3 { line-height: 1.3; margin: 0; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.05rem; margin-bottom: 10px; }
h3 { font-size: 0.98rem; }
mark { background: var(--mark); color: inherit; border-radius: 2px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 6px 0 0; }

/* ── 頂部列 ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  height: 58px; padding: 0 16px; padding-top: env(safe-area-inset-top);
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.brand img { border-radius: 8px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text small { color: var(--muted); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chip { font-size: 0.75rem; padding: 2px 10px; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.chip-local { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-weak); }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--text);
}
.icon-btn:hover { background: var(--surface-2); }

/* ── 版面 ── */
.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: calc(100vh - 58px); height: calc(100dvh - 58px); }
.sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--surface); min-height: 0; }
.sidebar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 14px 8px; }
.list-search { padding: 4px 14px 8px; }
.list-search input, .panel-toolbar input[type="search"] {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
}
.record-list { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.record-item {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 2px;
  border: 1px solid transparent; border-radius: 10px; background: transparent; cursor: pointer;
}
.record-item:hover { background: var(--surface-2); }
.record-item.active { background: var(--accent-weak); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.record-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-meta { font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.empty-list { color: var(--muted); text-align: center; padding: 28px 12px; font-size: 0.9rem; }
.sidebar-guide { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; border-top: 1px solid var(--border); padding: 12px 14px; color: var(--accent); font: inherit; font-size: 0.9rem; cursor: pointer; text-align: left; }
.sidebar-guide svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sidebar-guide:hover { background: var(--surface-2); }
.storage-line { font-size: 0.75rem; color: var(--muted); padding: 8px 14px 12px; border-top: 1px solid var(--border); }
.main { overflow-y: auto; padding: 22px clamp(16px, 3vw, 36px) 60px; outline: none; }
.main > section { max-width: 920px; margin: 0 auto; }

/* ── 按鈕 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-weight: 600; font-size: 0.92rem; white-space: nowrap;
  text-decoration: none; transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-sm { padding: 5px 12px; font-size: 0.85rem; border-radius: 8px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-record { background: var(--record); border-color: var(--record); color: #fff; }
.btn-record:hover { background: color-mix(in srgb, var(--record) 88%, #000); }
.btn-danger { background: var(--error); border-color: var(--error); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--error) 88%, #000); }
.btn-secondary { background: var(--surface); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 0.85rem; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--error); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; display: inline-block; flex: none; }

/* ── 卡片與提示 ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.alert { border-radius: 10px; padding: 10px 14px; margin: 10px 0; font-size: 0.9rem; }
.alert .btn { margin-left: 8px; }
.alert-info { background: var(--accent-weak); }
.alert-warn { background: var(--warn-weak); color: var(--text); }
.alert-error { background: var(--error-weak); }
.badge { font-size: 0.7rem; padding: 0 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge-ok { color: var(--ok); background: var(--ok-weak); border-color: transparent; }
.badge-warn { color: var(--warn); background: var(--warn-weak); border-color: transparent; }
.badge-busy { color: var(--accent); background: var(--accent-weak); border-color: transparent; }
.badge-rec { color: #fff; background: var(--record); border-color: transparent; }
.tag { font-size: 0.72rem; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.tag-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.tag-pending { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }

/* ── 首頁 ── */
.hero { padding: 18px 4px 22px; }
.hero h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 10px; color: var(--brand); }
.hero p { color: var(--muted); max-width: 680px; margin: 0 0 18px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-actions .btn { padding: 12px 20px; font-size: 1rem; }
.caps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.caps li { display: flex; gap: 10px; align-items: flex-start; }
.caps li span:last-child { display: flex; flex-direction: column; }
.caps small { color: var(--muted); }
.caps .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; flex: none; }
.caps .ok .dot { background: var(--ok); }
.caps .no .dot { background: var(--warn); }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; }

/* ── 詳細頁 ── */
.detail-head { margin-bottom: 14px; }
.title-input {
  width: 100%; font-size: 1.45rem; font-weight: 700; border: 1px solid transparent; border-radius: 10px;
  padding: 4px 8px; margin-left: -8px; background: transparent; color: var(--brand);
}
.title-input:hover { border-color: var(--border); }
.title-input:focus { border-color: var(--accent); outline: none; background: var(--surface); }
.meta-row { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 0.85rem; align-items: center; }
.date-field input { border: 1px solid var(--border); border-radius: 8px; padding: 2px 6px; background: var(--surface); font-size: 0.85rem; }
.player { padding: 12px 16px; position: sticky; top: -22px; z-index: 5; }
.player audio { width: 100%; height: 40px; display: block; }
.player-tools { display: flex; align-items: center; gap: 12px; margin-top: 6px; font-size: 0.85rem; color: var(--muted); }
.player-tools select { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); padding: 1px 4px; }
.player.no-audio { position: static; }

.analysis h2 { margin-bottom: 12px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 4px 0; }
.opt-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.opt-grid select, .opt-grid input[type="range"] { font-weight: 400; color: var(--text); }
.opt-grid select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.analysis-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.analysis-actions .hint { margin: 0 auto 0 0; }
.analysis.running { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.analysis-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.3s ease; }
.analysis-detail { font-size: 0.85rem; color: var(--muted); margin-top: 8px; min-height: 1.4em; }
.analysis-partial { font-size: 0.85rem; color: var(--text); background: var(--surface-2); border-radius: 8px; padding: 0 10px; margin-top: 6px; max-height: 4.8em; overflow: hidden; }
.analysis-partial:not(:empty) { padding: 6px 10px; }
.analysis.compact { padding: 12px 16px; }
.analysis-summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 0.88rem; color: var(--muted); }
.analysis-summary > span { padding-top: 4px; }
.reanalyze { flex: 1 1 100%; }
.reanalyze > summary { list-style: none; display: inline-flex; }
.reanalyze > summary::-webkit-details-marker { display: none; }
.reanalyze:not([open]) { flex: 0 0 auto; }
.reanalyze-body { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--text); }
.warnings { margin-top: 8px; font-size: 0.85rem; color: var(--muted); }
.warnings ul { margin: 6px 0 0; padding-left: 20px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 8px 0 16px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 10px 14px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.empty-panel { color: var(--muted); text-align: center; padding: 36px 16px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty-panel .btn { margin-left: 8px; }

/* ── 逐字稿 ── */
.panel-toolbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 12px; }
.panel-toolbar input[type="search"] { flex: 1 1 220px; width: auto; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); cursor: pointer; }
.segments { display: flex; flex-direction: column; gap: 2px; }
.seg {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 10px 12px 10px 8px;
  border-left: 3px solid var(--spk); border-radius: 4px 10px 10px 4px; background: var(--surface);
  scroll-margin: 120px 0;
}
.seg.review { background: color-mix(in srgb, var(--warn-weak) 55%, var(--surface)); }
.seg.playing { background: var(--accent-weak); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.seg.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { background: var(--mark); } 100% { background: var(--surface); } }
.seg-time { align-self: start; border: 0; background: none; color: var(--accent); cursor: pointer; font-variant-numeric: tabular-nums; font-size: 0.85rem; padding: 3px 0; text-align: right; }
.seg-time:hover { text-decoration: underline; }
.seg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.spk-select {
  border: 0; background: color-mix(in srgb, var(--spk) 14%, transparent); color: var(--spk); font-weight: 700; font-size: 0.82rem;
  border-radius: 99px; padding: 1px 8px; cursor: pointer; max-width: 200px;
}
:root[data-theme="dark"] .spk-select { color: color-mix(in srgb, var(--spk) 60%, #fff); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .spk-select { color: color-mix(in srgb, var(--spk) 60%, #fff); } }
.flag { font-size: 0.72rem; color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); border-radius: 99px; padding: 0 7px; }
.flag-edit { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.seg-text { cursor: text; white-space: pre-wrap; word-break: break-word; border-radius: 6px; padding: 2px 4px; margin: 0 -4px; }
.seg-text:hover { background: var(--surface-2); }
.seg-reasons { margin: 4px 0 0; padding-left: 18px; font-size: 0.8rem; color: var(--warn); }
.seg-tools { display: inline-flex; gap: 14px; margin-left: auto; opacity: 0; transition: opacity 0.15s; }
.seg:hover .seg-tools, .seg:focus-within .seg-tools { opacity: 1; }
@media (hover: none) { .seg-tools { opacity: 1; } }
.seg-editor textarea { width: 100%; min-height: 70px; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 8px; background: var(--surface); resize: vertical; }
.seg-editor-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 6px; }
.seg-editor-actions .hint { margin: 0 auto 0 0; }

/* ── 摘錄 ── */
.ai-card textarea.external { width: 100%; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); resize: vertical; line-height: 1.6; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.summary-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.summary-head h2 { margin: 0; }
.summary-head .hint { margin: 0 auto 0 0; }
.notice { font-size: 0.85rem; color: var(--muted); margin: 10px 0 4px; }
.notice p { margin: 6px 0 0; }
.note-group { margin-top: 18px; }
.note-group h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.note-group .count { font-size: 0.75rem; color: var(--muted); background: var(--surface-2); border-radius: 99px; padding: 0 8px; }
.note-group h3 .link-btn { margin-left: auto; font-weight: 400; }
.note { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--surface); }
.note.checked { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.kind-decision .note { border-left: 3px solid var(--ok); }
.kind-decisionCandidate .note { border-left: 3px solid var(--warn); }
.kind-action .note { border-left: 3px solid var(--accent); }
.note-text { white-space: pre-wrap; }
.note-fields { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; font-size: 0.85rem; color: var(--muted); }
.note-fields input { border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; background: var(--surface); width: 140px; }
.note-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-top: 8px; }
.evidence { display: flex; gap: 6px; flex-wrap: wrap; }
.ev { font-size: 0.78rem; border: 1px solid var(--border); background: var(--surface-2); border-radius: 99px; padding: 0 8px; cursor: pointer; color: var(--accent); }
.ev:hover { border-color: var(--accent); }
.ev-missing { color: var(--muted); cursor: default; }
.note-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ── 說話者 ── */
.speakers { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.speaker-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.spk-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--spk); flex: none; }
.spk-name { flex: 1 1 160px; min-width: 120px; border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; background: var(--surface); font-weight: 600; }
.spk-stats { font-size: 0.82rem; color: var(--muted); }
.spk-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.spk-actions select { border: 1px solid var(--border); border-radius: 8px; padding: 3px 6px; background: var(--surface); font-size: 0.85rem; }

/* ── 匯出 ── */
.export-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.export-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.export-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-weak); }
.export-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.export-btn small { color: var(--muted); font-size: 0.78rem; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.88rem; }
.history li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.danger-zone { border-color: color-mix(in srgb, var(--error) 30%, var(--border)); }

/* ── 設定 ── */
.settings h1 { margin: 4px 0 16px; color: var(--brand); }
.terms { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.9rem; }
.terms th { text-align: left; font-size: 0.8rem; color: var(--muted); font-weight: 600; padding: 4px 6px; }
.terms td { padding: 4px 6px; border-top: 1px solid var(--border); }
.terms td input:not([type="checkbox"]) { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; background: var(--surface); }
.term-add { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.term-add input:not([type="checkbox"]) { flex: 1 1 140px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; background: var(--surface); }
.models, .plain { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; font-size: 0.9rem; }
.models small { color: var(--muted); }
.kv { list-style: none; padding: 0; margin: 0; font-size: 0.9rem; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.kv li span:first-child { color: var(--muted); }

/* ── 錄音浮層 ── */
.recorder { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(8, 12, 20, 0.6); padding: 16px; }
.recorder[hidden] { display: none; }
.recorder-card { width: min(420px, 100%); background: var(--surface); border-radius: 18px; padding: 28px 24px 20px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
.rec-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--record); }
.rec-status .rec-dot { background: var(--record); }
.rec-dot.live { animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.rec-time { font-size: 3rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: 6px 0 12px; letter-spacing: 1px; }
.rec-meter { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.rec-meter-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), var(--warn), var(--record)); transition: width 0.08s linear; }
.rec-hint { color: var(--muted); font-size: 0.85rem; margin: 14px 0; }
.rec-hint.warn { color: var(--warn); background: var(--warn-weak); border-radius: 8px; padding: 8px 10px; font-weight: 600; }
.sample-link { display: inline-block; margin-top: 12px; }
.card.tip { border-left: 4px solid var(--accent); }
.rec-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-bottom: 14px; }
.rec-actions .btn { padding: 12px; font-size: 1rem; }

/* ── 對話框與提示 ── */
.dialog { border: 0; border-radius: 16px; padding: 0; width: min(480px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.dialog::backdrop { background: rgba(8, 12, 20, 0.5); }
.dialog-form { padding: 20px 22px 18px; }
.dialog-form h2 { font-size: 1.1rem; margin-bottom: 10px; }
.dialog-body { font-size: 0.92rem; }
.dialog-body ul { padding-left: 20px; }
.dialog-body .raw { white-space: pre-wrap; background: var(--surface-2); padding: 10px 12px; border-radius: 8px; }
.dialog-form input[name="v"], .dialog-form textarea[name="v"] { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); margin-top: 8px; }
.dialog-actions { display: flex; flex-direction: row-reverse; gap: 8px; margin-top: 18px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60;
  background: #1d2633; color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 0.9rem; max-width: calc(100vw - 32px);
  transition: opacity 0.2s, transform 0.2s; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.drop-hint { position: fixed; inset: 12px; z-index: 70; display: grid; place-items: center; border: 3px dashed var(--accent); border-radius: 20px; background: color-mix(in srgb, var(--accent-weak) 85%, transparent); font-size: 1.3rem; font-weight: 700; color: var(--accent); pointer-events: none; }
.drop-hint[hidden] { display: none; }
.print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; }

/* ── 手機 ── */
.back-btn { margin-left: -8px; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .layout[data-mode="list"] .main { display: none; }
  .layout[data-mode="main"] .sidebar { display: none; }
  .layout[data-mode="list"] .sidebar { border-right: 0; }
  .main { padding: 16px 16px 60px; }
  .chip-local { display: none; }
  .seg { grid-template-columns: 52px minmax(0, 1fr); gap: 8px; }
  .player { top: -16px; }
  .layout[data-mode="list"] .sidebar::after {
    content: "錄音前請告知與會者。資料只存在這個瀏覽器。"; display: block; color: var(--muted); font-size: 0.75rem; text-align: center; padding: 0 14px 12px;
  }
}
@media (min-width: 861px) {
  .back-btn { display: none !important; }
}
