/* 注音小讀者・機構後台
   Tokens mirror lib/theme/app_theme.dart and the website site.css:
   cream paper, mint as the brand, coral and honey as warm support.
   CSP forbids inline styles: keep all visuals here. */
:root {
  color-scheme: light;
  --bg: #fbf7f0;
  --paper: #fffdf8;
  --surface: #ffffff;
  --surface-2: #f3eee4;
  --ink: #2e2a26;
  --ink-2: #6b6157;
  --ink-3: #857a6e;
  --line: #e8e0d5;
  --line-2: #c9bfae;
  --mint: #4fb7ab;
  --mint-deep: #2f8e84;
  --mint-action: #28776f;
  --mint-soft: #d9f0ec;
  --coral: #ffa585;
  --coral-deep: #b95f48;
  --coral-soft: #ffe6dc;
  --gold: #f4b860;
  --gold-deep: #8c621f;
  --gold-soft: #ffefd5;
  --danger: #c0443f;
  --danger-deep: #6e1f1c;
  --danger-soft: #fad2d0;
  --zhuyin: #ff7a00;
  --font: 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', system-ui, sans-serif;
  --mono: 'SF Mono', ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 150ms;
  --normal: 280ms;
  --r-input: 14px;
  --r-button: 16px;
  --r-surface: 20px;
  --shadow-soft: 0 10px 30px -18px rgb(46 42 38 / 0.25);
  --shadow-lift: 0 24px 60px -20px rgb(46 42 38 / 0.35);
  font-family: var(--font);
  font-synthesis: none;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; background: var(--bg); font-size: 15.5px; line-height: 1.58; }
h1, h2, h3, p { margin: 0; }
a { color: var(--mint-deep); }
input, select, button, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgb(79 183 171 / 0.55); outline-offset: 2px; }
.boot { padding: 40px; color: var(--ink-3); }
img { max-width: 100%; }

/* ---------- Primitives ---------- */
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.small { font-size: 12px; }
.block { display: block; }
.num { font-variant-numeric: tabular-nums; }
.stack { display: grid; gap: 2px; }
.pad { padding: 20px 4px; }
.hint { color: var(--ink-3); font-size: 13.5px; line-height: 1.6; }
.tone-warn { color: var(--gold-deep); }
.tone-attention { color: var(--coral-deep); }
.tone-danger { color: var(--danger); }
.tone-ok { color: var(--mint-deep); }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 800; color: var(--mint-deep); }

/* Candy tags */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 9px;
  border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2);
}
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.chip[data-tone='ok'] { background: var(--mint-soft); color: var(--mint-deep); }
.chip[data-tone='warn'] { background: var(--gold-soft); color: var(--gold-deep); }
.chip[data-tone='attention'], .chip[data-tone='info'] { background: var(--coral-soft); color: var(--coral-deep); }
.chip[data-tone='danger'] { background: var(--danger-soft); color: var(--danger-deep); }
.dot { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-3); white-space: nowrap; }
.dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; border: 2px solid currentColor; }
.dot[data-tone='ok'] { color: var(--mint-deep); }
.dot[data-tone='ok']::before { background: currentColor; }

.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-input); font-size: 14px; line-height: 1.65; background: var(--surface-2); color: var(--ink-2); }
.callout .icon { margin-top: 1px; }
.callout[data-tone='warn'] { background: var(--gold-soft); color: #6e4c16; }
.callout[data-tone='danger'] { background: var(--danger-soft); color: var(--danger-deep); }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--r-button); cursor: pointer;
  font-weight: 800; font-size: 15px; white-space: nowrap; text-decoration: none;
  background: transparent; color: var(--ink-2);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.button:active:not(:disabled) { transform: translateY(1px) scale(0.98); }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.button.small { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 12px; gap: 6px; }
.button.small .icon { width: 18px; height: 18px; }
.button.block { width: 100%; }
.button.primary { background: var(--mint-action); color: #fff; box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.12); }
.button.primary:hover:not(:disabled) { background: #1f655e; }
.button.soft { background: var(--mint-soft); color: var(--mint-deep); }
.button.soft:hover:not(:disabled) { background: #c6e8e2; }
.button.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.button.danger { background: var(--danger); color: #fff; box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.12); }
.button.danger:hover:not(:disabled) { background: #a3342f; }
.button.danger-text { color: var(--danger); }
.button.danger-text:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger-deep); }
#refresh:disabled .icon { animation: spin 0.9s linear infinite; }
.icon-button {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink-3); cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.icon-button:hover { background: var(--surface-2); color: var(--ink); }
.link-button { border: 0; background: none; padding: 0; color: var(--mint-deep); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.link-button:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Form fields ---------- */
.field { display: grid; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); min-width: 0; border: 0; padding: 0; margin: 0; }
.field .hint { font-weight: 400; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; }
.field input, .field select, .field textarea, .select-inline select, .search input {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--r-input);
  background: var(--surface); font-weight: 500; font-size: 15.5px; color: var(--ink);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.field input:hover, .field select:hover, .field textarea:hover, .select-inline select:hover, .search input:hover { border-color: var(--line-2); }
.field input:focus, .field select:focus, .field textarea:focus, .select-inline select:focus, .search input:focus {
  outline: none; border-color: var(--mint); box-shadow: 0 0 0 4px rgb(79 183 171 / 0.2);
}
.field input[readonly] { background: var(--surface-2); color: var(--ink-2); }
.field-static { display: grid; gap: 4px; font-size: 14px; }
.field-static span { color: var(--ink-3); font-weight: 700; }
.field-static strong { font-size: 16.5px; }
.switch-field { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; cursor: pointer; }
.switch-field input { flex-shrink: 0; appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; transition: background var(--fast) var(--ease); margin: 0; }
.switch-field input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.2); transition: transform var(--normal) var(--ease); }
.switch-field input:checked { background: var(--mint); }
.switch-field input:checked::after { transform: translateX(18px); }
.invoice-fields { display: grid; gap: 14px; padding: 18px; border: 0; border-radius: 18px; background: var(--surface-2); }
.invoice-fields legend { padding: 0; font-size: 14px; font-weight: 800; color: var(--ink-2); }
.invoice-fields [data-invoice-details] { display: grid; gap: 14px; }
.invoice-fields [data-invoice-details][hidden] { display: none; }
.payment-methods { display: flex; flex-wrap: wrap; gap: 10px 20px; border: 0; padding: 0; }
.payment-methods legend { margin-bottom: 10px; color: var(--ink-2); font-size: 14px; font-weight: 800; }
.payment-methods label { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; cursor: pointer; }
.payment-methods label:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.payment-methods input { accent-color: var(--mint-deep); }
.transfer-bank { display: grid; justify-items: start; gap: 6px; padding: 18px; border-radius: 18px; background: var(--surface-2); }
.transfer-bank[hidden] { display: none; }
.transfer-bank h3, .transfer-proof h3 { font-size: 16px; font-weight: 800; }
.transfer-proof h3 .chip { margin-left: 6px; vertical-align: 2px; }
.transfer-bank .mono { font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.transfer-qr { display: block; width: min(220px, 100%); height: auto; margin: 12px 0; border-radius: 12px; background: #fff; }
.transfer-proof { margin-top: 18px; }
.transfer-proof img { display: block; width: 100%; max-height: 460px; object-fit: contain; margin-top: 12px; }
.transfer-proof img[hidden] { display: none; }
[data-proof-form] { display: grid; gap: 12px; }
[data-proof-form] > button { justify-self: start; }
.transfer-settings { display: grid; gap: 0; margin-bottom: 20px; }
.transfer-settings > div { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.transfer-settings > div:last-child { border-bottom: 0; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; }
.inline-form .field { flex: 1; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--r-input); background: var(--surface); width: fit-content; }
.stepper input { width: 72px; border: 0; text-align: center; font-variant-numeric: tabular-nums; font-weight: 800; min-height: 44px; padding: 0; -moz-appearance: textfield; background: transparent; font-size: 17px; }
.stepper input:focus { outline: none; }
.stepper:focus-within { border-color: var(--mint); box-shadow: 0 0 0 4px rgb(79 183 171 / 0.2); }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }
.stepper .icon-button { width: 44px; height: 44px; color: var(--mint-deep); }
.code-input { font-family: var(--mono); font-size: 22px !important; letter-spacing: 0.4em; text-align: center; }
.secret { padding: 16px; border-radius: var(--r-input); background: var(--gold-soft); font-size: 15px; letter-spacing: 0.06em; overflow-wrap: anywhere; }
.totp-qr { display: block; margin: 0 0 12px; border-radius: var(--r-input); image-rendering: pixelated; }
.drop-zone { position: relative; display: grid; justify-items: center; gap: 10px; padding: 22px 16px; border-radius: var(--r-input); background: var(--surface-2); color: var(--ink-2); text-align: center; cursor: pointer; outline: 2px dashed var(--line-2); outline-offset: -2px; transition: background var(--fast) var(--ease), outline-color var(--fast) var(--ease); }
.drop-zone:hover, .drop-zone[data-over] { background: var(--mint-soft); outline-color: var(--mint); color: var(--mint-deep); }
.drop-zone:focus-within { outline: 2px solid var(--mint); box-shadow: 0 0 0 4px rgb(79 183 171 / 0.2); }
.drop-zone[data-state='invalid'] { outline-color: var(--danger); }
.drop-zone > * { pointer-events: none; }
.drop-zone-copy { display: grid; justify-items: center; gap: 4px; }
.drop-zone-copy .icon { width: 30px; height: 30px; }
.drop-zone[data-state='ready'] .drop-zone-copy .icon { display: none; }
.drop-zone-copy strong { font-size: 14.5px; overflow-wrap: anywhere; }
.drop-zone-copy small { font-weight: 500; color: var(--ink-3); }
.drop-zone img { max-height: 160px; border-radius: 10px; object-fit: contain; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 26px;
  padding: 22px 14px 16px; background: var(--surface-2);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; flex-wrap: wrap; }
.brand-icon { width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0; box-shadow: 0 4px 12px -6px rgb(46 42 38 / 0.4); transform: rotate(-4deg); }
.brand-text { display: grid; font-weight: 800; font-size: 16px; line-height: 1.3; }
.brand-text small { font-weight: 600; font-size: 12.5px; color: var(--ink-3); }
.nav { display: grid; gap: 20px; align-content: start; flex: 1; overflow-y: auto; }
.nav-title { padding: 0 12px 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.nav-group { display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 700;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.nav-item .icon { width: 22px; height: 22px; color: var(--ink-3); transition: color var(--fast) var(--ease); }
.nav-item:hover { background: rgb(255 255 255 / 0.6); color: var(--ink); }
.nav-item[aria-current='page'] { background: var(--surface); color: var(--mint-deep); box-shadow: var(--shadow-soft); }
.nav-item[aria-current='page'] .icon { color: var(--mint); }
.nav-badge { margin-left: auto; min-width: 24px; padding: 1px 8px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 12.5px; font-weight: 800; text-align: center; }
.nav-scope { display: grid; gap: 4px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.nav-scope span { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.scope-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 10px 8px 14px;
  border: 0; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-soft); cursor: pointer; text-align: left;
  transition: box-shadow var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.scope-trigger:hover { box-shadow: var(--shadow-lift); }
.scope-trigger:active { transform: scale(0.98); }
.scope-trigger strong { flex: 1; min-width: 0; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-trigger .nav-badge { margin-left: 0; }
.scope-trigger .icon { width: 16px; height: 16px; color: var(--ink-3); }
.scope-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.scope-option {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 10px 14px; border: 0; border-radius: 14px;
  background: transparent; cursor: pointer; text-align: left; font-size: 15px; font-weight: 700; color: var(--ink-2);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.scope-option:hover { background: var(--surface-2); color: var(--ink); }
.scope-option[aria-current='true'] { background: var(--mint-soft); color: var(--mint-deep); }
.scope-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.panel-dialog .search { max-width: none; flex: none; }
.nav-scope-note { font-size: 12px; font-weight: 600; color: var(--gold-deep); }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--gold); color: #5b3f10; font-weight: 800; flex-shrink: 0; transform: rotate(-4deg); }
.who { display: grid; min-width: 0; line-height: 1.35; }
.who strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .icon-button { margin-left: auto; }

.page { padding: 34px clamp(20px, 4vw, 56px) 120px; max-width: 1280px; width: 100%; outline: none; animation: page-in var(--normal) var(--ease); }
.page-head { display: flex; align-items: center; gap: 16px 20px; flex-wrap: wrap; margin-bottom: 30px; }
.page-art { width: 72px; height: 72px; flex-shrink: 0; transform: rotate(-5deg); filter: drop-shadow(0 6px 10px rgb(46 42 38 / 0.12)); }
.page-title { display: grid; gap: 4px; max-width: 64ch; flex: 1 1 320px; }
.page-title h1 { font-size: clamp(24px, 2.2vw, 30px); font-weight: 800; line-height: 1.28; }
.page-title p { color: var(--ink-2); font-size: 15px; line-height: 1.7; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.page-actions #refresh { color: var(--ink-3); font-weight: 600; font-size: 13.5px; }
.inbox-bell { position: relative; width: 44px; padding: 0; color: var(--ink-3); }
.inbox-bell .icon { width: 22px; height: 22px; }
.inbox-bell[data-waiting] { background: var(--coral-soft); color: var(--coral-deep); }
.inbox-bell .nav-badge { position: absolute; top: -4px; right: -6px; margin: 0; min-width: 20px; padding: 0 6px; font-size: 11.5px; line-height: 20px; box-shadow: 0 0 0 2px var(--bg); }
.inbox-section { display: grid; gap: 8px; }
.inbox-section .section-label { display: flex; align-items: center; gap: 8px; }
.inbox-section .count { padding: 0 8px; border-radius: 999px; background: var(--surface-2); font-size: 12px; }
.inbox-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.inbox-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 16px;
  background: transparent; cursor: pointer; text-align: left; color: var(--ink);
  transition: background var(--fast) var(--ease);
}
.inbox-item:hover { background: var(--surface-2); }
.inbox-item .stack { flex: 1; min-width: 0; }
.inbox-item strong { font-size: 15px; overflow-wrap: anywhere; }
.inbox-item > .icon { width: 16px; height: 16px; color: var(--ink-3); }

/* ---------- Metrics: one soft band, not boxed tiles ---------- */
.metric-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 4px; margin-bottom: 32px; padding: 6px; border-radius: var(--r-surface); background: var(--surface-2); }
.metric { display: grid; gap: 2px; padding: 14px 18px; border-radius: 16px; }
.metric:first-child { background: var(--surface); }
.metric-label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); font-weight: 700; }
.metric-value { font-size: 34px; font-weight: 800; line-height: 1.2; color: var(--ink); }
.metric:first-child .metric-value { color: var(--mint-deep); }
.metric-band.compact .metric-value { font-size: 26px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.swatch.seg-available, .stack-bar .seg-available { background: var(--mint); fill: var(--mint); }
.swatch.seg-reserved, .stack-bar .seg-reserved { background: var(--coral); fill: var(--coral); }
.swatch.seg-refunding, .stack-bar .seg-refunding { background: var(--coral-deep); fill: var(--coral-deep); }
.swatch.seg-used, .stack-bar .seg-used { background: var(--line-2); fill: var(--line-2); }
.swatch.seg-expired, .stack-bar .seg-expired { background: var(--gold); fill: var(--gold); }
.swatch.seg-revoked, .stack-bar .seg-revoked { background: var(--danger); fill: var(--danger); }
.stack-bar .seg-empty { fill: var(--surface-2); }

/* ---------- Home ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.panel { background: var(--surface); border-radius: var(--r-surface); padding: 22px 24px 10px; }
.panel.quiet { background: var(--surface-2); padding-bottom: 22px; }
.section-title { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.section-title.spaced { margin-top: 26px; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px dashed var(--line); }
.task-list li:first-child { border-top: 0; }
.task-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--surface-2); color: var(--ink-2); flex-shrink: 0; transform: rotate(-4deg); }
.task-icon .icon { width: 22px; height: 22px; }
.task-icon[data-tone='warn'] { background: var(--gold-soft); color: var(--gold-deep); }
.task-icon[data-tone='attention'], .task-icon[data-tone='info'] { background: var(--coral-soft); color: var(--coral-deep); }
.task-icon[data-tone='danger'] { background: var(--danger-soft); color: var(--danger); }
.task-text { flex: 1; font-weight: 700; font-size: 15.5px; }
.all-clear { display: flex; gap: 16px; align-items: center; padding: 8px 0 18px; }
.upcoming, .term-list { list-style: none; margin: 0; padding: 0; }
.upcoming li { display: grid; grid-template-columns: minmax(0, 1fr) auto 56px; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line-2); font-size: 14.5px; align-items: baseline; }
.upcoming li:first-child { border-top: 0; }
.upcoming-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.upcoming-date { color: var(--ink-2); font-size: 13.5px; }
.upcoming-left { text-align: right; font-size: 13.5px; font-weight: 800; }
.term-list { display: flex; flex-wrap: wrap; gap: 8px; }
.term-list li { display: flex; gap: 10px; align-items: baseline; padding: 8px 16px; border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 700; }
.term-list b { font-size: 18px; color: var(--mint-deep); }

/* ---------- Toolbar & tables ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 240px; max-width: 360px; }
.search .icon { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--ink-3); pointer-events: none; }
.search input { padding-left: 44px; min-height: 44px; }
.select-inline select { min-height: 44px; width: auto; padding-right: 34px; }
.segmented { display: inline-flex; gap: 2px; padding: 4px; border-radius: 16px; background: var(--surface-2); overflow-x: auto; max-width: 100%; }
.segmented button {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed='true'] { background: var(--surface); color: var(--mint-deep); box-shadow: 0 2px 6px -3px rgb(46 42 38 / 0.25); }
.segmented .count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: rgb(46 42 38 / 0.06); font-size: 12px; font-variant-numeric: tabular-nums; }
.segmented button[aria-pressed='true'] .count { background: var(--mint-soft); }
.list-meta { font-size: 13.5px; color: var(--ink-3); margin: 4px 0 8px; }
.check-list { display: grid; }
.check-list label { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; font-size: 14.5px; font-weight: 700; cursor: pointer; }
.check-list label + label { border-top: 1px dashed var(--line); }
.check-list input { flex-shrink: 0; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--mint-action); cursor: pointer; }
.refund-detail { width: 100%; min-height: 120px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-input); background: var(--surface); font-size: 15.5px; line-height: 1.7; resize: vertical; transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.refund-detail:hover { border-color: var(--line-2); }
.refund-detail:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 4px rgb(79 183 171 / 0.2); }
.refund-entry { margin: 20px 0 0; font-size: 12.5px; color: var(--ink-3); }
.refund-entry a { color: inherit; }
.link-button.quiet { margin-left: 6px; color: var(--ink-3); font-size: 12.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.table-wrap { position: relative; overflow-x: auto; border-radius: var(--r-surface); background: var(--surface); padding: 4px 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; text-align: left; }
thead th { padding: 12px; font-size: 13px; font-weight: 700; color: var(--ink-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--fast) var(--ease); }
.data-table tbody tr:hover { background: var(--bg); }
tbody tr.is-selected, .data-table tbody tr.is-selected:hover { background: var(--mint-soft); }
tbody tr.is-muted td { color: var(--ink-3); }
th:first-child, td:first-child { padding-left: 6px; }
.col-check { width: 40px; }
.col-check input { width: 18px; height: 18px; accent-color: var(--mint-action); cursor: pointer; }
.col-actions { text-align: right; white-space: nowrap; }
.col-actions > * + * { margin-left: 4px; }
.num-col { text-align: right; }
.table-empty { padding: 40px 12px; text-align: center; color: var(--ink-3); }
.group-row td { padding: 16px 6px 6px; border-bottom: 0; }
.group-row span { font-weight: 800; font-size: 15px; color: var(--mint-deep); }
.group-row small { margin-left: 8px; color: var(--ink-3); font-size: 13px; }
.group-row + tr td { border-top: 1px solid var(--line); }
.row-link { display: grid; gap: 1px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.row-link strong { font-size: 15px; }
.row-link .mono { color: var(--ink-3); font-size: 12.5px; }
.row-link:hover strong { color: var(--mint-deep); text-decoration: underline; text-underline-offset: 3px; }

.invoice-list { padding: 4px 22px; border-radius: var(--r-surface); background: var(--surface); }
.invoice-when { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 8px; font-size: 13.5px; }
.invoice-when > span { color: var(--ink-3); font-weight: 700; }
.invoice-when > strong { font-size: 15px; font-weight: 800; color: var(--ink); }
.invoice-row { padding: 22px 0; border-bottom: 1px dashed var(--line-2); }
.invoice-row:last-child { border-bottom: 0; }
.invoice-row-head { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; }
.invoice-identity { display: grid; gap: 4px; min-width: 0; }
.invoice-identity > strong { font-size: 18px; font-weight: 800; }
.invoice-identity > span { color: var(--ink-3); overflow-wrap: anywhere; }
.invoice-summary { display: flex; align-items: center; justify-content: flex-end; gap: 10px 16px; flex-wrap: wrap; }
.invoice-summary > span:first-child { color: var(--ink-2); font-weight: 700; }
.invoice-summary > strong { font-size: 20px; }
.invoice-copy-grid { display: grid; grid-template-columns: minmax(150px, 0.75fr) minmax(180px, 1fr) minmax(220px, 1.35fr); gap: 12px 28px; margin-top: 22px; padding: 18px 20px; border-radius: 18px; background: var(--surface-2); }
.invoice-copy-field { display: grid; gap: 5px; min-width: 0; }
.invoice-copy-field > span { color: var(--ink-3); font-size: 13px; font-weight: 700; }
.invoice-copy-field > div { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.invoice-copy-field strong { font-size: 16px; overflow-wrap: anywhere; }
.invoice-copy-field .link-button { flex-shrink: 0; }
.invoice-row-foot { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 14px; color: var(--ink-3); font-size: 13.5px; }
.invoice-row-foot b { color: var(--ink-2); font-weight: 700; }
.invoice-empty { padding: 40px 12px; border-radius: var(--r-surface); background: var(--surface); color: var(--ink-3); text-align: center; }

@media (max-width: 820px) {
  .invoice-row-head { align-items: flex-start; flex-direction: column; }
  .invoice-summary { justify-content: flex-start; }
  .invoice-copy-grid { grid-template-columns: 1fr; }
}

.bulk-bar {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 20;
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 20px; border-radius: 20px;
  background: var(--ink); color: #fff; box-shadow: var(--shadow-lift);
  translate: -50% 0; animation: rise var(--normal) var(--ease); font-size: 14.5px; font-weight: 700;
}
.bulk-bar .button.ghost { color: #d9d2c8; }
.bulk-bar .button.ghost:hover { background: rgb(255 255 255 / 0.1); color: #fff; }

/* ---------- Empty & loading ---------- */
.empty-state { display: grid; justify-items: start; gap: 8px; padding: 40px 4px; max-width: 460px; }
.empty-state h3 { font-size: 18px; font-weight: 800; margin-top: 6px; }
.empty-state p { color: var(--ink-2); line-height: 1.7; }
.empty-state .button { margin-top: 12px; }
.empty-art { width: 96px; height: 96px; transform: rotate(-6deg); filter: drop-shadow(0 8px 12px rgb(46 42 38 / 0.12)); animation: bob 3.6s ease-in-out infinite; }
.all-clear .empty-art { width: 72px; height: 72px; }
.skeleton-nav { gap: 10px; padding: 8px; }
.skeleton-nav span, .skeleton-head span, .skeleton-band span, .skeleton-row span { display: block; border-radius: 10px; background: #e9e2d6; animation: pulse 1.4s ease-in-out infinite; }
.skeleton-nav span { height: 34px; }
.skeleton-head { display: grid; gap: 10px; margin-bottom: 32px; }
.skeleton-head span:first-child { width: 90px; height: 14px; }
.skeleton-head span:last-child { width: 220px; height: 32px; }
.skeleton-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.skeleton-band span { height: 76px; border-radius: 16px; }
.skeleton-list { display: grid; }
.skeleton-row { display: flex; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px dashed var(--line); }
.skeleton-row span:first-child { width: min(320px, 60%); height: 16px; }
.skeleton-row span:last-child { width: 80px; height: 16px; }
.skeleton-row:nth-child(2n) span:first-child { width: min(240px, 45%); }

/* ---------- Vouchers ---------- */
.inventory { display: grid; gap: 10px; }
.inventory-row { border-radius: var(--r-surface); background: var(--surface); }
.inventory-row summary {
  display: grid; grid-template-columns: minmax(160px, 0.8fr) minmax(0, 2fr) 36px; align-items: center; gap: 28px;
  padding: 20px 22px; cursor: pointer; list-style: none; border-radius: var(--r-surface); transition: background var(--fast) var(--ease);
}
.inventory-row summary::-webkit-details-marker { display: none; }
.inventory-row summary:hover { background: rgb(243 238 228 / 0.5); }
.inventory-name { display: grid; gap: 2px; min-width: 0; }
.inventory-name strong { font-size: 16.5px; font-weight: 800; overflow-wrap: anywhere; }
.inventory-name small { color: var(--ink-3); font-size: 13.5px; }
.inventory-bar { display: grid; gap: 10px; }
.stack-bar { width: 100%; height: 12px; border-radius: 999px; overflow: hidden; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { color: var(--ink); }
.inventory-toggle { display: grid; place-items: center; color: var(--ink-3); transition: transform var(--normal) var(--ease); }
.inventory-row[open] .inventory-toggle { transform: rotate(90deg); }
.inventory-detail { padding: 0 10px 12px; }
.inventory-detail .table-wrap { padding: 0 8px; }

.plan-rows { list-style: none; margin: 0; padding: 4px 20px; border-radius: var(--r-surface); background: var(--surface); }
.plan-rows li { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto auto; align-items: center; gap: 24px; padding: 18px 0; border-bottom: 1px dashed var(--line); }
.plan-rows li:last-child { border-bottom: 0; }
.plan-rows li.is-muted .plan-term, .plan-rows li.is-muted .plan-amount strong { color: var(--ink-3); }
.plan-term { display: flex; align-items: baseline; gap: 6px; font-weight: 700; color: var(--ink-2); }
.plan-term b { font-size: 32px; font-weight: 800; color: var(--mint-deep); }
.plan-amount { display: grid; }
.plan-amount strong { font-size: 18px; font-weight: 800; }
.plan-amount small { font-size: 13px; }

/* ---------- Audit timeline ---------- */
.timeline-day + .timeline-day { margin-top: 26px; }
.timeline-date { display: inline-block; margin-bottom: 6px; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13.5px; font-weight: 800; color: var(--ink-2); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 63px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--line); }
.timeline-item { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 32px; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: 58px; top: 18px; width: 12px; height: 12px; border-radius: 50%; background: var(--line-2); box-shadow: 0 0 0 3px var(--bg); }
.timeline-item[data-cat='student']::before { background: var(--mint); }
.timeline-item[data-cat='voucher']::before { background: var(--gold); }
.timeline-item[data-cat='order']::before { background: var(--coral); }
.timeline-item[data-cat='organization']::before, .timeline-item[data-cat='admin']::before, .timeline-item[data-cat='plan']::before { background: var(--mint-deep); }
.timeline-item time { padding-top: 12px; font-size: 13.5px; color: var(--ink-3); text-align: right; }
.timeline-item details { border-bottom: 1px dashed var(--line); }
.timeline-item summary { display: flex; justify-content: space-between; gap: 8px 20px; padding: 10px 0; cursor: pointer; list-style: none; flex-wrap: wrap; }
.timeline-item summary::-webkit-details-marker { display: none; }
.timeline-item summary:hover strong { color: var(--mint-deep); }
.timeline-main { display: grid; gap: 1px; min-width: 0; }
.timeline-main strong { font-size: 15px; font-weight: 800; }
.timeline-main > span { color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.timeline-actor { font-size: 13px; color: var(--ink-3); padding-top: 3px; overflow-wrap: anywhere; }
.load-more { display: flex; justify-content: center; margin-top: 20px; }

.facts { display: grid; margin: 0 0 8px; }
.facts > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.facts dt { color: var(--ink-3); font-weight: 700; font-size: 13.5px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts.compact { margin: 0 0 12px; }
.facts.compact > div { padding: 6px 0; border: 0; font-size: 13.5px; }

/* ---------- Settings ---------- */
.settings-list { list-style: none; margin: 0; padding: 4px 20px; max-width: 760px; border-radius: var(--r-surface); background: var(--surface); }
.settings-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px 0; border-bottom: 1px dashed var(--line); }
.settings-list li:last-child { border-bottom: 0; }
.settings-list p { font-size: 14px; margin-top: 2px; }
.settings-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--mint-soft); color: var(--mint-deep); transform: rotate(-4deg); }

/* ---------- Dialogs & sheets ---------- */
.panel-dialog {
  border: 0; padding: 0; color: var(--ink); background: var(--paper);
  box-shadow: var(--shadow-lift); max-height: min(88dvh, 820px);
}
.panel-dialog[open] { display: flex; flex-direction: column; }
.panel-dialog::backdrop { background: rgb(46 42 38 / 0.38); backdrop-filter: blur(2px); animation: fade var(--normal) var(--ease); }
.panel-dialog.modal { width: min(520px, calc(100% - 32px)); border-radius: 24px; animation: pop var(--normal) var(--ease); }
.panel-dialog.sheet {
  margin: 0 0 0 auto; width: min(480px, 100%); height: 100dvh; max-height: 100dvh; max-width: 100%;
  border-radius: 24px 0 0 24px; animation: sheet-in 340ms var(--ease);
}
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 24px 8px; }
.dialog-head > div { display: grid; gap: 4px; min-width: 0; }
.dialog-head h2 { font-size: 21px; font-weight: 800; overflow-wrap: anywhere; }
.dialog-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.dialog-body { display: grid; gap: 18px; align-content: start; padding: 12px 24px 20px; overflow-y: auto; flex: 1; }
.dialog-lead { color: var(--ink-2); font-size: 15px; line-height: 1.7; }
.form-error { margin: 0 24px 12px; color: var(--danger); font-size: 14px; font-weight: 700; }
.form-error:empty { display: none; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px calc(20px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.sheet .dialog-foot { margin-top: auto; }
.dialog-foot.wrap { flex-wrap: wrap; }
.refund-invoice-review .review-confirm { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; font-weight: 700; cursor: pointer; }
.refund-invoice-review .review-confirm input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--mint-deep); }
.section-label { font-size: 14px; font-weight: 800; color: var(--ink-2); }
.application-queue { margin-bottom: 32px; }
.application-queue h2 { margin-bottom: 12px; }
.application-history { margin-top: 16px; }
.application-history summary { cursor: pointer; margin-bottom: 12px; }
.application-queue p, .application-details p { overflow-wrap: anywhere; }
.application-queue .data-table td:not(.col-actions) { max-width: 320px; white-space: normal; overflow-wrap: anywhere; }
.grant-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.grant-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-input); background: var(--surface-2); font-size: 14.5px; }
.grant-list li.is-revoked .num { text-decoration: line-through; color: var(--ink-3); }

.plan-picker { display: grid; gap: 8px; }
.plan-picker legend { margin-bottom: 8px; }
.plan-option {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px;
  border: 2px solid transparent; border-radius: 18px; background: var(--surface-2); cursor: pointer; font-weight: 400;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.plan-option:hover { background: #ede6da; }
.plan-option input { position: absolute; opacity: 0; pointer-events: none; }
.plan-option:has(input:checked) { border-color: var(--mint); background: var(--mint-soft); transform: rotate(-0.6deg); }
.plan-option:has(input:focus-visible) { outline: 3px solid rgb(79 183 171 / 0.55); outline-offset: 2px; }
.plan-months { font-size: 14.5px; color: var(--ink-2); font-weight: 700; }
.plan-months b { font-size: 24px; font-weight: 800; color: var(--mint-deep); margin-right: 2px; }
.plan-price { font-weight: 800; font-size: 17px; }
.plan-price small { font-weight: 500; color: var(--ink-3); font-size: 13px; }
.plan-price .plan-original { display: block; color: var(--ink-2); }
.plan-price { margin-left: auto; white-space: nowrap; }
.plan-months { white-space: nowrap; }
.plan-saving { padding: 4px 10px; border-radius: 99px; background: var(--mint-soft); color: var(--mint-action); font-size: 13px; font-weight: 700; white-space: nowrap; }
.purchase-summary { padding: 16px 18px; border-radius: 18px; background: var(--mint-soft); }
.purchase-comparison-line { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 10px; color: var(--ink-2); }
.purchase-saving { color: var(--mint-action); font-weight: 700; }
.purchase-summary .total-line { padding: 4px 0 0; background: transparent; color: var(--ink); }
@media (max-width: 420px) {
  .plan-option { padding: 12px 10px; gap: 8px; }
  .plan-saving { padding-inline: 8px; }
}
.total-line { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 18px; border-radius: 18px; background: var(--gold-soft); font-weight: 800; color: #6e4c16; }
.total-line strong { font-size: 28px; color: var(--ink); }

.credential-list { display: grid; }
.credential-info { display: grid; gap: 12px; min-width: 0; align-content: start; }
.credential-account { padding: 16px 0; border-bottom: 1px dashed var(--line); display: grid; gap: 12px; }
.credential-account h3 { font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.credential-field { display: grid; gap: 6px; }
.rename-field { margin-bottom: 4px; }
.rename-field input { min-height: 42px; }
.credential-account .field > span { font-size: 13px; color: var(--ink-3); font-weight: 700; }
.credential-field > span { font-size: 13px; color: var(--ink-3); font-weight: 700; }
.credential-line { display: flex; gap: 6px; align-items: center; }
.credential-line input { flex: 1; min-width: 0; min-height: 42px; padding: 8px 12px; border: 0; border-radius: 12px; background: var(--surface-2); font-family: var(--mono); font-size: 14.5px; }
.credential-line .button[data-state='done'] { color: var(--mint-deep); }
.credential-account .copy-parent-message { min-height: 48px; white-space: normal; }
.parent-message-preview summary { padding: 10px 0; cursor: pointer; color: var(--mint-deep); font-size: 14px; font-weight: 700; }
.parent-template, .parent-message-text { width: 100%; padding: 18px; border: 0; border-radius: var(--r-input); background: var(--surface-2); line-height: 1.8; font-family: var(--font); font-size: 16px; font-weight: 400; }
.parent-template { min-height: 280px; }
.parent-message-text { margin: 12px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.parent-message-preview { min-width: 0; }
.panel-dialog.family-handoff { width: min(1120px, calc(100% - 48px)); max-height: calc(100dvh - 48px); }
.family-handoff .credential-account { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 32px; align-items: start; }
.panel-dialog.parent-template-dialog { width: min(800px, 100%); }
.parent-template-dialog .field-row { flex-wrap: wrap; gap: 4px 12px; }
.template-variables { display: flex; gap: 8px; flex-wrap: wrap; }
.template-variables .hint { width: 100%; }
.template-variables .button { min-height: 44px; }

/* ---------- Toast ---------- */
#notice {
  position: fixed; right: 24px; top: calc(20px + env(safe-area-inset-top, 0px)); z-index: 40;
  max-width: min(420px, calc(100% - 32px)); margin: 0; padding: 14px 18px;
  border-radius: 18px; background: var(--surface); color: var(--ink); font-size: 14.5px; font-weight: 600; line-height: 1.6;
  box-shadow: var(--shadow-lift); border-left: 6px solid var(--mint); animation: toast-in var(--normal) var(--ease);
}
#notice:empty { display: none; }
#notice[data-tone='error'] {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px; font-size: 15.5px;
  background: var(--danger); color: #fff; border-left-color: var(--danger-deep);
  box-shadow: 0 24px 60px -16px rgb(192 68 63 / 0.6), var(--shadow-lift);
  animation: toast-in var(--normal) var(--ease), nudge 420ms var(--ease) var(--normal);
}
#notice[data-tone='error']::before {
  content: '!'; flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; color: var(--danger); font-size: 16px; font-weight: 800; line-height: 1;
}
#notice[data-tone='ok'] { border-left-color: var(--mint); }

/* ---------- Auth ---------- */
.auth-screen { display: grid; grid-template-columns: minmax(340px, 5fr) 7fr; min-height: 100dvh; }
.auth-art {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 36px 40px; background: var(--mint-soft); color: var(--ink);
}
.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 17px; position: relative; z-index: 2; }
.auth-brand small { margin-left: 4px; font-weight: 600; font-size: 13px; color: var(--mint-deep); }
.auth-mascot { position: absolute; z-index: 1; right: 6%; bottom: 0; width: min(78%, 420px); height: auto; border-radius: 32px 32px 0 0; box-shadow: var(--shadow-lift); }
.zhuyin-bubbles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.zhuyin-bubbles span {
  position: absolute; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 20px;
  background: var(--surface); font-size: 32px; font-weight: 800; box-shadow: var(--shadow-soft); animation: bob 4s ease-in-out infinite;
}
.zhuyin-bubbles span:nth-child(1) { top: 16%; left: 10%; color: var(--zhuyin); rotate: -10deg; }
.zhuyin-bubbles span:nth-child(2) { top: 30%; left: 30%; color: var(--mint-deep); rotate: 8deg; animation-delay: -1s; }
.zhuyin-bubbles span:nth-child(3) { top: 12%; right: 12%; color: var(--coral-deep); rotate: 6deg; animation-delay: -2s; }
.zhuyin-bubbles span:nth-child(4) { top: 44%; left: 8%; color: var(--gold-deep); rotate: -6deg; animation-delay: -3s; }
.zhuyin-bubbles span:nth-child(n + 5) { display: none; }
.auth-quote { position: relative; z-index: 2; max-width: 9em; padding: 14px 18px; border-radius: 22px; background: rgb(255 255 255 / 0.88); font-size: clamp(22px, 2.2vw, 28px); font-weight: 800; line-height: 1.35; color: var(--mint-deep); box-shadow: var(--shadow-soft); }
.auth-panel { display: grid; place-items: center; padding: 48px 24px; }
.auth-card { width: min(420px, 100%); min-width: 0; display: grid; gap: 14px; justify-items: start; overflow-wrap: anywhere; }
.auth-card > * { width: 100%; }
.auth-card > .chip, .auth-card > .eyebrow, .auth-card > .button:not(.block) { width: auto; }
.auth-card h1 { font-size: 30px; font-weight: 800; line-height: 1.28; }
.auth-lead { color: var(--ink-2); line-height: 1.7; margin-bottom: 10px; }
.auth-form { display: grid; gap: 16px; }
.auth-form .button.block { margin-top: 6px; min-height: 50px; font-size: 16px; }
.disclosure { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.disclosure summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.disclosure[open] summary { margin-bottom: 10px; }
.disclosure .inline-form { margin-top: 10px; }
.setup-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.setup-step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-top: 1px dashed var(--line-2); }
.setup-step > div { display: grid; gap: 10px; justify-items: start; }
.setup-step .auth-form, .setup-step .inline-form, .setup-step #secret { width: 100%; }
.setup-step h2 { font-size: 16.5px; font-weight: 800; }
.step-no { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 11px; background: var(--gold); color: #5b3f10; font-weight: 800; font-size: 15px; transform: rotate(-6deg); }

/* ---------- Motion ---------- */
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes sheet-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; translate: -50% 12px; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }
@keyframes nudge { 20%, 60% { translate: -6px 0; } 40%, 80% { translate: 6px 0; } }
@keyframes pulse { 50% { opacity: 0.45; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 50% { translate: 0 -6px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::backdrop { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .family-handoff .credential-account { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: sticky; top: 0; z-index: 10; height: auto; display: grid; gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'brand foot' 'nav nav';
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 10px;
  }
  .sidebar-brand { grid-area: brand; padding: 0; }
  .sidebar-foot { grid-area: foot; padding: 0; border: 0; }
  .sidebar-foot .who { display: none; }
  .brand-icon { width: 36px; height: 36px; }
  .avatar { width: 32px; height: 32px; font-size: 14px; }
  .nav { grid-area: nav; display: flex; gap: 4px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-group { display: contents; }
  .nav-title { display: none; }
  .nav-item { padding: 8px 12px; font-size: 14.5px; white-space: nowrap; flex-shrink: 0; }
  .skeleton-nav span { width: 72px; flex-shrink: 0; }
  .data-table { min-width: 760px; }
  .data-table td { white-space: nowrap; }
  .page { padding: 22px 16px 120px; }
  .auth-screen { grid-template-columns: minmax(0, 1fr); }
  .auth-art { min-height: 260px; padding: 20px; }
  .auth-mascot { width: 170px; right: 16px; border-radius: 24px 24px 0 0; }
  .zhuyin-bubbles span { width: 46px; height: 46px; font-size: 24px; border-radius: 15px; }
  .zhuyin-bubbles { display: none; }
  .auth-brand { max-width: 50%; flex-wrap: wrap; }
  .auth-quote { font-size: 20px; max-width: 8em; }
  .auth-panel { place-items: start center; padding: 28px 16px 64px; }
}
@media (max-width: 640px) {
  .page-art { width: 52px; height: 52px; align-self: flex-start; }
  .page-title { flex: 1 1 0; }
  .page-actions { width: 100%; margin-left: 0; }
  .page-actions .button.primary { flex: 1; }
  .metric-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 12px 14px; }
  .metric-value { font-size: 28px; }
  .search { max-width: none; flex-basis: 100%; }
  .skeleton-band { grid-template-columns: repeat(2, 1fr); }
  .inventory-row summary { grid-template-columns: minmax(0, 1fr) 28px; gap: 12px 16px; padding: 18px; }
  .inventory-bar { grid-column: 1 / -1; grid-row: 2; }
  .inventory-toggle { grid-row: 1; grid-column: 2; }
  .plan-rows li { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; }
  .plan-rows .chip { grid-column: 1; justify-self: start; }
  .timeline::before { left: 51px; }
  .timeline-item { grid-template-columns: 40px minmax(0, 1fr); gap: 24px; }
  .timeline-item::before { left: 46px; }
  .panel-dialog.sheet { border-radius: 24px 24px 0 0; margin: auto 0 0; height: auto; max-height: 92dvh; width: 100%; animation-name: sheet-up; }
  .dialog-foot .button { flex: 1; }
  .panel-dialog.modal.refund-invoice-review { width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0; background: #fff; }
  .refund-invoice-review .dialog-foot { flex-direction: column-reverse; }
  .refund-invoice-review .dialog-foot .button { width: 100%; }
  .bulk-bar { width: calc(100% - 32px); justify-content: space-between; padding-left: 16px; }
  .credential-line { flex-wrap: wrap; }
  .credential-line input { flex-basis: 100%; }
  #notice { right: 16px; left: 16px; max-width: none; }
}

/* Publisher new-book wizard (#1608) */
.wizard-steps { list-style: none; margin: 0 0 18px; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.wizard-steps li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink-3); font-size: 13.5px; font-weight: 700; }
.wizard-steps li .num { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 7px; background: var(--line); font-size: 12px; }
.wizard-steps li[aria-current="step"] { background: var(--gold); color: #5b3f10; }
.wizard-steps li[aria-current="step"] .num { background: var(--gold-soft); }
.wizard-step { display: grid; gap: 14px; }
.wizard-summary { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.wizard-summary dt { color: var(--ink-3); font-weight: 700; }
.wizard-summary dd { margin: 0; overflow-wrap: anywhere; }

/* Publisher layout board (#1610) */
.panel-dialog.sheet.board-sheet { width: min(1480px, 100%); border-radius: 24px 0 0 24px; }
.layout-board { display: grid; gap: 22px; }
.board-section { display: grid; gap: 10px; }
.board-section .section-label small { font-weight: 500; margin-left: 6px; }
.board-drop { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 18px 16px; border: 2px dashed var(--line-2); border-radius: var(--r-surface); background: var(--surface-2); cursor: pointer; transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease); }
.board-drop:hover, .board-drop:focus-visible, .board-drop.is-over { border-color: var(--mint); background: var(--mint-soft); outline: none; }
.board-pages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.board-card { display: grid; gap: 8px; padding: 10px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-soft); cursor: grab; }
.board-card.is-over { outline: 2px solid var(--mint); }
.board-card.is-spread { box-shadow: 10px 0 0 -4px var(--gold), var(--shadow-soft); }
.board-card-body { display: grid; gap: 2px; min-width: 0; }
.board-card-body small { color: var(--ink-3); overflow-wrap: anywhere; }
.board-card-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.board-spread { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; color: var(--ink-2); }
.board-thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.board-thumb img { width: 100%; height: 100%; object-fit: contain; }
.board-thumb.checker { background-color: #fff; background-image: linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%), linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }
.board-file { font-weight: 800; color: var(--ink-3); letter-spacing: 0.06em; }
.board-layers { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.board-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.board-layer-fields { display: grid; gap: 6px; min-width: 0; }
.board-inline { display: flex; flex-wrap: wrap; gap: 6px; }
.board-issue { font-size: 13px; font-weight: 700; }
.board-issue[data-tone="danger"] { color: var(--danger); }
.board-issue[data-tone="warn"] { color: var(--gold-deep); }
.board-issue[data-tone="ok"] { color: var(--mint-deep); }
@media (max-width: 640px) {
  .board-pages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-row { grid-template-columns: 72px minmax(0, 1fr); }
  .board-row > .button { grid-column: 2; justify-self: start; }
}
.batch-books { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.batch-book { display: grid; gap: 10px; padding: 14px; border-radius: var(--r-surface); background: var(--surface); box-shadow: var(--shadow-soft); }
.batch-book-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.batch-book-head .board-spread { margin-right: auto; font-weight: 700; }
/* Read-only board for the platform: no drops, moves or edits. */
.board-readonly .board-drop, .board-readonly .board-card-actions, .board-readonly .board-row > .button, .board-readonly .board-issue { display: none; }
.board-readonly .board-card { cursor: default; }
.board-readonly select, .board-readonly input { pointer-events: none; }

/* Large page view inside the board (#1611) */
.board-zoom { border: 0; padding: 0; cursor: zoom-in; width: 100%; }
.board-zoom:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }
.board-preview { position: fixed; inset: 0; z-index: 5; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; padding: 20px 24px; background: rgb(20 18 16 / 0.94); color: #fff; outline: none; }
.board-preview-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.board-preview-head strong { font-size: 18px; }
.board-preview-head small { color: rgb(255 255 255 / 0.7); overflow-wrap: anywhere; }
.board-preview-head .button { margin-left: auto; }
.board-preview-stage { display: grid; place-items: center; min-height: 0; }
.board-preview-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; background: #fff; }
.board-preview-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.board-preview .button.ghost { color: #fff; }
@media (max-width: 640px) {
  .board-pages { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .board-preview { padding: 12px; }
}

/* Motion proof player (#1615) */
.motion-player { display: grid; gap: 14px; }
.mp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.mp-head strong { font-size: 18px; }
.mp-head small { color: var(--ink-3); }
.mp-head .board-spread { margin-left: auto; }
/* The whole page fits: width follows the page ratio within ~64% of the screen height. */
.mp-viewport { position: relative; overflow: hidden; border-radius: 16px; background: #fff; aspect-ratio: var(--ratio); width: min(100%, calc(64dvh * var(--ratio))); margin: 0 auto; }
.mp-stage { position: absolute; inset: 0; }
.mp-viewport.is-left .mp-stage, .mp-viewport.is-right .mp-stage { width: 200%; }
.mp-viewport.is-right .mp-stage { transform: translateX(-50%); }
.mp-still { display: block; width: 100%; height: 100%; }
.mp-layer, .mp-layer-body { position: absolute; inset: 0; }
.mp-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
video.mp-scene { object-fit: cover; }
.mp-layer img { position: absolute; inset: 0; width: 100%; height: 100%; }
.mp-text { font-size: 20px; line-height: 1.8; }
.mp-foot { display: flex; justify-content: space-between; gap: 10px; }

/* File drop zone used by single-file dialogs (#1617) */
.file-drop { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 22px 16px; border: 2px dashed var(--line-2); border-radius: var(--r-surface); background: var(--surface-2); cursor: pointer; }
.file-drop:hover, .file-drop:focus-visible, .file-drop.is-over { border-color: var(--mint); background: var(--mint-soft); outline: none; }
.file-drop [data-file-name] { font-weight: 700; color: var(--mint-deep); overflow-wrap: anywhere; }
.review-tabs { margin-bottom: 4px; }
.review-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.inline-field { display: inline-grid; gap: 4px; min-width: 200px; }
.group-row th { text-align: left; padding-top: 18px; font-size: 15px; font-weight: 800; }
.group-row small { margin-left: 8px; font-weight: 500; color: var(--ink-3); }

/* Book blocks on the submissions page (#1619) */
.book-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.book-group { display: grid; gap: 10px; margin-top: 18px; }
.group-heading { font-size: 17px; font-weight: 800; display: flex; align-items: baseline; gap: 10px; }
.group-heading small { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.book-empty { padding: 28px 0; text-align: center; }
.book-block { display: grid; gap: 14px; padding: 20px 22px; border-radius: var(--r-surface); background: var(--surface); box-shadow: var(--shadow-soft); }
.book-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.book-head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.book-head h3 { font-size: 18px; font-weight: 800; }
.book-head p { margin-top: 2px; font-size: 13.5px; }
.book-stages { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.book-stages li { display: inline-flex; align-items: center; gap: 6px; }
.book-stages li + li::before { content: ''; width: 22px; height: 2px; border-radius: 2px; background: var(--line); margin-right: 2px; }
.book-stages .num { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 8px; background: var(--surface-2); font-size: 12px; font-weight: 800; }
.book-stages li.is-done .num { background: var(--mint-soft); color: var(--mint-deep); }
.book-stages li.is-done + li::before { background: var(--mint); }
.book-stages li.is-current { color: var(--ink); font-weight: 800; }
.book-stages li.is-current .num { background: var(--gold); color: #5b3f10; }
.book-next { display: grid; gap: 10px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); border-left: 4px solid var(--line-2); }
.book-next[data-tone="warn"] { background: var(--gold-soft); border-left-color: var(--gold); }
.book-next[data-tone="danger"] { background: var(--danger-soft); border-left-color: var(--danger); }
.book-next[data-tone="ok"] { background: var(--mint-soft); border-left-color: var(--mint); }
.book-next p { line-height: 1.6; }
.book-next p strong { margin-right: 10px; font-weight: 800; }
.book-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.book-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0; font-size: 14px; }
.book-details dt { color: var(--ink-3); font-weight: 700; }
.book-details dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; overflow-wrap: anywhere; }
.book-files, .book-more { font-size: 14px; }
.book-files summary, .book-more summary { cursor: pointer; color: var(--ink-2); font-weight: 700; }
.book-files[open] > p, .book-more[open] > .book-actions { margin-top: 8px; }
@media (max-width: 640px) {
  .book-block { padding: 16px; }
  .book-details { grid-template-columns: minmax(0, 1fr); }
}

/* Collapsible publisher groups and per-book history (#1620) */
details.book-group > summary { cursor: pointer; list-style: none; padding: 6px 0; }
details.book-group > summary::-webkit-details-marker { display: none; }
details.book-group > summary::before { content: '▸'; display: inline-block; width: 14px; transition: transform var(--fast) var(--ease); color: var(--ink-3); }
details.book-group[open] > summary::before { transform: rotate(90deg); }
.book-log { font-size: 14px; }
.book-log summary { cursor: pointer; color: var(--ink-2); font-weight: 700; }
.book-log ol { list-style: none; margin: 8px 0 0; padding: 0 0 0 12px; display: grid; gap: 6px; border-left: 2px solid var(--line); }
.book-log li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.book-log time { color: var(--ink-3); font-size: 12.5px; min-width: 92px; }
.log-who { font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); }
.log-who[data-by="platform"] { background: var(--mint-soft); color: var(--mint-deep); }
.mp-particles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.book-pricing { min-width: 0; margin: 0; padding: 0; border: 0; }
.book-pricing legend { padding: 0; font-weight: 600; }
.book-pricing .board-inline label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.book-pricing [hidden] { display: none; }

/* 繪本系列分部編輯列 */
.series-parts { display: grid; gap: 10px; }
.series-parts-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.series-parts-head > span { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.series-part-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); align-items: end; }
.series-part-row .series-part-zhuyin { grid-column: 1 / -1; }

/* 書商月報：左側選書，右側對帳。 */
.sales-view { container: sales / inline-size; }
.sales-view .page-head { align-items: end; }
.sales-view .row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.sales-panes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 5%, 56px); margin-block: 24px; }
.sales-panes > * { min-width: 0; overflow-wrap: anywhere; }
.sales-view h2 { margin: 12px 0 8px; font-size: 1.17rem; }
.sales-view h3 { margin-top: 12px; font-size: 1rem; }
.sales-view .field { margin-block: 10px; }
.sales-view :is(button, input, select, summary) { min-height: 44px; }
.sales-view .button { margin: 4px 4px 4px 0; }
.sales-earn { padding: clamp(16px, 3cqw, 26px); margin-bottom: 18px; border-radius: 18px; background: var(--mint-soft); }
.sales-earn h2 { margin-top: 0; }
.sales-amount { display: block; margin: 6px 0 10px; font-size: clamp(1.9rem, 4.7cqw, 3.55rem); line-height: 1.18; color: var(--mint-action); font-variant-numeric: tabular-nums; }
.sales-detail { border-bottom: 1px solid var(--line-2); padding-block: 8px; }
.sales-detail summary { cursor: pointer; padding-block: 9px; font-weight: 700; }
.sales-line, .sales-book { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.sales-line small { display: block; color: var(--ink-2); }
.sales-book { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer; padding: 12px; }
.sales-book small { display: block; color: var(--ink-2); }
.sales-book[aria-pressed="true"] { background: var(--mint-soft); border-radius: 12px; }
@container sales (max-width: 600px) { .sales-panes { grid-template-columns: 1fr; gap: 16px; } }
@media (horizontal-viewport-segments: 2) { .sales-panes { column-gap: max(32px, env(viewport-segment-left 1 0, 0px) - env(viewport-segment-right 0 0, 0px) + 24px); } }
@media (vertical-viewport-segments: 2) { .sales-panes { grid-template-columns: 1fr; row-gap: 44px; } }

/* Published shelf: covers float on the page, no boxes around them. */
.published-shelf { display: grid; gap: 10px; margin-bottom: 26px; }
.published-shelf .hint { margin: 0; }
.shelf-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px 18px; }
.shelf-book { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: start; }
.shelf-cover { aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--gold-soft); display: grid; place-items: center; box-shadow: 0 6px 14px rgba(140, 98, 31, 0.16); transform: rotate(-2deg); }
.shelf-book:nth-child(even) .shelf-cover { background: var(--mint-soft); transform: rotate(2deg); }
.shelf-cover span { font-size: 30px; font-weight: 700; color: var(--gold-deep); }
.shelf-cover img { width: 100%; height: 100%; object-fit: cover; }
.shelf-info { display: grid; gap: 4px; min-width: 0; }
.shelf-info strong { overflow-wrap: anywhere; }
.shelf-info small { color: var(--ink-2); }
.shelf-pending { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0; }
.shelf-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.change-summary { margin: 0 0 12px; padding-left: 1.2em; display: grid; gap: 4px; }

/* 檔案明細: names in tidy columns, the full file one click away (#1757). */
.asset-list { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 16px; }
.asset-list li { display: flex; align-items: center; gap: 2px; min-width: 0; }
.asset-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-list .button.small { padding-inline: 8px; }
