/* ==========================================================================
   管理工具（/admin，v0.62）——站長一個人的工作台。
   先載入 style.css（色票、按鈕、輸入框、.seg、.badge），這裡只放管理頁自己的版面與元件；style.css 由遊戲頁的設計師維護，不要改它。
   設計：延續遊戲的「玄鐵＋琥珀燈火」。總覽用一盞盞油燈標示待處理的事（點著＝要處理、熄了＝沒事），是整頁唯一的強調；
   其餘一律安靜：列表用細線分隔、不堆卡片；標題用明體（--serif），內文用黑體。
   對比：淺色主題的琥珀、綠色在淺底上不到 4.5，這裡另外定義較深的「字用」色（--a-ink、--a-ok…），背景色仍用 style.css 的。
   ========================================================================== */
:root, [data-theme="dark"] {
  --a-ink: #E0A34A; --a-ok: #5FC28C; --a-frost: #8DB4DA; --a-frost-soft: #1B2938; --a-bad: #E57373;
  --a-hover: #232A33; --a-glow: rgba(224, 163, 74, .38); --a-glow-bad: rgba(229, 115, 115, .42);
  --a-on-accent: #1A1408; --a-accent-bg: #E0A34A; --a-backdrop: rgba(4, 6, 9, .66); --a-danger-fill: #C24848;
  --plc-fu-ink: #E8D2FA; --plc-fu-soft: #3C2748; --plc-fu-line: #9A6AB8;
  --fb-builtin: #8DB4DA; --fb-event: #EF8484; --fb-event-cd: #EF8484; --fb-player: #D9C7A0;
}
[data-theme="light"] {
  --a-ink: #8A560C; --a-ok: #23663F; --a-frost: #335F8C; --a-frost-soft: #DCE7F3; --a-bad: #A83232;
  --a-hover: #EEF1F5; --a-glow: rgba(168, 106, 18, .28); --a-glow-bad: rgba(178, 58, 58, .28);
  --a-on-accent: #FFFFFF; --a-accent-bg: #8A560C; --a-backdrop: rgba(20, 28, 40, .45); --a-danger-fill: #B23A3A;
  --plc-fu-ink: #63267E; --plc-fu-soft: #F1E4F7; --plc-fu-line: #9A64B5;
  --fb-builtin: #335F8C; --fb-event: #A83232; --fb-event-cd: #7E2424; --fb-player: #7A6033;
}
@media (prefers-color-scheme: light) {
  [data-theme="system"] {
    --a-ink: #8A560C; --a-ok: #23663F; --a-frost: #335F8C; --a-frost-soft: #DCE7F3; --a-bad: #A83232;
    --a-hover: #EEF1F5; --a-glow: rgba(168, 106, 18, .28); --a-glow-bad: rgba(178, 58, 58, .28);
    --a-on-accent: #FFFFFF; --a-accent-bg: #8A560C; --a-backdrop: rgba(20, 28, 40, .45); --a-danger-fill: #B23A3A;
    --plc-fu-ink: #63267E; --plc-fu-soft: #F1E4F7; --plc-fu-line: #9A64B5;
    --fb-builtin: #335F8C; --fb-event: #A83232; --fb-event-cd: #7E2424; --fb-player: #7A6033;
  }
}
:root { --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif; --nav-w: 240px; }

/* ==========================================================================
   UI-0 共用表單元件（2026-10-19，規格 ui-spec.md 1.2～1.6）
   只新增 .af-*／.w-* 與變數，不改任何既有類別；各區塊之後再逐張換過來。
   ========================================================================== */
:root {
  --af-h: 36px;
  --af-h-sm: 32px;
  --af-lbl: 7.5em;
  --af-gx: 12px;
  --af-gy: 10px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
}
@media (max-width: 900px) {
  :root { --af-h: 40px; --af-h-sm: 36px; }
}

/* 欄寬六級：寬度以字元的 ch 計；.af-f 在手機把字級提到 16px，級距跟著放大。 */
.w-num { inline-size: calc(10ch + 16px); }
.w-num-l { inline-size: calc(14ch + 16px); }
.w-short { inline-size: calc(16ch + 16px); }
.w-name { inline-size: calc(24ch + 16px); }
.w-mid { inline-size: calc(40ch + 16px); }
.w-full { inline-size: 100%; }
.w-fit { inline-size: auto; min-inline-size: 8em; max-inline-size: 24em; field-sizing: content; }
.af-f.w-fit > .af-in > select, select.w-fit { field-sizing: content; }
.w-dt { inline-size: calc(19ch + 40px); }

.af-f, .af-line, .af-kv, .af-rows, .af-actions, .af-drawer, .af-stats, .af-toolbar, .af-chips { font-size: 14px; }

/* 單一欄位（標籤在上） */
.af-f { display: inline-flex; flex-direction: column; gap: var(--sp-1); min-width: 0; max-inline-size: 100%; vertical-align: top; }
.af-l { min-height: 18px; font-size: 12.5px; line-height: 18px; color: var(--muted); white-space: nowrap; }
.af-in { display: flex; align-items: center; block-size: var(--af-h); min-block-size: var(--af-h); inline-size: 100%;
  overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.af-f > .af-in { inline-size: 100%; }
.af-in > input, .af-in > select { flex: 1 1 auto; inline-size: auto; min-inline-size: 0; block-size: 100%; min-block-size: 0;
  padding: 0 8px; border: 0; border-radius: 0; background-color: transparent; }
.af-in > select { padding-inline-end: 30px;
  background-position: calc(100% - 16px) calc(50% - 2px), calc(100% - 11px) calc(50% - 2px); }
.af-in > input[type="number"] { text-align: end; font-variant-numeric: tabular-nums; }
.af-in > textarea { flex: 1 1 auto; inline-size: auto; min-block-size: calc(var(--af-h) * 2); padding: 8px; border: 0; border-radius: 0;
  background: transparent; resize: vertical; }
.af-f > .af-in:has(> textarea) { block-size: auto; min-block-size: var(--af-h); align-items: stretch; }
.af-in:focus-within { outline: 2px solid var(--a-ink); outline-offset: -1px; }
.af-in > input:focus, .af-in > select:focus, .af-in > textarea:focus { outline: 0; }
.af-unit { flex: none; padding: 0 8px 0 2px; font-style: normal; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.af-pre { display: inline-flex; flex: none; align-items: center; align-self: stretch; padding: 0 8px;
  border-inline-end: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.af-f.af-btns > .af-in { gap: 8px; overflow: visible; border: 0; background: transparent; }
.af-f.af-btns > .af-in > button { block-size: var(--af-h); }

/* 一列多欄：標籤固定 18px 高，控制項頂端因此自然對齊 */
.af-line { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--af-gy) var(--af-gx); }
.af-line > .af-help, .af-line > .af-err { flex-basis: 100%; }

/* 標籤在左的表單 */
.af-kv { display: grid; grid-template-columns: var(--af-lbl) minmax(0, 1fr); gap: var(--af-gy) var(--af-gx); align-items: start; }
.af-kv > .af-k { font-size: 13px; line-height: var(--af-h); color: var(--muted); white-space: nowrap; }
.af-kv > .af-v { min-width: 0; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px var(--af-gx); }
.af-kv > .af-v > .af-f { flex: 0 0 auto; }
.af-kv > .af-v > .af-help, .af-kv > .af-v > .af-err { flex-basis: 100%; }

/* 唯讀值與內部代號 */
.af-ro { display: inline-flex; align-items: center; gap: 6px; min-block-size: var(--af-h);
  font-size: 13.5px; line-height: 1.45; color: var(--ink); }
.af-ro .af-id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--muted); }

/* 說明、錯誤、鎖定 */
.af-help { margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.af-err { display: flex; gap: 6px; margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--a-bad); }
.af-err .ic { flex: none; margin-top: .15em; font-size: 14px; }
.af-err:empty, .af-help:empty, .af-err[hidden] { display: none; }
.af-lock { display: inline-flex; align-items: center; gap: 6px; min-block-size: var(--af-h); padding: 0 10px;
  border: 1px dashed var(--line-strong); border-radius: 8px; font-size: 12.5px; color: var(--muted); }

/* 區段與小組 */
.af-sec { padding: var(--sp-4) 0; border-top: 1px solid var(--line); }
.af-sec:first-of-type { padding-top: var(--sp-2); border-top: 0; }
.af-sec + .af-sec { padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.af-sections > .af-sec { padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.af-sections > .af-sec:first-child { padding-top: var(--sp-2); border-top: 0; }
.af-sec-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--sp-3);
  font-size: 14px; font-weight: 700; color: var(--ink); }
.af-sec-h .ic { flex: none; font-size: 16px; color: var(--a-ink); }
.af-sec-h .af-chev { color: var(--muted); transition: transform .15s ease; }
details.af-sec > summary.af-sec-h { cursor: pointer; list-style: none; }
details.af-sec > summary.af-sec-h::-webkit-details-marker { display: none; }
details.af-sec[open] > summary .af-chev { transform: rotate(90deg); }
details.af-sec:not([open]) > summary.af-sec-h { margin-bottom: 0; }
.af-sec-n { font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.af-sec-tools { display: flex; gap: 6px; margin-inline-start: auto; }
.af-sub { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px dashed var(--line); }
.af-sub-h { margin: 0 0 var(--sp-2); font-size: 12.5px; font-weight: 600; color: var(--muted); }

/* 可增減的列 */
.af-rows { display: flex; flex-direction: column; min-width: 0; }
.af-rows-head { display: grid; grid-template-columns: var(--af-cols, minmax(0, 1fr) auto);
  gap: 6px var(--af-gx); padding: 0 0 var(--sp-1); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); white-space: nowrap; }
.af-r { display: grid; grid-template-columns: var(--af-cols, minmax(0, 1fr) auto); align-items: start;
  gap: 6px var(--af-gx); padding: var(--sp-2) 0; border-bottom: 1px dashed var(--line); }
.af-r > * { min-width: 0; }
.af-r.bad { background: var(--danger-soft); outline: 2px solid var(--a-bad); border-radius: 8px; }
.af-r-acts { display: flex; gap: var(--sp-1); justify-self: end; }
.af-add { align-self: flex-start; block-size: var(--af-h-sm); margin-top: var(--sp-2); }

/* 圖示鈕：32px（手機 36px），一定要有 aria-label 與 title */
.af-ibtn { inline-size: var(--af-h-sm); block-size: var(--af-h-sm); min-inline-size: var(--af-h-sm); min-block-size: var(--af-h-sm);
  padding: 0; justify-content: center; color: var(--muted); }
.af-ibtn:hover { color: var(--ink); }
.af-ibtn.danger { color: var(--a-bad); }
.af-ibtn.danger:hover { background: var(--danger-soft); }
.af-ibtn .ic { font-size: 15px; }

/* 操作列：左狀態／危險、右預覽→儲存；可固定在抽屜底部 */
.af-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-3) 0 0; border-top: 1px solid var(--line); }
.af-actions .af-msg { margin-inline-end: auto; font-size: 12.5px; color: var(--muted); }
.af-actions .af-left, .af-actions .af-right { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.af-actions .af-right { margin-inline-start: auto; }
.af-actions > button, .af-actions .af-left > button, .af-actions .af-right > button { block-size: var(--af-h); }
.af-actions.sticky { position: sticky; bottom: 0; z-index: 2; margin: 0 calc(-1 * var(--sp-4));
  padding: var(--sp-3) var(--sp-4); background: var(--raise); box-shadow: 0 -6px 12px -10px rgba(0, 0, 0, .35); }

/* 抽屜外框（UI-0 只做樣式，不套到任何既有區塊） */
.af-drawer { inline-size: 100%; max-inline-size: 760px; padding: 0 var(--sp-4);
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--raise); container: af / inline-size; }
.af-list { min-width: 0; container: af / inline-size; }
.af-dh { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: var(--sp-2);
  min-block-size: calc(var(--af-h) + var(--sp-3) * 2); padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line); background: var(--raise); }
.af-dh > .ic { flex: none; font-size: 18px; color: var(--a-ink); }
.af-dh-t { min-width: 0; margin: 0; font-family: var(--serif); font-size: 18px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.af-dh .badge { flex: none; }
.af-dh > .af-ibtn { margin-inline-start: auto; }
.af-sum { padding: var(--sp-2) 0; border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.af-body { padding-bottom: var(--sp-4); }

/* 摘要列、工具列、篩選籤 */
.af-stats { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); }
.af-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.af-stat-l { font-size: 12px; color: var(--muted); white-space: nowrap; }
.af-stat-v { font-size: 14px; font-weight: 600; color: var(--ink); }
.af-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--af-gy) var(--af-gx);
  padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); }
.af-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: var(--sp-2) 0; }
.af-chips button { block-size: var(--af-h-sm); padding: 0 13px; border-radius: 999px; font-size: 13px; color: var(--muted); background: var(--bg); }
.af-chips button.on, .af-chips button[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--a-ink); font-weight: 600; }

/* 窄容器：標籤改到上方、列變成一列一張小卡、表頭收起 */
@container af (min-width: 520px) and (max-width: 719px) {
  .af-r { grid-template-columns: var(--af-cols-mid, var(--af-cols, minmax(0, 1fr) auto)); }
}
@container af (min-width: 520px) {
  .af-r.has-head .af-l { display: none; }
}
@container af (max-width: 519px) {
  .af-kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .af-kv > .af-k { line-height: 18px; margin-top: var(--sp-2); }
  .af-kv > .af-k:first-child { margin-top: 0; }
  .af-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3) var(--sp-4); }
  .af-rows-head { display: none; }
  .af-r { grid-template-columns: minmax(0, 1fr); }
  .af-r.has-head .af-l { display: block; }
  .af-r-acts { justify-self: stretch; justify-content: flex-end; }
  .af-actions .af-right { flex: 1 1 100%; margin-inline-start: 0; }
  .af-actions .af-right > button { flex: 1 1 0; justify-content: center; }
}

/* 清單容器 <800px：之後換過來的表格用同一組斷點改成卡片 */
@container af (max-width: 799px) {
  .af-list > .af-tbl thead { display: none; }
  .af-list > .af-tbl, .af-list > .af-tbl tbody, .af-list > .af-tbl tr, .af-list > .af-tbl td { display: block; inline-size: 100%; }
  .af-list > .af-tbl tr { padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); }
  .af-list > .af-tbl td { padding: 0; border: 0; }
  .af-list > .af-tbl td[data-l]::before { content: attr(data-l) " "; color: var(--muted); font-size: 12px; }
}

@media (max-width: 900px) {
  .af-f { font-size: 16px; }
  .w-name, .w-mid, .w-fit { max-inline-size: 100%; }
}
@media (max-width: 519px) {
  .af-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3) var(--sp-4); }
  .af-actions .af-right { flex: 1 1 100%; margin-inline-start: 0; }
  .af-actions .af-right > button { flex: 1 1 0; justify-content: center; }
}

/* style.css 的 html, body { overflow-x: hidden } 會讓 body 變成捲動容器，左側導覽的 sticky 就黏不住；管理頁改用 clip（一樣不讓頁面橫向超出） */
html:has(body[data-page="admin"]), body[data-page="admin"] { height: auto; min-height: 100%; overflow-x: clip; }
body[data-page="admin"] { background: var(--bg); }
/* 管理頁專用的覆寫（admin.css 只有 /admin 載入）：對話框、調整清單、提示訊息都不在 .adm 裡，所以掛在 body 底下 */
body a { color: var(--a-ink); }
body a:hover { text-decoration: underline; text-underline-offset: 3px; }
body .badge { color: var(--a-ink); }
body .badge.ok { color: var(--a-ok); }
body .badge.bad { background: var(--danger-soft); color: var(--a-bad); }
body .badge.plain { color: var(--muted); }
body .note { color: var(--a-ink); }
body .seg button.on { color: var(--a-ink); }
body button.primary { background: var(--a-accent-bg); border-color: var(--a-accent-bg); color: var(--a-on-accent); }
body button.danger { color: var(--a-bad); }
body button.danger-fill { background: var(--a-danger-fill); border-color: var(--a-danger-fill); color: #fff; font-weight: 600; }
body .ok { color: var(--a-ok); }
body .warn { color: var(--a-bad); }
body .small { font-size: 12.5px; color: var(--muted); }
body :focus-visible { outline: 2px solid var(--a-ink); outline-offset: 2px; }
body input:focus, body select:focus, body textarea:focus { outline: 2px solid var(--a-ink); outline-offset: -1px; }
body textarea { width: 100%; font: inherit; color: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); resize: vertical; min-height: 64px; }
body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.grow { flex: 1; }
.num-t { font-variant-numeric: tabular-nums; }

/* ---------- 整體版面：左側固定導覽＋內容 ---------- */
.adm { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.nav { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--line); background: var(--paper); padding: 18px 12px 16px; }
.nav-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 14px; }
.nav-brand .lamp { font-size: 30px; color: var(--accent); flex: none; filter: drop-shadow(0 0 6px var(--a-glow)); }
.nav-bt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.nav-bt b { font-family: var(--serif); font-size: 18px; font-weight: 700; letter-spacing: .04em; }
.nav-bt span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.nav-theme { width: 34px; height: 34px; padding: 0; justify-content: center; color: var(--muted); }
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-g { font-size: 12px; color: var(--muted); padding: 14px 10px 6px; letter-spacing: .08em; }
.nav-g:first-child { padding-top: 2px; }
.nav-list a { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 9px; color: var(--ink); font-size: 14px; text-decoration: none; position: relative; }
.nav-list a .ic { font-size: 17px; color: var(--muted); }
.nav-list a span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-list a:hover { background: var(--a-hover); text-decoration: none; }
.nav-list a[aria-current="page"] { background: var(--accent-soft); color: var(--a-ink); font-weight: 600; }
.nav-list a[aria-current="page"] .ic { color: var(--a-ink); }
.nav-list a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.cnt { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center;
  background: var(--accent-soft); color: var(--a-ink); font-variant-numeric: tabular-nums; }
.cnt.bad { background: var(--danger-soft); color: var(--a-bad); }
.cnt:empty { display: none; }
.nav-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.reauth { height: auto; min-height: 36px; padding: 6px 10px; border-radius: 9px; font-size: 12.5px; white-space: normal; text-align: left; line-height: 1.4;
  color: var(--muted); background: transparent; border: 1px dashed var(--line-strong); justify-content: flex-start; }
.reauth .ic { font-size: 16px; flex: none; }
.reauth .s { display: none; }
.reauth.on { color: var(--a-ok); border-style: solid; border-color: var(--a-ok); background: var(--ok-soft); }
.nav-who { font-size: 12.5px; color: var(--muted); padding: 0 4px; overflow-wrap: anywhere; }
.nav-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px; }

.main { min-width: 0; padding: 30px clamp(16px, 3.4vw, 44px) 140px; }
.pane { max-width: 1080px; }
.pane[hidden] { display: none; }
.pane-hd { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 6px; }
.pane-t { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 700; letter-spacing: .03em; line-height: 1.3; }
.pane-t:focus { outline: none; }
.pane-sum { color: var(--muted); font-size: 13px; min-width: 0; }
.pane-tools { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.pane-hd .seg { width: auto; margin-left: auto; }
.pane-hd .seg button { padding: 0 14px; height: 32px; font-size: 13px; }
.pane-lead { margin: 4px 0 18px; max-width: 70ch; color: var(--muted); font-size: 13.5px; line-height: 1.8; }
.pane-lead b { color: var(--ink); }
.blk-t { margin: 30px 0 8px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.blk-t .ic { color: var(--a-ink); }
.link-more { font-size: 13px; }
.box { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.box + .box { margin-top: 12px; }
.adm .empty { padding: 22px 4px; color: var(--muted); font-size: 13.5px; text-align: left; }
.loading { padding: 18px 4px; color: var(--muted); font-size: 13px; }
.err-line { color: var(--a-bad); font-size: 13px; }

/* ---------- 工具列（搜尋、篩選、排序） ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-bottom: 10px; }
.search { flex: 1 1 260px; min-width: 0; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--muted); }
.search:focus-within { border-color: var(--a-ink); }
.search input { border: 0; background: transparent; height: 100%; padding: 0; outline: none; min-width: 0; color: var(--ink); }
.search input:focus { outline: none; }
.sel { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.sel select { width: auto; min-width: 9em; color: var(--ink); }
.sel input { width: 6em; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chips button { height: 32px; padding: 0 13px; border-radius: 999px; font-size: 13px; color: var(--muted); background: var(--bg); }
.chips button.on { background: var(--accent-soft); color: var(--a-ink); border-color: var(--accent); font-weight: 600; }
.more-row { display: flex; justify-content: center; padding: 14px 0; }
.more-row button { min-width: 160px; justify-content: center; }

/* ---------- 總覽：案頭的燈 ---------- */
.ov-head { margin: 14px 0 4px; font-family: var(--serif); font-size: clamp(24px, 3.2vw, 34px); font-weight: 700; line-height: 1.35; letter-spacing: .02em; max-width: 24em; }
.ov-todo { border-bottom: 1px solid var(--line); margin-top: 6px; }
.todo { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 2px 14px; padding: 14px 4px; border-top: 1px solid var(--line); }
.todo .lamp { grid-row: span 2; font-size: 30px; color: var(--muted); justify-self: center; }
.todo.lv-urgent .lamp { color: var(--danger); filter: drop-shadow(0 0 7px var(--a-glow-bad)); }
.todo.lv-attn .lamp { color: var(--accent); filter: drop-shadow(0 0 7px var(--a-glow)); }
.todo .tt { font-size: 15px; font-weight: 600; min-width: 0; }
.todo .td { grid-column: 2; font-size: 13px; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.todo .go { grid-column: 3; grid-row: 1 / span 2; }
.btn-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--raise); color: var(--ink) !important; font-size: 14px; text-decoration: none !important; }
.btn-link:hover { border-color: var(--line-strong); }
.btn-link.primary { background: var(--a-accent-bg); border-color: var(--a-accent-bg); color: var(--a-on-accent) !important; font-weight: 600; }
.todo.lv-urgent .tt { color: var(--a-bad); }
@keyframes lamp-light { 0% { opacity: 0; transform: translateY(2px) scale(.7); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
.todo.lit .lamp { transform-origin: 50% 80%; animation: lamp-light .55s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }

/* 時間線（最近的操作、操作紀錄） */
.feed { display: flex; flex-direction: column; }
.feed-row { display: grid; grid-template-columns: 128px minmax(0, 1fr) auto; gap: 4px 18px; padding: 13px 2px; border-top: 1px solid var(--line); align-items: start; }
.feed-row:last-child { border-bottom: 1px solid var(--line); }
.feed-row time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 1px; }
.feed-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.feed-l1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.feed-l1 .act { font-weight: 600; }
.feed-l1 .who { font-size: 12.5px; color: var(--muted); }
.feed-why { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.feed-why b { color: var(--ink); font-weight: 500; }
.feed-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.chg { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.chg li { display: flex; flex-wrap: wrap; gap: 2px 8px; overflow-wrap: anywhere; }
.chg .lb { color: var(--muted); }
.chg .old { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.chg .arr { color: var(--muted); font-size: 12px; align-self: center; }
.chg .new { color: var(--ink); font-weight: 500; }
.undone { font-size: 12.5px; color: var(--muted); }

/* ---------- 列表（試玩碼、備份、回收桶…）：細線分隔的列，不堆卡片 ---------- */
.rows { display: flex; flex-direction: column; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 2px; border-top: 1px solid var(--line); min-width: 0; }
.rows > .row:last-child { border-bottom: 1px solid var(--line); }
.row .nm { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.row .dt { flex: 1 1 240px; min-width: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.row .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.npab-lead { margin: 0 0 8px; }
#npcBkList .row { min-height: 54px; }
#npcBkList .row .badge, #npcBkList .row .acts { flex: none; }
.npab-list { margin: 2px 0 12px; }
.npab-one { padding: 10px 0 12px; border-top: 1px solid var(--line); }
.npab-one:first-child { border-top: 0; }
.npab-h { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-width: 0; }
.npab-h b { font-family: var(--serif); font-size: 15px; overflow-wrap: anywhere; }
.npab-h .badge { flex: none; }
.npab-pick { display: inline-flex; align-items: center; gap: 7px; margin: 7px 0 5px; font-size: 13px; white-space: nowrap; }
.npab-one .diff { margin-top: 3px; }
.npab-one .diff td:last-child { line-height: 1.55; }
.npab-adv { margin-top: 7px; font-size: 12.5px; color: var(--muted); }
.npab-adv summary { cursor: pointer; }
.npab-adv pre { margin: 6px 0 0; padding: 8px 10px; max-height: 220px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.npab-tomb { margin-top: 4px; gap: 4px; }
.kv-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; font-size: 13.5px; }
.kv-list > span { color: var(--muted); }
.kv-list > b { font-weight: 500; overflow-wrap: anywhere; }
.kv-list b .ic { vertical-align: -2px; margin-right: 4px; }

/* 舊區塊沿用的元件（健檢、試玩碼、翻譯、數值、復原；測試也看這些 class） */
.adm-list { display: flex; flex-direction: column; gap: 12px; }
.adm-group, .adm-card { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.adm-gh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.adm-gh b { overflow-wrap: anywhere; }
.adm-gh .grow { flex: 1; }
.adm-gh + .adm-gd { flex: 1 1 100%; margin-top: -2px; color: var(--muted); font-size: 12.5px; line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; }
.adm-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.adm-row .nm { font-weight: 600; min-width: 7em; overflow-wrap: anywhere; }
.adm-row .dt { flex: 1 1 220px; min-width: 0; color: var(--muted); overflow-wrap: anywhere; }
.adm-row .sug { flex: 0 1 auto; min-width: 0; font-size: 12.5px; color: var(--muted); white-space: normal; overflow-wrap: anywhere; }
.adm-row .sug b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.adm-row .sug i { display: block; font-style: normal; }
.adm-row .pass-edit { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; width: 100%; padding-top: 2px; }
.adm-row .pass-edit .pe { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.adm-row .pass-edit input { width: 5.5em; min-width: 0; }
.adm-row .pass-edit select { max-width: 13em; min-width: 0; }
.adm-row .row-msg { font-size: 12px; }
.adm-row .row-msg:empty { display: none; }
.adm-row .saved { color: var(--a-ok); font-size: 12px; }
.rows .adm-row { border-top: 1px solid var(--line); padding: 12px 2px; }
.rows .adm-row:last-child { border-bottom: 1px solid var(--line); }
.adm-kv { display: flex; gap: 10px; font-size: 13px; }
.adm-kv span { color: var(--muted); min-width: 5em; }
.adm-kv b { font-weight: 500; overflow-wrap: anywhere; }
.adm-kv.adm-empty summary { cursor: pointer; color: var(--muted); min-width: 0; font-weight: 500; }
.adm-kv.adm-empty summary::marker { color: var(--muted); }
.adm-kv.adm-empty[open] summary { margin-bottom: 4px; }
.adm-empty-list { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.adm-ok { display: flex; align-items: center; gap: 8px; color: var(--a-ok); padding: 14px 2px; font-weight: 500; }
.adm-q { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.adm-q .seg { width: auto; }
.adm-q input:not([type=checkbox]) { flex: 1 1 200px; min-width: 0; }
.adm-q select { width: auto; }
.adm-q label.small { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.adm-q input[type=checkbox] { flex: none; width: 18px; height: 18px; min-height: 0; padding: 0; }
.adm-add { margin-top: 14px; }
.adm-add summary { cursor: pointer; padding: 6px 0; }
.adm-scroll { overflow-x: auto; }
.adm-tbl { border-collapse: collapse; font-size: 13px; width: 100%; }
.adm-tbl th { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.adm-tbl th, .adm-tbl td { padding: 6px 8px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
.adm-tbl input { width: 4.6em; height: 30px; padding: 0 6px; }
.adm-tbl .rk { color: var(--muted); }
.adm .tr-t { width: 100%; min-height: 38px; resize: vertical; font: inherit; color: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.small-btn { height: 30px; padding: 0 11px; font-size: 12.5px; }
.code-new { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 22px; letter-spacing: .1em; font-weight: 600; padding: 6px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line-strong); }
.once { border-color: var(--accent); background: var(--accent-soft); }
.once .small { color: var(--ink); }

/* ---------- 試玩碼（2026-10-15 重排）：摘要＋建立表單＋一碼一列（電腦對齊成表格、手機成卡片；看 #ptBox 自己的寬度），調整在列下展開 ---------- */
#ptBox { display: flex; flex-direction: column; gap: 14px; container-type: inline-size; }
#ptBox > .pt-intro { margin: 0; font-size: 13.5px; color: var(--muted); }
.pt-rules { margin: -8px 0 0; font-size: 13px; color: var(--muted); }
.pt-rules summary { cursor: pointer; display: inline-block; color: var(--a-ink); }
.pt-rules .pane-lead { margin: 6px 0 0; }
.pt-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pt-sum { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); gap: 4px 32px; justify-content: start; min-width: 0; }
.pt-s { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pt-s span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pt-s b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-s b em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 4px; }
.pt-form { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px 12px; align-items: end; }
.pt-h { grid-column: 1 / -1; margin: 0; font-size: 13px; font-weight: 700; color: var(--a-ink); letter-spacing: .04em; }
.pt-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pt-f > span { font-size: 12px; color: var(--muted); }
.pt-f input, .pt-f select { width: 100%; min-width: 0; }
.f-name, .f-bind, .f-days { grid-column: span 4; }
.f-model { grid-column: span 6; }
.f-daily, .f-total { grid-column: span 3; }
.pt-go { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pt-msg { margin: 0; flex: 1 1 200px; font-size: 13px; color: var(--muted); min-height: 1.4em; }
.pt-msg:empty { display: none; }
.pt-once { border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pt-once-h { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 14px; }
.pt-once-h .ic { color: var(--a-ink); font-size: 18px; flex: none; }
.pt-once-h span { font-size: 13px; color: var(--ink); }
.pt-once-c { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.pt-once .code-new { font-size: 26px; padding: 8px 14px; user-select: all; }
.pt-once .pt-sub { margin: 0; color: var(--ink); opacity: .8; }
.pt-list { display: flex; flex-direction: column; }
.pt-owner { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.pt-owner.off { border-style: dashed; }
.pt-owner .pt-c { flex: 1 1 240px; }
.pt-owner .row-msg { flex-basis: 100%; }
.pt-ok-ic { display: inline-flex; color: var(--a-ink); font-size: 18px; flex: none; }
.pt-head, .pt-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 100px 80px 156px 60px 142px; align-items: center; gap: 0 10px; }
.pt-head { padding: 0 2px 6px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.pt-item { border-bottom: 1px solid var(--line); }
.pt-row { padding: 10px 2px; }
.pt-c { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pt-nm { font-size: 14.5px; overflow-wrap: anywhere; }
.pt-sub { font-size: 12px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.pt-sub code { color: var(--muted); font-size: 12px; }
.pt-v { font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-use { align-items: flex-start; gap: 4px; }
.pt-use .badge { white-space: normal; line-height: 1.4; max-width: 100%; }
.pt-meter { display: block; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin: 2px 0; }
.pt-meter b { display: block; height: 100%; background: var(--a-ink); border-radius: 2px; }
.pt-meter.hot b { background: var(--a-bad); }
.pt-st { align-items: flex-start; }
.pt-act { flex-direction: row; align-items: center; gap: 6px; justify-self: end; }
.pt-edit[aria-expanded="true"] { color: var(--a-ink); border-color: var(--a-ink); }
.pt-edit .ic { font-size: 14px; }
.pt-item.off .pt-name, .pt-item.off .pt-use, .pt-item.off .pt-day, .pt-item.off .pt-tot, .pt-item.off .pt-exp { opacity: .62; }
.pt-item .row-msg { display: block; padding: 0 2px 8px; font-size: 12.5px; color: var(--a-bad); }
.pt-item .row-msg:empty { display: none; }
.pt-panel { margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); display: flex; flex-direction: column; gap: 12px; }
.pt-panel[hidden] { display: none; }
.pt-ed { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; }
.pt-eg { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pt-eg > b { font-size: 13px; }
.pt-ei { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.pt-ei input { width: 5.5em; flex: none; height: 32px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.pt-ei select { flex: 1 1 8em; min-width: 0; height: 32px; }
.pt-ed2 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding-top: 10px; border-top: 1px dashed var(--line); }
.pt-ed2 .saved { margin-right: auto; color: var(--a-ok); font-size: 12.5px; }
@container (max-width: 800px) {
  .rk-rules { margin-bottom: 6px; }
  .pt-head { display: none; }
  .pt-list { gap: 10px; }
  .pt-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 2px; background: var(--paper); }
  .pt-item.off { border-style: dashed; }
  .pt-row { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-areas: "name name name st" "use use use use" "day day tot tot" "exp exp exp exp" "act act act act"; gap: 8px 10px; padding: 0 0 10px; align-items: start; }
  .pt-name { grid-area: name; } .pt-use { grid-area: use; flex-direction: row; flex-wrap: wrap; } .pt-day { grid-area: day; } .pt-tot { grid-area: tot; }
  .pt-exp { grid-area: exp; } .pt-st { grid-area: st; justify-self: end; } .pt-act { grid-area: act; justify-self: stretch; }
  .pt-act button { flex: 1 1 0; justify-content: center; height: 36px; }
  .pt-nm { font-size: 16px; }
  .pt-use:empty { display: none; }
  .pt-ed { grid-template-columns: minmax(0, 1fr); }
  .pt-panel { margin: 0 0 12px; }
  .pt-ei input { height: 38px; } .pt-ei select { height: 38px; }
  .pt-ed2 button { flex: 1 1 auto; justify-content: center; height: 36px; }
  .pt-ed2 .saved { flex-basis: 100%; }
  .pt-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
  .pt-top { flex-wrap: wrap; }
  .pt-top > button { flex: 1 1 100%; justify-content: center; }
  .pt-owner { padding: 10px; }
  .pt-owner .pt-c { flex-basis: calc(100% - 44px); }
}
@container (max-width: 560px) {
  .f-name, .f-bind, .f-days, .f-model, .f-daily, .f-total { grid-column: 1 / -1; }
  .pt-go button { flex: 1 1 100%; justify-content: center; }
  .pt-once .code-new { font-size: 22px; }
  .pt-once-c button { flex: 1 1 40%; justify-content: center; }
}

/* ---------- 狀態標記（不只靠顏色：一律有字，凍結另有雪花） ---------- */
.st { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.st .ic { font-size: 13px; }
.st-active { color: var(--a-ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.st-frozen { color: var(--a-frost); background: var(--a-frost-soft); }
.st-deleted { color: var(--a-bad); background: var(--danger-soft); }
.st-admin { color: var(--a-ink); background: var(--accent-soft); }
.st-plain { color: var(--muted); border-color: var(--line); font-weight: 500; }
/* 玩家剛剛還有動作（取代原本的整條黃色警告；完整提醒在 title 與 .sr-only） */
.st-live { color: var(--a-ink); background: var(--accent-soft); border-color: color-mix(in srgb, var(--a-ink) 45%, transparent); cursor: help; }
.st-live .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hid { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 999px; padding: 1px 8px; white-space: nowrap; font-weight: 500; }
.hid .ic { font-size: 12px; }

/* ---------- 玩家清單 ---------- */
.ptbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ptbl th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.ptbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
/* 表頭排序鈕（共用元件 sortableTable，所有管理頁的表一樣） */
button.sk { display: inline-flex; align-items: center; gap: 4px; height: 26px; margin: -3px -6px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-weight: inherit; cursor: pointer; white-space: nowrap; }
button.sk:hover { background: var(--a-hover); color: var(--ink); }
button.sk .sk-i { display: inline-flex; }
button.sk .ic { font-size: 13px; flex: none; opacity: .5; }
button.sk.on { color: var(--a-ink); font-weight: 600; }
button.sk.on .ic { opacity: 1; fill: currentColor; stroke: none; }
.sk-sep { color: var(--muted); margin: 0 2px; }
.sk-m { display: none; }
.sk-m select { width: auto; min-width: 9em; color: var(--ink); }
.ptbl tbody tr { cursor: pointer; }
.ptbl tbody tr:hover { background: var(--a-hover); }
.ptbl .who a { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.ptbl .who a:hover { color: var(--a-ink); }
.ptbl .pid { display: block; font-size: 12px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ptbl .t2 { display: block; font-size: 12px; color: var(--muted); }
.ptbl .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ptbl .why { font-size: 12.5px; color: var(--muted); }
.ptbl .why li { margin: 2px 0; }
.ptbl ul { margin: 0; padding-left: 16px; }
.ptbl .acts { white-space: nowrap; text-align: right; }
.ptbl .acts button { margin-left: 4px; }
.segbar { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.segbar svg { width: 64px; height: 8px; flex: none; }
.segbar .d { fill: var(--accent); }
.segbar .n { fill: var(--line-strong); }

/* 全體主線統計：每一節兩條橫條（完成幾位、停在這節幾位） */
.cs-sum { font-size: 15px; line-height: 1.8; margin: 14px 0 10px; max-width: 60ch; }
.cs-sum b { font-variant-numeric: tabular-nums; }
/* 用量統計：每位玩家一列，點開看呼叫種類與模型 */
.us-list { border-top: 1px solid var(--line); }
.us-p { border-bottom: 1px solid var(--line); }
.us-p > summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 10px 2px; cursor: pointer; list-style: none; }
.us-p > summary::-webkit-details-marker { display: none; }
.us-p > summary:focus-visible { outline: 2px solid var(--a-ink); outline-offset: 2px; border-radius: 4px; }
.us-nm, .us-v { min-width: 0; overflow-wrap: anywhere; }
.us-v { text-align: right; font-variant-numeric: tabular-nums; }
.us-nm .sub, .us-v .sub, .dtbl td .sub { display: block; font-size: 12px; color: var(--muted); }
.us-in { padding: 0 2px 14px; }
.cs-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--muted); margin: 4px 0 6px; }
.cs-legend i { display: inline-block; width: 18px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 6px; }
.cs-legend .k-done { background: var(--accent); }
.cs-legend .k-here { border: 1.5px solid var(--a-frost); background: var(--a-frost-soft); }
.cs-rows { display: flex; flex-direction: column; }
.cs-row { display: grid; grid-template-columns: minmax(150px, 15em) minmax(0, 1fr); gap: 4px 18px; padding: 12px 0; border-top: 1px solid var(--line); align-items: center; }
.cs-row:last-child { border-bottom: 1px solid var(--line); }
.cs-nt { font-family: var(--serif); font-size: 15px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.cs-nt small { display: block; font-family: inherit; font-size: 12px; color: var(--muted); font-weight: 500; }
.cs-bars { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cs-bar { display: grid; grid-template-columns: minmax(0, 1fr) 7.5em; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.cs-bar svg { width: 100%; height: 12px; display: block; }
.cs-bar .tr { fill: var(--line); }
.cs-bar .done { fill: var(--accent); }
.cs-bar .here { fill: var(--a-frost-soft); stroke: var(--a-frost); stroke-width: 1.5; }
.cs-bar b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- 單一玩家 ---------- */
.crumb { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; margin-bottom: 10px; }
.crumb .ic { font-size: 16px; }
.pd-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; }
.pd-top .crumb { margin-bottom: 0; }
.pd-reload { display: inline-flex; align-items: center; gap: 10px; }
.pl-reload { margin: 2px 0 6px; }
.pd-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 14px; }
.pd-name { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.pd-name:focus { outline: none; }
.pd-tags { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 5px; }
.pd-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px 22px; margin: 16px 0 8px; }
.pd-more { margin: 0 0 14px; }
.pd-more > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; font-size: 12.5px; color: var(--muted); list-style: none; }
.pd-more > summary::-webkit-details-marker { display: none; }
.pd-more > summary::before { content: ""; width: 0; height: 0; border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .15s; }
.pd-more[open] > summary::before { transform: rotate(90deg); }
.pd-more > summary:hover { color: var(--ink); }
.pd-more > summary:focus-visible { outline: 2px solid var(--a-ink); outline-offset: 2px; border-radius: 4px; }
.pd-more .pd-facts { margin: 6px 0 0; }
.pd-facts div { min-width: 0; }
.pd-facts dt { font-size: 12px; color: var(--muted); }
.pd-facts dd { margin: 2px 0 0; font-size: 13.5px; overflow-wrap: anywhere; }
.pd-facts dd small { color: var(--muted); font-size: 12px; }
.copy { height: 26px; padding: 0 8px; font-size: 12px; gap: 4px; vertical-align: 1px; margin-left: 4px; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.7; margin: 0 0 10px; border: 1px solid var(--line); }
.banner .ic { font-size: 18px; flex: none; margin-top: 2px; }
.banner.b-warn { border-color: var(--accent); background: var(--accent-soft); }
.banner.b-warn .ic { color: var(--a-ink); }
.banner.b-frost { background: var(--a-frost-soft); border-color: transparent; }
.banner.b-frost .ic { color: var(--a-frost); }
.banner.b-bad { background: var(--danger-soft); border-color: transparent; }
.banner.b-bad .ic { color: var(--a-bad); }
.banner b { font-weight: 600; }
.banner .bx { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.banner button { margin-top: 4px; }

/* 動作列：日常 ｜ 帳號 ｜ 危險（推到右邊、紅框），不能做的停用並寫原因 */
/* 2026-10-12 甲・分組標籤列：一排一種用途，左邊寫用途 */
.acts-bar { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 16px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); margin: 4px 0 6px; }
.acts-bar .acts-lbl { font-size: 12px; color: var(--muted); letter-spacing: .1em; white-space: nowrap; }
.acts-bar .acts-lbl.d { color: var(--a-bad); }
.acts-bar .grp { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.acts-bar .grp.danger-g { padding-top: 10px; border-top: 1px dashed color-mix(in srgb, var(--danger) 40%, var(--line)); }
.acts-bar .acts-lbl.d { align-self: stretch; display: flex; align-items: center; padding-top: 10px; border-top: 1px dashed color-mix(in srgb, var(--danger) 40%, var(--line)); }
.acts-bar .grp.danger-g button { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); color: var(--a-bad); }
.acts-bar button .ic { font-size: 16px; }
.acts-why { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; display: flex; gap: 6px; align-items: flex-start; }
.acts-why .ic { flex: none; margin-top: 2px; }
.notices { margin: 8px 0 12px; }
.notices .row .dt { color: var(--ink); }

.pd-body { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: 26px; margin-top: 18px; align-items: start; }
.pd-tabs { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 1px; }
.pd-tg { font-size: 12px; color: var(--muted); padding: 12px 10px 4px; letter-spacing: .06em; }
.pd-tg:first-child { padding-top: 0; }
.pd-tab { height: 34px; border: 0; background: transparent; color: var(--ink); justify-content: flex-start; font-size: 13.5px; border-radius: 8px; padding: 0 10px; gap: 8px; width: 100%; }
.pd-tab .ic { font-size: 15px; color: var(--muted); }
.pd-tab:hover { background: var(--a-hover); }
.pd-tab[aria-selected="true"] { background: var(--accent-soft); color: var(--a-ink); font-weight: 600; }
.pd-tab[aria-selected="true"] .ic { color: var(--a-ink); }
.pd-tab .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: auto; }
.pd-panel { min-width: 0; }
.tab-hd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.tab-t { margin: 0; font-size: 18px; font-weight: 700; font-family: var(--serif); }
.tab-t:focus { outline: none; }
.tab-hd .tools { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.edit-on { border-color: var(--accent) !important; color: var(--a-ink) !important; background: var(--accent-soft) !important; }
.editing .edit-hint { display: flex; }
.edit-hint { display: none; gap: 8px; align-items: center; font-size: 13px; color: var(--ink); background: var(--accent-soft); border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; }
.edit-hint .ic { color: var(--a-ink); flex: none; }

/* 資料表（數值、背包、武學…） */
.dtbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dtbl th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 7px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.dtbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dtbl td.n { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtbl td.nw { white-space: nowrap; }
.st-model-table th, .st-model-table td { padding-left: 6px; padding-right: 6px; }
.st-model-table td:first-child code { white-space: nowrap; font-size: 12px; }
.dtbl .sub { display: block; font-size: 12px; color: var(--muted); }
.dtbl input[type=number], .dtbl select, .fx input[type=number], .fx select { height: 32px; padding: 0 8px; width: 6.5em; }
.dtbl select, .fx select { width: auto; min-width: 7em; padding-right: 28px; }
.dtbl input.changed, .fx input.changed, .dtbl select.changed, .fx select.changed { border-color: var(--accent); background: var(--accent-soft); }
.dtbl .bag-gh td { background: var(--accent-soft); }
@media (max-width: 900px) { .dtbl.stack tr.bag-gh { padding: 10px 8px; } }
.bag-gh-in { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.bag-gh-in label { display: inline-flex; align-items: center; gap: 6px; }
.bag-gh-help > summary { cursor: pointer; display: inline-block; padding: 0 6px; color: var(--muted); }
.bag-gh-help p { margin: 4px 0 0; color: var(--muted); max-width: 46em; }
.bar2 { position: relative; height: 8px; border-radius: 4px; background: var(--line); width: 100%; min-width: 80px; overflow: hidden; }
.bar2 i { position: absolute; top: 0; bottom: 0; left: 0; background: var(--accent); border-radius: 4px; }
.bar2.bi::after { content: ""; position: absolute; left: 50%; top: -1px; bottom: -1px; width: 1px; background: var(--line-strong); }
.bar2.neg i { background: var(--danger); }
.sec2 { margin-top: 26px; }
.sec2:first-child { margin-top: 0; }
.sec2 > h3 { margin: 0 0 8px; font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sec2 > h3 .ic { color: var(--a-ink); }
.fx { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); }
.fx label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.fx input:not([type=checkbox]):not([type=number]) { height: 34px; width: auto; flex: 1 1 140px; min-width: 0; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.chk input { width: 18px; height: 18px; padding: 0; flex: none; accent-color: var(--accent); }
.tog[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--a-ink); }

/* 人物 */
.npc-list { display: flex; flex-direction: column; }
.npc { border-top: 1px solid var(--line); }
.npc:last-child { border-bottom: 1px solid var(--line); }
.npc > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(120px, 1.2fr) minmax(160px, 1fr) minmax(0, .9fr); align-items: center; gap: 4px 16px; padding: 11px 4px; }
.npc > summary::-webkit-details-marker { display: none; }
.npc > summary:hover { background: var(--a-hover); }
.npc .nn { font-weight: 600; overflow-wrap: anywhere; }
.npc .nn small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.npc .aff { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; font-size: 13px; }
.npc .aff .bar2 { flex: 1; }
.npc .tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.npc-bd { padding: 4px 4px 14px; display: flex; flex-direction: column; gap: 10px; }
.npc-facets { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; font-size: 13px; }
.npc-facets .f { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.npc-facets .f .ic { flex: none; margin-top: 3px; }
.npc-facets .f.on .ic { color: var(--a-ok); }
.npc-facets .f.off { color: var(--muted); }
.npc-facets .f span { overflow-wrap: anywhere; }
.npc-hist { font-size: 12.5px; color: var(--muted); margin: 0; padding-left: 18px; }

/* 主線時間軸 */
.tl { position: relative; padding-left: 26px; }
.tl::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-node { position: relative; padding: 4px 0 18px; }
.tl-node::before { content: ""; position: absolute; left: -23px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--line-strong); }
.tl-node.done::before { background: var(--accent); border-color: var(--accent); }
.tl-node.active::before { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.tl-h b { font-family: var(--serif); font-size: 16px; }
.tl-h .small { font-size: 12.5px; }
.tl-goal { font-size: 13px; color: var(--muted); margin: 2px 0 8px; }
.beat { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0 0; background: var(--paper); display: flex; flex-direction: column; gap: 6px; }
.beat.known { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.beat-t { font-size: 13.5px; line-height: 1.7; overflow-wrap: anywhere; }
.beat-m { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); align-items: center; }
.beat-src { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }

/* 回合紀錄、筆記 */
.turn { border-top: 1px solid var(--line); padding: 14px 2px; }
.turn:last-child { border-bottom: 1px solid var(--line); }
.turn-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.turn-h b { font-family: var(--serif); font-size: 15px; }
.turn-in { margin: 6px 0; font-size: 13.5px; color: var(--a-ink); overflow-wrap: anywhere; }
.turn-sum { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.turn details { margin-top: 6px; }
.turn details summary { cursor: pointer; font-size: 13px; color: var(--a-ink); width: max-content; }
.prose { white-space: pre-wrap; font-size: 14.5px; line-height: 1.95; max-width: 68ch; margin: 8px 0 0; overflow-wrap: anywhere; }
.pager { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 14px 0; font-size: 13px; color: var(--muted); }
.book { border-top: 1px solid var(--line); }
.book:last-child { border-bottom: 1px solid var(--line); }
.book > summary { list-style: none; cursor: pointer; padding: 12px 4px; display: flex; gap: 10px; align-items: center; font-weight: 600; }
.book > summary::-webkit-details-marker { display: none; }
.book > summary .small { font-weight: 400; }
.book .ic.chev { margin-left: auto; color: var(--muted); transition: transform .2s; }
.book[open] .ic.chev { transform: rotate(180deg); }
.note-e { padding: 6px 4px 14px; }
.note-e h4 { margin: 0 0 4px; font-family: var(--serif); font-size: 15px; }
.note-e .prose p { margin: 0 0 .6em; }
.snaps { display: flex; flex-wrap: wrap; gap: 6px; }
.snaps button { height: 32px; min-width: 64px; justify-content: center; font-variant-numeric: tabular-nums; }
.snaps button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--a-ink); font-weight: 600; }
.raw { margin: 0; padding: 14px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 70vh; overflow: auto; }
.qa { display: grid; grid-template-columns: minmax(140px, 16em) minmax(0, 1fr); gap: 0; border-top: 1px solid var(--line); }
.qa > * { padding: 11px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; overflow-wrap: anywhere; }
.qa dt { color: var(--muted); }
.qa dd { margin: 0; font-weight: 500; }

/* ---------- 調整清單（固定在畫面底部；跨分頁累積，一次預覽、一次套用） ---------- */
.tray { position: fixed; z-index: 30; left: calc(var(--nav-w) + 24px); right: 24px; bottom: 16px; max-width: 1080px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px 10px 16px; border-radius: 14px;
  background: var(--raise); border: 1px solid var(--accent); box-shadow: var(--shadow); }
.tray[hidden] { display: none; }
.tray .tt { font-weight: 700; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tray .tt .ic { color: var(--a-ink); }
.tray .items { flex: 1 1 260px; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; max-height: 68px; overflow-y: auto; }
.tray .it { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: 12.5px; max-width: 100%; }
.tray .it span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tray .it button { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; justify-content: center; background: transparent; color: var(--muted); flex: none; }
.tray .it button:hover { color: var(--a-bad); }
.tray .acts { display: flex; gap: 8px; margin-left: auto; }

/* ---------- 風控管理（第 1 期）：摘要＋工具列＋一項一列（電腦對齊成表格、手機成卡片；看 #rkBox 自己的寬度） ---------- */
#rkBox { gap: 12px; container-type: inline-size; }
.rk-rules { margin: -8px 0 14px; font-size: 13px; color: var(--muted); max-width: 70ch; }
.rk-rules summary { cursor: pointer; display: inline-block; color: var(--a-ink); }
.rk-rules p { margin: 6px 0 0; line-height: 1.8; }
.rk-sum { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); gap: 4px 28px; justify-content: start; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.rk-s { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rk-s span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rk-s b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rk-when { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.rk-when select { height: 36px; width: auto; }
.rk-at { height: 36px; width: auto; }
.rk-at[hidden] { display: none; }
.rk-msg { margin: 0 0 0 4px; flex: 1 1 200px; font-size: 13px; color: var(--muted); min-height: 1.4em; }
.rk-msg:empty { display: none; }
.rk-check { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.rk-check[hidden] { display: none; }
.rk-ck-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.rk-ck-h b { display: inline-flex; align-items: center; gap: 4px; }
.rk-check .diff, .dlg .rk-cl { width: 100%; border-collapse: collapse; }
.rk-check .diff td { padding: 6px 6px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.rk-check .diff td:first-child { color: var(--muted); width: 34%; }
.rk-check .old, .rk-h .old { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.rk-check .new { font-weight: 600; }
.rk-check .arr { color: var(--muted); padding: 0 6px; }
.rk-imp { margin: 0; line-height: 1.7; }
.rk-errs { margin: 0; padding-left: 18px; color: var(--a-bad); }
.rk-head, .rk-row { display: grid; grid-template-columns: minmax(0, 1fr) 108px 142px 132px 132px 58px; align-items: center; gap: 0 10px; }
.rk-head { padding: 0 2px 6px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.rk-list { display: flex; flex-direction: column; }
.rk-g { padding: 12px 2px 2px; font-size: 12.5px; font-weight: 700; color: var(--a-ink); letter-spacing: .04em; }
.rk-fold { border: none; border-bottom: 1px solid var(--line); }
.rk-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 8px; padding: 8px 2px 2px; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.rk-fold > summary::-webkit-details-marker { display: none; }
.rk-fold > summary::before { content: '▸'; color: var(--muted); font-size: 11px; flex: none; }
.rk-fold[open] > summary::before { content: '▾'; }
.rk-fold-n { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.rk-fold-b { display: flex; flex-direction: column; }
.rk-units { display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px; min-width: 0; }
.rk-u { width: auto; flex: 1 1 84px; min-width: 84px; flex-direction: column-reverse; justify-content: flex-start; align-items: stretch; gap: 2px; }
.rk-u i { font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; flex: none; }
.rk-u input { max-width: none; height: 30px; }
/* 面額列：三個輸入框要放得下 6 位數，「改成」欄在電腦版橫跨兩欄、警戒線擺到它正下方，其他列不動 */
.rk-u input { font-variant-numeric: tabular-nums; }
@container (min-width: 801px) {
  .rk-row:has(.rk-units) .rk-name, .rk-row:has(.rk-units) .rk-def, .rk-row:has(.rk-units) .rk-cur, .rk-row:has(.rk-units) .rk-act { grid-row: 1 / 3; }
  .rk-row:has(.rk-units) .rk-new { grid-column: 4 / 6; grid-row: 1; }
  .rk-row:has(.rk-units) .rk-alert { grid-column: 4 / 6; grid-row: 2; }
}
.rk-sel { height: 34px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.rk-item { border-bottom: 1px solid var(--line); }
.rk-item.dirty { background: var(--accent-soft); }
.rk-row { padding: 8px 2px; }
.rk-c { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.rk-cap { display: none; }
.rk-nl { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.rk-nm { font-size: 14.5px; white-space: nowrap; }
.rk-code { font-size: 11px; color: var(--muted); }
.rk-sub { font-size: 12px; color: var(--muted); line-height: 1.55; }
.rk-v { font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk-src { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.rk-src.db { color: var(--a-ink); font-weight: 600; }
.rk-src.bad, .rk-off { color: var(--a-bad); font-size: 12px; white-space: nowrap; }
.rk-item[data-row="money.units"] .rk-v { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; font-size: 12.5px; }
.rk-pend { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 4px; font-size: 11.5px; color: var(--a-frost); line-height: 1.45; }
.rk-pend .ic { font-size: 12px; flex: none; }
.rk-pend > span { white-space: nowrap; }
.rk-inp { display: flex; align-items: center; gap: 5px; min-width: 0; }
.rk-inp input { flex: 1 1 auto; width: 100%; min-width: 0; height: 34px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.rk-inp em { font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; flex: none; }
.rk-unl { flex-basis: 100%; font-style: normal; font-size: 11.5px; line-height: 1.45; color: var(--a-frost); overflow-wrap: anywhere; }
.rk-new:has(.rk-unl) { flex-wrap: wrap; }
.rk-unl-confirm { margin-top: 8px; white-space: normal; }
.rk-sw { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.rk-sw input { flex: none; width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--accent); }
.rk-act { align-items: flex-end; }
.rk-act button { white-space: nowrap; }
.rk-err { margin: 0; padding: 0 2px 8px; font-size: 12.5px; color: var(--a-bad); }
.rk-err:empty { display: none; }
.rk-none { margin: 0; font-size: 13px; }
.rk-h { display: grid; grid-template-columns: 128px minmax(0, 1fr) auto; gap: 4px 16px; padding: 10px 2px; border-top: 1px solid var(--line); align-items: start; }
.rk-h:last-child { border-bottom: 1px solid var(--line); }
.rk-h time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk-hb { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13.5px; }
.rk-hb .small { overflow-wrap: anywhere; }
.rk-hb ul { margin: 2px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.65; }
.rk-ha { display: flex; gap: 6px; align-items: center; }
.rk-ha button { white-space: nowrap; }
.rk-force { margin-top: -4px; }
#rkBox .blk-t { margin: 10px 0 0; }
@container (max-width: 800px) {
  .rk-head { display: none; }
  .rk-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
  .rk-bar > button { flex: 1 1 30%; justify-content: center; }
  .rk-bar .ghost { flex: 0 0 auto; }
  .rk-list { gap: 8px; }
  .rk-g { padding: 8px 2px 0; }
  .rk-fold { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 0 12px 4px; }
  .rk-fold > summary { padding: 10px 0 4px; }
  .rk-fold-b .rk-item { border: none; border-radius: 0; border-top: 1px solid var(--line); }
  .rk-units { flex-direction: row; }
  .rk-row:has(.rk-units) { grid-template-areas: "name name" "def cur" "new new" "alert alert"; }
  .rk-u input { height: 28px; }
  .rk-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 2px; background: var(--paper); }
  .rk-item { position: relative; }
  .rk-row { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "name name" "def cur" "new alert"; gap: 8px 10px; padding: 0 0 10px; align-items: start; }
  .rk-item:has(.rk-act button) .rk-name { padding-right: 60px; }
  .rk-name { grid-area: name; } .rk-def { grid-area: def; } .rk-cur { grid-area: cur; } .rk-new { grid-area: new; } .rk-alert { grid-area: alert; }
  .rk-act { position: absolute; top: 8px; right: 10px; }
  .rk-act:empty { display: none; }
  .rk-cap { display: block; flex-basis: 100%; font-size: 12px; color: var(--muted); white-space: nowrap; }
  .rk-def, .rk-cur { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
  .rk-pend { flex-basis: 100%; }
  .rk-bar .rk-when { flex: 1 1 auto; }
  .rk-bar .rk-when select { flex: 1 1 auto; }
  .rk-inp input { height: 38px; }
  .rk-h { grid-template-columns: minmax(0, 1fr) auto; }
  .rk-h time { grid-column: 1 / -1; }
}

/* ---------- 風控 UI-2：5 欄、可篩選收合、手機精簡卡（覆寫上面第一版樣式） ---------- */
.rk-rules { margin: 0 0 12px; font-size: 13px; color: var(--muted); max-width: 78ch; }
.rk-rules p { margin: 6px 0 0; line-height: 1.7; }
.rk-rules-full p { max-width: 72ch; }
.rk-sum { padding: 8px 0; gap: 8px 24px; border-bottom: 1px solid var(--line); }
.rk-toolbar { align-items: center; padding: 10px 0; }
.rk-toolbar .af-chips { padding: 0; flex: 1 1 430px; }
.rk-search { flex: 0 1 234px; min-width: 170px; margin-left: auto; }
.rk-search .af-in { height: var(--af-h); }
.rk-expand { height: var(--af-h-sm); white-space: nowrap; }
.rk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rk-main-actions, .rk-schedule-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rk-main-actions > button { height: var(--af-h); }
.rk-msg { margin: 0; flex: 1 1 180px; font-size: 12.5px; color: var(--muted); min-height: 1.4em; }
.rk-head, .rk-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px clamp(100px, calc(11ch + 44px), 140px) clamp(100px, calc(11ch + 44px), 140px) 52px;
  align-items: start;
  gap: 0 12px;
}
.rk-head { padding: 0 2px 6px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.rk-list { display: flex; flex-direction: column; min-width: 0; }
.rk-group { margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rk-group:first-of-type { border-top: 0; }
.rk-group > summary.af-sec-h { margin: 0; padding: 3px 2px; font-size: 14px; line-height: 20px; gap: 7px; border-bottom: 1px solid transparent; }
.rk-group > summary::-webkit-details-marker { display: none; }
.rk-group[open] > summary.af-sec-h { border-bottom-color: var(--line); }
.rk-chev { flex: none; color: var(--muted); font-size: 14px; transition: transform .15s ease; }
.rk-group[open] .rk-chev { transform: rotate(90deg); }
.rk-group-name { flex: none; }
.rk-group-count { font-size: 11.5px; line-height: 18px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.rk-group-dirty { margin-left: auto; font-size: 11.5px; background: var(--accent-soft); color: var(--a-ink); }
.rk-group-dirty[hidden] { display: none; }
.rk-group-b { min-width: 0; }
.rk-fold { border: 0; border-top: 1px dashed var(--line); }
.rk-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 8px; padding: 4px 2px 3px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.rk-fold > summary::-webkit-details-marker { display: none; }
.rk-fold > summary::before { content: '▸'; color: var(--muted); font-size: 10px; flex: none; }
.rk-fold[open] > summary::before { content: '▾'; }
.rk-fold-n { font-size: 11px; color: var(--muted); font-weight: 400; }
.rk-fold-b { display: flex; flex-direction: column; min-width: 0; }
.rk-item { border-bottom: 1px dashed var(--line); min-width: 0; }
.rk-fold-b > .rk-item:last-child, .rk-group-b > .rk-item:last-child { border-bottom: 0; }
.rk-item.dirty { background: var(--accent-soft); }
.rk-row { padding: 3px 2px; }
.rk-c { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.rk-cap { display: none; font-size: 12px; line-height: 18px; color: var(--muted); white-space: nowrap; }
.rk-nl { display: flex; align-items: center; gap: 5px; min-width: 0; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; line-height: 18px; text-align: left; }
button.rk-nl { height: auto; min-height: 0; cursor: pointer; }
.rk-nm { font-size: 13.5px; line-height: 18px; font-weight: 600; overflow-wrap: anywhere; }
.rk-code { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.rk-info { display: inline-flex; flex: none; margin-left: auto; color: var(--a-frost); }
.rk-info .ic { font-size: 16px; }
.rk-sub { display: flex; align-items: center; gap: 4px; min-width: 0; margin-top: 0; font-size: 11.5px; color: var(--muted); line-height: 16px; white-space: nowrap; overflow: hidden; }
.rk-sub-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rk-unl { flex: none; max-width: 42%; color: var(--a-frost); font-style: normal; overflow: hidden; text-overflow: ellipsis; }
.rk-item.desc-open .rk-sub { align-items: flex-start; white-space: normal; overflow: visible; }
.rk-item.desc-open .rk-sub-t { overflow: visible; white-space: normal; text-overflow: clip; }
.rk-item.desc-open .rk-unl { max-width: none; overflow: visible; white-space: normal; text-overflow: clip; }
.rk-cur { gap: 1px; font-variant-numeric: tabular-nums; }
.rk-curline { display: flex; align-items: center; flex-wrap: wrap; gap: 1px 5px; min-height: 20px; }
.rk-v { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.rk-inf { margin-right: 3px; font-size: 18px; line-height: 1; color: var(--a-frost); }
.rk-src { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.rk-src.bad, .rk-off { color: var(--a-bad); font-size: 12px; white-space: nowrap; }
.rk-def { display: flex; align-items: baseline; flex-wrap: wrap; gap: 1px 5px; font-size: 11px; line-height: 16px; color: var(--muted); }
.rk-def .rk-cap { display: inline; font-size: inherit; line-height: inherit; }
.rk-pend { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 4px; font-size: 11px; color: var(--a-frost); line-height: 1.35; }
.rk-pend .ic { font-size: 12px; flex: none; }
.rk-pend > span { white-space: nowrap; }
.rk-num { inline-size: clamp(100px, calc(11ch + 44px), 140px); max-inline-size: 100%; flex: none; }
.rk-new > .rk-cap, .rk-alert > .rk-cap { display: none; }
.rk-inp { min-width: 0; }
.rk-inp input { min-width: 0; flex: 1 1 auto; width: 100%; height: 100%; padding: 0 7px; font-variant-numeric: tabular-nums; }
.rk-inp em, .rk-inp .af-unit { padding-inline: 1px 6px; }
.rk-sel { width: 100%; min-width: 0; height: 100%; font-variant-numeric: tabular-nums; }
.rk-bool { padding: 0 8px; }
.rk-alert-rule { font-size: 11.5px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.rk-units-cell { grid-column: 3 / 5; min-width: 0; }
.rk-units-cell > .rk-cap { display: none; }
.rk-units { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.rk-u { inline-size: 84px; flex: none; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 4px; min-inline-size: 0; }
.rk-u .af-l { display: block; }
.rk-u .af-in > input { height: 100%; padding-inline: 6px; font-variant-numeric: tabular-nums; }
.rk-row:has(.rk-units) .rk-alert { display: none; }
.rk-row:has(.rk-units) .rk-units-cell { grid-column: 3 / 5; grid-row: auto; }
.rk-row:has(.rk-units) .rk-name, .rk-row:has(.rk-units) .rk-cur, .rk-row:has(.rk-units) .rk-act { grid-row: auto; }
.rk-act { align-items: flex-end; justify-content: flex-end; min-height: var(--af-h); }
.rk-act button { height: var(--af-h-sm); padding: 0 8px; white-space: nowrap; }
.rk-err { margin: 0; padding: 0 2px 6px; font-size: 12px; color: var(--a-bad); }
.rk-item.is-event .rk-new { grid-column: 3 / 5; align-self: center; color: var(--muted); font-size: 12px; }
.rk-item.is-event .rk-alert, .rk-item.is-event .rk-sub, .rk-item.is-event .rk-info { display: none; }
.rk-event-note { min-height: var(--af-h); display: flex; align-items: center; }
.rk-filter-empty { padding: 14px 2px; }
.rk-sched-sec { padding: 6px 0 0; border-top: 1px solid var(--line); }
.rk-subhead { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 3px; font-size: 14px; line-height: 20px; color: var(--ink); font-weight: 700; }
.rk-subhead .ic { flex: none; font-size: 16px; color: var(--a-ink); }
.rk-history { border-top: 1px solid var(--line); margin-top: 12px; }
.rk-history > summary { list-style: none; cursor: pointer; padding: 10px 0 7px; margin: 0; }
.rk-history > summary::-webkit-details-marker { display: none; }
.rk-history > summary::after { content: '▸'; margin-left: auto; color: var(--muted); font-size: 11px; }
.rk-history[open] > summary::after { content: '▾'; }
.rk-history[open] > summary { border-bottom: 1px solid var(--line); }
.rk-history-n { margin-left: auto; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.rk-h { display: grid; grid-template-columns: 128px minmax(0, 1fr) auto; gap: 4px 16px; padding: 8px 2px; border-top: 1px dashed var(--line); align-items: start; }
.rk-h:first-child { border-top: 0; }
.rk-h time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk-hb { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.rk-hb .small { overflow-wrap: anywhere; }
.rk-hb ul { margin: 2px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.55; }
.rk-ha { display: flex; gap: 6px; align-items: center; }
.rk-ha button { white-space: nowrap; }
.rk-force { margin-top: -4px; }
.rk-unl-confirm { margin-top: 8px; white-space: normal; }

@container (max-width: 800px) {
  .rk-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; padding: 5px 0; }
  .rk-toolbar { align-items: stretch; padding: 5px 0; gap: 4px 8px; }
  .rk-toolbar .af-chips { flex-basis: 100%; gap: 4px; }
  .rk-toolbar .af-chips button { padding: 0 8px; font-size: 12px; }
  .rk-search { flex: 1 1 180px; min-width: 0; margin-left: 0; }
  .rk-search .af-in { height: var(--af-h); }
  .rk-expand { flex: 0 0 auto; height: var(--af-h); }
  .rk-bar { gap: 4px 8px; padding: 6px 0; }
  .rk-main-actions { flex: 1 1 100%; }
  .rk-main-actions > button { flex: 1 1 calc(50% - 4px); justify-content: center; }
  .rk-schedule-row { flex: 1 1 100%; }
  .rk-schedule-row .rk-when { flex: 1 1 auto; }
  .rk-schedule-row .rk-when select { flex: 1 1 auto; min-width: 0; }
  .rk-msg { flex-basis: 100%; margin-left: 0; }
  .rk-head { display: none; }
  .rk-list { gap: 8px; }
  .rk-group { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 0 10px 4px; }
  .rk-group + .rk-group { margin-top: 6px; }
  .rk-group > summary.af-sec-h { padding: 5px 0 4px; border-bottom: 0; gap: 5px 7px; }
  .rk-group[open] > summary.af-sec-h { border-bottom: 1px solid var(--line); margin-bottom: 2px; }
  .rk-group-count { font-size: 11px; }
  .rk-group-dirty { margin-left: 0; }
  .rk-fold { border: 0; }
  .rk-fold > summary { padding: 7px 0 4px; }
  .rk-item { position: relative; border: 0; border-top: 1px solid var(--line); padding: 0 2px; background: transparent; }
  .rk-group-b > .rk-item:first-child, .rk-fold-b > .rk-item:first-child { border-top: 0; }
  .rk-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "name name" "cur cur" "new alert";
    align-items: start;
    gap: 1px 8px;
    padding: 1px 0;
  }
  .rk-name { grid-area: name; padding-right: 42px; }
  .rk-cur { grid-area: cur; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0; }
  .rk-new { grid-area: new; }
  .rk-alert { grid-area: alert; }
  .rk-act { position: absolute; top: 0; right: 0; min-height: var(--af-h-sm); align-items: center; }
  .rk-act button { height: var(--af-h-sm); }
  .rk-cap, .rk-new > .rk-cap, .rk-alert > .rk-cap { display: block; flex-basis: 100%; min-height: 16px; height: 16px; line-height: 16px; }
  .rk-nl { line-height: 18px; padding-right: 2px; }
  .rk-nm { font-size: 13.5px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rk-info { display: inline-flex; margin-left: auto; }
  .rk-sub { display: none; margin-top: 2px; font-size: 12px; line-height: 1.45; white-space: normal; overflow: visible; }
  .rk-item.desc-open .rk-sub { display: block; }
  .rk-sub-t { overflow: visible; white-space: normal; text-overflow: clip; }
  .rk-unl { display: inline; max-width: none; overflow: visible; white-space: normal; text-overflow: clip; }
  .rk-cur .rk-def::before { content: '・'; color: var(--muted); }
  .rk-curline { min-height: 16px; height: 16px; flex-wrap: nowrap; gap: 0 5px; }
  .rk-v { font-size: 12.5px; line-height: 16px; }
  .rk-def { font-size: 10.5px; line-height: 16px; gap: 0 4px; flex-wrap: nowrap; white-space: nowrap; }
  .rk-def .rk-src { display: none; }
  .rk-pend { font-size: 10.5px; }
  .rk-new, .rk-alert { inline-size: 100%; max-inline-size: 150px; gap: 0; }
  .rk-num { inline-size: 100%; max-inline-size: 150px; }
  .rk-new > .af-in, .rk-alert > .af-in { inline-size: 100%; height: var(--af-h); }
  .rk-units-cell { grid-column: 1 / -1; max-inline-size: none; }
  .rk-row:has(.rk-units) { grid-template-areas: "name name" "cur cur" "new new"; }
  .rk-row:has(.rk-units) .rk-units-cell { grid-column: 1 / -1; }
  .rk-units-cell > .rk-cap { display: block; }
  .rk-units { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; inline-size: 100%; }
  .rk-u { inline-size: 100%; min-inline-size: 0; }
  .rk-u .af-l { min-height: 18px; line-height: 18px; }
  .rk-u .af-in > input { padding-inline: 5px; }
  .rk-item.is-event { block-size: 51px; overflow: hidden; }
  .rk-item.is-event .rk-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name cur"; align-items: center; gap: 4px; block-size: 50px; padding: 0; }
  .rk-item.is-event .rk-name { grid-area: name; padding-right: 0; }
  .rk-item.is-event .rk-cur { grid-area: cur; align-items: flex-end; text-align: right; }
  .rk-item.is-event .rk-new, .rk-item.is-event .rk-alert, .rk-item.is-event .rk-sub, .rk-item.is-event .rk-info, .rk-item.is-event .rk-def { display: none; }
  .rk-item.is-event .rk-curline { justify-content: flex-end; min-height: 0; flex-wrap: nowrap; }
  .rk-item.is-event .rk-v { font-size: 11.5px; }
  .rk-sched-sec, .rk-history { margin-top: 12px; }
  .rk-subhead { font-size: 13.5px; }
  .rk-history-n { flex-basis: 100%; margin-left: 23px; }
  .rk-h { grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; }
  .rk-h time { grid-column: 1 / -1; }
}

/* ---------- 對話框 ---------- */
.dlg { border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink); padding: 0; width: min(600px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); box-shadow: var(--shadow); }
.dlg::backdrop { background: var(--a-backdrop); }
.dlg-in { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 18px; }
.dlg-hd { display: flex; align-items: center; gap: 10px; }
.dlg-hd h2 { margin: 0; font-family: var(--serif); font-size: 20px; font-weight: 700; line-height: 1.35; flex: 1; min-width: 0; }
.dlg-hd .ic { font-size: 22px; color: var(--a-ink); flex: none; }
.dlg.tone-danger .dlg-hd .ic { color: var(--a-bad); }
.dlg.tone-danger { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.dlg-lead { margin: 0; font-size: 13.5px; line-height: 1.8; color: var(--muted); }
.dlg-lead b { color: var(--ink); }
.steps { margin: 0; padding-left: 22px; font-size: 13.5px; line-height: 1.75; }
.steps li { margin: 2px 0; padding-left: 2px; }
.steps li::marker { color: var(--a-ink); font-weight: 600; }
.dlg ul.plain { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.75; }
.fld { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.fld > span { color: var(--muted); display: flex; justify-content: space-between; gap: 10px; }
.fld > span em { font-style: normal; font-variant-numeric: tabular-nums; }
.fld > span em.over { color: var(--a-bad); }
.fld input, .fld select { height: 40px; }
.fld.verify > span { display: block; }
.verify b { color: var(--ink); font-size: 15px; }
.dlg-err { margin: 0; min-height: 1.2em; font-size: 13px; color: var(--a-bad); }
.dlg-err:empty { display: none; }
.dlg-act { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.dlg-act button { min-width: 88px; justify-content: center; }
.dlg .diff { width: 100%; border-collapse: collapse; font-size: 13px; }
.dlg .diff td { padding: 7px 6px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.dlg .diff td:first-child { color: var(--muted); width: 38%; }
.dlg .diff .old { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.dlg .diff .new { font-weight: 600; }
.dlg .diff .arr { color: var(--muted); padding: 0 6px; }
.dlg .scroll { max-height: 38vh; overflow-y: auto; border-bottom: 1px solid var(--line); }
.temp { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px; border-radius: 12px; background: var(--bg); border: 1px dashed var(--accent); }
.temp code { font-size: 26px; font-weight: 700; letter-spacing: .12em; color: var(--ink); }
.toast { position: fixed; z-index: 40; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: calc(100vw - 32px); display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--raise); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-size: 13.5px;
  animation: none; }
.toast > span { min-width: 0; overflow-wrap: anywhere; }
.toast[hidden] { display: none; }
.toast.up { bottom: 112px; }

/* ---------- 手機（≤900px）：導覽改成頂端橫滑的分類籤 ---------- */
@media (max-width: 900px) {
  .adm { display: block; }
  .nav { position: sticky; top: 0; z-index: 20; height: auto; overflow: visible; padding: 10px 0 0; border-right: 0; border-bottom: 1px solid var(--line);
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand foot" "list list"; gap: 0; }
  .nav-brand { grid-area: brand; padding: 0 0 8px 16px; gap: 8px; min-width: 0; }
  .nav-brand .lamp { font-size: 24px; }
  .nav-bt b { font-size: 16px; }
  .nav-bt span { display: none; }
  .nav-brand .grow { display: none; }
  .nav-foot { grid-area: foot; margin: 0; padding: 0 12px 8px 0; flex-direction: row; align-items: center; gap: 6px; }
  .nav-who { display: none; }
  .nav-back span { display: none; }
  .nav-back { width: 36px; height: 36px; justify-content: center; }
  .reauth { min-height: 34px; padding: 4px 9px; font-size: 12.5px; max-width: 46vw; white-space: nowrap; }
  .reauth .l { display: none; }
  .reauth .s { display: inline; }
  .nav-list { grid-area: list; flex-direction: row; gap: 6px; overflow-x: auto; padding: 2px 16px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav-list::-webkit-scrollbar { display: none; }
  .nav-g { display: none; }
  .nav-list a { flex: none; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; gap: 6px; background: var(--bg); }
  .nav-list a .ic { font-size: 15px; }
  .nav-list a[aria-current="page"] { border-color: var(--accent); }
  .nav-list a[aria-current="page"]::before { display: none; }
  .main { padding: 18px 16px 150px; }
  .pane-t { font-size: 22px; }
  .pane-tools { margin-left: 0; }
  .ov-head { font-size: 24px; }
  .todo { grid-template-columns: 36px minmax(0, 1fr); padding: 12px 2px; }
  .todo .lamp { font-size: 26px; }
  .todo .go { grid-column: 2; grid-row: auto; justify-self: start; margin-top: 6px; }
  .feed-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .feed-side { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .kv-list { grid-template-columns: minmax(4.5em, max-content) minmax(0, 1fr); gap: 8px 12px; font-size: 13px; }
  input, select, textarea { font-size: 16px; }
  .search { flex-basis: 100%; }
  .sel { flex-wrap: wrap; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 10px; padding: 0 16px 2px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chips button { flex: none; }
  /* 玩家清單：表格改成一位一段：名字＋狀態一行，其他資料接在下面一兩行 */
  .ptbl thead { display: none; }
  .sk-m:not(.sk-6) { display: inline-flex; margin: 0 0 8px; }
  .ptbl, .ptbl tbody { display: block; width: 100%; }
  .ptbl tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
  .ptbl td { display: block; border: 0; padding: 0; }
  .ptbl td.who { flex: 1 1 55%; min-width: 0; }
  .ptbl td.stc { flex: none; margin-left: auto; text-align: right; }
  .ptbl td.m { flex: none; font-size: 12.5px; color: var(--muted); max-width: 100%; }
  .ptbl td.m.wide, .ptbl td.why { flex: 1 1 100%; }
  .ptbl td.m::before { content: attr(data-l) " "; }
  .ptbl td.m:empty { display: none; }
  .ptbl td.m .abs { display: none; }
  .ptbl td.m .t2 { display: inline; font-size: inherit; }
  .ptbl td.acts { flex: 1 1 100%; text-align: left; padding-top: 4px; }
  .ptbl td.acts button { margin: 0 6px 0 0; }
  .cs-row { grid-template-columns: minmax(0, 1fr); }
  .cs-bar { grid-template-columns: minmax(0, 1fr) 6.5em; }
  .pd-name { font-size: 25px; }
  .pd-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
  .acts-bar { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 10px; }
  .acts-bar .acts-lbl, .acts-bar .acts-lbl.d { padding-top: 0; margin-top: 6px; border-top: 0; }
  .acts-bar .grp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acts-bar .grp.danger-g { padding-top: 0; border-top: 0; }
  .acts-bar button { width: 100%; justify-content: flex-start; white-space: normal; text-align: left; height: auto; min-height: 40px; padding: 6px 10px; }
  .pd-body { display: block; margin-top: 14px; }
  .pd-tabs { position: static; flex-direction: row; overflow-x: auto; gap: 6px; margin: 0 -16px 14px; padding: 0 16px 4px; scrollbar-width: none; }
  .pd-tabs::-webkit-scrollbar { display: none; }
  .pd-tg { display: none; }
  .pd-tab { flex: none; width: auto; height: 34px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
  .pd-tab[aria-selected="true"] { border-color: var(--accent); }
  .npc > summary { grid-template-columns: minmax(0, 1fr) minmax(90px, .8fr); }
  .npc .tags { grid-column: 1 / -1; justify-content: flex-start; }
  .qa { grid-template-columns: minmax(0, 1fr); }
  .qa dt { border-bottom: 0; padding-bottom: 0; }
  .qa dd { padding-top: 2px; }
  .dtbl.stack thead { display: none; }
  .dtbl.stack, .dtbl.stack tbody, .dtbl.stack tr, .dtbl.stack td { display: block; width: 100%; }
  .dtbl.stack tr { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); align-items: center; }
  .dtbl.stack td { border: 0; padding: 0; width: auto; }
  .dtbl.stack td.wide { flex: 1 1 100%; }
  .dtbl.stack td[data-l]::before { content: attr(data-l) " "; color: var(--muted); font-size: 12px; }
  .tray { left: 10px; right: 10px; bottom: 10px; padding: 10px; }
  .tray .items { flex-basis: 100%; order: 3; max-height: 62px; }
  .tray .acts { margin-left: auto; }
  .toast { bottom: 14px; }
  .toast.up { bottom: 150px; }
  .dlg-in { padding: 16px; }
  .dlg-act button { flex: 1 1 auto; }
  .temp code { font-size: 22px; }
}
@media (max-width: 420px) {
  .reauth { max-width: 40vw; }
}
@media (prefers-reduced-motion: reduce) {
  .todo.lit .lamp { animation: none; }
  .book .ic.chev { transition: none; }
}

/* ===== 贊助方案（站長 10-14；10-15 重排）：摘要＋工具列＋一方案一列（電腦對齊成表格、手機成卡片），文字在列下方展開 ===== */
#stBox { gap: 12px; container-type: inline-size; }
.st-rules { margin: -8px 0 14px; font-size: 13px; color: var(--muted); max-width: 70ch; }
.st-rules summary { cursor: pointer; display: inline-block; color: var(--a-ink); }
.st-rules p { margin: 6px 0 0; line-height: 1.8; }
.st-rules b { color: var(--ink); }
.st-sum { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); gap: 4px 28px; justify-content: start; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.st-s { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.st-s span { font-size: 12px; color: var(--muted); }
.st-s b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.st-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-msg:empty { display: none; }
.st-msg { margin: 0 0 0 4px; flex: 1 1 200px; font-size: 13px; color: var(--muted); min-height: 1.4em; }
.st-list { display: flex; flex-direction: column; }
.st-row, .st-head { display: grid; grid-template-columns: 56px minmax(0, 1fr) 92px 92px 70px 128px 68px 96px; align-items: center; gap: 0 8px; }
.st-head { padding: 0 2px 6px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.st-head { margin-bottom: -12px; }
.st-item { border-bottom: 1px solid var(--line); }
.st-item:last-child { border-bottom: 0; }
.st-row { padding: 10px 2px; }
.st-item.off .st-row { opacity: .72; }
.st-c { display: flex; flex-direction: column; min-width: 0; }
.st-cap, .st-pa { display: none; }
.st-c input[type=number] { width: 100%; min-width: 0; height: 34px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.st-nl { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.st-nm { font-size: 15px; overflow-wrap: anywhere; }
.st-bdg { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--a-ink); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.st-sub { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--muted); }
.st-sub code { color: var(--muted); }
.st-imp.warn { color: var(--a-bad); }
.st-turn { font-size: 13px; color: var(--muted); white-space: nowrap; }
.st-on { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.st-on input { flex: none; width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--accent); }
.st-edit { justify-self: end; white-space: nowrap; }
.st-edit .ic { font-size: 15px; }
.st-edit[aria-expanded="true"] { color: var(--a-ink); border-color: var(--a-ink); }
.st-panel { padding: 4px 2px 14px; display: flex; flex-direction: column; gap: 12px; }
.st-panel[hidden] { display: none; }
.st-langs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.st-lc { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.st-lc legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.st-l { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); min-width: 0; }
.st-l input { width: 100%; min-width: 0; }
.st-pvrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.st-pv { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; min-width: 0; }
.st-pv-h { font-size: 12px; color: var(--muted); }
.st-card { position: relative; display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; padding: 8px 12px; border: 1px solid var(--line-strong, var(--line)); border-radius: 10px; font-size: 13px; }
.st-amt { font-weight: 700; color: var(--a-ink); }
@container (max-width: 800px) {
  .st-head { display: none; }
  .st-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
  .st-bar button { flex: 1 1 30%; justify-content: center; }
  .st-bar .ghost { flex: 1 1 100%; }
  .st-list { gap: 10px; }
  .st-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 4px; background: var(--paper); }
  .st-item:last-child { border: 1px solid var(--line); }
  .st-item.off { border-style: dashed; }
  .st-item.off .st-row { opacity: 1; }
  .st-item.off .st-nm, .st-item.off .st-pa { opacity: .6; }
  .st-row { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-areas: "name name name name" "amount credits bonus order" "on turn turn edit"; gap: 10px 8px; padding: 0 0 12px; align-items: end; }
  .st-name { grid-area: name; }
  .st-amount { grid-area: amount; } .st-credits { grid-area: credits; } .st-bonus_pct { grid-area: bonus; } .st-order { grid-area: order; }
  .st-turn { grid-area: turn; white-space: normal; align-self: center; font-size: 12.5px; }
  .st-on { grid-area: on; align-self: center; } .st-edit { grid-area: edit; justify-self: end; height: 34px; padding: 0 8px; gap: 4px; }
  .st-edx { display: none; }
  .st-cap { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; white-space: nowrap; }
  .st-c input[type=number] { height: 38px; padding: 0 6px; }
  .st-nl { flex-wrap: nowrap; }
  .st-nm { flex: 0 1 auto; font-size: 16px; }
  .st-pa { display: block; margin-left: auto; padding-left: 8px; font-size: 18px; font-weight: 700; color: var(--a-ink); white-space: nowrap; }
  .st-bdg { white-space: normal; }
  .st-sub { margin-top: 2px; }
  .st-langs { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .st-pvrow { flex-direction: column; align-items: flex-start; }
}
.warn-line { margin: 0; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--accent); font-size: 13px; }
.dlg-l { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.dlg-l textarea { width: 100%; min-height: 72px; resize: vertical; font: inherit; }
/* ===== NPC管理（原「數值」）區改版：分組收合、單人抽屜、相性矩陣、疑似重複（static/admin.js 的 NP） ===== */
.np-grp { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); margin: 10px 0; }
.np-grp > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-weight: 600; }
.np-grp > summary::-webkit-details-marker { display: none; }
.np-grp > summary .ic { color: var(--a-ink); }
.np-grp > summary .cnt { margin-left: auto; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.np-grp[open] > summary { border-bottom: 1px solid var(--line); }
.np-box { padding: 6px 10px 12px; }
.np-scroll { overflow-x: auto; }
.np-dwr:not(:empty) { margin-top: 10px; }
.np-tbl { table-layout: fixed; }   /* 三組同一組 colgroup 百分比：欄寬一致、排序後不跳 */
.np-tbl th, .np-tbl td { white-space: normal; overflow-wrap: anywhere; vertical-align: middle; }
.np-tbl th { white-space: nowrap; }
.np-touch-tools { margin: 6px 0 10px; }
.np-touch-tools .sel { height: 34px; }
.np-touch-tools input { height: 34px; }
.np-tbl .np-touch { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-dep-tbl td { white-space: normal; vertical-align: top; }
.np-dep-tbl .np-nowrap { white-space: nowrap; }
.np-dep-tbl tbody tr > td { height: 100%; }
.np-touch-k { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-tag.np-est { display: inline-block; margin: 0 0 0 4px; padding: 0 6px; color: var(--a-ink); border-color: var(--accent); vertical-align: middle; }
.np-last-touch { margin: 4px 0 0; word-break: keep-all; overflow-wrap: anywhere; }
.np-last-touch a { color: var(--a-ink); text-decoration: underline dotted; text-underline-offset: 2px; }
.np-touch-preview { margin: 0; padding-left: 18px; line-height: 1.7; }
.np-open { background: transparent; border: 0; padding: 0; height: auto; color: var(--a-ink); font: inherit; font-weight: 600; text-decoration: underline dotted; cursor: pointer; }
.np-open[aria-expanded="true"] { text-decoration: none; }
.np-open .np-nick { display: inline-block; max-width: 100%; white-space: nowrap; font-size: clamp(12px, 3.5vw, 14px); }
.np-open .np-registered { display: block; font-weight: 400; text-decoration: none; white-space: normal; overflow-wrap: anywhere; }
.np-tbl td.nm .np-registered { display: block; flex-basis: 100%; margin-top: 0; }
.np-tbl td.nm .np-tag { margin: 0 0 0 6px; vertical-align: middle; }
.np-tag { display: block; width: max-content; margin: 3px 0 0; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }   /* 名字下一行、不拆行 */
.np-tag.np-ret { border-style: dashed; }
.np-tag.np-purged { border-style: solid; color: var(--a-bad); border-color: color-mix(in srgb, var(--a-bad) 45%, var(--line)); }   /* 已清除（墓碑）：實線紅，和還能復原的虛線區分 */
.np-tag.np-due { color: var(--a-ink); }
.np-tag.np-tn { margin-left: 6px; display: inline-flex; align-items: center; gap: 4px; color: var(--a-ink); border-color: color-mix(in srgb, var(--a-ink) 45%, var(--line)); }
.np-tag.np-tn .ic { width: 11px; height: 11px; }
.np-tag.np-dead { margin-left: 6px; display: inline-flex; align-items: center; }   /* 「已故」和真名籤同一列、同風格，不拆行 */
tr.np-gone > td { color: var(--muted); }
.np-drawer .warn-line { font-size: 13px; line-height: 1.6; padding: 8px 10px; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--ink); }
.np-note { margin: 4px 0 8px; }
.np-drawer.np-tomb { display: block; padding: 0; border: 0; background: transparent; }
.np-tomb .warn-line { display: flex; gap: 8px; align-items: flex-start; }
.np-tomb .warn-line .ic { flex: none; margin-top: 2px; }
.np-heart-set { display: flex; align-items: center; gap: 8px; height: 32px; min-width: 0; }   /* 和旁邊輸入框同高：（無）狀態籤＋玩家代號輸入框合在一欄 */
.np-heart-set input { flex: 1 1 0; min-width: 0; }
.np-heart-set .np-heart { margin-right: 0; white-space: nowrap; flex: none; }
.np-act .np-msg.err-line { flex: 1 1 100%; margin-right: 0; order: -1; }   /* 儲存失敗的原因：整列顯示在按鈕上方，不被擠成窄欄拆行 */
.np-dup-cap { flex-basis: 100%; }
.np-more { padding: 8px 0 0; }
.np-drawer { border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; background: var(--raise); display: grid; gap: 12px; }
.np-dh { display: flex; align-items: center; gap: 8px; min-width: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.np-dh .ic { font-size: 18px; color: var(--a-ink); flex: none; }
.np-dh h3 { margin: 0; font-family: var(--serif); font-size: 16px; font-weight: 700; line-height: 1.35; white-space: normal; min-width: 0; overflow-wrap: anywhere; }
.np-dh h3 .np-registered { display: inline; font-family: sans-serif; font-weight: 400; }
.np-dsub { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-dh .np-dx { flex: none; }
.np-sec > h4 { margin: 0 0 8px; font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.np-sec > h4 .ic { color: var(--a-ink); }
.np-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 12px; }   /* auto-fit：欄位少的那一列撐滿，不留右側空白 */
.np-grid.np-kin { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }   /* auto-fill：欄寬和「基本」段一致（別名、心上人各佔一欄，第三欄放「加一條關係」） */
.np-grid.np-basic { grid-template-columns: repeat(12, minmax(0, 1fr)); }   /* 12 格：身分｜真名｜性別各 4 格、常在之處｜生死｜狀態｜武力各 3 格，一列放完不留空格 */
.np-basic > .np-f { grid-column: span 4; }
.np-basic > .np-f.q { grid-column: span 3; }
.np-basic > .np-f.wide { grid-column: 1 / -1; }
.np-grid.np-num { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.np-f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.np-f.wide { grid-column: 1 / -1; }
.np-f.np-tn .np-tnnote { font-size: 12px; color: var(--muted); }   /* 在「基本」段身分欄右方，欄寬有限：整段可在片段之間換行，每個片段不拆 */
.np-f.np-tn .np-tnnote > span, .np-f.np-tn > span:first-child .hid { white-space: nowrap; }
.np-f.np-tn .np-tnnote b { color: var(--ink); font-weight: 500; }
.np-f.np-tn > span:first-child .np-tag { display: inline-flex; margin: 0 0 0 6px; vertical-align: middle; }   /* 「站長指定」小標：和真名籤同風格、同一列 */
.np-tag.np-tf { color: var(--a-ink); border-color: color-mix(in srgb, var(--a-ink) 45%, var(--line)); }
.np-tnwarn { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-start; }
.np-tnwarn[hidden] { display: none; }
.np-tnwarn-box { flex: 1 1 280px; min-width: 0; display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px;
  border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft); color: var(--a-ink); font-size: 12.5px; line-height: 1.55; }
.np-tnwarn-box .ic { flex: none; margin-top: 3px; color: var(--a-ink); }
.np-tnwarn-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.np-tnwarn-list li { overflow-wrap: anywhere; }   /* 琥珀警告逐條；很長的中文說明在窄欄裡只斷在字間、不擠出頁面 */
.np-tnwarn .small-btn { flex: none; }
.np-f.np-tie-add { justify-content: flex-end; }
.np-kin .np-tie-add { justify-content: flex-start; padding-top: 22px; }
.np-f.np-tie-add .small-btn { height: 32px; width: 100%; justify-content: center; }
.np-f > input, .np-f > select, .np-f > textarea { height: 32px; padding: 0 8px; font-size: 13px; width: 100%; }   /* 舊版直接掛在 .np-f 下的欄位；新版都包在 .af-in */
.np-f > textarea { height: auto; padding: 6px 8px; }
.np-facets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--af-gy) 24px; }
.np-facet { display: grid; grid-template-columns: 5em minmax(0, 1fr); gap: 6px 12px; align-items: center; font-size: 13px; min-width: 0; }
.np-facet-f { inline-size: 100%; max-inline-size: 260px; }
.np-facet input:not([type=checkbox]) { min-width: 0; width: 100%; }
.np-drawer input[type=checkbox], .np-dup input[type=checkbox] { width: 16px; height: 16px; padding: 0; margin: 0; }
.np-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.np-ties { display: flex; flex-direction: column; inline-size: 100%; }
.np-tie-head { margin-top: 0; }
.np-tie { inline-size: 100%; }
.np-tie .af-in > input { inline-size: 100%; }
.np-tie-add { margin-top: 0; }
.np-chr { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.np-chnote { margin: 0 0 8px; }
.np-chnote code { font-family: inherit; font-weight: 700; color: var(--ink); }
.np-chlist { display: grid; gap: 6px; max-height: 360px; overflow-y: auto; padding-right: 2px; }   /* 30 筆時自己捲，不把抽屜撐得很長 */
.np-chr-row { inline-size: 100%; align-items: start; }
.np-chr-row .np-chr-main > .af-in > input { inline-size: 100%; }
.np-chr-row .np-chm { line-height: 1.45; white-space: normal; overflow: visible; text-overflow: clip; }
.np-chr-row.gone input, .np-chr-row.gone select { text-decoration: line-through; opacity: .55; }
.np-chr-row.np-chr-ro { grid-template-columns: minmax(0, 1fr); font-size: 13px; }
.np-chr-row.np-chr-ro .np-chm { grid-column: 1; }
.np-chr-text { overflow-wrap: anywhere; }
.np-chadd { margin-top: 8px; }
.np-hist { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); }
.np-hist time { font-variant-numeric: tabular-nums; }
.np-heart { font-size: 13px; color: var(--ink); margin-right: 10px; }
.np-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 10px; }
.np-act .np-msg { margin-right: auto; }
.cp-mx th { font-weight: 600; }
.cp-mx td { text-align: center; }
.cp-close { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.cp-warm { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.cp-plain { color: var(--muted); }
.cp-cold { background: color-mix(in srgb, var(--a-bad) 12%, transparent); }
.cp-clash { background: color-mix(in srgb, var(--a-bad) 26%, transparent); }
.cp-self { color: var(--muted); }
.cp-key { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; margin: 2px 4px 2px 0; border: 1px solid var(--line); }
.np-dup { border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; margin: 10px 0; background: var(--paper); overflow-x: auto; }
.np-dup-h { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-bottom: 6px; }
.np-dup-act { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 8px; }
.np-dup-act select { height: 30px; padding: 0 24px 0 8px; }
#npcQ { height: 34px; padding: 0 10px; flex: 1 1 240px; min-width: 0; }
.np-grp > summary .hid { margin-left: 6px; }
@media (max-width: 640px) {
  .np-tbl .np-touch, .np-tbl .np-touch .nw { white-space: normal; overflow: visible; text-overflow: clip; word-break: keep-all; overflow-wrap: anywhere; }
  .np-facet { grid-template-columns: 4.5em minmax(0, 1fr); }
  #npcQ { flex-basis: 100%; }
}

/* ===== 地點管理 1-b：第二款分組展開；地圖與地點文件分段（static/admin.js 的 PL） ===== */
#places button.ghost { border: 1px solid var(--a-ink); background: var(--paper); color: var(--a-ink); }
#places button.ghost:hover { background: var(--a-hover); }
.plc-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 10px; }
.plc-summary button { height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); white-space: nowrap; }
.plc-summary button:hover { background: var(--a-hover); color: var(--ink); }
.plc-summary button.warn { color: var(--a-ink); border-color: color-mix(in srgb, var(--a-ink) 55%, var(--line)); }
.plc-summary button.bad { color: var(--a-bad); border-color: color-mix(in srgb, var(--a-bad) 55%, var(--line)); }
.plc-summary button b { color: var(--ink); font-variant-numeric: tabular-nums; }
.plc-summary button.bad b { color: var(--a-bad); }
.plc-summary .plc-base { margin-left: auto; }
.plc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.plc-search { flex: 1 1 240px; min-width: 0; }
.plc-search input { min-width: 0; width: 100%; }
.plc-sel { flex: 0 0 auto; }
.plc-sel select { max-width: 11em; }
#plcRouteFilterWrap[hidden] { display: none; }
.plc-view { flex: 0 0 auto; }
.plc-toolbar > button { flex: 0 0 auto; }
.plc-meta { margin-left: auto; white-space: nowrap; }
.plc-health { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); }
.plc-health[hidden] { display: none; }
.plc-health > b { display: inline-flex; align-items: center; gap: 5px; color: var(--a-ink); white-space: nowrap; }
.plc-health button { height: 28px; max-width: 100%; flex: 0 1 auto; padding: 0 9px; border-radius: 999px; font-size: 12px; color: var(--a-bad); white-space: nowrap; }
.plc-grp { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); margin: 10px 0; overflow: hidden; }
.plc-grp > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; font-weight: 700; }
.plc-grp > summary::-webkit-details-marker { display: none; }
.plc-grp > summary .ic { color: var(--a-ink); flex: none; }
.plc-grp > summary .cnt { margin-left: auto; min-width: 26px; text-align: center; padding: 1px 7px; border-radius: 999px; background: var(--field); color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.plc-pending > summary .cnt { background: var(--a-accent-bg); color: var(--a-on-accent); }
.plc-grp[open] > summary { border-bottom: 1px solid var(--line); }
.plc-body { padding: 10px; }
.plc-body-flush { padding: 0; }
.plc-legacy-sw { margin-left: 8px; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.plc-legacy-sw input { width: 16px; height: 16px; padding: 0; margin: 0; }
.plc-queue-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.plc-queue-bar .small { line-height: 1.5; }
.plc-queue-bar button { white-space: nowrap; }
.plc-triage-list { max-height: 42vh; overflow: auto; display: grid; gap: 8px; }
.plc-triage-mustbar { display: flex; align-items: center; gap: 8px; }
.plc-triage-must { margin: 2px 0 0; font-size: 13px; }
.plc-triage-mustbar #plcTriageDlgHelp { margin-left: auto; width: auto; flex: none; }
.plc-triage-helpbar { display: flex; justify-content: flex-end; align-items: center; }
.plc-triage-helpbar #plcTriageDlgHelp { width: auto; flex: none; }
.plc-triage-rest { border-top: 1px solid var(--line); height: 0; margin: 4px 0; }
.plc-triage-help { margin: 0; font-size: 13px; line-height: 1.65; color: var(--muted); }
.plc-triage-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--raise); }
.plc-triage-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.plc-triage-pick input[type="checkbox"] { width: 18px; height: 18px; flex: none; margin: 0; padding: 0; }
.plc-triage-pick b, .plc-triage-pick .small { white-space: nowrap; }
.plc-triage-action { width: 100%; }
.plc-triage-row select, .plc-triage-row input[type="text"], .plc-triage-row input[type="number"] { width: 100%; min-width: 0; max-width: 100%; height: 36px; }
.plc-triage-adopt, .plc-triage-into, .plc-triage-note { grid-column: 1 / -1; }
.plc-triage-adopt { display: grid; gap: 6px; }
.plc-triage-into { display: flex; align-items: center; gap: 6px; min-width: 0; }
.plc-triage-into > span { flex: none; white-space: nowrap; }
.plc-triage-adopt[hidden], .plc-triage-into[hidden] { display: none; }
.plc-triage-phrase { display: flex; align-items: center; gap: 6px; min-width: 0; }
.plc-triage-phrase > span, .plc-triage-phrase > em { flex: none; white-space: nowrap; }
.plc-triage-dist { display: flex; align-items: center; gap: 6px; }
.plc-triage-dist input { flex: 1 1 auto; }
.plc-triage-dist span, .plc-triage-dist em { white-space: nowrap; flex: none; font-style: normal; }
.plc-triage-note { margin: 0; color: var(--a-bad); font-size: 12.5px; }
.plc-triage-note.is-known { color: var(--muted); }
.plc-queue { display: grid; gap: 8px; }
.plc-qcard { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 4px 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--raise); }
.plc-qcard.plc-far { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.plc-qcheck { padding-top: 2px; }
.plc-qcheck input { width: 16px; height: 16px; padding: 0; margin: 0; accent-color: var(--accent); }
.plc-qname { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.plc-qname b { font-family: var(--serif); font-size: 15.5px; white-space: nowrap; }
.plc-qmain p { margin: 3px 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.plc-qmeta, .plc-qpeople { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11.5px; color: var(--muted); }
.plc-qpeople { margin-top: 3px; color: var(--a-ink); }
.plc-qacts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.plc-qacts button { min-height: 32px; white-space: nowrap; }
.plc-origin { margin: 5px 0 0 !important; padding: 6px 8px; border-left: 2px solid var(--line-strong); color: var(--ink) !important; background: var(--paper); }
.plc-empty { padding: 16px 12px; color: var(--muted); font-size: 13px; }
.plc-realm, .plc-region { margin: 0; border-bottom: 1px solid var(--line); }
.plc-realm:last-child, .plc-region:last-child { border-bottom: 0; }
.plc-realm > summary, .plc-region > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px; }
.plc-realm > summary::-webkit-details-marker, .plc-region > summary::-webkit-details-marker { display: none; }
.plc-realm > summary { background: var(--raise); font-weight: 700; }
.plc-region > summary { padding-left: 28px; font-size: 13px; }
.plc-realm > summary .ic { color: var(--a-ink); }
.plc-cnt { margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.plc-tier { display: inline-flex; align-items: center; justify-content: center; min-width: 2.4em; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; border: 1px solid var(--line-strong); color: var(--muted); background: var(--paper); }
.plc-tier-府 { color: var(--plc-fu-ink); border-color: var(--plc-fu-line); background: var(--plc-fu-soft); }
.plc-tier-城 { color: var(--a-frost); border-color: color-mix(in srgb, var(--a-frost) 50%, var(--line)); background: var(--a-frost-soft); }
.plc-tier-鎮, .plc-tier-地點 { color: var(--a-ink); border-color: color-mix(in srgb, var(--a-ink) 45%, var(--line)); background: var(--accent-soft); }
.plc-tier-村 { color: var(--a-ok); border-color: color-mix(in srgb, var(--a-ok) 45%, var(--line)); background: var(--ok-soft); }
.plc-tier-野地 { color: var(--a-ok); border-style: dashed; }
.plc-row { border-top: 1px solid var(--line); }
.plc-row:first-child { border-top: 0; }
.plc-pick { width: 100%; height: 42px; padding: 0 10px 0 30px; border: 0; border-radius: 0; background: transparent; display: grid; grid-template-columns: minmax(0, 1fr) auto 86px; align-items: center; gap: 10px; text-align: left; }
.plc-pick:hover, .plc-pick[aria-expanded="true"] { background: var(--a-hover); }
.plc-name, .plc-row-meta, .plc-dist { min-width: 0; }
.plc-name { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.plc-name b { font-size: 13.5px; white-space: nowrap; }
.plc-row-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; overflow: hidden; }
.plc-dist { color: var(--muted); font-size: 12px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plc-tag { display: inline-flex; align-items: center; gap: 3px; width: max-content; max-width: 100%; min-height: 20px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font-size: 10.5px; font-weight: 500; white-space: nowrap; }
.plc-tag .ic { font-size: 11px; }
.plc-tag.warm { color: var(--a-ink); border-color: color-mix(in srgb, var(--a-ink) 40%, var(--line)); }
.plc-tag.bad { color: var(--a-bad); border-color: color-mix(in srgb, var(--a-bad) 45%, var(--line)); }
.plc-tag.ok { color: var(--a-ok); border-color: color-mix(in srgb, var(--a-ok) 45%, var(--line)); }
.plc-inline-drawer { padding: 10px; background: var(--bg); border-top: 1px solid var(--line); }
.plc-table-wrap { overflow: visible; }
.plc-tbl { table-layout: fixed; width: 100%; }
.plc-tbl th, .plc-tbl td { padding: 7px 8px; vertical-align: middle; }
.plc-tbl th:first-child, .plc-tbl td:first-child { width: 28%; }
.plc-tbl th:nth-child(2), .plc-tbl td:nth-child(2) { width: 16%; }
.plc-tbl th:nth-child(3), .plc-tbl td:nth-child(3) { width: 13%; }
.plc-tbl th:nth-child(4), .plc-tbl td:nth-child(4) { width: 8%; }
.plc-tbl th:nth-child(5), .plc-tbl td:nth-child(5) { width: 12%; }
.plc-tbl th:nth-child(6), .plc-tbl td:nth-child(6) { width: 13%; }
.plc-tbl th:nth-child(7), .plc-tbl td:nth-child(7) { width: 10%; }
.plc-tbl td:first-child .plc-tag { margin: 2px 3px 0 0; }
.plc-name-btn { height: auto; padding: 0; border: 0; background: transparent; color: var(--a-ink); font: inherit; font-weight: 700; text-decoration: underline dotted; white-space: nowrap; }
.plc-routes { display: grid; }
.plc-route-card { display: grid; grid-template-columns: minmax(0, 1.8fr) 90px 70px 52px auto auto; align-items: center; gap: 8px; min-height: 42px; padding: 6px 10px; border-top: 1px solid var(--line); font-size: 12.5px; }
.plc-route-card:first-child { border-top: 0; }
.plc-route-card.provisional { box-shadow: inset 3px 0 0 var(--accent); }
.plc-route-ends { display: flex; align-items: center; gap: 5px; min-width: 0; white-space: nowrap; }
.plc-route-ends button { height: auto; padding: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 600; white-space: nowrap; }
.plc-route-ends span { color: var(--muted); }
.plc-route-length { color: var(--a-ink); white-space: nowrap; }
.plc-drawer { border: 1px solid var(--line-strong); border-radius: 12px; background: var(--raise); padding: 12px 14px; }
.plc-dh { display: flex; align-items: flex-start; gap: 10px; padding: 0 0 10px; border-bottom: 1px solid var(--line); }
.plc-dh > div { min-width: 0; flex: 1; }
.plc-dh-name { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 7px; font-family: var(--serif); font-size: 17px; font-weight: 700; }
.plc-dh-name > b { white-space: nowrap; }
.plc-close { flex: none; }
.plc-form label { min-width: 0; }
.plc-form label > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.plc-form label.plc-wide { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.plc-form label.plc-wide input:not([type=checkbox]) { flex: 0 0 34px; width: 100%; height: 34px; }
.plc-form textarea { width: 100%; min-height: 54px; padding: 7px 9px; resize: vertical; }
.plc-wide { flex: 1 1 100%; }
.plc-fixed-aliases { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.plc-alias { display: inline-flex; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); font-size: 11.5px; white-space: nowrap; }
.plc-alias.fixed { border-style: dashed; color: var(--muted); }
.plc-inline { display: inline-flex !important; align-items: center; gap: 6px; white-space: nowrap; }
.plc-inline input { width: 17px; height: 17px; padding: 0; margin: 0; accent-color: var(--accent); }
.plc-note { flex: 1 1 240px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.plc-doc-actions { display: flex; justify-content: flex-end; }
.plc-gossip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 200px) auto; align-items: end; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--line-strong); }
.plc-gossip > div { display: flex; flex-direction: column; gap: 1px; }
.plc-gossip label { display: flex; flex-direction: column; gap: 3px; }
.plc-gossip button { white-space: nowrap; }
.plc-route-editor { display: grid; gap: 6px; }
.plc-route-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); align-items: end; gap: 7px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.plc-route-edit > button, .plc-route-other { grid-column: 1 / -1; justify-self: start; }
.plc-area { padding: 5px 0; }
.plc-area > summary { color: var(--ink); font-size: 13px; cursor: pointer; padding: 6px; }
.plc-region-version { font-size: 12px; padding: 4px 8px; color: var(--ink); }
#plcGossip { width: 100%; min-height: 40px; color: var(--ink); background: var(--paper); }
.plc-gossip label { align-items: stretch; width: 100%; }
.plc-similar { color: var(--ink); }
.box:has(.plc-moved-title) p { margin: 6px 0 0; }
.plc-route-edit.deleted { opacity: .45; text-decoration: line-through; }
.plc-route-edit.plc-route-player-days { border-color: var(--a-bad); background: var(--danger-soft); }
.plc-route-edit.plc-route-player-days input:disabled { opacity: .72; cursor: not-allowed; }
.plc-route-other { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.plc-route-other b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plc-route-other em { font-style: normal; font-size: 11px; color: var(--muted); }
.plc-route-edit label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.plc-route-edit input, .plc-route-edit select { width: 100%; min-width: 0; height: 32px; }
.plc-route-edit input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.plc-provisional-distance { border-bottom: 1px dashed currentColor; }
.plc-path { font-size: 13px; line-height: 1.7; color: var(--ink); }
.plc-path span { color: var(--muted); }
.plc-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; font-size: 13px; }
.plc-kv > span { color: var(--muted); }
.plc-kv > b { font-weight: 500; }
.plc-list2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 4px 12px; font-size: 13px; }
.plc-list2 .dead { color: var(--muted); text-decoration: line-through; }
.plc-version-list { display: grid; gap: 6px; }
.plc-version { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; align-items: start; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.plc-version:first-child { border-top: 0; }
.plc-version time { color: var(--muted); white-space: nowrap; }
.plc-version > span { overflow-wrap: anywhere; }
.plc-version button { white-space: nowrap; }
.plc-drawer-act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.plc-drawer-loading { margin: 0; padding: 10px; }
.plc-diff { display: grid; gap: 5px; }
.plc-diff > div { display: flex; flex-wrap: wrap; gap: 4px 7px; font-size: 12.5px; }
.plc-diff .old { color: var(--muted); text-decoration: line-through; }
.plc-impact { display: grid; gap: 3px; font-size: 12.5px; }
.plc-blocked { margin: 0; padding-left: 18px; color: var(--a-bad); font-size: 12.5px; line-height: 1.65; }
@media (max-width: 900px) {
  .plc-search { flex-basis: 100%; }
  .plc-sel { flex: 1 1 150px; }
  .plc-sel select { width: 100%; max-width: none; }
  .plc-meta { margin-left: 0; }
  .plc-summary .plc-base { margin-left: 0; }
}
@media (max-width: 640px) {
  .plc-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .plc-summary button { min-width: 0; padding: 0 6px; font-size: 11.5px; }
  .plc-summary .plc-base { grid-column: span 2; justify-self: stretch; }
  .plc-toolbar { gap: 6px; }
  .plc-view { width: 100%; }
  .plc-view button { flex: 1 1 0; }
  .plc-toolbar > button { flex: 1 1 auto; justify-content: center; }
  .plc-health button { max-width: 100%; white-space: nowrap; overflow-wrap: normal; }
  .plc-meta { flex-basis: 100%; }
  .plc-grp > summary { padding: 0 10px; }
  .plc-legacy-sw { margin-left: auto; }
  .plc-queue-bar { align-items: flex-start; flex-wrap: wrap; }
  .plc-queue-bar .small { flex: 1 1 100%; }
  .plc-queue-bar button { width: 100%; justify-content: center; }
  .plc-triage-row { grid-template-columns: minmax(0, 1fr); }
  .plc-triage-action { grid-column: 1; width: 100%; }
  .plc-triage-row select, .plc-triage-row input[type="text"], .plc-triage-row input[type="number"] { width: 100%; }
  #plcTriageHelp, #plcTriage { width: auto; flex: none; }
  .plc-qcard { grid-template-columns: 24px minmax(0, 1fr); }
  .plc-qacts { grid-column: 1 / -1; justify-content: stretch; }
  .plc-qacts button { flex: 1 1 28%; justify-content: center; }
  .plc-realm > summary, .plc-region > summary { min-height: 44px; }
  .plc-region > summary { padding-left: 20px; }
  .plc-pick { height: auto; min-height: 56px; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name dist" "meta meta"; gap: 3px 8px; padding: 7px 10px 7px 18px; }
  .plc-name { grid-area: name; }
  .plc-dist { grid-area: dist; }
  .plc-row-meta { grid-area: meta; justify-content: flex-start; flex-wrap: wrap; overflow: visible; }
  .plc-tbl thead { display: none; }
  .plc-tbl, .plc-tbl tbody, .plc-tbl tr, .plc-tbl td { display: block; width: 100%; }
  .plc-tbl tr { padding: 9px 10px; border-top: 1px solid var(--line); }
  .plc-tbl tr:first-child { border-top: 0; }
  .plc-tbl td { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; text-align: right; }
  .plc-tbl td::before { content: attr(data-l); color: var(--muted); text-align: left; }
  .plc-tbl td:first-child { display: block; padding-bottom: 4px; text-align: left; }
  .plc-tbl td:first-child::before { display: none; }
  .plc-tbl td:first-child .plc-tag { margin-top: 3px; }
  .plc-route-card { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 9px 10px; }
  .plc-route-ends, .plc-route-length { white-space: normal; }
  .plc-route-card > :not(.plc-route-ends) { justify-self: start; }
  .plc-drawer { padding: 10px; }
  .plc-version { grid-template-columns: 1fr auto; }
  .plc-version > span { grid-column: 1 / -1; grid-row: 2; }
  .plc-gossip { grid-template-columns: 1fr; }
  .plc-route-edit { grid-template-columns: 1fr 1fr; }
  .plc-route-other { grid-column: 1 / -1; }
  .plc-route-edit .plc-tag { align-self: center; }
  .plc-drawer-act button { flex: 1 1 auto; justify-content: center; }
}
@media (min-width: 600px) {
  .plc-triage-adopt { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.35fr) minmax(0, 0.9fr); align-items: center; }
}
.plc-triage-phrase select, .plc-triage-phrase input, .plc-triage-into input { width: 0; flex: 1 1 auto; min-width: 0; max-width: 100%; }

/* 共用世界健檢與全站物品掃描的按鈕列間距。 */
#relicHealthBar { margin-top: var(--sp-2); }

@media (max-width: 640px) {
  .sk-6 { display: inline-flex; margin: 0 0 8px; }
}

/* 1-B 維護區（暫放在「共用世界健檢」最下面；1-G 改版時搬走） */
.hk-maint { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); margin-top: 12px; padding: 0 14px; }
.hk-maint-sum { padding: 12px 0; font-weight: 600; cursor: pointer; }
.hk-maint-sum::marker { color: var(--muted); }
.hk-maint-body { border-top: 1px dashed var(--line); padding: 12px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.hk-maint, .dlg.tone-hkm .dlg-lead, .dlg .hk-maint-kv, .dlg .hk-maint-note, .dlg .hk-maint-chip { word-break: keep-all; overflow-wrap: anywhere; text-wrap: pretty; }   /* 中文只在標點與空白換行，不把詞拆開 */
.hk-maint-lead { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.hk-maint-lead > span { display: block; }   /* 一句一行，斷點自然；單句太長時才在標點換行 */
.nw { white-space: nowrap; }
.adm-acts { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
@media (max-width: 640px) { .adm-row .adm-acts { flex: 1 1 100%; } }   /* 手機：所有列的按鈕都在文字下方、靠左同一位置 */
.hk-maint-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hk-maint-actions button { white-space: normal; height: auto; min-height: 30px; padding-top: 4px; padding-bottom: 4px; text-align: left; }
.hk-maint-preview { display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 1.6; }
.hk-maint-kv { display: flex; flex-direction: column; gap: 2px; }
.hk-maint-kv span { color: var(--muted); font-size: 12px; }
.hk-maint-kv b { font-weight: 500; overflow-wrap: anywhere; }
.hk-maint-chip { display: inline-block; margin: 0 4px 4px 0; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font-size: 12px; }
.hk-maint-note { color: var(--muted); font-size: 12px; line-height: 1.7; }
.dlg .hk-maint-edges { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dlg .hk-maint-edge { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
.dlg .hk-maint-edge:first-child { border-top: 0; }
.dlg .hk-maint-edge b { font-weight: 600; }
.dlg .hk-maint-edge em { color: var(--muted); font-style: normal; font-size: 12px; }
.dlg .hk-maint-more { margin-top: 4px; font-size: 13px; }
.dlg .hk-maint-more summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.hk-maint-kin-box { border-top: 1px dashed var(--line); padding-top: 10px; }
.hk-maint-kin-hd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.hk-maint-kin-hd h3 { margin: 0; font-size: 14px; font-weight: 600; }
.hk-maint-kin-list { display: flex; flex-direction: column; }
.hk-maint-kin { display: grid; grid-template-columns: minmax(190px, .85fr) minmax(180px, 1fr) auto; gap: 8px 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.hk-maint-kin:first-child { border-top: 0; }
.hk-maint-kin-main { min-width: 0; }
.hk-maint-kin-pair { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 14px; }
.hk-maint-kin-pair b { font-weight: 600; overflow-wrap: anywhere; }
.hk-maint-kin-pair .rel { color: var(--ink); font-weight: 500; }
.hk-maint-kin-why { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.hk-maint-kin-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.hk-maint-kin-acts button { white-space: nowrap; min-width: 58px; }
.hk-maint-empty { margin: 0; padding: 10px 0 2px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.hk-maint-tn-box { border-top: 1px dashed var(--line); padding-top: 10px; }
.hk-maint-tn-box h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.hk-maint-tn-box p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.hk-maint-tn-done { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); font-size: 13px; line-height: 1.7; }
.hk-maint-tn-done b { display: block; font-size: 14px; font-weight: 600; }
.hk-maint-tn-done span { color: var(--muted); }
@media (max-width: 760px) {
  .hk-maint-kin { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .hk-maint-kin-acts { justify-content: flex-start; }
  .hk-maint-kin-acts button { flex: 1 1 120px; }
}

/* NPC 管理各組表格：手機改成一位一張小卡（人物名＋徽章一列，其餘六項成兩欄小字），不橫向捲動；排序用上方的「排列」下拉 */
@media (max-width: 640px) {
  .np-scroll { overflow-x: visible; }
  .np-tbl thead, .np-tbl colgroup { display: none; }
  .np-tbl, .np-tbl tbody { display: block; width: 100%; }
  .np-tbl tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 12px; padding: 10px 2px; border-top: 1px solid var(--line); }
  .np-tbl tbody tr:first-child { border-top: 0; }
  .np-tbl td { display: block; border: 0; padding: 0; font-size: 12.5px; min-width: 0; }
  .np-tbl td[data-l]::before { content: attr(data-l) "　"; color: var(--muted); }
  .np-tbl td.nm { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 14px; margin-bottom: 2px; }
  .np-tbl td.nm .np-tag { margin: 0; }
  .np-tbl td.nm .np-tag.np-tn, .np-tbl td.nm .np-tag.np-dead { margin-left: 0; }
  .np-dep-tbl .np-dep-cause, .np-dep-tbl .np-touch { grid-column: 1 / -1; }
  .np-dep-tbl .np-nowrap { white-space: nowrap; }
}
/* ===== 人物語氣（NPC 個別語氣，T-B）：摘要＋兩個底線頁籤。條件表／已調整的人物清單看 #tnBox 自己的寬度：≥900px 對齊成表格、較窄就一條（一人）一張卡 ===== */
.tn-box { container-type: inline-size; gap: 12px; }
.tn-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; font-size: 13px; color: var(--muted); }
.tn-meta > span { white-space: nowrap; }
.tn-mode { font-weight: 600; color: var(--a-bad); }
.tn-mode.on { color: var(--a-ok); }
.tn-box .tn-off { margin: 0; }
.tn-sum { border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; font-size: 14px; line-height: 1.75; background: var(--bg); word-break: keep-all; overflow-wrap: anywhere; }
.tn-nw { white-space: nowrap; }
.tn-dot { color: var(--muted); padding: 0 6px; }
.tn-tabs { display: flex; flex-wrap: wrap; gap: 2px 6px; border-bottom: 1px solid var(--line); margin-top: 2px; }
.tn-tabs button { height: 40px; padding: 0 14px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.tn-tabs button:hover { border-bottom-color: var(--line-strong); color: var(--ink); }
.tn-tabs button[aria-selected="true"], .tn-tabs button[aria-selected="true"]:hover { border-bottom-color: var(--a-ink); color: var(--a-ink); font-weight: 600; }
.tn-panel { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tn-panel[hidden] { display: none; }
.tn-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 8px; }
.tn-acts, .tn-go { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tn-go { margin-left: auto; }
.tn-bar button { white-space: nowrap; }
.tn-narrow { display: none; }
.tn-actsel select { width: auto; min-width: 7em; }
.tn-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tn-msg { margin: 0; flex: 1 1 100%; font-size: 13px; color: var(--muted); min-height: 1.4em; }
.tn-msg:empty { display: none; }
.tn-head, .tn-row { display: grid; grid-template-columns: 22px 104px 132px minmax(0, 1fr) 84px 244px 98px; gap: 0 10px; align-items: start; }
.tn-head { padding: 0 2px 6px 6px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tn-list { display: flex; flex-direction: column; margin-top: -10px; }
.tn-item { border-bottom: 1px solid var(--line); position: relative; }
.tn-item.dirty { background: color-mix(in srgb, var(--accent) 7%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.tn-row { padding: 9px 2px 8px 6px; }
.tn-c { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tn-cap { display: none; font-size: 12px; color: var(--muted); }
.tn-no { height: 34px; justify-content: center; align-items: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.tn-box .tn-c input, .tn-box .tn-c select { height: 34px; padding: 0 8px; font-size: 13.5px; }
.tn-box select { background-position: calc(100% - 16px) calc(50% - 1px), calc(100% - 11px) calc(50% - 1px); }
.tn-box input[type=number] { appearance: textfield; -moz-appearance: textfield; font-variant-numeric: tabular-nums; }
.tn-box input[type=number]::-webkit-outer-spin-button, .tn-box input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tn-rel select { padding-right: 24px; }
.tn-note { display: none; font-size: 12px; color: var(--muted); line-height: 1.5; }
.tn-cust { display: flex; align-items: center; gap: 4px; }
.tn-cust i { font-style: normal; color: var(--muted); }
.tn-cust input { min-width: 0; text-align: center; padding: 0 4px; }
.tn-cats { display: flex; flex-wrap: wrap; gap: 4px; min-height: 34px; align-content: center; }
.tn-cat { font-size: 12px; padding: 1px 8px; border: 1px solid var(--line-strong); border-radius: 999px; white-space: nowrap; color: var(--ink); line-height: 1.6; }
.tn-cat.all { color: var(--muted); border-style: dashed; }
.tn-pick { align-self: flex-start; height: 26px; }
.tn-pick .ic { font-size: 12px; transition: transform .15s; }
.tn-pick[aria-expanded="true"] .ic { transform: rotate(180deg); }
.tn-inp { display: flex; align-items: center; gap: 5px; }
.tn-inp input { width: 100%; min-width: 0; }
.tn-inp em { font-style: normal; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.tn-mixs { display: flex; align-items: flex-end; gap: 4px; }
.tn-lv { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 36px; flex: none; }
.tn-lv span { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.tn-lv input { width: 36px; padding: 0 2px; text-align: center; }
.tn-mixs .tn-tot { align-self: flex-end; line-height: 34px; min-width: 44px; margin-left: 4px; white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }
.tn-mixs .tn-tot.bad { color: var(--a-bad); font-weight: 600; }
.tn-hint { font-size: 12px; color: var(--a-bad); line-height: 1.5; }
.tn-hint:empty { display: none; }
.tn-op { display: flex; gap: 4px; align-items: center; height: 34px; }
.small-btn.tn-ib { width: 28px; padding: 0; justify-content: center; }
.tn-xt { display: none; }
.tn-catpanel { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; padding: 2px 2px 10px 6px; }
.tn-catpanel[hidden] { display: none; }
.tn-chip { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; font-size: 13px; min-width: 0; }
.tn-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.tn-chip input { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; flex: none; accent-color: var(--accent); }
.tn-chip b { font-weight: 600; white-space: nowrap; }
.tn-chip i { font-style: normal; font-size: 11.5px; color: var(--muted); min-width: 0; word-break: keep-all; overflow-wrap: anywhere; }
.tn-chip:focus-within { outline: 2px solid var(--a-ink); outline-offset: 1px; }
.tn-err { margin: 0; padding: 0 2px 8px 6px; font-size: 12.5px; color: var(--a-bad); }
.tn-err:empty { display: none; }
.tn-none { margin: 0; padding: 16px 2px; }
.tn-foot { margin: -4px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.tn-hist { border-top: 1px solid var(--line); }
.tn-hist > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 2px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.tn-hist > summary::-webkit-details-marker { display: none; }
.tn-hist > summary .ic { color: var(--a-ink); font-size: 16px; }
.tn-hist > summary em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); }
.tn-hist[open] > summary { border-bottom: 1px solid var(--line); }
/* ② 已調整的人物 */
.tn-lbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.tn-seg { width: auto; flex: none; }
.tn-seg button { flex: none; padding: 0 12px; height: 32px; font-size: 13px; gap: 6px; white-space: nowrap; }
.tn-seg button b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tn-seg button.on { color: var(--a-ink); }
.tn-lsel select { width: auto; min-width: 9em; height: 36px; }
.tn-q { flex: 1 1 220px; max-width: 360px; }
.tn-pgs { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.tn-live { margin: 0; font-size: 13px; color: var(--a-ok); }
.tn-live:empty { display: none; }
.tn-empty { padding: 20px 2px; font-size: 13.5px; line-height: 1.8; color: var(--muted); max-width: 60ch; }
.tn-lhead, .tn-lrow { display: grid; grid-template-columns: minmax(90px, 1.1fr) minmax(80px, 1.1fr) 48px 148px 44px 86px minmax(90px, 1.2fr) 92px; gap: 0 10px; align-items: center; }
.tn-lhead { padding: 0 2px 6px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tn-lrow { padding: 8px 2px; border-top: 1px solid var(--line); }
.tn-lc { min-width: 0; font-size: 13.5px; overflow-wrap: anywhere; word-break: keep-all; }
.tn-lc.tn-ls, .tn-lc.tn-lsrc { white-space: nowrap; color: var(--muted); font-size: 13px; }
.tn-lat { white-space: nowrap; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tn-lby, .tn-lr { color: var(--muted); font-size: 13px; }
.tn-open { text-align: left; white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }
.tn-lt select { height: 34px; padding: 0 8px; font-size: 13.5px; width: 100%; }
.tn-lvt { font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.tn-lact button { white-space: nowrap; }
.tn-drbtn { display: none; }
.tn-dash { color: var(--muted); }
.tn-lmsg { grid-column: 1 / -1; margin: 0; font-size: 12.5px; color: var(--a-ink); font-weight: 600; }
.tn-lmsg:empty { display: none; }
.tn-ltbl .sk-m { display: none; }
/* 補抽對話框、抽屜的語氣下拉 */
.tn-bf { display: flex; flex-direction: column; gap: 6px; }
.tn-bf-l { margin: 0; font-size: 13.5px; line-height: 1.7; }
.tn-bf-none { color: var(--muted); }
.tn-amber { margin: 0; padding: 8px 12px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft); color: var(--a-ink); font-size: 13px; font-weight: 600; line-height: 1.6; }
.tn-bf-list ul { list-style: none; margin: 0; padding: 0; }
.tn-bf-list li { display: flex; align-items: baseline; gap: 10px; padding: 6px 4px; border-top: 1px solid var(--line); font-size: 13px; }
.tn-bf-list li:first-child { border-top: 0; }
.tn-bf-list li b { font-weight: 600; white-space: nowrap; }
.tn-bf-list li span { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.tn-bf-list li em { margin-left: auto; font-style: normal; color: var(--a-ink); white-space: nowrap; }
.tn-bf-list li.more { color: var(--muted); }
.tn-dr { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tn-dr .small { line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
@container (max-width: 899px) {
  .tn-wide { display: none; }
  .tn-narrow { display: inline-flex; }
  .tn-bar > .tn-acts { flex: 1 1 100%; }
  .tn-go { margin-left: 0; flex: 1 1 100%; }
  .tn-go button { flex: 1 1 0; justify-content: center; }
  .tn-acts > button, .tn-actsel { flex: 1 1 auto; }
  .tn-actsel select { width: 100%; }
  .tn-box button:not(.small-btn):not(.sk), .tn-box .tn-c input, .tn-box .tn-c select, .tn-box .tn-lt select, .tn-box .tn-q input, .tn-box .tn-lsel select, .tn-box .tn-actsel select, .tn-box .sk-m select { min-height: 44px; height: 44px; }
  .tn-box .tn-seg button, .tn-tabs button { min-height: 44px; height: 44px; }
  .tn-box .small-btn { min-height: 44px; height: 44px; font-size: 13px; }
  .tn-head { display: none; }
  .tn-list { margin-top: 0; gap: 8px; }
  .tn-item { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 6px 10px 2px; }
  .tn-item.dirty { background: color-mix(in srgb, var(--accent) 7%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
  .tn-row { grid-template-columns: 24px minmax(0, 1fr) auto auto; grid-template-areas: "no nm up dn" "rel rel rel rel" "ct ct ct ct" "p p p p" "mx mx mx mx" "del del del del"; gap: 8px 8px; padding: 6px 0 8px; align-items: center; }
  .tn-no { grid-area: no; height: auto; }
  .tn-nm { grid-area: nm; } .tn-rel { grid-area: rel; } .tn-ct { grid-area: ct; } .tn-p { grid-area: p; } .tn-mx { grid-area: mx; }
  .tn-op { display: contents; }
  .tn-op [data-tn-up] { grid-area: up; } .tn-op [data-tn-down] { grid-area: dn; } .tn-op [data-tn-del] { grid-area: del; justify-self: end; }
  .small-btn.tn-ib { width: 44px; }
  .small-btn.tn-ib[data-tn-del] { width: auto; padding: 0 14px; }
  .tn-x { display: none; } .tn-xt { display: inline; }
  .tn-nm .tn-cap { display: none; }
  .tn-cap { display: block; }
  .tn-note { display: block; }
  .tn-nm input { font-weight: 600; }
  .tn-p .tn-inp input { width: 112px; }
  .tn-pick { height: 44px; }
  .tn-mixs { flex-wrap: wrap; row-gap: 6px; align-items: center; }
  .tn-lv { flex-direction: row; width: auto; gap: 4px; align-items: center; }
  .tn-lv span { font-size: 13px; color: var(--muted); }
  .tn-lv input { width: 56px; }
  .tn-mixs .tn-tot { line-height: 44px; }
  .tn-catpanel { padding: 0 0 8px; }
  .tn-err { padding: 0 0 8px; }
  .tn-ltbl { display: flex; flex-direction: column; gap: 8px; }
  .tn-ltbl .sk-m { display: inline-flex; margin: 0 0 2px; }
  .tn-lhead { display: none; }
  .tn-lrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--paper); }
  .tn-ln { order: 1; flex: 0 1 auto; font-weight: 600; font-size: 15px; }
  .tn-lr { order: 2; flex: 1 1 auto; }
  .tn-ls { order: 3; margin-left: auto; }
  .tn-lsrc, .tn-lat, .tn-lby { order: 4; flex: none; font-size: 12.5px; }
  .tn-lsrc::after, .tn-lat::after { content: "・"; padding-left: 10px; }
  .tn-lt { order: 5; flex: 1 1 100%; }
  .tn-lact { order: 6; flex: 1 1 100%; display: flex; gap: 8px; }
  .tn-lact button { flex: 1 1 0; justify-content: center; }
  .tn-lact .tn-dash { display: none; }
  .tn-drbtn { display: inline-flex; }
  .tn-lmsg { order: 7; flex: 1 1 100%; }
  .tn-lbar .tn-q { flex: 1 1 100%; max-width: none; }
  .tn-lbar .tn-lsel { flex: 1 1 100%; }
  .tn-lsel select { flex: 1 1 auto; }
  .tn-seg { max-width: 100%; overflow-x: auto; }
  .tn-pgs { margin-left: 0; flex: 1 1 100%; justify-content: space-between; }
}
@container (max-width: 480px) { .tn-catpanel { grid-template-columns: 1fr; } }
@container (min-width: 560px) and (max-width: 899px) {   /* 卡片放得下兩欄：性情與命中並排，少一行 */
  .tn-row { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr) auto auto; grid-template-areas: "no nm nm up dn" "rel rel p p p" "ct ct ct ct ct" "mx mx mx mx mx" "del del del del del"; }
}
@media (max-width: 640px) { .np-facet { grid-template-columns: 4.5em minmax(0, 1fr); } #npcQ { flex-basis: 100%; } }   /* 手機底細一列放完（名稱、輸入），不另起一行 */

/* ==========================================================================
   UI-1 機緣簿（2026-10-19）：清單密度、卡片編輯分組、獎勵列與手機斷點。
   只在 .fb-* 內生效；編輯區仍是清單列下方展開。
   ========================================================================== */
.fb-toolbar .fb-status { flex: 0 1 auto; }
.fb-toolbar .fb-q { flex: 0 1 calc(24ch + 16px); max-inline-size: 100%; }
.fb-toolbar .fb-q input { inline-size: 100%; }
.fb-head, .fb-row { grid-template-columns: minmax(0, 1.6fr) 8.5em minmax(0, 1.3fr) minmax(0, 1.2fr) 9em 5em; }
.fb-item, .fb-c.fb-cond, .fb-c.fb-reward, .fb-c.fb-rule, .fb-row { min-width: 0; }
.fb-c.fb-cond, .fb-c.fb-reward, .fb-c.fb-rule { overflow-wrap: anywhere; }
.fb-row .fb-c.fb-cond { display: block; min-height: 0; padding: 0; border: 0; }
@media (min-width: 960px) and (max-width: 1199px) {
  .fb-row .fb-c.fb-cond { display: none; }
}

/* 展開卡：固定 760px 上限，標頭與操作列 sticky。 */
.fb-drawer-box.np-drawer {
  display: block;
  inline-size: 100%;
  max-inline-size: 760px;
  margin: 4px 0 16px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--raise);
  container: af / inline-size;
}
.fb-drawer-box > .np-dh {
  position: sticky;
  top: 0;
  z-index: 4;
  min-block-size: calc(var(--af-h) + var(--sp-3) * 2);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
  background: var(--raise);
}
.fb-drawer-box > .np-dh h3 { font-size: 18px; line-height: 1.35; }
.fb-drawer-box .fb-close { margin-inline-start: auto; flex: none; }
.fb-drawer-box .af-sum {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  padding: 0;
  overflow: visible;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  text-overflow: clip;
}
.fb-sum-piece, .fb-sum-sep { white-space: nowrap; }
.fb-sum-sep { color: var(--muted); }
.fb-drawer-body { padding-bottom: var(--sp-1); }

/* 七段：14px 粗體＋ SVG；第一段不畫上線。 */
.fb-drawer-box .fb-sec { padding: var(--sp-4) 0; border-top: 1px solid var(--line); }
.fb-drawer-box .fb-drawer-body > .fb-sec:first-child { padding-top: var(--sp-2); border-top: 0; }
.fb-drawer-box .fb-sec > summary.af-sec-h {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  list-style: none;
}
.fb-drawer-box .fb-sec > summary.af-sec-h:has(.af-sec-tools) { min-block-size: var(--af-h-sm); }
.fb-drawer-box .fb-sec > summary.af-sec-h::-webkit-details-marker { display: none; }
.fb-drawer-box .fb-sec > summary.af-sec-h > .ic:first-child {
  color: var(--muted);
  font-size: 14px;
  transition: transform .15s ease;
}
.fb-drawer-box .fb-sec[open] > summary.af-sec-h > .ic:first-child { transform: rotate(90deg); }
.fb-drawer-box .fb-sec-h .ic { color: var(--a-ink); }

/* 基本＋文案：四語兩欄，375 一欄。 */
.fb-title-grid, .fb-copy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--af-gy) var(--af-gx); inline-size: 100%; }
.fb-title-grid .af-f, .fb-copy-grid .af-f { inline-size: 100%; max-inline-size: 100%; }
.fb-drawer-box .af-kv > .af-v { align-items: center; }
.fb-drawer-box .af-kv > .af-v > .af-help { margin-block: 0; }
.fb-inline-help { align-self: center; }
.fb-basic-pair { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--af-gx); min-width: 0; }
.fb-sec-tools .af-add { margin: 0; }
.fb-test-label { display: inline-block; inline-size: auto; font-size: 0; line-height: 0; color: transparent; }
.fb-test-label::after { content: attr(data-label); font-size: 13px; line-height: normal; color: var(--ink); }
.fb-sec-h { position: relative; }
.fb-sec-h:has(.af-sec-tools) { padding-inline-end: 130px; }
.fb-sec-h .af-sec-tools { position: absolute; inset-inline-end: 0; inset-block-start: 50%; transform: translateY(-50%); margin: 0; }
.fb-drawer-box .af-sub { margin-top: var(--sp-2); padding-top: var(--sp-2); }
.fb-drawer-box .fb-sec > summary.af-sec-h:has(.af-sec-tools) {
  block-size: var(--af-h-sm);
  min-block-size: var(--af-h-sm);
  padding-block: 0;
}
.fb-builtin-rule { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); margin-top: var(--sp-3); color: var(--ink); }
.fb-lock-inline { display: inline-flex; align-items: center; gap: 6px; min-block-size: var(--af-h); color: var(--muted); font-size: 12.5px; }
.fb-lock-inline .ic { flex: none; color: var(--a-ink); }

/* 條件列：1280 種類｜內容｜時機區｜32px 拿掉；375 種類＋拿掉、內容下一列。 */
.fb-cond-head { grid-template-columns: 11em minmax(0, 1fr) 8em 32px; }
.fb-drawer-box .fb-cond {
  position: relative;
  display: grid;
  grid-template-columns: 11em minmax(0, 1fr) 8em 32px;
  align-items: center;
  gap: 6px var(--af-gx);
  min-height: calc(var(--af-h) + 12px);
  padding: 4px 0;
  border: 0;
  border-bottom: 1px dashed var(--line);
  border-radius: 0;
}
.fb-drawer-box .fb-cond > select {
  grid-column: 1;
  grid-row: 1;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: none;
  block-size: var(--af-h);
}
.fb-drawer-box .fb-cond > .fb-cond-f { grid-column: 2 / 4; grid-row: 1; }
.fb-drawer-box .fb-cond > .af-ibtn { grid-column: 4; grid-row: 1; justify-self: end; }
.fb-drawer-box .fb-cond-f { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--af-gx); min-width: 0; }
.fb-drawer-box .fb-cond-f > input,
.fb-drawer-box .fb-cond-f > select {
  min-width: 0;
  block-size: var(--af-h);
  padding: 0 8px;
}
.fb-drawer-box .fb-cond-f > input.w-name { inline-size: calc(24ch + 16px); max-inline-size: 100%; }
.fb-drawer-box .fb-cond-f > input.w-short { inline-size: calc(16ch + 16px); max-inline-size: 100%; }
.fb-drawer-box .fb-cond-f > input.w-num { inline-size: calc(10ch + 16px); }
.fb-drawer-box .fb-cond-f > select.w-fit { inline-size: auto; min-inline-size: 10em; max-inline-size: 24em; field-sizing: content; }
.fb-drawer-box input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.fb-drawer-box select { min-block-size: var(--af-h); }
.fb-drawer-box .fb-cond-f .af-unit { align-self: center; margin-inline-start: -4px; }
.fb-drawer-box .fb-cond-grp { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 6px 10px; margin: 6px 0; }
.fb-drawer-box .fb-cond-grp-h { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 2px 0 4px; }
.fb-drawer-box .fb-cond-grp-h .ic { color: var(--a-ink); }
.fb-drawer-box .fb-cond-grp-h .af-ibtn { margin-inline-start: auto; }
.fb-drawer-box .af-rows-add { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.fb-drawer-box .af-rows-add .af-add { margin-top: 0; }
.fb-compat-hit {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-start: 0;
  inline-size: 1px !important;
  block-size: var(--af-h) !important;
  min-block-size: var(--af-h) !important;
  padding: 0 !important;
  border: 0 !important;
  visibility: hidden;
  pointer-events: none;
}
.fb-cond > .fb-compat-hit { inset-block-start: 6px; }
.fb-rew > .fb-compat-hit { inset-block-start: 4px; }

/* 獎勵：固定六欄、每列固定兩行；說明集中在整段下方。 */
.fb-rew-head { grid-template-columns: 9em minmax(0, 1fr) 7.5em 7.5em 6.5em 96px; gap: 6px 8px; padding-top: 2px; }
.fb-rew {
  position: relative;
  display: grid;
  grid-template-columns: 9em minmax(0, 1fr) calc(10ch + 16px) calc(14ch + 16px) 6.5em 96px;
  grid-template-rows: var(--af-h) var(--af-h);
  align-items: start;
  gap: 2px var(--af-gx);
  min-height: calc(var(--af-h) * 2 + 10px);
  padding: 4px 0;
  border: 0;
  border-bottom: 1px dashed var(--line);
  border-radius: 0;
}
.fb-drawer-box .fb-rew {
  grid-template-columns: 9em minmax(0, 1fr) 7.5em 7.5em 6.5em 96px;
  grid-template-rows: var(--af-h) var(--af-h);
  gap: 2px 8px;
  min-height: calc(var(--af-h) * 2 + 10px);
  padding: 4px 0;
}
.fb-rew.bad { outline: 2px solid var(--a-bad); outline-offset: 3px; background: var(--danger-soft); }
.fb-rew > select {
  grid-column: 1;
  grid-row: 1;
  inline-size: 100%;
  min-inline-size: 0;
  block-size: var(--af-h);
  padding: 0 8px;
}
.fb-rew-t { grid-column: 2; grid-row: 1; min-width: 0; }
.fb-rew-t > input, .fb-rew-t > select { inline-size: 100%; max-inline-size: 100%; block-size: var(--af-h); padding: 0 8px; }
.fb-rew-qty { grid-column: 3; grid-row: 1; min-width: 0; }
.fb-rew-value { grid-column: 4; grid-row: 1; min-width: 0; }
.fb-rew-unique-cell { grid-column: 5; grid-row: 1; min-width: 0; min-block-size: var(--af-h); display: flex; align-items: center; }
.fb-rew-acts { grid-column: 6; grid-row: 1; display: flex; justify-self: end; align-items: center; gap: 0; }
.fb-rew-qty > .af-in, .fb-rew-value > .af-in { block-size: var(--af-h); min-block-size: var(--af-h); }
.fb-rew-qty input, .fb-rew-value input { text-align: end; font-variant-numeric: tabular-nums; }
.fb-rew-unit { padding-inline: 4px 7px; }
.fb-rew-unique { white-space: nowrap; line-height: 1.2; }
.fb-rew-note { grid-column: 2 / 7; grid-row: 2; display: flex; min-width: 0; }
.fb-rew.bad .fb-rew-note { grid-column: 2 / 5; }
.fb-rew-note input { inline-size: 100%; block-size: var(--af-h); padding: 0 8px; }
.fb-rew-err { grid-column: 5 / 7; grid-row: 2; align-self: center; font-size: 12px; line-height: 1.35; }
.fb-rew-help { display: flex; flex-direction: column; gap: 2px; padding-top: var(--sp-2); }
.fb-rew-help span { display: block; }
.fb-rew-footer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16em, 1fr); align-items: center; gap: var(--sp-2) var(--af-gx); }
.fb-rew-footer .fb-tot { margin: 0; }
.fb-drawer-box .fb-rew-acts .af-ibtn { flex: none; }
.fb-drawer-box .fb-tot { margin-top: var(--sp-2); }
.fb-drawer-box .fb-extra { margin-top: var(--sp-3); }

/* 期間、顯示、預覽。 */
.fb-win-box { align-items: flex-start; row-gap: 4px; }
.fb-win-to { align-self: flex-end; min-block-size: var(--af-h); display: inline-flex; align-items: center; color: var(--muted); font-size: 12.5px; }
.fb-win-box .af-f.w-dt { flex: 0 0 auto; inline-size: calc(19ch + 72px); }
.fb-win-acts { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.fb-show-line { align-items: flex-end; }
.fb-drawer-box .fb-show-sub { margin-top: 6px; padding-top: 6px; }
.fb-show-sub .af-sub-h { margin: 0; align-self: center; white-space: nowrap; }
.fb-show-line > .chk { min-block-size: var(--af-h); align-items: center; }
.fb-show-select { flex: 0 0 auto; }
.fb-show-select .af-in { inline-size: min(10em, 160px); min-inline-size: 0; }
.fb-show-select select { inline-size: 100%; }
.fb-prev h4 { margin: 4px 0 2px; font-size: 13px; color: var(--ink); }
.fb-prev-narr { color: var(--ink); white-space: pre-wrap; font-size: 12.5px; line-height: 1.55; margin: 0; }
.fb-pv-tabs { display: flex; flex-wrap: wrap; gap: 4px; width: fit-content; margin: 0 0 6px; }
.fb-pv-tabs button { min-block-size: var(--af-h-sm); padding: 0 12px; }
.fb-pv { display: flex; flex-direction: column; gap: 2px; max-inline-size: 40em; padding: 6px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.fb-pv b { font-size: 14px; }
.fb-pv span { font-size: 13px; line-height: 1.6; }

/* 紀錄：最近修改一行，版本列表一列一行。 */
.fb-record-line { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0 0 var(--sp-2); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.fb-drawer-box .fb-ver { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.fb-drawer-box .fb-ver .small-btn { margin-inline-start: auto; }

/* 儲存列：底部 sticky，桌面左右，手機兩排。 */
.fb-drawer-box .af-actions.sticky {
  bottom: 0;
  margin: 0 calc(-1 * var(--sp-4));
  padding: var(--sp-3) var(--sp-4);
  background: var(--raise);
  box-shadow: 0 -6px 12px -10px rgba(0, 0, 0, .35);
}
.fb-drawer-box .af-actions .af-left,
.fb-drawer-box .af-actions .af-right { align-items: center; }
.fb-drawer-box .af-actions .af-left > button { min-block-size: var(--af-h); }
.fb-drawer-box .af-actions .af-right > button { min-block-size: var(--af-h); }

/* 清單手機卡片：狀態在右上，次數／獎勵第二行，條件第三行。 */
@media (max-width: 959px) {
  .fb-item > .fb-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "code st" "rule reward" "cond cond" "win win";
    align-items: start;
    gap: 4px 10px;
    padding: 10px 12px;
  }
  .fb-item > .fb-row .fb-c { display: block; min-width: 0; }
  .fb-item > .fb-row .fb-code { grid-area: code; }
  .fb-item > .fb-row .fb-rule { grid-area: rule; }
  .fb-item > .fb-row .fb-reward { grid-area: reward; text-align: end; }
  .fb-item > .fb-row .fb-cond { grid-area: cond; }
  .fb-item > .fb-row .fb-win { grid-area: win; }
  .fb-item > .fb-row .fb-st { grid-area: st; justify-self: end; align-self: start; }
  .fb-item > .fb-row .fb-c.fb-empty { display: none; }
}

/* 展開卡窄容器：四語一欄、條件／獎勵改小卡、期間與操作列分排。 */
@container af (max-width: 519px) {
  .fb-drawer-box .fb-cond > .fb-compat-hit { inset-block-start: 0; }
  .fb-title-grid, .fb-copy-grid { grid-template-columns: minmax(0, 1fr); }
  .fb-drawer-box .fb-cond {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: var(--af-h) auto;
  }
  .fb-drawer-box .fb-cond > select { grid-column: 1; grid-row: 1; }
  .fb-drawer-box .fb-cond > .af-ibtn { grid-column: 2; grid-row: 1; }
  .fb-drawer-box .fb-cond > .fb-cond-f { grid-column: 1 / -1; grid-row: 2; }
  .fb-drawer-box .fb-cond-f > input.w-name,
  .fb-drawer-box .fb-cond-f > input.w-short,
  .fb-drawer-box .fb-cond-f > input.w-num,
  .fb-drawer-box .fb-cond-f > select.w-fit { inline-size: auto; flex: 1 1 100%; max-inline-size: 100%; }
  .fb-drawer-box .fb-cond-f > input.w-num { inline-size: calc(10ch + 16px); max-inline-size: 150px; flex: 0 1 calc(10ch + 16px); }
  .fb-drawer-box .fb-cond-f > input[data-fb-cond-f="spot"],
  .fb-drawer-box .fb-cond-f > select[data-fb-cond-f="when"] { flex: 1 1 calc(50% - 3px); inline-size: calc(50% - 3px); }
  .fb-cond-head, .fb-rew-head { display: none; }
  .fb-drawer-box .fb-rule-limits .af-f { inline-size: 8.5em; max-inline-size: calc(50% - 6px); }
  .fb-drawer-box .fb-rew {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: var(--af-h) auto auto auto;
    gap: 6px var(--sp-3);
    position: relative;
  }
  .fb-drawer-box .fb-rew > select { grid-column: 1 / -1; grid-row: 1; inline-size: calc(100% - 116px); }
  .fb-drawer-box .fb-rew-acts { position: absolute; inset-block-start: 4px; inset-inline-end: 0; grid-column: auto; grid-row: auto; }
  .fb-drawer-box .fb-rew-t { grid-column: 1 / -1; grid-row: 2; }
  .fb-drawer-box .fb-rew-no-target .fb-rew-t { display: none; }
  .fb-drawer-box .fb-rew-qty { grid-column: 1; grid-row: 3; }
  .fb-drawer-box .fb-rew-value { grid-column: 2; grid-row: 3; }
  .fb-drawer-box .fb-rew-unique-cell { grid-column: 1; grid-row: 4; min-inline-size: 5.5em; }
  .fb-drawer-box .fb-rew-note { grid-column: 2; grid-row: 4; }
  .fb-drawer-box .fb-rew-no-unique .fb-rew-unique-cell { display: none; }
  .fb-drawer-box .fb-rew-no-value .fb-rew-value { display: none; }
  .fb-drawer-box .fb-rew-no-target .fb-rew-qty { grid-row: 2; }
  .fb-drawer-box .fb-rew-no-unique .fb-rew-note { grid-column: 1 / -1; }
  .fb-drawer-box .fb-rew-no-unique:not(.fb-rew-no-target) .fb-rew-note { grid-column: 2; }
  .fb-drawer-box .fb-rew-no-target .fb-rew-note { grid-column: 2; grid-row: 2; }
  .fb-drawer-box .fb-rew.bad .fb-rew-note { grid-column: 1 / -1; grid-row: 4; }
  .fb-drawer-box .fb-rew-err { grid-column: 1 / -1; grid-row: 5; }
  .fb-drawer-box summary.af-sec-h.fb-cond-summary:has(.af-sec-tools) {
    block-size: auto;
    min-block-size: 0;
    padding-inline-end: 0;
    padding-block: 0 2px;
  }
  .fb-cond-summary .af-sec-tools {
    position: static;
    flex: 0 0 100%;
    inline-size: 100%;
    margin: var(--sp-2) 0 0;
    transform: none;
    flex-wrap: wrap;
    gap: var(--sp-2);
  }
  .fb-cond-summary .af-sec-tools .af-add {
    inline-size: auto;
    max-inline-size: 100%;
    white-space: nowrap;
  }
  .fb-win-box { flex-direction: column; align-items: stretch; }
  .fb-win-box .af-f.w-dt { inline-size: min(100%, 18em); }
  .fb-win-to { display: none; }
  .fb-win-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fb-win-acts button { width: 100%; justify-content: center; }
  .fb-show-line { align-items: flex-start; }
  .fb-drawer-box .fb-show-line { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px var(--sp-3); align-items: start; }
  .fb-drawer-box .fb-show-line > .chk { grid-column: 1 / -1; }
  .fb-drawer-box .fb-show-select .af-in { inline-size: 100%; }
  .fb-drawer-box .fb-rew-help { font-size: 11.5px; line-height: 1.45; gap: 0; }
  .fb-rew-footer { grid-template-columns: minmax(0, 1fr); }
  .fb-drawer-box .af-actions .af-left { flex: 1 1 100%; }
  .fb-drawer-box .af-actions .af-right { flex: 1 1 100%; margin-inline-start: 0; }
  .fb-drawer-box .af-actions .af-right > button { flex: 1 1 0; justify-content: center; }
}

/* 玩家詳情「伏筆與地點」：兩張表的改成欄同寬同高；T4 用 disabled 下拉。 */
.fb-thread-pick {
  inline-size: calc(16ch + 16px) !important;
  min-inline-size: calc(16ch + 16px) !important;
  max-inline-size: 100%;
  block-size: var(--af-h) !important;
  padding: 0 28px 0 8px;
}
.fb-thread-act { white-space: nowrap; }
@media (max-width: 640px) {
  .dtbl.stack td.fb-thread-text { flex: 1 1 100%; }
  .dtbl.stack td.fb-thread-act { flex: 1 1 100%; margin-top: 4px; }
  .fb-thread-pick {
    inline-size: calc(16ch + 16px) !important;
    min-inline-size: calc(16ch + 16px) !important;
    block-size: var(--af-h) !important;
  }
}

/* ==========================================================================
   機緣簿（第一期，§8）：新樣式一律 .fb- 前綴；色票見檔頭 --fb-builtin／--fb-event／--fb-player。
   版型照贊助方案（.st-*）與數值區的 .np-drawer；六欄 ≥1200、五欄 960～1199、卡片 <960。
   ========================================================================== */
.fb-lead { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin: 0 0 8px; }
.fb-mode { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 12px; font-size: 12.5px;
  font-weight: 700; white-space: nowrap; border: 1px solid; background: var(--accent-soft); color: var(--a-ink); border-color: color-mix(in srgb, var(--a-ink) 45%, transparent); }
.fb-mode[data-mode="on"] { background: var(--ok-soft); color: var(--a-ok); border-color: color-mix(in srgb, var(--a-ok) 50%, transparent); }
.fb-lead-txt { font-size: 13px; color: var(--muted); }
.fb-sum { display: flex; flex-wrap: wrap; gap: 4px 28px; padding: 2px 0 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.fb-sum-i { white-space: nowrap; color: var(--muted); }
.fb-sum-i b { color: var(--ink); font-variant-numeric: tabular-nums; }
.fb-s { display: inline; }
.fb-sum-dot { font-style: normal; color: var(--muted); padding: 0 2px; }
.fb-sum-i .fb-cd { color: var(--fb-event); font-weight: 600; }
.fb-sum-i.fb-risk { color: var(--a-ink); }
.fb-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 8px; }
.fb-toolbar .seg { width: auto; }
.fb-toolbar .fb-q { flex: 1 1 240px; min-width: 180px; }
.fb-toolbar .seg button, .fb-toolbar select, .fb-toolbar input[type="search"] { min-height: 36px; }
.fb-toolbar .fb-btn, .fb-cond-acts .fb-btn, .fb-drawer-act .fb-btn, .fb-retro .fb-btn { min-height: 36px; padding: 0 14px; }
.fb-addmenu { position: relative; }
.fb-addmenu .fb-addtoggle { display: none; }      /* 桌機（≥641）不用選單：兩顆新增鈕直接並排 */
.fb-addmenu-body { display: flex; gap: 8px; }
.fb-addmenu .fb-btn { min-height: 36px; }
.fb-meta { margin: 4px 0 8px; }
.fb-meta:empty { display: none; }
.fb-head, .fb-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(156px, 1fr) minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(64px, .95fr) minmax(58px, .55fr);
  gap: 0 10px; align-items: center; }
.fb-head { padding: 0 2px 6px 6px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.fb-item { border-left: 4px solid transparent; border-bottom: 1px solid var(--line); }
.fb-face-builtin { border-left-color: var(--fb-builtin); }
.fb-face-owner { border-left-color: var(--accent); }
.fb-face-player { border-left-color: var(--fb-player); }
/* 活動卡要醒目（P2-4）：整列淡紅底＋2px 紅框；燈籠 22～24px；倒數是有底色的膠囊 */
.fb-face-event { border: 2px solid var(--fb-event); border-radius: 10px; margin: 4px 0;
  background: color-mix(in srgb, var(--fb-event) 10%, var(--paper)); }
.fb-row { padding: 9px 2px; min-height: 42px; cursor: pointer; border-radius: 8px; }
.fb-row:hover { background: var(--a-hover); }
.fb-row[aria-expanded="true"] { background: var(--accent-soft); }
.fb-c { min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.fb-code { gap: 4px; }
.fb-name { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; word-break: keep-all;
  max-height: calc(2 * 1.35em); overflow: hidden; }
.fb-name code { font-size: 11.5px; color: var(--muted); margin-right: 6px; font-weight: 600; }
.fb-name-t { overflow-wrap: anywhere; }
.fb-info { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.fb-code > .ic { font-size: 15px; color: var(--fb-event); flex: none; }
.fb-face-event .fb-code > .ic.fb-lantern { font-size: 22px; }
.fb-badge { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; border: 1px solid;
  padding: 0 8px; font-size: 11.5px; font-weight: 700; white-space: nowrap; line-height: 1.7; }
.fb-face-builtin .fb-badge { color: var(--fb-builtin); border-color: color-mix(in srgb, var(--fb-builtin) 55%, transparent); }
.fb-face-event .fb-badge { color: var(--fb-event); border-color: color-mix(in srgb, var(--fb-event) 55%, transparent); }
.fb-face-owner .fb-badge { color: var(--a-ink); border-color: color-mix(in srgb, var(--a-ink) 55%, transparent); }
.fb-face-player .fb-badge { color: var(--fb-player); border-color: color-mix(in srgb, var(--fb-player) 55%, transparent); }
.fb-st-badge { display: inline-flex; width: fit-content; border-radius: 999px; padding: 0 9px; font-size: 11.5px;
  font-weight: 700; white-space: nowrap; line-height: 1.8; border: 1px solid var(--line); color: var(--muted); }
.fb-st-badge.fb-st-open { color: var(--a-ok); border-color: color-mix(in srgb, var(--a-ok) 50%, transparent); }
.fb-st-badge.fb-st-scheduled { color: var(--a-ink); border-color: color-mix(in srgb, var(--a-ink) 50%, transparent); }
.fb-st-badge.fb-st-expired, .fb-st-badge.fb-st-ended { color: var(--a-bad); border-color: color-mix(in srgb, var(--a-bad) 45%, transparent); }
.fb-cd { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fb-face-event .fb-cd { color: var(--fb-event-cd); font-weight: 700; border: 1px solid color-mix(in srgb, var(--fb-event) 55%, transparent);
  border-radius: 999px; padding: 2px 10px; background: color-mix(in srgb, var(--fb-event) 6%, transparent); }
.fb-seg { white-space: nowrap; }
/* UX-1（2026-11-08）：桌機「次數」欄的長片段（世界唯一（玩家看到…））不可溢進「條件」欄；
   片段改 inline-block，放得下就整段不拆，放不下才在欄寬內換行。手機卡片（<960）不動。 */
@media (min-width: 960px) {
  .fb-rule .fb-seg { display: inline-block; max-inline-size: 100%; white-space: normal; overflow-wrap: anywhere; }
}
.fb-seg-dot { color: var(--muted); padding: 0 2px; }
.fb-nowrap { white-space: nowrap; }
.fb-rule, .fb-cond, .fb-reward { line-height: 1.55; overflow-wrap: anywhere; word-break: keep-all; }
.fb-drawer { margin: 0; }
.fb-drawer .np-drawer { margin: 4px 0 16px; }
.fb-newbox .np-drawer { margin: 12px 0 16px; }
.fb-drawer .small-btn, .fb-newbox .small-btn { min-height: 36px; }
.fb-drawer-err:empty { display: none; }
.fb-sec { border-top: 1px solid var(--line); padding: 10px 0; }
.fb-sec > summary { cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--a-ink); padding: 2px 0; }
.fb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 14px; margin-top: 8px; }
.fb-f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.fb-f.fb-wide { grid-column: 1 / -1; }
.fb-f input, .fb-f select, .fb-f textarea { min-height: 36px; padding: 0 8px; font-size: 13px; width: 100%; min-width: 0; }
.fb-f textarea { height: auto; padding: 6px 8px; }
.fb-lock { display: flex; align-items: center; gap: 8px; border: 1px dashed var(--line-strong); border-radius: 10px;
  padding: 8px 12px; color: var(--muted); font-size: 13px; }
.fb-lock .ic { color: var(--a-ink); flex: none; }
.fb-msg:empty { display: none; }
.fb-msg .err { display: block; color: var(--a-bad); font-size: 12.5px; line-height: 1.6; margin-top: 4px; }
/* 條件列編輯器（P2-5）：≥768 種類｜內容｜時機｜拿掉 同一橫列；<768 直排、拿掉併進標題右側 */
.fb-cond { display: grid; grid-template-columns: 11em minmax(0, 1fr) auto; gap: 6px 10px; align-items: center;
  padding: 5px 0; border-bottom: 1px dashed var(--line); }
.fb-cond > select { min-height: 36px; padding: 0 8px; min-width: 0; width: 100%; }
.fb-cond-f { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.fb-cond-f input, .fb-cond-f select { min-height: 36px; padding: 0 8px; min-width: 0; flex: 0 1 auto; }
.fb-cond-f select { width: auto; min-width: 7em; }
.fb-cond-f input:not([type="number"]):not([type="datetime-local"]) { width: 12em; min-width: 6em; flex: 0 1 12em; }
.fb-cond-f input[type="number"] { width: 5em; }
.fb-cond-f input[type="datetime-local"] { width: 13em; }
.fb-cond-f input[list] { min-width: 8em; }
.fb-cond-grp { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 6px 10px; margin: 6px 0; }
.fb-cond-grp-h { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 2px 0 4px; }
.fb-cond-grp-h .ic { color: var(--a-ink); }
.fb-cond-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fb-words { flex: 1 1 100%; }
.fb-words-lang { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-wd { border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; min-width: 180px; }
.fb-wd > summary { cursor: pointer; font-size: 12.5px; color: var(--a-ink); }
.fb-wg { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 4px 0; }
.fb-wg input { width: 9em; }
.fb-wchip { display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--line); border-radius: 999px;
  padding: 1px 3px 1px 9px; font-size: 12.5px; background: var(--bg); }
.fb-wchip button { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.fb-wg-acts { padding: 2px 0 4px; }
.fb-per { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.fb-rule-box { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 8px; }
.fb-rule-f { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
/* 獎勵列編輯器（P2-5）：≥768 種類｜內容｜數量｜備註｜拿掉 同一橫列；<768 直排、拿掉併進標題右側 */
.fb-rule-f input[type="number"] { width: 5em; min-height: 36px; padding: 0 8px; }
.fb-rule-f select { min-height: 36px; padding: 0 8px; width: auto; min-width: 10em; }
.fb-rew { display: grid; grid-template-columns: 9em minmax(0, 1fr) auto auto minmax(5em, 1fr) auto;
  gap: 6px 10px; align-items: center; padding: 6px 4px;
  border-bottom: 1px dashed var(--line); border-radius: 8px; }
.fb-rew.bad { outline: 2px solid var(--a-bad); background: var(--danger-soft); }
.fb-rew > select { grid-column: 1; grid-row: 1; min-height: 36px; padding: 0 8px; width: 100%; min-width: 0; }
.fb-rew-t { grid-column: 2; grid-row: 1; display: flex; gap: 6px; align-items: center; min-width: 0; }
.fb-rew-t select, .fb-rew-t input { min-height: 36px; padding: 0 8px; min-width: 0; width: 100%; }
.fb-rew > input[type="number"] { grid-column: 3; grid-row: 1; min-height: 36px; padding: 0 8px; width: 7em; }
.fb-rew-unit { color: var(--muted); font-size: 12.5px; grid-column: 4; grid-row: 1; }
.fb-rew-x { grid-column: 5; grid-row: 1; display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; min-width: 0; }
.fb-rew-x input:not([type="checkbox"]) { min-height: 36px; padding: 0 8px; width: 7em; flex: 0 1 auto; }
.fb-rew-x .chk { white-space: nowrap; }
.fb-rew-why { grid-column: 1 / -1; grid-row: 2; font-size: 12px; color: var(--muted); line-height: 1.6; }
.fb-rew-acts { grid-column: 6; grid-row: 1; display: flex; gap: 4px; justify-self: end; }
.fb-tot { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.fb-extra { margin-top: 10px; }
.fb-extra-h { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.fb-xd { margin: 4px 0; }
.fb-xd > summary { cursor: pointer; font-size: 12.5px; color: var(--a-ink); }
.fb-retro { border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; margin-top: 12px;
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.fb-retro-line { flex: 1 1 100%; font-size: 13px; color: var(--ink); margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fb-retro-line:empty { display: none; }
.fb-retro-run .fb-bar { height: 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.fb-retro-run .fb-fill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.fb-retro-prev p { margin: 6px 0 0; line-height: 1.55; }
.fb-retro-prev p:first-child { margin-top: 0; }
.fb-retro-run p { margin: 6px 0 0; line-height: 1.5; }
.fb-prev h4 { margin: 8px 0 4px; font-size: 13px; }
.fb-prev-narr { white-space: pre-wrap; font-size: 13px; color: var(--muted); line-height: 1.8; margin: 0; }
.fb-pd { margin: 4px 0; }
.fb-pd > summary { cursor: pointer; font-size: 12.5px; color: var(--a-ink); }
.fb-pc { display: flex; flex-direction: column; gap: 2px; padding: 4px 8px; }
.fb-ver { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.fb-ver-v { font-weight: 700; color: var(--a-ink); }
.fb-ver-who { font-size: 12.5px; color: var(--muted); min-width: 0; }  /* 各片段不拆行（雜湊、「・」黏在前一段尾端），整列放不下才換行 */
.fb-ver-t { font-size: 12.5px; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.fb-ver .small-btn { margin-left: auto; }
.fb-drawer-act { margin-top: 2px; }
.fb-win-box { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; margin-top: 8px; }
.fb-win-box input[type="datetime-local"] { min-height: 36px; padding: 0 8px; }
.fb-win-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-recs { display: flex; flex-direction: column; gap: 6px; }
.fb-rec { display: grid; grid-template-columns: 14em minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.fb-rec-ev { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.fb-rec-what { min-width: 0; overflow-wrap: anywhere; }
.fb-rec-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
@media (max-width: 1199px) {
  .fb-head, .fb-row { grid-template-columns: minmax(0, 1.55fr) .75fr minmax(0, 1.3fr) .95fr .55fr; }
  .fb-head .fb-cond, .fb-row .fb-cond { display: none; }
}
@media (max-width: 959px) {
  .fb-head { display: none; }
  .fb-item { border: 1px solid var(--line); border-left-width: 4px; border-radius: 12px; margin-bottom: 10px; }
  .fb-face-event { border: 2px solid var(--fb-event); border-left-width: 2px; }   /* 活動卡 375 同樣 2px 紅框 */
  .fb-row { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 10px 12px; }
  .fb-c { flex-direction: row; flex-wrap: wrap; gap: 2px 10px; }
  .fb-c.fb-empty { display: none; }            /* 卡片模式：空欄不列（P2-3） */
  .fb-name { max-height: none; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  /* 768～1023：備註／數量欄放不下，獎勵列的選填欄整行移到第二列（不與拿掉鈕重疊） */
  .fb-rew { grid-template-columns: 9em minmax(0, 1fr) auto auto auto; }
  .fb-rew-acts { grid-column: 5; }
  .fb-rew-x { grid-column: 1 / -1; grid-row: 2; }
  .fb-rew-why { grid-row: 3; }
}
@media (max-width: 767px) {
  /* 展開卡標頭可換行，「收起」不被切出視窗（P2-6） */
  .fb-drawer-box .np-dh, .fb-newbox .np-dh { flex-wrap: wrap; }
  .fb-drawer-box .np-dh h3, .fb-newbox .np-dh h3 { white-space: normal; }
  .fb-drawer-box .np-dh .small-btn, .fb-newbox .np-dh .small-btn { margin-left: auto; flex: none; }
  .fb-drawer-box .np-dh .grow, .fb-newbox .np-dh .grow { flex: 1 1 100%; height: 0; }
  /* 條件列：種類＋拿掉同一列、欄位在下一列（P2-5） */
  .fb-cond { grid-template-columns: minmax(0, 1fr) auto; }
  .fb-cond > select { grid-column: 1; grid-row: 1; }
  .fb-cond > .small-btn { grid-column: 2; grid-row: 1; justify-self: end; }
  .fb-cond-f { grid-column: 1 / -1; grid-row: 2; }
  .fb-cond-f input:not([type="number"]):not([type="datetime-local"]) { width: auto; flex: 1 1 100%; }
  .fb-cond-f input[type="number"] { flex: 0 1 auto; }
  .fb-cond-f input[type="datetime-local"] { width: auto; flex: 1 1 auto; }
  /* 獎勵列：種類＋拿掉同一列、其餘直排（P2-5） */
  .fb-rew { grid-template-columns: minmax(0, 1fr) auto; }
  .fb-rew > select { grid-column: 1; grid-row: 1; }
  .fb-rew-acts { grid-column: 2; grid-row: 1; }
  .fb-rew-t { grid-column: 1 / -1; grid-row: 2; }
  .fb-rew > input[type="number"] { grid-column: 1; grid-row: 3; justify-self: start; }
  .fb-rew-unit { grid-column: 2; grid-row: 3; justify-self: start; }
  .fb-rew-x { grid-column: 1 / -1; grid-row: 4; }
  .fb-rew-why { grid-row: 5; }
}
@media (max-width: 640px) {
  .fb-toolbar .fb-src { flex-basis: 100%; }
  .fb-toolbar .fb-status, .fb-toolbar .fb-q { flex: 1 1 100%; }
  .fb-sum { gap: 4px 14px; }
  .fb-addmenu .fb-addtoggle { display: inline-flex; align-items: center; gap: 6px; }
  .fb-addmenu-body { display: none; position: absolute; top: calc(100% + 4px); right: 0; z-index: 30;
    flex-direction: column; gap: 4px; background: var(--raise); border: 1px solid var(--line-strong);
    border-radius: 10px; padding: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
  .fb-addmenu.fb-open .fb-addmenu-body { display: flex; }
  .fb-addmenu .fb-btn { width: 100%; }
  .fb-rec { grid-template-columns: 1fr; }
  .fb-rec-meta { white-space: normal; }
}

/* ==========================================================================
   UI-3 NPC 清單＋人物抽屜（規格 2.3；共用 .af-*／.w-*，只覆寫這一區）
   ========================================================================== */
.np-toolbar { align-items: flex-end; padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); }
.np-toolbar .np-q { flex: 0 1 auto; }
.np-toolbar .np-toolbar-btn { block-size: var(--af-h); }
.np-toolbar .np-meta { line-height: var(--af-h); white-space: nowrap; color: var(--muted); }
.np-sort-m { display: none; }
.np-sort-m select { min-inline-size: 11em; }
#npcQ { block-size: 100%; min-block-size: 0; padding: 0 8px; flex: none; inline-size: 100%; }

.np-npc-drawer {
  display: block;
  inline-size: 100%;
  max-inline-size: 760px;
  margin: 4px 0 16px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--raise);
  container: af / inline-size;
}
.np-npc-drawer > .np-dh {
  position: sticky; top: 0; z-index: 4;
  display: flex; align-items: center; gap: var(--sp-2);
  min-block-size: calc(var(--af-h) + var(--sp-3) * 2);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
  background: var(--raise);
}
.np-npc-drawer > .np-dh > .ic { flex: none; font-size: 18px; color: var(--a-ink); }
.np-npc-drawer .np-dh-main { flex: 1 1 auto; min-inline-size: 0; display: flex; flex-direction: column; gap: 2px; }
.np-npc-drawer .np-dh-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-inline-size: 0; }
.np-npc-drawer > .np-dh h3 {
  margin: 0; min-inline-size: 0; font-family: var(--serif); font-size: 16px; font-weight: 700;
  line-height: 1.35; white-space: normal; overflow-wrap: anywhere;
}
.np-npc-drawer .np-dsub {
  flex: none; max-inline-size: none; padding: 1px 8px; overflow: visible;
  font-size: 12px; line-height: 1.5; white-space: normal; text-overflow: clip;
}
.np-npc-drawer .np-dh-sys {
  min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; line-height: 1.5; color: var(--muted);
}
.np-npc-drawer .np-dx { flex: none; margin-inline-start: auto; }
.np-npc-drawer > .warn-line { margin-top: var(--sp-3); }

.np-npc-drawer .np-sec { padding: var(--sp-4) 0; border-top: 1px solid var(--line); }
.np-npc-drawer .np-sec:first-of-type { padding-top: var(--sp-2); border-top: 0; }
.np-npc-drawer > .np-sec + .np-sec { padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.np-npc-drawer .af-sec-h { margin: 0 0 var(--sp-3); font-size: 14px; }
.np-npc-drawer .af-sec-h h4 { margin: 0; font: inherit; line-height: 1.4; }
.np-npc-drawer .af-sec-h .af-sec-n { font-weight: 400; }
.np-npc-drawer .af-v { row-gap: 6px; }
.np-npc-drawer .af-l { font-size: 12.5px; }
.np-npc-drawer .np-f { font-size: 14px; color: inherit; }
.np-npc-drawer .np-rename { block-size: var(--af-h-sm); }
.np-npc-drawer .af-ro { flex-wrap: wrap; gap: 4px 8px; }
.np-npc-drawer .np-sysname { overflow-wrap: anywhere; }
.np-tn-wrap { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 8px; min-inline-size: 0; }
.np-tn-wrap .hid { margin-block-end: 1px; }
.np-npc-drawer .np-tnwarn { flex-basis: 100%; }
.np-npc-drawer .af-v > .af-help { flex-basis: 100%; }
.np-npc-drawer .np-tnnote { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.np-npc-drawer .np-tnnote > span { white-space: nowrap; }

.np-npc-drawer .np-basic { align-items: flex-start; }
.np-npc-drawer .np-basic .af-f { flex: 0 0 auto; }
.np-npc-drawer .np-basic .af-f.w-fit > .af-in > select { min-inline-size: 0; }
.np-npc-drawer .af-f.w-fit > .af-in { inline-size: auto; max-inline-size: 24em; }
.np-npc-drawer .af-f.w-fit > .af-in > select { flex: 0 0 auto; inline-size: auto; min-inline-size: 0; field-sizing: content; }
.np-npc-drawer .np-facets { margin-top: var(--sp-2); }
.np-npc-drawer .np-facet { font-size: 13px; }
.np-npc-drawer .np-facet-k { color: var(--muted); font-size: 13px; font-weight: 500; line-height: var(--af-h); }
.np-npc-drawer .np-facet .af-in { inline-size: 100%; max-inline-size: 260px; }

.np-npc-drawer .np-heart-set { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-block-size: var(--af-h); height: auto; }
.np-npc-drawer .np-heart-set .af-f { flex: 0 0 auto; }
.np-npc-drawer .np-heart { margin: 0; white-space: nowrap; }
.np-npc-drawer .np-tie-add { margin-top: 0; }
.np-npc-drawer .np-tie-add .af-add { margin-top: 0; }
.np-npc-drawer .np-tie { padding: var(--sp-2) 0; }
.np-npc-drawer .np-tie > .w-name, .np-npc-drawer .np-tie > .w-short, .np-npc-drawer .np-tie > .w-mid { inline-size: auto; }
.np-npc-drawer .np-tie-head { padding-bottom: var(--sp-1); }
.np-npc-drawer .af-r-acts { align-self: start; padding-top: 2px; }

.np-npc-drawer .np-chlist { max-height: 360px; overflow-y: auto; padding-right: 2px; }
.np-npc-drawer .np-chr-head { margin-bottom: 0; }
.np-npc-drawer .np-chr-row { padding: var(--sp-2) 0; }
.np-npc-drawer .np-chr-row .af-l { font-size: 12px; }
.np-npc-drawer .np-chm { color: var(--muted); font-size: 12px; }
.np-npc-drawer .np-chr-row .af-in > input { inline-size: 100%; }
.np-npc-drawer .np-chadd { margin-top: var(--sp-2); }
.np-npc-drawer .np-chnote { margin-top: var(--sp-2); }

.np-npc-drawer .np-num { align-items: flex-start; }
.np-npc-drawer .np-num .af-f { flex: 0 0 auto; }
@container af (max-width: 519px) {
  .np-npc-drawer .np-num { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .np-npc-drawer .np-num .af-f { inline-size: auto; max-inline-size: 100%; }
  .np-npc-drawer .np-facets { grid-template-columns: minmax(0, 1fr); }
  .np-npc-drawer .np-facet .af-in { max-inline-size: 100%; }
}

.np-npc-drawer .np-meta-kv { row-gap: var(--sp-2); }
.np-npc-drawer .np-last-touch { margin: 0; line-height: 1.6; white-space: normal; }
.np-npc-drawer .np-meta-body { padding-top: var(--sp-1); }
.np-npc-drawer .np-hist { margin-top: var(--sp-2); }

.np-npc-drawer .np-act.af-actions.sticky {
  margin: 0 calc(-1 * var(--sp-4));
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--line);
  background: var(--raise);
}
.np-npc-drawer .np-act .np-msg { flex: 1 1 100%; margin: 0; order: -1; }
.np-npc-drawer .np-act .af-left > .af-lock { max-inline-size: 100%; }

.np-npc-drawer .np-tbl td.np-sex, .np-npc-drawer .np-tbl td.np-rank { min-inline-size: 6em; }

/* 改名對話框與改名紀錄 */
.rn-fld { gap: 6px; }
.rn-in { block-size: var(--af-h); }
.rn-in > input { flex: 1 1 auto; inline-size: auto; min-inline-size: 0; border: 0; background: transparent; padding: 0 8px; }
.rn-fld .af-err { margin-top: 2px; }
.rn-fld > .af-err { justify-content: flex-start; align-items: flex-start; color: var(--a-bad); overflow-wrap: anywhere; }
.rn-fld > .af-err > span { display: block; min-inline-size: 0; color: inherit; text-align: start; }
.rn-err-list { margin: 0; padding-inline-start: 18px; color: inherit; line-height: 1.6; }
.dlg-in:has(.rn-card) { max-block-size: calc(100dvh - 32px); overflow-y: auto; }
.rn-lang { display: grid; gap: 6px; padding-top: 2px; }
.rn-lang > b { font-size: 13px; }
.rn-lang .af-line { align-items: stretch; }
.rn-lang .rn-tr { flex: 1 1 12em; inline-size: auto; min-inline-size: 0; max-inline-size: 100%; }
.rn-lang .rn-tr .af-help { min-block-size: 1.5em; }
.rn-card { border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; background: var(--paper); }
.rn-card.tone-danger { border-color: color-mix(in srgb, var(--a-bad) 55%, var(--line)); background: var(--danger-soft); }
.rn-card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.rn-card-h b { font-size: 13px; }
.rn-card-h .badge { margin-inline-start: auto; }
.rn-diff td:first-child { inline-size: 7em; }
.rn-src { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.rn-warn { margin: 8px 0 0; padding-inline-start: 18px; color: var(--a-ink); font-size: 12.5px; line-height: 1.6; }
.rn-warn:empty { display: none; }
.rn-preview-act { display: flex; justify-content: flex-end; margin-top: 8px; }
.rn-confirm { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.rn-confirm .fld { min-inline-size: 0; }
.rn-confirm input { inline-size: 100%; block-size: var(--af-h); }
.rn-history { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.rn-history .af-sub-h { margin-bottom: 6px; }
.rn-history-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 12px; align-items: center;
  padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.rn-history-row:first-child { border-top: 0; }
.rn-history-when { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rn-history-row .small-btn { justify-self: end; }

@media (max-width: 900px) {
  .np-toolbar .np-q { flex: 1 1 100%; max-inline-size: 100%; }
  .np-toolbar .np-meta { line-height: 1.5; }
}
@media (max-width: 640px) {
  #statsBox .sk-m { display: none; }                 /* 各組的小「排列」收起；改用工具列一個共用排序 */
  .np-sort-m { display: inline-flex; align-items: center; gap: 6px; }
  .np-npc-drawer .np-dh-sys { white-space: normal; overflow: visible; text-overflow: clip; }
  .np-npc-drawer .np-tbl td.np-sex, .np-npc-drawer .np-tbl td.np-rank { min-inline-size: 6em; }

  /* 事蹟一筆（手機）：等級下拉｜內容框｜刪除鈕同一行，內容框吃掉剩下的寬度；日期那行字照舊在內容框下面。
     清單不再畫「語言／內容」表頭；下拉框（大／中／小＋箭頭）固定 --np-chr-lv-w。 */
  .np-npc-drawer { --np-chr-lv-w: 56px; }
  .np-npc-drawer .np-chr-row:not(.np-chr-ro) { grid-template-columns: var(--np-chr-lv-w) minmax(0, 1fr) auto; }
  .np-npc-drawer .np-chr-row.has-head .af-l { display: none; }
  .np-npc-drawer .np-chr-lv.w-fit { inline-size: auto; min-inline-size: 0; max-inline-size: var(--np-chr-lv-w); }

  /* 關係一筆（手機）：第一行「對象＋關係」（關係窄一點）、第二行「備註＋刪除鈕」。
     小標不逐筆重複，靠輸入框的 placeholder（對象／關係／備註）認欄位。 */
  .np-npc-drawer .np-tie { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px var(--af-gx); }
  .np-npc-drawer .np-tie.has-head .af-l { display: none; }
  .np-npc-drawer .np-tie > .af-f { min-inline-size: 0; max-inline-size: 100%; }
  .np-npc-drawer .np-tie > .w-name { flex: 1 1 58%; }
  .np-npc-drawer .np-tie > .w-short { flex: 0 1 34%; }
  .np-npc-drawer .np-tie > .w-mid { flex: 1 1 60%; inline-size: auto; }
  .np-npc-drawer .np-tie > .af-r-acts { flex: 0 0 auto; }
}
@media (max-width: 600px) {
  .rn-diff, .rn-diff tbody, .rn-diff tr, .rn-diff td { display: block; inline-size: 100%; }
  .rn-diff tr { padding: 6px 0; border-top: 1px solid var(--line); }
  .rn-diff tr:first-child { border-top: 0; }
  .rn-diff td { padding: 0; border: 0; }
  .rn-diff td:first-child { inline-size: auto; font-size: 12px; color: var(--muted); }
  .rn-diff .old, .rn-diff .new, .rn-diff .arr { display: block; }
  .rn-diff .arr { padding: 2px 0; }
  .rn-confirm { grid-template-columns: minmax(0, 1fr); }
  .rn-lang .rn-tr { flex-basis: 100%; }
  .rn-history-row { grid-template-columns: minmax(0, 1fr) auto; }
  .rn-history-row > span:nth-child(2) { grid-column: 1; }
  .rn-history-row .small-btn { grid-column: 2; grid-row: 1 / span 2; }
}

/* ==========================================================================
   NPC 管理重排（站長 10-20 核可預覽）：疑似重複表格＋同寬人物抽屜
   ========================================================================== */
.np-dup {
  padding: 0;
  margin: 10px 0;
  overflow: hidden;
  border-color: var(--line);
  background: var(--paper);
}
.np-dup-h {
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  gap: 4px 14px;
}
.np-dup-h b { font-size: 15px; }
.np-dup-h q { color: var(--ink); }
.np-dup-tbl {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.np-dup-tbl th,
.np-dup-tbl td {
  border-top: 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.np-dup-tbl th {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.np-dup-tbl td { padding: 9px 10px; font-size: 13px; }
.np-dup-tbl tbody tr:last-child td { border-bottom: 0; }
.np-dup-tbl .c-chk { width: 44px; padding-inline: 0; text-align: center; }
.np-dup-tbl .c-who { width: 22%; }
.np-dup-tbl .c-id { width: auto; }
.np-dup-tbl .c-loc { width: 13%; }
.np-dup-tbl .c-alias { width: 10%; }
.np-dup-tbl .c-n { width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.np-dup-tbl .c-made { width: 15%; }
.np-dup-tbl .c-id { white-space: normal; overflow-wrap: anywhere; }
.np-dup-tbl .c-loc,
.np-dup-tbl .c-alias,
.np-dup-tbl .who b,
.np-dup-tbl .who small,
.np-dup-tbl .made > * {
  min-inline-size: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-dup-tbl .np-open {
  display: block;
  inline-size: 100%;
  text-align: start;
  text-decoration: none;
  font-weight: 400;
}
.np-dup-tbl .who b { display: block; color: var(--a-ink); font-weight: 700; }
.np-dup-tbl .who small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.np-dup-tbl .made { font-size: 12.5px; line-height: 1.35; }
.np-dup-tbl .made > span,
.np-dup-tbl .made > small { display: block; }
.np-dup-tbl .made > small { color: var(--muted); font-variant-numeric: tabular-nums; }
.np-dup-tbl .dash,
.np-dup-tbl .zero { color: var(--muted); }
.np-dup-tbl .meta-m { display: none; }
.np-dup-act {
  margin: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--raise);
  align-items: flex-end;
  gap: 10px 12px;
}
.np-dup-main {
  display: grid;
  gap: 4px;
  flex: 0 1 300px;
  min-inline-size: 0;
}
.np-dup-main > span { font-size: 12px; color: var(--muted); }
.np-dup-main select {
  inline-size: 100%;
  block-size: var(--af-h);
  padding: 0 30px 0 10px;
}
.np-dup-act > .small-btn { block-size: var(--af-h); }
.np-dup-sp { flex: 1 1 auto; }

.af-drawer.np-npc-drawer {
  max-inline-size: none;
  padding-inline: 18px;
  overflow: hidden;
}
.np-npc-drawer > .np-dh h3 { font-size: 18px; }
.np-name-kv,
.np-kin-kv {
  grid-template-columns: 5.5em minmax(0, 1fr);
  gap: 10px 14px;
}
.np-name-kv > .af-k,
.np-kin-kv > .af-k { font-size: 12.5px; line-height: var(--af-h); }
.np-name-kv > .af-v,
.np-kin-kv > .af-v { align-items: center; gap: 6px 10px; }
.np-name-kv .af-v > .af-f,
.np-kin-kv .af-v > .af-f { flex: 0 0 auto; }
.np-name-kv .np-inline-help,
.np-kin-kv .np-inline-help { flex: 0 1 auto; min-inline-size: 0; }
.np-name-kv > .af-v > .np-inline-help {
  align-self: flex-start;
  flex: 0 1 auto;
  line-height: var(--af-h);
  white-space: normal;
}
.np-name-kv .np-sys-copy {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--af-h);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-align: start;
  cursor: copy;
}
.np-name-kv .np-tn-wrap {
  flex: 1 1 100%;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}
.np-name-kv .np-tn-wrap > .af-f { flex: 0 1 14em; inline-size: 14em; }
.np-name-kv .np-tnnote { flex: 0 1 auto; }
.np-name-kv .np-tnwarn { flex-basis: 100%; }

.np-form-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--af-gy) var(--af-gx);
  align-items: start;
}
.np-form-grid > .af-f {
  inline-size: auto;
  min-inline-size: 0;
  max-inline-size: none;
}
.np-form-grid > .s1 { grid-column: span 1; }
.np-form-grid > .s2 { grid-column: span 2; }
.np-form-grid > .s3 { grid-column: span 3; }
.np-form-grid > .s4 { grid-column: span 4; }
.np-form-grid > .s6 { grid-column: span 6; }
.np-form-grid > .np-last-field .af-ro { min-block-size: var(--af-h); }
.np-form-grid > .np-last-field .np-last-touch { margin: 0; line-height: 1.6; }
.np-form-grid > .np-num,
.np-num {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.np-num > .af-f { inline-size: auto; max-inline-size: none; }
.np-num .af-in { inline-size: 100%; }
.np-num .af-in > input { text-align: center; }

.np-facets {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 8px 16px;
}
.np-facet { grid-template-columns: 5.5em minmax(0, 1fr); }
.np-facet .af-in { max-inline-size: none; }

.np-alias-editor { flex: 1 1 100%; min-inline-size: 0; }
.np-alias-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-block-size: var(--af-h);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}
.np-alias-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  block-size: calc(var(--af-h) - 8px);
  padding: 0 4px 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--raise);
  font-size: 13px;
  white-space: nowrap;
}
.np-alias-chip button {
  inline-size: 22px;
  block-size: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  justify-content: center;
}
.np-alias-chip button:hover { background: var(--a-hover); color: var(--ink); }
.np-alias-chips > input {
  flex: 1 1 8em;
  min-inline-size: 6em;
  block-size: calc(var(--af-h) - 8px);
  padding: 0 6px;
  border: 0;
  background: transparent;
}
.np-heart-set { gap: 6px 10px; min-block-size: var(--af-h); height: auto; }
.np-heart { display: inline-flex; align-items: center; gap: 10px; margin: 0; }
.np-heart b { font-weight: 600; }
.np-heart-id { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.np-heart-none { color: var(--muted); }
.np-heart-change { flex: 0 1 14em; inline-size: 14em; min-inline-size: 10em; }
.np-heart-change .af-in { background: var(--bg); }
.np-ties,
.np-tie-rows { inline-size: 100%; }
.np-tie-empty,
.np-tie-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.np-tie-empty { min-block-size: var(--af-h); }
.np-tie-empty span { color: var(--muted); font-size: 13px; }
.np-tie-empty .af-add,
.np-tie-add .af-add { margin-top: 0; }
.np-kin-note { margin-top: 12px; }
.np-chr-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-block-size: var(--af-h);
}
.np-chr-empty > span { color: var(--muted); font-size: 13px; }
.np-chr-empty .af-add,
.np-chadd .af-add { margin-top: 0; }

@container af (max-width: 640px) {
  .np-name-kv,
  .np-kin-kv { grid-template-columns: 4.5em minmax(0, 1fr); }
  .np-name-kv .np-tn-wrap > .af-f { flex: 0 1 14em; inline-size: 14em; max-inline-size: 100%; }
  .np-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .np-form-grid > .s2,
  .np-form-grid > .s3,
  .np-form-grid > .s4,
  .np-form-grid > .s6 { grid-column: span 2; }
  .np-num { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .np-facets { grid-template-columns: minmax(0, 1fr); }
  .np-facet { grid-template-columns: 4.5em minmax(0, 1fr); }
  .np-heart-change { flex: 1 1 100%; inline-size: auto; }
}

@media (max-width: 760px) {
  .np-dup-h { padding: 10px 14px; }
  .np-dup-tbl,
  .np-dup-tbl tbody { display: block; inline-size: 100%; }
  .np-dup-tbl thead,
  .np-dup-tbl colgroup { display: none; }
  .np-dup-tbl tr {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 2px 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
  }
  .np-dup-tbl tbody tr:last-child { border-bottom: 0; }
  .np-dup-tbl td {
    display: block;
    inline-size: auto;
    min-inline-size: 0;
    padding: 0;
    border: 0;
  }
  .np-dup-tbl .c-chk { grid-row: 1 / span 3; padding-top: 3px; text-align: start; }
  .np-dup-tbl .c-who,
  .np-dup-tbl .c-id,
  .np-dup-tbl .meta-m { grid-column: 2; }
  .np-dup-tbl .c-who { inline-size: 100%; }
  .np-dup-tbl .who b,
  .np-dup-tbl .who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .np-dup-tbl .c-id { font-size: 13px; white-space: normal; }
  .np-dup-tbl .c-loc,
  .np-dup-tbl .c-alias,
  .np-dup-tbl .c-n,
  .np-dup-tbl .c-made { display: none; }
  .np-dup-tbl .meta-m {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
  }
  .np-dup-act { padding: 10px 14px; align-items: stretch; }
  .np-dup-main { flex-basis: 100%; }
  .np-dup-act > .small-btn { flex: 1 1 calc(50% - 8px); min-inline-size: 0; justify-content: center; }
  .np-dup-sp { display: none; }
}

@media (max-width: 640px) {
  .np-npc-drawer .np-act.af-actions.sticky {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
  .np-npc-drawer .np-act .np-msg { grid-column: 1 / -1; order: -1; }
  .np-npc-drawer .np-act .af-left,
  .np-npc-drawer .np-act .af-right { display: contents; }
  .np-npc-drawer .np-act .af-left > button,
  .np-npc-drawer .np-act .af-right > button {
    inline-size: 100%;
    justify-content: center;
  }
  .np-npc-drawer .np-act .af-lock { grid-column: 1 / -1; justify-content: center; }
}
/* 修正後的結果一句一塊，不在句子中間斷行（物品健檢「這次的問題已修好」「這份存檔還有 N 筆其他問題」）。 */
.fix-outcome { display: inline-block; }
.hold-review-list { display: grid; gap: .65rem; }
.hold-review-row { border: 1px solid var(--line, #8885); border-radius: .7rem; padding: .65rem .85rem; }
.hold-review-row > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; }
.hold-review-row > summary em { font-style: normal; color: var(--muted, #777); }
.hold-review-row .pd-facts { margin: .75rem 0; }
.hold-review-row .inline { margin-top: .7rem; }
.hold-review-help, .hold-review-maint, .hold-review-detail { margin: .6rem 0; padding: .55rem .7rem; border: 1px solid var(--line, #8885); border-radius: .55rem; }
.hold-review-help > summary, .hold-review-maint > summary, .hold-review-detail > summary { cursor: pointer; }
@media (max-width: 500px) { .hold-review-row .inline { display: grid; grid-template-columns: 1fr; } .hold-review-row .inline button { width: 100%; } }

/* ===== 2026-11-08 UX-2 玩家詳情第一屏（管理頁版面規範，見 docs/systems/accounts-admin.md） =====
   1280：帳號動作只留第一排＋「⋯更多」；375：整列收成一列「帳號動作 ▾」。分頁 375 改成「目前分頁名 ▾」展開分組清單，1280 維持左側直排。 */
.acts-chev { flex: none; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid currentColor; transition: transform .15s; }
[aria-expanded="true"] > .acts-chev { transform: rotate(180deg); }
.acts-fold, .pd-tabsw { display: none; }
.acts-bar { grid-template-columns: 6.5em minmax(0, 1fr) max-content; }
.acts-bar .acts-lbl { white-space: normal; }
.acts-bar button { height: auto; min-height: 44px; }
.acts-moreb { gap: 4px; }
.acts-rest { grid-column: 1 / -1; display: none; grid-template-columns: 6.5em minmax(0, 1fr); gap: 10px 16px; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.acts-bar.open .acts-rest { display: grid; }
.acts-rest .acts-why { grid-column: 1 / -1; margin: 0; }
.pd-reload .small-btn, .pd-more > summary, .pd-facts .copy, .pd-top .crumb { min-height: 44px; }
.pd-top .crumb { display: inline-flex; align-items: center; }
@media (max-width: 640px) {
  .pd-pre { display: none; }
  .acts-bar { grid-template-columns: minmax(0, 1fr); padding: 4px 10px; gap: 6px; }
  .acts-bar.open { padding-bottom: 10px; }
  .acts-bar .acts-fold { display: flex; align-items: center; justify-content: space-between; width: 100%; background: transparent; border: 0; padding: 0 2px; }
  .acts-bar > .acts-lbl, .acts-bar > .grp, .acts-moreb { display: none; }
  .acts-bar.open > .acts-lbl { display: block; }
  .acts-bar.open > .grp { display: grid; }
  .acts-rest { grid-template-columns: minmax(0, 1fr); gap: 6px; padding-top: 6px; }
  .acts-rest .acts-lbl, .acts-rest .acts-lbl.d { padding-top: 0; margin-top: 6px; border-top: 0; }
  .pd-tabsw { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; justify-content: flex-start; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
  .pd-tabsw { margin-bottom: 12px; }
  .pd-body.sw-open .pd-tabsw { margin-bottom: 6px; }
  .pd-tabsw .sw-g { color: var(--muted); }
  .pd-tabsw .sw-g::after { content: " ›"; }
  .pd-tabsw b { flex: 1; text-align: left; }
  /* 目前分頁名已經在上面的切換鈕裡，內容標題只留給讀屏（視覺隱藏、不用 display:none，textContent 不變） */
  .tab-hd .tab-t { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
  .tab-hd:not(:has(button)) { margin-bottom: 0; }
  .pd-body.sw-open .pd-tabsw { border-color: var(--accent); }
  .pd-tabs { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; margin: 0 0 14px; padding: 4px 10px 10px; gap: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
  .pd-body.sw-open .pd-tabs { display: grid; }
  .pd-tg { display: block; grid-column: 1 / -1; padding: 8px 2px 0; }
  .pd-tab { width: 100%; height: auto; min-height: 44px; border-radius: 10px; }
  #plDetail button, #plDetail select, #plDetail summary { min-height: 44px; }
}
