/* Perspic Audit AI — design system matching Ohm Studio admin-dashboard + desktop-shell.
 * Vanilla CSS implementation of the Tailwind-based Ohm style:
 *   - Poppins everywhere; Logirent reserved for branding word-mark
 *   - sky-500/indigo-500 gradient palette with emerald/amber/rose accents
 *   - 256px sidebar w/ sky-500 left-border active state
 *   - StatCard: rounded-xl + shadow-sm + gradient icon container
 *   - Custom slate scrollbar
 *   - Lucide-style stroke-2.5 SVG icons (inline)
 */

/* ============== Color tokens (mirrors Tailwind palette) ============== */
:root {
  /* ─── BUG-UPLOAD-DUP-STUCK-001 fix · z-index design tokens ───
     Documented layer order (low → high) — when adding a new modal/overlay,
     pick the closest matching token. Interactive modals MUST be above passive
     overlays so user can always reach their buttons.
     PASSIVE = no required user interaction (progress, dim, background)
     INTERACTIVE = user must click to proceed (modals, dropdowns, pickers)  */
  --z-base: 1;
  --z-content-sticky: 10;          /* sticky table headers */
  --z-popover: 40;                 /* small floating UI like byte-panel-v2 */
  --z-fab: 50;                     /* byte avatar fab */
  --z-overlay-passive: 80;         /* upload progress overlay (.uo-root) - PASSIVE */
  --z-sidebar: 100;                /* sidebar / sticky layout */
  --z-modal-interactive: 1000;     /* primary modal (.dup-modal-overlay, .rd-edit-overlay) - INTERACTIVE */
  --z-modal-sub: 1100;             /* modal-on-modal (cluster disagree sub-overlay) */
  --z-cluster-layered: 1200;       /* layered pickers (.cluster-docpicker-overlay) */
  --z-tour-ring: 2000;             /* tour highlight ring above modals */
  --z-tour-caption: 2100;          /* tour caption bubble */
  --z-toast: 9000;                 /* toast / notification - always on top of UI */
  --z-system-critical: 9999;       /* system-critical (drag handles, escape hatches) */

  /* Backgrounds */
  --white: #ffffff;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Brand: sky + indigo */
  --sky-50: #f0f9ff;
  --sky-100: #e0f2fe;
  --sky-500: #0ea5e9;
  --sky-600: #0284c7;
  --sky-700: #0369a1;
  --indigo-50: #eef2ff;
  --indigo-100: #e0e7ff;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;

  /* Status */
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --rose-50: #fff1f2;
  --rose-100: #ffe4e6;
  --rose-500: #f43f5e;
  --rose-600: #e11d48;
  --rose-700: #be123c;
  --purple-100: #ede9fe;
  --purple-500: #8b5cf6;
  --purple-700: #6d28d9;

  /* V2.7 · Single-source-of-truth font stack (architectural fix for BUG-V27-01/02).
     UI font: Manrope (was Poppins). Numeric font: Martian Mono (was JetBrains Mono).
     Logirent reserved for Perspic brand wordmark only. */
  --font-ui: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans CJK TC', sans-serif;
  --font-mono: 'Martian Mono', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-brand: 'Logirent', var(--font-ui);

  /* ═══════════ V31 · Tuned values from v3-fullscreen.html ═══════════
     Single source of truth for all sizes/spacing. Adjust here, not in components. */
  /* Sidebar */
  --t-sidebar-width: 258px;
  --t-logo-size: 36px;
  --t-brand-name-size: 22px;
  --t-brand-logo-gap: 3px;
  --t-brand-name-margin-top: 0px;
  --t-tool-icon-size: 34px;
  --t-tool-icon-svg: 19px;
  --t-tool-label-size: 12px;
  --t-stmt-head-size: 10.5px;
  --t-stmt-period-size: 11px;
  /* Top bar */
  --t-topbar-height: 72px;
  --t-topbar-padding-x: 26px;
  --t-pnum-size: 28px;
  --t-pnum-font: 12.5px;
  --t-plbl-size: 13px;
  --t-pline-width: 36px;
  --t-tb-avatar-size: 33px;
  --t-tb-avatar-font: 13px;
  --t-tb-uname-size: 13.5px;
  --t-tb-umail-size: 12px;
  --t-tb-signout-size: 34px;
  /* Stage */
  --t-stage-padding: 30px;
  --t-stage-h-size: 22px;
  --t-stage-mute-size: 13px;
  /* Numerics */
  --t-num-table-size: 12.5px;
  --t-num-kpi-size: 18px;
  --t-num-stat-size: 23px;
  /* Bank pills (V15 skewed flag) */
  --t-bank-pill-font: 10.5px;
  --t-bank-pill-pad-x: 8px;
  --t-bank-pill-pad-r: 13px;
  --t-bank-pill-skew: 9px;
  /* Byte FAB */
  --t-byte-fab-size: 90px;
  --t-byte-fab-bottom: 32px;
  --t-byte-fab-right: 32px;
  /* Stage 1 · Upload + Recon */
  --t-drop-padding: 50px;
  --t-drop-ic-size: 66px;
  --t-drop-t-size: 15px;
  --t-drop-h-size: 13.5px;
  --t-recon-padding: 19px;
  --t-recon-ic-size: 50px;
  --t-recon-t-size: 15px;
  --t-recon-h-size: 12.5px;
  /* Stage 2 · Review queue */
  --t-review-progress-pad: 12px;
  --t-review-progress-font: 12px;
  --t-q-card-padding: 30px;
  --t-q-meta-size: 11px;
  --t-q-h4-size: 16.5px;
  --t-q-amt-size: 32px;
  --t-q-sug-size: 13px;
  --t-q-btn-padding: 8.5px;
  --t-q-btn-font: 12px;
  /* Stage 4 · Report */
  --t-report-tab-font: 12px;
  --t-pl-head-pad: 19px;
  --t-pl-h3-size: 20px;
  --t-pl-body-pad: 20px;
  --t-pl-body-font: 13px;
  /* Stage 5 · Stats charts */
  --t-graph-tab-font: 12.5px;
  --t-chart-canvas-height: 470px;
  --t-chart-canvas-pad: 13px;
  --t-chart-h-font: 15.5px;
  --t-chart-axis-font: 10.5px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

/* V2.7 · Force Manrope inheritance everywhere — inputs / buttons / textareas
   don't inherit font-family by default in some browsers. */
input, button, select, textarea, optgroup {
  font-family: inherit;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  color: var(--slate-700);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--sky-600); text-decoration: none; }
a:hover { color: var(--sky-700); }

button { cursor: pointer; font: inherit; }

.muted { color: var(--slate-400); }
.micro { color: var(--slate-400); font-size: 12px; }

/* Custom slate scrollbars (matches Ohm) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--slate-100); }
::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }

/* ============== Buttons ============== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--slate-200);
  background: var(--white);
  color: var(--slate-700);
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 500;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.15s ease;
}
.btn:hover { background: var(--slate-50); border-color: var(--slate-300); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Primary CTA — sky→indigo gradient */
.btn-primary {
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
  border: 0;
  color: #fff;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
  font-weight: 600;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--sky-600), var(--indigo-600));
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
  transform: translateY(-1px);
}
.btn-ghost { background: var(--white); }
.btn-large { padding: 14px 28px; font-size: 15px; }
.btn-link {
  background: transparent;
  border: 0;
  color: var(--sky-600);
  font-weight: 600;
  padding: 0;
}
.btn-link:hover { text-decoration: underline; }
.btn-back {
  background: none;
  border: 0;
  color: var(--sky-600);
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-back:hover { color: var(--sky-700); }

/* ============== Badges ============== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--slate-100);
  color: var(--slate-600);
}
.badge-sky { background: var(--sky-50); color: var(--sky-700); }
.badge-emerald { background: var(--emerald-50); color: var(--emerald-700); }
.badge-amber { background: var(--amber-50); color: var(--amber-700); }
.badge-rose { background: var(--rose-50); color: var(--rose-700); }
.badge-demo { background: var(--amber-50); color: var(--amber-700); border: 1px solid var(--amber-100); }

/* ============== Icon utility ============== */
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; flex-shrink: 0; }
.icon-lg { width: 24px; height: 24px; flex-shrink: 0; }

/* ============== Topnav (landing) ============== */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 36px;
  border-bottom: 1px solid var(--slate-200);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topnav nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.topnav nav a {
  color: var(--slate-600);
  font-weight: 500;
  font-size: 14px;
  transition: color 0.15s;
}
.topnav nav a:hover { color: var(--slate-900); }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
/* Founder request 2026-05-09 · logo ≥ brand-name font size · prior 32px 太細 */
.brand-logo {
  height: 44px;
  width: auto;
  display: block;
}
.brand-name {
  font-weight: 700;
  font-size: 17px;
  color: var(--slate-900);
  letter-spacing: -0.015em;
}
.brand-name .accent { color: var(--sky-500); }

/* ============== Hero ============== */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 36px;
}
.hero h1 {
  font-size: 56px;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1.05;
  margin: 0 0 24px;
  letter-spacing: -0.025em;
}
.hero h1 .gradient {
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero .lead {
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 32px;
  color: var(--slate-600);
}
.cta-row {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}
.hero-visual { display: flex; justify-content: center; }
.card-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 380px;
}

/* ============== StatCard (Ohm pattern) ============== */
.stat-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-icon-sky { background: linear-gradient(135deg, var(--sky-100), var(--indigo-100)); color: var(--sky-700); }
.stat-icon-emerald { background: linear-gradient(135deg, var(--emerald-100), #ccfbf1); color: var(--emerald-700); }
.stat-icon-amber { background: linear-gradient(135deg, var(--amber-100), #fed7aa); color: var(--amber-700); }
.stat-icon-purple { background: linear-gradient(135deg, var(--purple-100), var(--indigo-100)); color: var(--purple-700); }
.stat-icon-rose { background: linear-gradient(135deg, var(--rose-100), #fce7f3); color: var(--rose-700); }
.stat-body { flex: 1; min-width: 0; }
.stat-label {
  font-size: 11.5px;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  margin-bottom: 4px;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--slate-900);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-sub { font-size: 12px; color: var(--slate-400); margin-top: 2px; }

/* ============== Bands (landing sections) ============== */
.band {
  padding: 80px 36px;
  border-top: 1px solid var(--slate-200);
}
.band-soft { background: var(--slate-50); }
.band > h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--slate-900);
  text-align: center;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.band-sub {
  text-align: center;
  color: var(--slate-500);
  margin: 0 auto 48px;
  max-width: 640px;
  font-size: 16px;
}

.three-paths {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.path {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  padding: 28px;
  transition: all 0.15s;
}
.path:hover {
  border-color: var(--sky-300, #7dd3fc);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.08);
}
.path h3 {
  font-size: 18px;
  margin: 18px 0 8px;
  color: var(--slate-900);
  font-weight: 600;
}
.path p { margin: 0; line-height: 1.6; color: var(--slate-600); }

.path-letter {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  font-family: var(--font-ui);
}
.path-a { background: linear-gradient(135deg, var(--sky-500), var(--indigo-500)); }
.path-b { background: linear-gradient(135deg, var(--purple-500), var(--indigo-500)); }
.path-c { background: linear-gradient(135deg, var(--emerald-500), #06b6d4); }

/* Trust list */
.trust-list {
  max-width: 800px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.trust-list li {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--slate-200);
  font-size: 15px;
  line-height: 1.6;
}
.trust-list li:last-child { border-bottom: 0; }
.trust-list .check {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--emerald-100);
  color: var(--emerald-700);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tiers */
.tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.tier {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  padding: 32px 28px;
  transition: all 0.15s;
}
.tier:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06); }
.tier-pro {
  border: 2px solid var(--sky-500);
  position: relative;
  background: linear-gradient(180deg, var(--sky-50), var(--white));
  box-shadow: 0 12px 32px rgba(14, 165, 233, 0.12);
}
.tier h3 {
  font-size: 18px;
  margin: 0 0 16px;
  color: var(--slate-900);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tier .price {
  font-size: 40px;
  font-weight: 700;
  color: var(--slate-900);
  margin: 8px 0 24px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.tier .price small { font-size: 14px; color: var(--slate-400); font-weight: 500; }
.tier ul { list-style: none; padding: 0; margin: 0; }
.tier li {
  padding: 8px 0 8px 26px;
  position: relative;
  font-size: 14px;
  color: var(--slate-600);
}
.tier li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--emerald-500);
  font-weight: 700;
  font-size: 16px;
}
.soon {
  font-size: 11px;
  background: var(--amber-100);
  color: var(--amber-700);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
}

footer {
  padding: 40px 36px;
  border-top: 1px solid var(--slate-200);
  background: var(--slate-50);
  text-align: center;
}
footer p { margin: 8px 0; color: var(--slate-500); }
.footer-logo { height: 24px; vertical-align: middle; margin-right: 10px; }

/* ============== App layout ============== */
body.app {
  display: grid;
  grid-template-columns: 256px 1fr;
  height: 100vh;
  overflow: hidden;
  background: var(--slate-50);
}

/* ============== Sidebar (Ohm pattern) ============== */
.sidebar {
  background: linear-gradient(180deg, var(--white), var(--slate-50) 50%, var(--slate-100));
  border-right: 1px solid var(--slate-200);
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 12px rgba(0,0,0,0.04), 6px 0 24px rgba(0,0,0,0.02);
  z-index: 10;
}
.sidebar-head {
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--slate-200);
  background: var(--slate-900);
}
.sidebar-head .brand-name { color: #fff; font-size: 17px; }
.sidebar-head .brand-name .accent { color: var(--sky-400, #38bdf8); }
.sidebar-head .brand-logo { filter: brightness(0) invert(1); }

.side-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 2px;
  overflow-y: auto;
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--slate-600);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  margin-left: -3px;
  padding-left: 17px;
}
.side-nav a:hover {
  background: var(--slate-100);
  color: var(--slate-900);
  text-decoration: none;
}
.side-nav a.active {
  background: linear-gradient(135deg, var(--sky-50), rgba(238, 242, 255, 0.5));
  color: var(--sky-700);
  border-left-color: var(--sky-500);
  font-weight: 600;
}
.side-nav a .icon {
  color: var(--slate-400);
}
.side-nav a:hover .icon, .side-nav a.active .icon { color: var(--sky-600); }

.side-section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-400);
  font-weight: 600;
  padding: 16px 18px 8px;
}

.side-foot {
  padding: 14px 16px;
  border-top: 1px solid var(--slate-200);
  background: rgba(255,255,255,0.6);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  margin-bottom: 8px;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
  color: #fff;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}
.user-info { overflow: hidden; flex: 1; min-width: 0; }
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-email {
  font-size: 11px;
  color: var(--slate-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============== App main ============== */
.app-main {
  overflow-y: auto;
  padding: 24px 32px 48px;
  background: var(--slate-50);
}

.view { display: none; }
.view.active { display: block; }

.page-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.page-head h1 {
  margin: 0;
  font-size: 26px;
  color: var(--slate-900);
  font-weight: 600;
  letter-spacing: -0.015em;
}
.page-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* ============== KPI grid ============== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

/* ============== Cards (general) ============== */
.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.card h2 {
  margin: 0 0 16px;
  font-size: 17px;
  color: var(--slate-900);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card h3 {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--slate-700);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============== Upload ============== */
.upload-card { padding-bottom: 8px; }
.upload-zone {
  border: 2px dashed var(--slate-200);
  border-radius: 14px;
  padding: 40px 24px;
  text-align: center;
  background: var(--slate-50);
  transition: all 0.2s;
  cursor: pointer;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--sky-500);
  background: var(--sky-50);
}
.upload-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--sky-100), var(--indigo-100));
  color: var(--sky-700);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-zone p { margin: 8px 0; }
.upload-zone p strong { color: var(--slate-800); font-weight: 600; }

.upload-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}
.upload-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  margin-bottom: 8px;
  background: var(--slate-50);
}
.upload-list .ufile-name { flex: 1; font-weight: 600; color: var(--slate-800); }
.upload-list .ufile-size { font-size: 12px; color: var(--slate-400); }
.upload-list .ufile-status { font-size: 12px; font-weight: 500; min-width: 200px; text-align: right; }
.upload-list .progress-bar {
  height: 6px;
  width: 140px;
  background: var(--slate-200);
  border-radius: 999px;
  overflow: hidden;
}
.upload-list .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sky-500), var(--indigo-500));
  transition: width 0.3s;
}

/* ============== Statements list ============== */
.statements-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.stmt-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.stmt-card:hover {
  border-color: var(--sky-500);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.1);
  transform: translateY(-2px);
}
.stmt-card .stmt-bank {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--slate-900);
  margin-bottom: 6px;
}
.stmt-card .stmt-period {
  font-size: 13px;
  color: var(--slate-400);
  margin-bottom: 14px;
}
.stmt-card .stmt-totals {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  padding-top: 12px;
  border-top: 1px solid var(--slate-200);
}
.stmt-card .stmt-totals span {
  display: block;
  font-size: 10.5px;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
  margin-bottom: 2px;
}
.stmt-card .stmt-totals b { color: var(--slate-900); font-weight: 600; }

.empty-state {
  padding: 36px;
  text-align: center;
  color: var(--slate-400);
}
.empty-state .empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  background: var(--slate-100);
  color: var(--slate-400);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============== Verify panel ============== */
.verify-panel { border-top: 4px solid var(--emerald-500); }
.verify-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.verify-path {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
}
.verify-path.pass { border-color: var(--emerald-500); background: var(--emerald-50); }
.verify-path.fail { border-color: var(--rose-500); background: var(--rose-50); }
.verify-path .path-letter {
  width: 38px;
  height: 38px;
  font-size: 17px;
  border-radius: 10px;
}
.verify-path .path-name {
  font-weight: 600;
  color: var(--slate-900);
  font-size: 13px;
}
.verify-path .path-status {
  font-size: 11.5px;
  color: var(--slate-500);
  margin-top: 3px;
}
.verify-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--slate-50);
  border-radius: 10px;
}

/* ============== Charts + grid ============== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.chart-card {
  height: 320px;
  display: flex;
  flex-direction: column;
}
.chart-card canvas { flex: 1; max-height: 240px; }

/* ============== Ledger ============== */
.ledger-controls { margin-bottom: 14px; }
.control-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.control-row input,
.control-row select {
  padding: 9px 14px;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  font: inherit;
  background: var(--white);
  color: var(--slate-700);
  font-size: 13.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.control-row input:focus,
.control-row select:focus {
  outline: 0;
  border-color: var(--sky-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}
.control-row input { width: 280px; }

.table-wrap {
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  overflow: auto;
  max-height: 60vh;
  background: var(--white);
}
.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ledger-table th {
  position: sticky;
  top: 0;
  background: var(--slate-50);
  color: var(--slate-700);
  font-weight: 600;
  text-align: left;
  padding: 11px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--slate-200);
}
.ledger-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: top;
}
.ledger-table tr:last-child td { border-bottom: 0; }
.ledger-table tbody tr:hover { background: var(--slate-50); }
.ledger-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.row-review { background: var(--rose-50); }
.row-review:hover { background: var(--rose-100) !important; }
.row-mid { background: var(--amber-50); }
.row-mid:hover { background: var(--amber-100) !important; }

.export-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* ============== Rules list ============== */
.rules-list { display: grid; gap: 10px; }
.rule-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 80px;
  gap: 14px;
  padding: 12px 16px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  align-items: center;
  font-size: 13px;
}
.rule-row code {
  background: var(--slate-900);
  color: var(--slate-200);
  padding: 3px 8px;
  border-radius: 6px;
  font: 12px ui-monospace, Menlo, Monaco, monospace;
}

/* ============== Byte Chat overlay ============== */
.byte-chat {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
}
.byte-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.byte-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(14, 165, 233, 0.5);
}
.byte-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 400px;
  height: 540px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.byte-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}
.byte-head button {
  margin-left: auto;
  background: transparent;
  color: #fff;
  border: 0;
  font-size: 24px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.byte-head button:hover { background: rgba(255,255,255,0.2); }
.byte-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.byte-msg {
  max-width: 85%;
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}
.byte-msg-bot {
  background: var(--slate-100);
  color: var(--slate-800);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.byte-msg-user {
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
/* D-093 BAI-H · Citation chips inside Byte AI bot messages */
.byte-cite-block { margin-top: 8px; padding-top: 6px; border-top: 1px dashed #cbd5e1; }
.byte-cite-block small { color: #64748b; }
.byte-cite-rows { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
button.byte-cite {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: #fff; border: 1px solid #cbd5e1; color: #0369a1;
  cursor: pointer; font-family: 'SF Mono', monospace;
}
button.byte-cite:hover { background: #f0f9ff; border-color: #38bdf8; }
.byte-cite-note { margin-top: 6px; color: #64748b; font-size: 12px; }
@keyframes byteCiteFlash {
  0% { background: #fef9c3; }
  100% { background: transparent; }
}
.sheet-row.byte-cite-flash, tr.byte-cite-flash { animation: byteCiteFlash 1.5s ease-out; }

/* LM-G7-T (D-128) · markdown table inside bot reply */
.byte-msg-bot .byte-md-table {
  width: 100%; border-collapse: collapse; margin: 8px 0;
  font-size: 12px; font-family: inherit;
}
.byte-msg-bot .byte-md-table th,
.byte-msg-bot .byte-md-table td {
  border: 1px solid #cbd5e1; padding: 5px 8px; text-align: left;
}
.byte-msg-bot .byte-md-table th { background: #f1f5f9; color: #1e293b; font-weight: 600; }
.byte-msg-bot .byte-md-table tr:nth-child(even) td { background: #f8fafc; }
.byte-msg-bot p { margin: 6px 0; line-height: 1.5; }
.byte-msg-bot .byte-md-cite-token { color: #0369a1; font-family: 'SF Mono', monospace; font-size: 11px; }

/* LM-G7-T (D-128) · "Show more" fold for long replies */
.byte-reply-more { margin-top: 6px; }
.byte-reply-more summary {
  cursor: pointer; font-size: 11.5px; color: #0369a1;
  padding: 3px 0; font-family: inherit;
  list-style: none;
}
.byte-reply-more summary::-webkit-details-marker { display: none; }
.byte-reply-more summary::before { content: '▾ '; color: #94a3b8; }
.byte-reply-more[open] summary::before { content: '▴ '; }

/* LM-G7-T (D-128) · navigation action chip (single big primary button) */
.byte-action-block {
  margin-top: 8px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
button.byte-action-btn {
  font-size: 12px; padding: 6px 14px;
  background: #0ea5e9; color: #fff;
  border: 1px solid #0284c7; border-radius: 6px;
  cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 4px;
  font-weight: 500;
}
button.byte-action-btn:hover { background: #0284c7; border-color: #0369a1; }

/* LM-G7-T (D-128) · floating arrow overlay (Atom G) */
.byte-arrow-overlay {
  position: absolute; z-index: var(--z-tour-ring);  /* BUG-UPLOAD-DUP-STUCK-001 fix · was 6500 · teaching arrow above modals it points to */
  pointer-events: none;
  display: flex; align-items: center; gap: 0;
  animation: byteArrowIn .25s ease-out;
}
.byte-arrow-overlay.byte-arrow-fade { opacity: 0; transition: opacity .25s ease-out; }
.byte-arrow-bubble {
  background: #0ea5e9; color: #fff;
  padding: 6px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 500; font-family: inherit;
  box-shadow: 0 4px 12px rgba(14, 165, 233, .35);
  white-space: nowrap; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis;
}
.byte-arrow-svg { display: block; }
@keyframes byteArrowIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.byte-form {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--slate-200);
  background: var(--slate-50);
}
.byte-form input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--slate-200);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.byte-form input:focus {
  outline: 0;
  border-color: var(--sky-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}
.byte-form button { padding: 10px 18px; border-radius: 999px; }

/* ============== Toasts ============== */
.toast-stack {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  font-size: 13px;
  min-width: 280px;
  border-left: 4px solid var(--sky-500);
  animation: toastIn 0.25s ease-out;
  pointer-events: auto;
}
.toast.toast-success { border-left-color: var(--emerald-500); }
.toast.toast-warn { border-left-color: var(--amber-500); }
.toast.toast-error { border-left-color: var(--rose-500); }
@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============== Responsive ============== */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding: 48px 24px; }
  .hero h1 { font-size: 38px; }
  .three-paths, .tiers { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  body.app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .verify-row { grid-template-columns: 1fr; }
  .control-row input { width: 100%; }
  .byte-panel { width: calc(100vw - 32px); right: -8px; }
}


/* ============================================================
   WORKSPACE (LM-WORKSPACE-V2.6)
   Sidebar (240px) + main with topbar + stage host + Byte FAB.
   White theme · Poppins · sky→indigo gradients · V15 skewed bank flags.
   ============================================================ */

body.ws {
  display: grid;
  grid-template-columns: var(--t-sidebar-width) 1fr;
  height: 100vh;
  overflow: hidden;
  background: var(--white);
}

/* ============== SIDEBAR ============== */
.sidebar {
  background: #fafbfc;
  border-right: 1px solid var(--slate-200);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* V2.7 · Logo 300% bigger, vertical stack brand layout
   V2.8 BUG-V28-02: gap tight (logo + wordmark = 1 group)
   V3.0 BUG-V30-01: SVG trimmed → logo fills container, no fake whitespace.
   Old `-8px margin-top` removed because trimmed SVG would cause overlap. */
.sb-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--t-brand-logo-gap);
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--slate-100);
}
.sb-brand .sb-logo {
  width: var(--t-logo-size);
  height: var(--t-logo-size);
  flex-shrink: 0;
  display: block;
  /* V2.8 BUG-V28-01: object-fit:contain ensures aspect ratio kept even if
     the SVG asset later replaces with one missing viewBox. */
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(14, 165, 233, .12));
}
.sb-brand .nm {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: var(--t-brand-name-size);
  letter-spacing: -.4px;
  color: var(--slate-800);
  line-height: 1;
  /* V3.0 BUG-V30-01: removed -8px (trimmed SVG no longer has whitespace) */
  margin-top: 0;
}
.sb-brand .nm-a {
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Tools 2x3 grid */
.sb-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 12px;
}
.sb-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
}
.sb-tool:hover {
  border-color: var(--sky-500);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, .1);
}
.sb-tool.act {
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(14, 165, 233, .3);
}
.sb-tool.act .sb-tool-ic { background: rgba(255, 255, 255, .2); color: #fff; }
.sb-tool.act .sb-tool-lbl { color: #fff; font-weight: 600; }
.sb-tool-ic {
  width: var(--t-tool-icon-size); height: var(--t-tool-icon-size);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--slate-50), var(--slate-100));
  color: var(--slate-600);
  display: grid; place-items: center;
}
.sb-tool-ic svg { width: var(--t-tool-icon-svg); height: var(--t-tool-icon-svg); stroke-width: 1.75; }
.sb-tool-lbl {
  font-size: var(--t-tool-label-size);
  font-weight: 600;
  color: var(--slate-500);
  letter-spacing: .2px;
}

/* Statements list (sidebar mid) */
.sb-stmt-head {
  padding: 14px 16px 6px;
  font-size: var(--t-stmt-head-size);
  font-weight: 700;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  border-top: 1px solid var(--slate-100);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sb-stmt-head .count {
  margin-left: auto;
  background: var(--sky-500);
  color: #fff;
  font-size: 9px;
  padding: 1px 7px;
  border-radius: 9px;
  letter-spacing: 0;
  font-weight: 700;
}
.sb-stmt-list { flex: 1; overflow-y: auto; padding: 0 10px 10px; }
.sb-stmt-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--slate-300);
  font-size: 12px;
  line-height: 1.5;
}
.sb-stmt-empty .ic svg { width: 36px; height: 36px; stroke-width: 1.5; }
.sb-stmt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.sb-stmt-card {
  padding: 7px 9px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
}
.sb-stmt-card:hover { border-color: var(--sky-500); background: var(--sky-50); }
.sb-stmt-card.act { border-color: var(--sky-500); background: var(--sky-50); }
/* FEAT-V34-02: per-statement delete × button — visible on card hover */
.sb-stmt-x {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px;
  border: none; background: transparent;
  color: var(--slate-400); font-size: 16px; line-height: 14px;
  border-radius: 4px; padding: 0; cursor: pointer;
  opacity: 0; transition: opacity .12s, background .12s, color .12s;
}
.sb-stmt-card:hover .sb-stmt-x { opacity: 1; }
.sb-stmt-x:hover { background: var(--rose-100, #ffe4e6); color: var(--rose-600, #e11d48); }
.sb-stmt-row1 { display: flex; align-items: center; gap: 5px; font-size: 10.5px; }
.sb-stmt-period {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--slate-800);
  font-size: 10.5px;
}

/* V15 skewed-flag bank pills (chosen 2026-05-07) */
.sb-bank-pill {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9px; font-weight: 800;
  padding: 2px 11px 2px 7px; border-radius: 0;
  letter-spacing: .4px; color: #fff;
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.sb-bank-pill.bank-hsbc { background: #dc2626; }
.sb-bank-pill.bank-scb  { background: #16a34a; }
.sb-bank-pill.bank-boc  { background: #f59e0b; }
.sb-bank-pill.bank-citi { background: #2563eb; }
.sb-bank-pill.bank-dbs  { background: #7c3aed; }
/* D-164 LM-G7-T BUG-BANK-PILL-DESIGN-001 fix · universal .pill.bank
   Replaces 5 hardcoded .bank-XXX classes. Color comes from inline style
   resolved by bank-colors.js · any LLM-emitted short code renders identically
   shaped skewed-flag pill, founder rule「平臺給工具,無 hardcode bank list」. */
.pill.bank {
  display: inline-flex; align-items: center;
  padding: 2px var(--t-bank-pill-pad-r) 2px var(--t-bank-pill-pad-x);
  font-size: var(--t-bank-pill-font); font-weight: 800;
  color: #fff; letter-spacing: .4px;
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--t-bank-pill-skew)) 100%, 0 100%);
  border-radius: 0;
  white-space: nowrap;
}

.sb-stmt-stat {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 8.5px; font-weight: 700;
  padding: 1px 5px; border-radius: 5px;
  text-transform: uppercase; letter-spacing: .3px;
}
.sb-stmt-stat.s-recon { background: var(--sky-100); color: #1e40af; }
.sb-stmt-stat.s-done  { background: var(--emerald-100); color: var(--emerald-700); }
.sb-stmt-stat.s-rev   { background: var(--amber-100); color: var(--amber-700); }
.sb-stmt-stat.s-fail  { background: var(--rose-100); color: var(--rose-700); }

/* Sidebar search + year-grouping */
.sb-stmt-search { padding: 0 12px 8px; display: none; }
.sb-stmt-search.show { display: block; }
.sb-stmt-search input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--slate-200);
  border-radius: 7px;
  font: inherit;
  font-size: 11.5px;
  background: var(--white);
  outline: none;
}
.sb-stmt-search input:focus { border-color: var(--sky-500); }
.sb-year-group { margin-bottom: 6px; }
.sb-year-head {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  font-size: 10.5px; font-weight: 700;
  color: var(--slate-600);
  text-transform: uppercase; letter-spacing: .6px;
  cursor: pointer;
  background: #fafbfc;
  border: 1px solid var(--slate-200);
  border-radius: 7px;
  margin: 0 0 4px;
}
.sb-year-head:hover { background: var(--slate-100); }
.sb-year-head .arr { transition: transform .15s; font-size: 9px; }
.sb-year-head.open .arr { transform: rotate(90deg); }
.sb-year-head .count { margin-left: auto; color: var(--slate-400); font-weight: 600; }
.sb-year-body { display: none; padding-left: 6px; }
.sb-year-body.open { display: block; }

/* (V2.8) Byte toggle removed — Byte FAB is now always visible + draggable.
   Old .byte-toggle CSS dropped per BUG-V28-03. */
.byte-toggle .sw {
  position: relative;
  width: 28px; height: 16px;
  background: var(--slate-300);
  border-radius: 9px;
  transition: all .2s;
}
.byte-toggle .sw::after {
  content: ""; position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  background: #fff;
  border-radius: 50%;
  transition: all .2s;
}
.byte-toggle input { display: none; }
.byte-toggle input:checked + .sw {
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
}
.byte-toggle input:checked + .sw::after { transform: translateX(12px); }

/* (V2.7) Old .sb-user / .sb-avatar / .sb-uinfo block removed — user info moved to top bar (see .tb-user above). */

/* ============== MAIN PANE ============== */
.main {
  display: grid;
  /* V42.G G1.3 · 3 rows: topbar · year tabs · ym-frame (month-rail + stage-host) */
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
  position: relative;
}

/* Top progress strip + user (V2.7 · BUG-V27-06: user moved here from sidebar) */
.topbar {
  padding: 12px var(--t-topbar-padding-x);
  background: var(--white);
  border-bottom: 1px solid var(--slate-100);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
}
.progress { display: flex; align-items: center; gap: 0; }

/* Top-right user block */
.tb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 12px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 999px;
}
.tb-avatar {
  width: var(--t-tb-avatar-size); height: var(--t-tb-avatar-size);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: var(--t-tb-avatar-font);
  font-family: var(--font-ui);
}
.tb-uinfo { line-height: 1.18; min-width: 0; }
.tb-uname {
  font-size: var(--t-tb-uname-size); font-weight: 600; color: var(--slate-800);
  max-width: 150px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tb-umail {
  font-size: var(--t-tb-umail-size); color: var(--slate-500);
  max-width: 150px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tb-signout {
  width: var(--t-tb-signout-size); height: var(--t-tb-signout-size);
  border-radius: 50%;
  border: 1px solid var(--slate-200);
  background: var(--white);
  color: var(--slate-500);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .15s;
}
.tb-signout:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}
.pstep { display: flex; align-items: center; gap: 7px; padding: 3px 4px; cursor: pointer; }
.pnum {
  width: var(--t-pnum-size); height: var(--t-pnum-size);
  border-radius: 50%;
  border: 1.5px solid var(--slate-300);
  background: var(--white);
  color: var(--slate-500);
  display: grid; place-items: center;
  font-size: var(--t-pnum-font); font-weight: 700;
  font-family: var(--font-ui);
  transition: all .2s;
  flex-shrink: 0;
}
.plbl {
  font-size: var(--t-plbl-size); font-weight: 500;
  color: var(--slate-400);
  transition: color .2s;
}
.pstep.act .pnum {
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, .12);
}
.pstep.act .plbl { color: var(--slate-800); font-weight: 600; }
.pstep.done .pnum { background: var(--emerald-500); border-color: var(--emerald-500); color: #fff; font-size: 0; }
.pstep.done .pnum::after { content: "✓"; font-size: 12px; font-weight: 700; }
.pstep.done .plbl { color: var(--emerald-700); }
.pline { width: var(--t-pline-width); height: 2px; background: var(--slate-200); margin: 0 4px; border-radius: 2px; }
.pline.done { background: var(--emerald-500); }
.topbar-actions { display: flex; gap: 8px; }
.tb-btn {
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid var(--slate-200);
  background: var(--white);
  color: var(--slate-600);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.tb-btn:hover { border-color: var(--sky-500); color: var(--sky-700); }
.tb-btn-pri {
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 10px rgba(14, 165, 233, .25);
}
.tb-btn-pri:hover {
  color: #fff;
  box-shadow: 0 5px 14px rgba(14, 165, 233, .35);
}
.tb-btn svg { width: 14px; height: 14px; stroke-width: 1.75; }

/* Stage host */
.stage-host {
  padding: var(--t-stage-padding);
  overflow-y: auto;
  background:
    radial-gradient(circle at 100% 0%, rgba(14, 165, 233, .03) 0%, transparent 40%),
    var(--white);
}

/* Common stage helpers */
.stage-h {
  font-family: var(--font-ui);
  font-size: var(--t-stage-h-size); font-weight: 700;
  color: var(--slate-800);
  margin: 0 0 4px;
  letter-spacing: -.3px;
}
.stage-mute { font-size: var(--t-stage-mute-size); color: var(--slate-500); margin: 0 0 18px; }

.ico-stroke { stroke: currentColor; stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; }
/* D-133 (LM-G7-W) · Perspic icon system · inline SVG, sized 1em off parent font-size */
.psp-ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex-shrink: 0; }
/* slightly enlarge icons inside the icon-only round buttons (match list / docpicker preview) */
.cluster-match-preview-btn .psp-ic, .cluster-docpicker-row .psp-ic, .sheet-src-btn .psp-ic { font-size: 1.05em; }
.psp-spin .psp-ic, .psp-spin.psp-ic { animation: pspSpin 1s linear infinite; }
@keyframes pspSpin { to { transform: rotate(360deg); } }
/* the "已根據附加文件重新判斷" pill: make the inline reEval icon spin once on appear (optional · static is fine) */
.cluster-verdict-reevaluated .psp-ic { vertical-align: -0.12em; }

/* Statement context bar */
.ctx-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(90deg, var(--sky-50) 0%, #fafbfc 100%);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  margin-bottom: 18px;
}
.ctx-bar.empty { background: #fafbfc; border-color: var(--slate-200); color: var(--slate-400); }
.ctx-ic {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
  color: #fff;
  display: grid; place-items: center; flex-shrink: 0;
}
.ctx-ic svg { width: 20px; height: 20px; stroke-width: 1.75; }
.ctx-info { flex: 1; line-height: 1.3; }
.ctx-line1 { font-size: 13.5px; font-weight: 600; color: var(--slate-800); }
.ctx-line2 { font-size: 11.5px; color: var(--slate-500); margin-top: 2px; font-family: var(--font-mono); }
.ctx-stat {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 9px;
  background: var(--emerald-100); color: var(--emerald-700);
  font-size: 11px; font-weight: 600;
}
.ctx-stat.warn { background: var(--amber-100); color: var(--amber-700); }
.ctx-stat.fail { background: var(--rose-100); color: var(--rose-700); }
.ctx-stat .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ctx-stat[data-vp-toggle] { cursor: pointer; }
.ctx-stat[data-vp-toggle]:hover { filter: brightness(0.95); }

/* V35 · Verification panel — collapsible per-statement layer evidence */
.vp { background: #fff; border: 1px solid var(--slate-200); border-radius: 12px; margin: 8px 0 14px; overflow: hidden; }
.vp-h { display: flex; align-items: center; gap: 14px; padding: 11px 18px; background: linear-gradient(180deg,#f8fafc,#fff); border-bottom: 1px solid var(--slate-100); }
.vp-summary { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.vp-summary b { font-size: 13.5px; color: var(--slate-800); font-weight: 700; }
.vp-mock-badge { display: inline-block; padding: 1px 7px; border-radius: 4px; background: var(--amber-100); color: var(--amber-700); font-size: 10.5px; font-weight: 600; letter-spacing: .02em; cursor: help; }
.vp-summary-text { color: var(--slate-500); font-size: 12px; flex: 1; }
.vp-toggle { padding: 4px 10px; border: 1px solid var(--slate-200); background: #fff; border-radius: 6px; font-size: 11.5px; color: var(--slate-700); cursor: pointer; flex-shrink: 0; }
.vp-toggle:hover { background: var(--slate-50); border-color: var(--sky-500); color: var(--sky-700); }
.vp-body { display: none; padding: 14px 18px; }
.vp.open .vp-body { display: block; }
.vp-layer { padding: 10px 12px; border: 1px solid var(--slate-100); border-radius: 8px; background: #fafbfd; margin-bottom: 8px; }
.vp-layer:last-of-type { margin-bottom: 12px; }
.vp-layer-h { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.vp-layer-h b { font-size: 12.5px; color: var(--slate-800); font-weight: 700; }
.vp-layer-m { font-size: 11.5px; color: var(--slate-500); margin-bottom: 8px; }
.vp-layer-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px 14px; font-size: 12px; }
.vp-layer-kv > div { display: flex; justify-content: space-between; gap: 6px; padding: 3px 0; border-bottom: 1px dashed var(--slate-100); }
.vp-layer-kv span { color: var(--slate-500); }
.vp-layer-kv b { color: var(--slate-800); font-weight: 600; font-variant-numeric: tabular-nums; }
.vp-badge { padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; letter-spacing: .02em; margin-left: auto; }
.vp-badge.ok { background: var(--emerald-100, #d1fae5); color: var(--emerald-700, #047857); }
.vp-badge.warn { background: var(--amber-100); color: var(--amber-700); }
.vp-badge.fail { background: var(--rose-100); color: var(--rose-700); }
.vp-foot { display: flex; flex-wrap: wrap; gap: 14px 22px; font-size: 11px; color: var(--slate-500); padding-top: 8px; border-top: 1px dashed var(--slate-200); }
.vp-foot code.vp-sha { font-family: ui-monospace, Menlo, monospace; color: var(--slate-700); }

/* V35 · upload list per-step detail sub-text */
.ul-detail { font-family: inherit; font-size: 11.5px; color: var(--slate-600); margin-top: 4px; min-height: 14px; }
/* BUG-G7H-002 (D-118) · AI active badge · no emoji · matches body font */
.ul-ai-badge {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 2px 9px;
  background: #f0f9ff; border: 1px solid #bae6fd; color: #0c4a6e;
  font-family: inherit; font-size: 11px; font-weight: 600; letter-spacing: 0;
  border-radius: 999px; vertical-align: middle;
}
.ul-ai-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #0ea5e9;
  animation: aiDotPulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes aiDotPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50%      { opacity: 1;    transform: scale(1.15); }
}
.ul-li.ul-ai-active { border-left: 3px solid #0ea5e9; padding-left: 9px; background: linear-gradient(90deg, #f0f9ff60, transparent); }

/* BUG-G7H-004 (D-118) · Full-screen upload/AI processing overlay · gear spinner · gray dim · interaction lock */
/* BUG-UPLOAD-DUP-STUCK-001 (D-143) · z-index uses --z-overlay-passive (passive overlay,
   interactive modals MUST sit above it; previously 9000 covered modal overlays → user
   couldn't reach dup-modal buttons → batch upload stuck). */
.uo-root {
  position: fixed; inset: 0; z-index: var(--z-overlay-passive);
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 220ms ease-out;
  font-family: inherit;
}
.uo-root.uo-visible { opacity: 1; pointer-events: auto; }
.uo-card {
  background: #ffffff; border-radius: 12px;
  padding: 26px 32px;
  display: flex; align-items: center; gap: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 4px 14px rgba(0,0,0,0.08);
  /* BUG-G7O-001 · fix card size · prevents jumping per stage text length */
  width: 520px; max-width: calc(100vw - 32px);
  min-height: 132px;
  animation: uoCardEnter 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes uoCardEnter {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* BUG-G7I-002 (D-119) · cute robot mascot · 4 layered animations · replaces flat gear */
.uo-mascot { color: #0ea5e9; flex-shrink: 0; animation: uoMascotBob 2.6s ease-in-out infinite; }
.uo-card.uo-ai .uo-mascot { color: #06b6d4; }
.uo-mascot .uo-antenna { animation: uoAntennaPulse 1.4s ease-in-out infinite; }
.uo-mascot .uo-eye { transform-origin: center; transform-box: fill-box; animation: uoEyeBlink 3.6s ease-in-out infinite; }
.uo-mascot .uo-doc { animation: uoDocSlide 2.4s ease-in-out infinite; }
.uo-mascot .uo-beam { animation: uoBeamPulse 1.2s ease-in-out infinite; }
@keyframes uoMascotBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
@keyframes uoAntennaPulse {
  0%, 100% { opacity: 0.4; r: 2.4; }
  50%      { opacity: 1;   r: 3.4; }
}
@keyframes uoEyeBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  94%, 98%      { transform: scaleY(0.1); }
}
@keyframes uoDocSlide {
  0%   { transform: translateX(0); }
  60%  { transform: translateX(48px); }
  100% { transform: translateX(0); }
}
@keyframes uoBeamPulse {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 0.85; }
}
/* Legacy class retained for graceful fallback */
.uo-gear { display: none; }
.uo-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.uo-title {
  font-family: inherit; font-size: 15.5px; font-weight: 600; color: #0f172a;
  line-height: 1.35;
  /* BUG-G7O-001 · fix to single line with ellipsis · prevents card height jump */
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-height: 21px;
}
.uo-sub {
  font-family: inherit; font-size: 12px; color: #64748b;
  line-height: 1.4;
  /* fix 2-line clamp · always reserves 2 line heights */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 33.6px;  /* 12 × 1.4 × 2 */
  max-height: 33.6px;
}
/* LM-G7-O · progress bar + ETA · fixed area below sub */
.uo-progress { margin-top: 6px; }
.uo-bar {
  height: 6px; background: #e2e8f0; border-radius: 999px; overflow: hidden;
}
.uo-bar-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #0ea5e9, #06b6d4);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.uo-card.uo-ai .uo-bar-fill {
  background: linear-gradient(90deg, #06b6d4, #0891b2);
}
.uo-progress-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 4px;
  font-family: inherit; font-size: 11px; color: #64748b;
  min-height: 14px;
}
.uo-pct { font-weight: 600; color: #0f172a; font-variant-numeric: tabular-nums; }
.uo-eta { color: #64748b; }
/* D-188 LM-G7-X Atom A · Cancel button on overlay */
.uo-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.uo-cancel {
  padding: 6px 14px;
  border: 1px solid #f43f5e;
  background: #fff;
  color: #be123c;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.06s;
}
.uo-cancel:hover { background: #f43f5e; color: #fff; }
.uo-cancel:active { transform: scale(0.97); }
/* BUG-G7H-003 (D-118) · upload list family inherit · single visual language */
.ul-li, .ul-li .nm, .ul-li .sz, .ul-li .st, .ul-li .x { font-family: inherit; }
.udk-row, .udk-name, .udk-stage, .udk-pct, .udk-detail { font-family: inherit; }

/* Period & Bank filter bars */
.period-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  background: #fafbfc; border: 1px solid var(--slate-200);
  border-radius: 10px; margin-bottom: 14px;
  font-size: 11.5px; color: var(--slate-500);
}
.period-bar .lbl { font-weight: 700; color: var(--slate-600); text-transform: uppercase; letter-spacing: .6px; font-size: 10.5px; }
.period-bar .preset { display: flex; gap: 3px; background: #fff; border: 1px solid var(--slate-200); padding: 2px; border-radius: 7px; }
.period-bar .preset button { padding: 5px 11px; border: none; background: transparent; color: var(--slate-500); font-size: 11px; font-weight: 600; border-radius: 5px; cursor: pointer; }
.period-bar .preset button.act { background: linear-gradient(135deg, var(--sky-500), var(--indigo-500)); color: #fff; }
.period-bar .range { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.period-bar .range input { padding: 4px 8px; border: 1px solid var(--slate-200); border-radius: 6px; font-family: var(--font-mono); font-size: 11px; width: 110px; background: #fff; }
.period-bar .info { font-family: var(--font-mono); color: var(--sky-700); font-weight: 600; }

/* D-168 BUG-BANKS-BAR-WIDTH-001 fix · responsive at extreme chip count (33 banks).
   .total stays nowrap right-aligned (flex-shrink:0 so it doesn't compress). */
.bank-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 10px; margin-bottom: 14px;
  font-size: 11.5px; color: var(--slate-500);
  flex-wrap: wrap;
}
.bank-bar .lbl { font-weight: 700; color: var(--slate-600); text-transform: uppercase; letter-spacing: .6px; font-size: 10.5px; flex-shrink: 0; }
.bank-bar .total { flex-shrink: 0; white-space: nowrap; }
/* Chip never compresses · bar wraps · supports 1-33+ chips uniformly */
.bank-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; background: #fafbfc;
  border: 1px solid var(--slate-200); border-radius: 14px;
  font-size: 11px; font-weight: 600;
  cursor: pointer; color: var(--slate-600);
  transition: all .15s;
  white-space: nowrap; flex-shrink: 0;
}
.bank-chip:hover { border-color: var(--sky-500); }
.bank-chip.act { background: var(--sky-100); border-color: var(--sky-500); color: var(--sky-700); }
.bank-bar .total { margin-left: auto; font-size: 11.5px; }
.bank-bar .total b { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--slate-800); }
.bank-bar .xfer-badge {
  padding: 4px 9px; background: var(--amber-100); border: 1px solid #fde68a;
  border-radius: 7px; font-size: 10.5px; color: var(--amber-700);
}

/* Per-bank summary cards */
.bank-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.bank-card {
  padding: 14px 16px; background: var(--white);
  border: 1px solid var(--slate-200); border-radius: 10px;
}
.bank-card .h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bank-card .acct { font-size: 10.5px; color: var(--slate-400); font-family: var(--font-mono); margin-left: auto; }
.bank-card .net { font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 700; }
.bank-card .net.pos { color: var(--emerald-700); }
.bank-card .net.neg { color: var(--rose-700); }
.bank-card .meta { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--slate-500); margin-top: 5px; }
.bank-card .meta .v { font-variant-numeric: tabular-nums; font-weight: 600; }

.ibt-notice {
  margin-bottom: 10px;
  padding: 8px 14px;
  background: var(--amber-100); border: 1px solid #fde68a;
  border-radius: 9px;
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--amber-700);
}

/* Recon banner */
.recon-card {
  margin-top: 18px;
  padding: var(--t-recon-padding) 22px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  display: flex; align-items: center; gap: 16px;
}
.recon-card.ok { background: linear-gradient(90deg, var(--emerald-50), #fff); border-color: var(--emerald-100); }
.recon-card.warn { background: linear-gradient(90deg, var(--rose-50), #fff); border-color: var(--rose-100); align-items: flex-start; flex-direction: column; }
.recon-ic { width: var(--t-recon-ic-size); height: var(--t-recon-ic-size); border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.recon-ic.ok { background: linear-gradient(135deg, var(--emerald-500), var(--emerald-600)); }
.recon-ic.warn { background: linear-gradient(135deg, #dc2626, #991b1b); }
.recon-ic svg { width: 26px; height: 26px; stroke-width: 2; }
.recon-msg { flex: 1; line-height: 1.4; }
.recon-msg .t { font-size: 15px; font-weight: 600; color: var(--slate-800); }
.recon-msg .h { font-size: 12.5px; color: var(--slate-500); margin-top: 3px; }
.recon-card.warn .recon-row { display: flex; align-items: center; gap: 14px; width: 100%; }
.recon-card.warn .recon-msg .t { color: var(--rose-700); }

.recon-issues {
  width: 100%;
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 8px;
  max-height: 380px;
  overflow-y: auto; padding-right: 4px;
}
.iss-row {
  display: grid; grid-template-columns: 88px 1fr auto auto;
  align-items: center; gap: 14px;
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid #fecaca;
  border-radius: 9px;
  transition: all .15s;
}
.iss-row:hover { border-color: #dc2626; box-shadow: 0 4px 14px rgba(220, 38, 38, .1); }
.iss-row .dt { color: var(--slate-500); font-size: 11px; font-family: var(--font-mono); }
.iss-row .desc { color: var(--slate-800); font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iss-row .desc .why { display: block; color: var(--slate-400); font-weight: 400; font-size: 11px; margin-top: 2px; }
.iss-row .dt-amt { font-weight: 700; color: #dc2626; font-variant-numeric: tabular-nums; font-size: 12px; background: var(--rose-100); padding: 3px 10px; border-radius: 6px; }
.iss-row .fix-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
  color: #fff; font-size: 11.5px; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap;
}
.iss-row .fix-btn svg { width: 13px; height: 13px; stroke-width: 2; }

.iss-group { background: #fff; border: 1px solid #fecaca; border-radius: 9px; margin-bottom: 8px; overflow: hidden; }
.iss-group-head { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--rose-50); border-bottom: 1px solid #fee2e2; cursor: pointer; }
.iss-group-head:hover { background: var(--rose-100); }
.iss-group-head .arr { transition: transform .15s; font-size: 9px; color: var(--rose-700); }
.iss-group-head.open .arr { transform: rotate(90deg); }
.iss-group-head .name { font-size: 12px; font-weight: 600; color: var(--rose-700); flex: 1; }
.iss-group-head .count { padding: 2px 8px; background: #fff; border: 1px solid #fecaca; border-radius: 6px; color: var(--rose-700); font-size: 10.5px; font-weight: 700; font-family: var(--font-mono); }
.iss-group-head .bulk { padding: 5px 11px; background: linear-gradient(135deg, #dc2626, #991b1b); color: #fff; border: none; border-radius: 6px; font-size: 10.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.iss-group-body { display: none; padding: 6px 8px; }
.iss-group-body.open { display: block; max-height: 240px; overflow-y: auto; }

/* Sheet flash */
@keyframes rowFlash {
  0%, 30% { background: var(--sky-100); outline: 2px solid var(--sky-500); outline-offset: -2px; }
  100% { background: transparent; outline: 2px solid transparent; }
}
.sheet-tbl tbody tr.row-flash { animation: rowFlash 3s ease-out; }

/* BUG-G7G-004 (D-117) · review disagreement card flash on entry from "Review N →" click */
@keyframes rdFlash {
  0%   { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.55); background: #fff; }
  35%  { box-shadow: 0 0 0 8px rgba(14, 165, 233, 0.0);  background: #f0f9ff; }
  100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.0);    background: #fff; }
}
.rd-list [data-rd-idx].rd-flash { animation: rdFlash 2.2s ease-out; outline: 2px solid #0ea5e9; outline-offset: 2px; border-radius: 8px; }

/* BUG-G7G-005 (D-117) · Sheet scope chip · clear visual cue for active filter */
.sheet-scope-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f0f9ff; color: #0c4a6e; border: 1px solid #bae6fd;
  padding: 6px 14px; border-radius: 999px; font-size: 12.5px; cursor: pointer;
  transition: background 0.15s ease;
}
.sheet-scope-chip:hover { background: #e0f2fe; }
.sheet-scope-chip.is-all { background: #fffbeb; color: #78350f; border-color: #fde68a; }
.sheet-scope-chip.is-all:hover { background: #fef3c7; }
.sheet-scope-chip b { font-weight: 600; text-decoration: underline; }
/* LM-G7-MC-W2 B4 · per-stmt currency chip in Sheet stage header */
.sheet-ccy-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fff; color: #0f172a; border: 1.5px solid #cbd5e1;
  padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s ease;
  font-family: inherit; letter-spacing: .5px;
}
.sheet-ccy-chip b { font-weight: 700; color: #0c4a6e; letter-spacing: .8px; }
.sheet-ccy-chip:hover { background: #f0f9ff; border-color: #0ea5e9; color: #0369a1; }
.sheet-ccy-chip:focus { outline: 2px solid #0ea5e9; outline-offset: 2px; }
/* LM-G7-EXT W-D-02 EX-10b · currency sub-tabs (Sheet stage) · always ≥1 tab · consistent rendering */
.sheet-ccy-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; padding: 4px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; width: fit-content; }
.sheet-ccy-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: transparent; color: #475569; border: none; border-radius: 7px; font-family: inherit; font-size: 12.5px; cursor: pointer; transition: all .15s; }
.sheet-ccy-tab b { font-family: ui-monospace, monospace; letter-spacing: .5px; }
.sheet-ccy-tab-count { color: #94a3b8; font-size: 11px; }
.sheet-ccy-tab:hover { background: #f0f9ff; color: #0369a1; }
.sheet-ccy-tab.active { background: #fff; color: #0c4a6e; box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.sheet-ccy-tab.active .sheet-ccy-tab-count { color: #0ea5e9; font-weight: 700; }
.pill-clickable { transition: background 0.15s ease, transform 0.1s ease; }
.pill-clickable:hover { transform: scale(1.05); filter: brightness(1.05); }

/* Byte AI floating avatar — V2.8 (BUG-V28-04)
   - position: fixed → drag anywhere on viewport
   - No background, no ring, no border-radius — only the SVG mascot itself
   - Float idle animation pauses while dragging */
.byte-fab {
  position: fixed;
  bottom: var(--t-byte-fab-bottom); right: var(--t-byte-fab-right);
  width: var(--t-byte-fab-size); height: var(--t-byte-fab-size);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: grab;
  display: block;
  z-index: 9999;
  filter: drop-shadow(0 6px 14px rgba(5, 190, 254, .35));
  animation: byteFloat 4.5s ease-in-out infinite;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
.byte-fab:active { cursor: grabbing; }
.byte-fab.dragging { animation: none; transition: none; }
@keyframes byteFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.byte-fab:hover { filter: drop-shadow(0 10px 20px rgba(5, 190, 254, .5)); }
.byte-avatar-svg {
  width: 100%; height: 100%;
  pointer-events: none;
}
.byte-fab-status {
  position: absolute;
  bottom: 8px; right: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--emerald-500);
  border: 2px solid #fff;
  pointer-events: none;
}

/* BUG-BYTE-SIDEBAR-001 (founder「不要 sidebar · 像 perspic website 那樣」)
   Floating bottom-right chat dialog (~360×480) replaces the full-height
   sidebar. Anchors above the byte-fab so user mental model stays「click fab
   → bubble pops above」like Intercom / Drift. Mobile breakpoint widens to
   near-full width. */
.byte-panel-v2 {
  position: fixed;
  bottom: 140px;          /* above byte-fab (90px + 32px gap) */
  right: 32px;
  width: 360px;
  height: 480px;
  max-height: calc(100vh - 200px);
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .18), 0 4px 12px rgba(15, 23, 42, .08);
  opacity: 0;
  transform: translateY(20px) scale(.96);
  transition: opacity .22s ease-out, transform .22s ease-out;
  pointer-events: none;
  z-index: 40;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.byte-panel-v2.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
@media (max-width: 600px) {
  .byte-panel-v2 {
    right: 16px; left: 16px; width: auto;
    bottom: 110px;
    height: calc(100vh - 160px);
  }
}
.byte-panel-head {
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
  color: #fff;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600;
}
.byte-panel-head .x {
  margin-left: auto;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  border: none; color: #fff;
  font-size: 14px; cursor: pointer;
}
.byte-msgs {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  font-size: 12px; line-height: 1.5;
}
.byte-msg-bot { padding: 10px 12px; background: var(--sky-50); border-radius: 10px; border: 1px solid #bae6fd; color: #0c4a6e; }
.byte-msg-user { align-self: flex-end; padding: 10px 12px; background: linear-gradient(135deg, var(--sky-500), var(--indigo-500)); color: #fff; border-radius: 10px; max-width: 85%; }
.byte-form-v2 { padding: 12px; border-top: 1px solid var(--slate-100); display: flex; gap: 6px; }
.byte-form-v2 input { flex: 1; padding: 8px 12px; border: 1px solid var(--slate-200); border-radius: 8px; font: inherit; font-size: 12px; outline: none; }
.byte-form-v2 button { padding: 8px 14px; background: linear-gradient(135deg, var(--sky-500), var(--indigo-500)); color: #fff; border: none; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; }

/* G1.6.1 F4.A · Upload first-time welcome card (above drop zone) */
.upload-welcome {
  background: linear-gradient(135deg, var(--sky-50), #fff);
  border: 1px solid var(--sky-100);
  border-radius: 14px;
  padding: 26px 32px 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.upload-welcome::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sky-500), var(--indigo-500));
}
.upload-welcome .welcome-ic {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
  color: #fff;
  display: grid; place-items: center;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(14, 165, 233, .25);
}
.upload-welcome .welcome-ic svg { width: 28px; height: 28px; stroke-width: 1.7; }
.upload-welcome .welcome-h {
  font-size: 22px; font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 6px;
  letter-spacing: -.4px;
}
.upload-welcome .welcome-mute {
  font-size: 13.5px;
  color: var(--slate-500);
  margin-bottom: 16px;
  max-width: 640px;
}
.upload-welcome .welcome-steps {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
  margin: 0; padding: 0;
  list-style: none; counter-reset: ws-step;
  font-size: 13px;
  color: var(--slate-700);
}
.upload-welcome .welcome-steps li {
  counter-increment: ws-step;
  position: relative;
  padding-left: 32px;
  line-height: 1.5;
}
.upload-welcome .welcome-steps li::before {
  content: counter(ws-step);
  position: absolute;
  left: 0; top: 1px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--sky-100);
  color: var(--sky-700);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
}
.upload-welcome .welcome-steps li b { color: var(--slate-900); font-weight: 700; }

/* Drop zone (Upload stage) */
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.drop-z {
  padding: var(--t-drop-padding) 22px;
  border: 2px dashed var(--slate-300);
  border-radius: 14px;
  background: #fafbfc;
  text-align: center;
  transition: all .18s;
  /* BUG-BROWSE-FILES-NORESP-001 fix · entire zone clickable (was: only Browse
   * button) · cursor:pointer signals click affordance to user */
  cursor: pointer;
}
.drop-z:hover { border-color: var(--sky-500); background: var(--sky-50); }
.drop-z .ic {
  width: var(--t-drop-ic-size); height: var(--t-drop-ic-size);
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--slate-200);
  display: grid; place-items: center;
  color: var(--sky-600);
}
.drop-z .ic svg { width: 24px; height: 24px; stroke-width: 1.5; }
.drop-z .t { font-size: 14px; font-weight: 600; color: var(--slate-800); }
.drop-z .h { font-size: 11.5px; color: var(--slate-400); margin-top: 5px; }
.drop-z .pick {
  margin-top: 12px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
  color: #fff; border: none; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.drop-z .pick svg { width: 14px; height: 14px; stroke-width: 1.75; }

/* V42.E E3 · ul-box capped height + sticky header so 20+ files stay scannable */
.ul-box {
  padding: 14px;
  background: #fafbfc;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  max-height: 480px;
  overflow-y: auto;
  position: relative;
}
.ul-h {
  font-size: 11px; font-weight: 700;
  color: var(--slate-400);
  text-transform: uppercase; letter-spacing: 1.2px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
  position: sticky; top: -14px;
  margin-top: -14px; padding: 14px 0 8px;
  background: #fafbfc;
  z-index: 2;
  border-bottom: 1px solid var(--slate-100);
}
.ul-h .count { margin-left: auto; background: var(--sky-500); color: #fff; font-size: 10px; padding: 1px 8px; border-radius: 9px; letter-spacing: 0; }
.ul-li {
  display: grid;
  grid-template-columns: 18px 1fr 60px 90px 22px;
  align-items: center; gap: 10px;
  padding: 8px 10px; background: var(--white);
  border: 1px solid var(--slate-200); border-radius: 9px;
  margin-bottom: 6px; font-size: 12px;
}
.ul-li .fic { width: 18px; height: 18px; color: #dc2626; }
.ul-li .fic svg { width: 18px; height: 18px; stroke-width: 1.5; }
.ul-li .nm { font-weight: 600; color: var(--slate-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ul-li .nm .sz { font-weight: 400; color: var(--slate-400); font-size: 10.5px; display: block; }
.ul-li .bar { height: 5px; background: var(--slate-100); border-radius: 3px; overflow: hidden; }
.ul-li .bar div { height: 100%; background: linear-gradient(90deg, var(--sky-500), var(--indigo-500)); border-radius: 3px; transition: width .3s; }
.ul-li .st { font-size: 10.5px; font-weight: 600; letter-spacing: .3px; text-align: right; }
.ul-li.done .st { color: var(--emerald-500); }
.ul-li.uploading .st { color: var(--sky-500); }
.ul-li.fail .st { color: #dc2626; }
.ul-li .x { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--slate-200); background: var(--white); color: var(--slate-400); display: grid; place-items: center; cursor: pointer; font-size: 11px; }
.ul-mini { display: flex; align-items: center; gap: 3px; margin-top: 4px; font-size: 9px; }
.ul-mini .stp { padding: 1px 6px; border-radius: 5px; background: var(--slate-100); color: var(--slate-400); font-weight: 600; letter-spacing: .3px; white-space: nowrap; }
.ul-mini .stp.ok { background: var(--emerald-100); color: var(--emerald-700); }
.ul-mini .stp.now { background: var(--sky-100); color: #1e40af; animation: bytePulse 1.2s infinite; }

.det-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px;
  background: linear-gradient(90deg, var(--emerald-50), #fff);
  border: 1px solid var(--emerald-100);
  border-radius: 999px;
  font-size: 11px; color: var(--emerald-700);
  margin-top: 6px;
}
.det-chip svg { width: 12px; height: 12px; stroke-width: 2; }
.det-chip b { color: var(--emerald-700); font-weight: 700; }

/* Sheet */
.sheet-toolbar { display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: #fafbfc; border: 1px solid var(--slate-200); border-radius: 12px 12px 0 0; border-bottom: 0; flex-wrap: wrap; }
.sheet-toolbar input { flex: 1; min-width: 200px; padding: 7px 12px; border: 1px solid var(--slate-200); border-radius: 8px; font-size: 12px; background: var(--white); outline: none; }
.sheet-toolbar input:focus { border-color: var(--sky-500); }
.sheet-toolbar .sep { width: 1px; height: 20px; background: var(--slate-200); margin: 0 2px; }
.sheet-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 14px; background: var(--white); border: 1px solid var(--slate-200); border-top: 0; align-items: center; }
.sheet-chip { padding: 4px 10px; background: var(--slate-100); border: 1px solid transparent; border-radius: 14px; font-size: 11px; font-weight: 600; color: var(--slate-600); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.sheet-chip:hover { background: var(--sky-100); color: var(--sky-700); }
.sheet-chip.act { background: linear-gradient(135deg, var(--sky-500), var(--indigo-500)); color: #fff; }
.sheet-chip-l { font-size: 10px; color: var(--slate-400); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; margin-right: 4px; }
.sheet-bulk { padding: 8px 14px; background: linear-gradient(90deg, var(--sky-50), #fff); border: 1px solid #bae6fd; border-top: 0; display: none; align-items: center; gap: 10px; font-size: 11.5px; color: var(--sky-700); }
.sheet-bulk.show { display: flex; }
.sheet-bulk button { margin-left: auto; background: linear-gradient(135deg, var(--sky-500), var(--indigo-500)); border: none; color: #fff; padding: 5px 12px; border-radius: 7px; font-size: 11px; font-weight: 600; cursor: pointer; }
.sheet-tbl { background: var(--white); border: 1px solid var(--slate-200); border-radius: 0; overflow: hidden; overflow-x: auto; }
/* D-168 BUG-BANKS-BAR-WIDTH-001 fix · table min-width forces horizontal scroll when
   long counterparty + many columns would otherwise squeeze numeric columns. OUT/IN/BAL
   always remain at their full readable width via th.num min-width below. */
.sheet-tbl table { width: 100%; min-width: 1100px; border-collapse: collapse; font-size: 12px; }
.sheet-tbl thead { background: var(--slate-50); position: sticky; top: 0; z-index: 2; }
.sheet-tbl th { text-align: left; padding: 9px 12px; font-size: 10.5px; font-weight: 700; color: var(--slate-500); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--slate-200); white-space: nowrap; }
/* D-162 2026-05-18 · NO font-mono · tabular-nums alone.
   D-168 2026-05-18 · numeric cells keep min-width 90px so OUT/IN/BAL never get
   squeezed by an over-wide COUNTERPARTY cell (long Middle-East / pharma names). */
.sheet-tbl th.num, .sheet-tbl td.num { text-align: right; font-variant-numeric: tabular-nums; min-width: 110px; white-space: nowrap; padding-right: 14px; }
.sheet-tbl td { padding: 8px 12px; border-bottom: 1px solid var(--slate-100); color: var(--slate-700); vertical-align: middle; }
.sheet-tbl tbody tr:hover { background: var(--sky-50); }
.sheet-tbl tbody tr.rv { background: rgba(244, 63, 94, .05); }
.sheet-tbl tbody tr.md { background: rgba(245, 158, 11, .05); }
.cell-edit { padding: 1px 4px; border: 1px dashed transparent; border-radius: 4px; cursor: text; display: inline-block; min-height: 18px; min-width: 60px; }
.cell-edit:hover { border-color: var(--slate-300); background: var(--white); }
.cell-edit:focus { outline: none; border-color: var(--sky-500); background: var(--sky-50); border-style: solid; }
.cell-num { width: 80px; padding: 1px 4px; border: 1px dashed transparent; border-radius: 4px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; background: transparent; font-size: 12px; }
.cell-num:hover { border-color: var(--slate-300); background: var(--white); }
.cell-num:focus { outline: none; border-color: var(--sky-500); background: var(--sky-50); border-style: solid; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 9px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.pill-h { background: var(--emerald-100); color: var(--emerald-700); }
.pill-m { background: var(--amber-100); color: var(--amber-700); }
.pill-r { background: var(--rose-100); color: var(--rose-700); }
.pill-ok { background: var(--sky-100, #e0f2fe); color: var(--sky-700, #0369a1); }
/* BUG-G7H-006 (D-118) · new states · "not provided" (orange) + "not relevant" (grey) */
.pill-np { background: #fed7aa; color: #9a3412; }
.pill-nr { background: #f1f5f9; color: #64748b; }
/* D-119 · per-row Auto-match link removed; link CSS retained dead in case third-party copy reuses */
.docs-automatch-link { display: none; }
/* D-120 LM-G7-J · cluster verdict pills */
.pill-cluster-pattern {
  background: linear-gradient(90deg, #ddd6fe, #c7d2fe);
  color: #4c1d95;
  border: 1px solid #a78bfa;
}
.pill-cluster-individual {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.f3-btn-mini {
  padding: 2px 8px; font-size: 10.5px;
  border: 1px solid #cbd5e1; background: #fff; color: #475569;
  border-radius: 5px; cursor: pointer;
}
.f3-btn-mini:hover { background: #f1f5f9; border-color: #94a3b8; }
.f3-btn-secondary {
  background: #f1f5f9; border: 1px solid #cbd5e1; color: #1e293b;
}
.f3-btn-secondary:hover { background: #e2e8f0; }
/* D-119 LM-G7-I Atom E · sheet read-only mode visual cues */
.sheet-tbl tbody tr.sheet-readonly .cell-edit,
.sheet-tbl tbody tr.sheet-readonly .cell-num {
  cursor: default; background: transparent; color: var(--slate-700);
  border-color: transparent;
}
.sheet-tbl tbody tr.sheet-readonly .cell-edit:hover,
.sheet-tbl tbody tr.sheet-readonly .cell-num:hover {
  background: transparent;
  outline: none;
}
.sheet-tbl tbody tr.sheet-readonly .cell-num {
  pointer-events: none;
}
.sheet-pager { padding: 8px 14px; background: #fafbfc; border: 1px solid var(--slate-200); border-top: 0; display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--slate-500); }
.sheet-pager .info b { color: var(--slate-800); font-family: var(--font-mono); }
.sheet-pager button { padding: 5px 10px; border: 1px solid var(--slate-200); background: var(--white); color: var(--slate-600); border-radius: 6px; font-size: 11px; font-weight: 600; cursor: pointer; }
.sheet-pager button:disabled { opacity: .4; cursor: not-allowed; }
.sheet-pager .page-input { width: 50px; padding: 4px 8px; border: 1px solid var(--slate-200); border-radius: 6px; font-family: var(--font-mono); font-size: 11px; text-align: center; }
.sheet-pager select { padding: 4px 8px; border: 1px solid var(--slate-200); border-radius: 6px; font: inherit; font-size: 11px; background: #fff; }
.sheet-foot { padding: 9px 14px; background: var(--slate-50); border: 1px solid var(--slate-200); border-top: 0; border-radius: 0 0 12px 12px; display: grid; grid-template-columns: 1fr auto auto auto; gap: 14px; font-size: 11.5px; }
.sheet-foot .l { color: var(--slate-500); }
.sheet-foot .v { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--slate-800); }
.sheet-foot .v.in { color: var(--emerald-700); }
.sheet-foot .v.out { color: var(--rose-700); }

/* Charts */
.graph-tabs { display: flex; gap: 4px; margin-bottom: 12px; background: #fafbfc; padding: 4px; border: 1px solid var(--slate-200); border-radius: 10px; width: fit-content; }
.graph-tab { padding: 7px 14px; font-size: var(--t-graph-tab-font); font-weight: 600; color: var(--slate-500); background: transparent; border: none; border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.graph-tab svg { width: 13px; height: 13px; stroke-width: 1.75; }
.graph-tab:hover { background: var(--sky-50); color: var(--sky-700); }
.graph-tab.act { background: linear-gradient(135deg, var(--sky-500), var(--indigo-500)); color: #fff; }
.chart-canvas { background: var(--white); border: 1px solid var(--slate-200); border-radius: 12px; padding: var(--t-chart-canvas-pad) 22px; height: var(--t-chart-canvas-height); display: flex; flex-direction: column; gap: 8px; }
.chart-h { display: flex; align-items: baseline; gap: 10px; }
.chart-h .t { font-size: var(--t-chart-h-font); font-weight: 600; color: var(--slate-800); }
.chart-h .sub { font-size: 11px; color: var(--slate-400); margin-left: auto; }
.chart-svg { flex: 1; width: 100%; }
.chart-axis { font-size: var(--t-chart-axis-font); fill: var(--slate-400); }
.chart-axis-y { font-size: 10px; fill: var(--slate-500); font-weight: 500; }
.chart-grid { stroke: var(--slate-100); stroke-width: 1; }
.chart-grid.zero { stroke: var(--slate-300); stroke-width: 1.5; }
.chart-bar { transition: opacity .15s; cursor: pointer; }
.chart-bar:hover { opacity: .78; }
.chart-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-line-dot { cursor: pointer; transition: r .15s; }
.chart-line-dot:hover { r: 6; }
.chart-area { opacity: .18; }
.chart-tooltip { position: absolute; background: rgba(15, 23, 42, .97); color: #fff; padding: 8px 13px; border-radius: 8px; font-size: 11px; pointer-events: none; display: none; z-index: 10; box-shadow: 0 8px 20px rgba(15, 23, 42, .3); }
.chart-tooltip.show { display: block; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 10.5px; color: var(--slate-500); margin-top: 6px; }
.chart-legend .item { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend .sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.kpi-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi-tile { padding: 10px 12px; background: #fafbfc; border: 1px solid var(--slate-200); border-radius: 8px; }
.kpi-tile .l { font-size: 9.5px; color: var(--slate-400); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.kpi-tile .v { font-size: 15px; font-weight: 700; color: var(--slate-800); margin-top: 3px; font-variant-numeric: tabular-nums; }
.kpi-tile .v.in { color: var(--emerald-700); }
.kpi-tile .v.out { color: var(--rose-700); }
.kpi-tile .delta { font-size: 10px; margin-top: 2px; font-weight: 600; }
.kpi-tile .delta.pos { color: var(--emerald-500); }
.kpi-tile .delta.neg { color: #ef4444; }
.split-toggle { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--slate-500); }
.split-toggle input { display: none; }
.split-toggle .sw { position: relative; width: 28px; height: 16px; background: var(--slate-300); border-radius: 9px; transition: all .2s; display: inline-block; }
.split-toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; background: #fff; border-radius: 50%; transition: all .2s; }
.split-toggle input:checked + .sw { background: linear-gradient(135deg, var(--sky-500), var(--indigo-500)); }
.split-toggle input:checked + .sw::after { transform: translateX(12px); }

.graph-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; }
.gside { background: var(--white); border: 1px solid var(--slate-200); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.gside-h { font-size: 11px; font-weight: 700; color: var(--slate-400); text-transform: uppercase; letter-spacing: 1.2px; }
.gside-card { padding: 12px; background: #fafbfc; border: 1px solid var(--slate-200); border-radius: 10px; }
.gside-card .nm { font-size: 13px; font-weight: 600; color: var(--slate-800); margin-bottom: 5px; }
.gside-card .stat { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--emerald-500); font-variant-numeric: tabular-nums; }
.gside-card .stat.neg { color: #dc2626; }
.gside-card .meta { font-size: 10.5px; color: var(--slate-500); margin-top: 5px; line-height: 1.45; }
.gside-list { display: flex; flex-direction: column; gap: 5px; }
.gside-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 7px 10px; background: #fafbfc; border-radius: 7px; font-size: 11.5px; cursor: pointer; }
.gside-row:hover { background: var(--sky-50); }
.gside-row .nm { color: var(--slate-800); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gside-row .v { font-family: var(--font-mono); font-weight: 600; color: var(--emerald-500); font-variant-numeric: tabular-nums; }
.gside-row .v.neg { color: #dc2626; }
.gside-row.act { background: var(--sky-50); border: 1px solid #bae6fd; }

/* Reports tabs */
.report-tabs { display: flex; gap: 4px; background: #fafbfc; padding: 4px; border: 1px solid var(--slate-200); border-radius: 10px; margin-bottom: 14px; width: fit-content; }
.report-tab { padding: 7px 14px; font-size: var(--t-report-tab-font); font-weight: 600; color: var(--slate-500); background: transparent; border: none; border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.report-tab svg { width: 13px; height: 13px; stroke-width: 1.75; }
.report-tab:hover { background: var(--sky-50); color: var(--sky-700); }
.report-tab.act { background: linear-gradient(135deg, var(--sky-500), var(--indigo-500)); color: #fff; }
.gl-section { background: #fff; border: 1px solid var(--slate-200); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.gl-head { padding: 10px 14px; background: var(--slate-50); border-bottom: 1px solid var(--slate-200); display: flex; align-items: center; gap: 10px; cursor: pointer; }
.gl-head:hover { background: var(--slate-100); }
.gl-head .arr { transition: transform .15s; font-size: 9px; color: var(--slate-400); }
.gl-head.open .arr { transform: rotate(90deg); }
.gl-head .name { font-size: 13px; font-weight: 600; color: var(--slate-800); flex: 1; }
.gl-head .stat { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; }
.gl-head .stat.in { color: var(--emerald-700); }
.gl-head .stat.out { color: var(--rose-700); }
.gl-body { display: none; }
.gl-body.open { display: block; }
.gl-body table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.gl-body td { padding: 6px 14px; border-top: 1px solid var(--slate-100); color: var(--slate-600); }
.gl-body td:first-child { color: var(--slate-400); font-family: var(--font-mono); font-size: 10.5px; width: 90px; }
.gl-body td.num { font-variant-numeric: tabular-nums; text-align: right; color: var(--slate-800); width: 120px; }

.pl-card { max-width: 680px; margin: 0 auto; background: #fff; border: 1px solid var(--slate-200); border-radius: 12px; overflow: hidden; }
.pl-head { padding: 18px 28px; background: linear-gradient(90deg, var(--sky-500), var(--indigo-500)); color: #fff; text-align: center; }
.pl-head .nm { font-weight: 700; letter-spacing: 1px; font-size: 13px; opacity: .95; }
.pl-head h3 { margin: 6px 0 0; font-size: 20px; font-weight: 700; }
.pl-head .pd { font-size: 12px; opacity: .85; margin-top: 3px; }
/* G1.7.3 I3.B · opening/closing balance line in Recon header */
.pl-head .recon-balances {
  font-family: var(--font-mono);
  font-size: 12px;
  margin-top: 8px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, .15);
  border-radius: 6px;
  display: inline-block;
}
.pl-body { padding: 20px 32px; }
.pl-body table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pl-body td { padding: 8px 0; border-bottom: 1px solid var(--slate-100); color: var(--slate-600); }
.pl-body td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--slate-800); }
.pl-body .section-h { padding-top: 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--slate-400); font-weight: 700; }
.pl-body .subtotal td { border-bottom: 2px solid var(--slate-800); border-top: 1px solid var(--slate-300); padding: 10px 0; font-weight: 700; color: var(--slate-800); }
.pl-body .net td { padding: 14px 0 6px; font-size: 15px; font-weight: 700; color: var(--sky-700); }
/* G1.7.2 I2.B + I2.C · HKFRS footer + auditor signature line (print-aware) */
.pl-body .pl-hkfrs {
  font-size: 10.5px; color: var(--slate-500);
  font-style: italic; margin-top: 24px; padding-top: 14px;
  border-top: 1px solid var(--slate-200);
}
.pl-body .pl-sig {
  margin-top: 18px; font-size: 12.5px; color: var(--slate-700);
  display: flex; flex-direction: column; gap: 12px;
}
.pl-body .pl-sig .pl-line {
  display: inline-block; min-width: 200px;
  border-bottom: 1px solid var(--slate-400);
  margin: 0 6px;
}
.pl-body .pl-sig .pl-line.short { min-width: 100px; }
.pl-body .pl-sig .pl-date { float: right; }
@media print {
  .pl-body .pl-sig { page-break-inside: avoid; }
  .pl-body .pl-hkfrs { color: var(--slate-700); }
}

/* G1.7.4 I4.B · MA Schedule period header (entity + schedule range) */
.ma-period-head {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.ma-period-head .ma-entity {
  font-size: 13px; font-weight: 700; color: var(--slate-800); margin-bottom: 2px;
}
.ma-period-head .ma-sched {
  font-size: 12px; color: var(--slate-500); font-family: var(--font-mono);
}

.ma-card { background: #fff; border: 1px solid var(--slate-200); border-radius: 10px; overflow: hidden; }
.ma-card table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ma-card th { background: var(--slate-50); padding: 9px 12px; font-size: 10.5px; font-weight: 700; color: var(--slate-600); text-align: left; text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--slate-200); }
.ma-card td { padding: 8px 12px; border-top: 1px solid var(--slate-100); color: var(--slate-800); }
.ma-card td.num { font-family: var(--font-mono); text-align: right; }

.pbc-card { background: #fff; border: 1px solid var(--slate-200); border-radius: 12px; padding: 24px; }
.pbc-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.pbc-row { display: grid; grid-template-columns: 32px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 14px; background: #fafbfc; border: 1px solid var(--slate-200); border-radius: 9px; font-size: 12.5px; }
.pbc-row .ic { width: 28px; height: 28px; background: linear-gradient(135deg, var(--sky-500), var(--indigo-500)); border-radius: 7px; color: #fff; display: grid; place-items: center; }
.pbc-row .ic svg { width: 14px; height: 14px; stroke-width: 2; }
.pbc-row .nm b { display: block; font-weight: 600; color: var(--slate-800); }
.pbc-row .nm span { color: var(--slate-400); font-size: 11px; }
.pbc-row .sz { font-family: var(--font-mono); color: var(--slate-500); font-size: 11px; }
.pbc-row .chk { color: var(--emerald-500); font-size: 14px; font-weight: 700; }
/* G1.7.5 I5.B · status indicator (ready/missing/partial) per checklist item */
.pbc-row.pbc-missing { background: #fff8f8; border-color: var(--rose-100); opacity: .75; }
.pbc-row.pbc-partial { background: var(--amber-50); border-color: var(--amber-100); }
.pbc-row .chk-ready { color: var(--emerald-500); }
.pbc-row .chk-missing { color: var(--rose-500); }
.pbc-row .chk-partial { color: var(--amber-500); }
.pbc-row.pbc-missing .ic { background: linear-gradient(135deg, var(--slate-300), var(--slate-400)); }
.pbc-row.pbc-partial .ic { background: linear-gradient(135deg, var(--amber-500), var(--amber-700)); }

/* LM-G7-X (D-135) · Consistency Engine · "需要查證" findings panel (top of Review stage) */
.findings-panel { margin: 20px 0 8px; padding: 14px 16px; background: #fffbeb; border: 1px solid #fcd34d; border-radius: 12px; }
.findings-h { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: #b45309; margin: 0 0 10px; font-family: inherit; }
.findings-list { display: flex; flex-direction: column; gap: 8px; }
.finding-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; background: #fff; border: 1px solid #fde68a; border-radius: 8px; }
.finding-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.finding-dot-high { background: #ef4444; }
.finding-dot-med  { background: #f59e0b; }
.finding-dot-info { background: #0ea5e9; }
.finding-body { flex: 1; min-width: 0; }
.finding-title { font-size: 13px; font-weight: 600; color: #1e293b; line-height: 1.4; }
.finding-detail { font-size: 11.5px; color: #64748b; line-height: 1.5; margin-top: 2px; }
.finding-act-btn { flex-shrink: 0; background: #fff; border: 1px solid #fcd34d; color: #b45309; }
.finding-act-btn:hover { background: #fef3c7; border-color: #f59e0b; }
.review-clear-tick { font-size: 38px; line-height: 1; margin-bottom: 8px; color: #10b981; display: inline-flex; }

/* Review queue */
.review-progress { max-width: 540px; margin: 0 auto 16px; padding: 8px 14px; background: var(--white); border: 1px solid var(--slate-200); border-radius: 10px; display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--slate-600); }
.review-progress .bar { flex: 1; height: 6px; background: var(--slate-100); border-radius: 3px; overflow: hidden; }
.review-progress .bar div { height: 100%; background: linear-gradient(90deg, var(--emerald-500), var(--emerald-600)); border-radius: 3px; transition: width .4s ease; }
.review-progress b { font-family: var(--font-mono); color: var(--slate-800); }
.review-host { display: grid; place-items: center; min-height: 340px; }
.q-card { width: 100%; max-width: 520px; background: var(--white); border: 1px solid var(--slate-200); border-radius: 16px; padding: var(--t-q-card-padding) 32px; text-align: center; box-shadow: 0 4px 20px rgba(15, 23, 42, .04); }
.q-card .q-meta { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--slate-400); margin-bottom: 12px; }
.q-card h4 { margin: 0 0 14px; font-size: 16px; font-weight: 600; color: var(--slate-800); word-break: break-word; }
.q-amt { font-family: var(--font-mono); font-size: var(--t-q-amt-size); font-weight: 700; color: var(--rose-700); margin-bottom: 16px; }
.q-amt.pos { color: var(--emerald-700); }
.q-sug { padding: 12px 16px; background: var(--sky-50); border-radius: 10px; font-size: 13px; color: var(--slate-600); margin-bottom: 18px; display: flex; align-items: center; gap: 6px; justify-content: center; }
.q-sug b { color: var(--sky-700); }
.q-acts { display: flex; gap: 8px; justify-content: center; }
.q-acts button { padding: 8px 14px; border-radius: 9px; border: 1px solid var(--slate-200); background: var(--white); color: var(--slate-600); font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.q-acts button.pri { background: linear-gradient(135deg, var(--emerald-500), var(--emerald-600)); border-color: transparent; color: #fff; box-shadow: 0 3px 10px rgba(16, 185, 129, .25); }
.q-acts svg { width: 13px; height: 13px; stroke-width: 2; }
.review-history { max-width: 540px; margin: 14px auto 0; padding: 10px 14px; background: #fafbfc; border: 1px solid var(--slate-200); border-radius: 10px; }
.review-history h6 { font-size: 10px; font-weight: 700; color: var(--slate-400); text-transform: uppercase; letter-spacing: 1px; margin: 0 0 6px; }
.review-history-list { display: flex; flex-direction: column; gap: 5px; }
.rh-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; padding: 6px 10px; background: var(--white); border-radius: 7px; border: 1px solid var(--slate-100); font-size: 11px; align-items: center; }
.rh-row .nm { color: var(--slate-800); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-row .cat { color: var(--sky-700); background: var(--sky-100); padding: 1px 7px; border-radius: 6px; font-size: 10px; font-weight: 600; }
.rh-row .undo { background: transparent; border: 1px solid var(--slate-200); padding: 3px 7px; border-radius: 6px; font-size: 10px; color: var(--slate-500); cursor: pointer; }
.review-kbd { margin-top: 10px; font-size: 10.5px; color: var(--slate-400); text-align: center; }
.kbd { display: inline-block; background: var(--white); border: 1px solid var(--slate-200); border-bottom-width: 2px; padding: 1px 5px; border-radius: 4px; font-family: var(--font-mono); font-size: 10px; color: var(--slate-600); margin: 0 2px; }

/* G1.6.4 F5.D · Upload-list rejection reason chip (founder T6 · two reason classes) */
.ul-li[data-reason="not_statement"] .st {
  color: var(--sky-700);
  font-weight: 600;
}
.ul-li[data-reason="not_statement"] .st::before {
  content: '↳ ';
  color: var(--sky-500);
  margin-right: 2px;
}
.ul-li[data-reason="low_confidence"] .st {
  color: var(--amber-700);
  font-weight: 600;
}
.ul-li[data-reason="low_confidence"] .st::before {
  content: '⚠ ';
  color: var(--amber-500);
  margin-right: 2px;
}

/* G1.6.3 F2.C · Sidebar placeholder card for in-flight stmt uploads (progressive feedback) */
.sb-stmt-card.placeholder {
  background: linear-gradient(135deg, var(--sky-50), #fff);
  border-color: var(--sky-100);
  position: relative;
  overflow: hidden;
  cursor: default;
}
.sb-stmt-card.placeholder::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.65) 50%,
    rgba(255, 255, 255, 0) 100%);
  animation: sb-shimmer 1.4s linear infinite;
  pointer-events: none;
}
@keyframes sb-shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}
.sb-stmt-card.placeholder .sb-stmt-x { display: none; }  /* not deletable while in flight */
.sb-stmt-card.placeholder .sb-stmt-stat.s-pending {
  background: var(--sky-100);
  color: var(--sky-700);
  font-size: 11px;
  display: inline-block;
  animation: sb-spin 1.2s linear infinite;
}
@keyframes sb-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.sb-stmt-phase {
  font-style: italic;
  color: var(--sky-700);
  font-family: inherit;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .1px;
}

/* BUG-G7L-001 (D-122) · canonical f3-modal CSS · used by 4 modals (cluster review +
 * 3 settings: password change / re-auth / delete account). Pattern was used since D-097
 * but the CSS rule was never written — modals appeared as inline blocks at end of body,
 * looking like "new page sections" rather than centered overlays. */
.f3-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-interactive);  /* BUG-UPLOAD-DUP-STUCK-001 fix · was 5000 */
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  place-items: center;
  backdrop-filter: blur(2px);
  animation: f3ModalOverlayIn 0.14s ease-out;
  padding: 16px;
}
@keyframes f3ModalOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.f3-modal {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 4px 14px rgba(0, 0, 0, 0.08);
  padding: 24px 28px;
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  font-family: inherit;
  animation: f3ModalCardIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes f3ModalCardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.f3-modal h3 { font-family: inherit; }
.f3-modal p { font-family: inherit; line-height: 1.55; }
.f3-modal table { font-family: inherit; }

/* D-122 BUG-G7L-001 · cluster review modal · preview-style split-pane (founder request) */
.f3-modal.cluster-modal {
  max-width: 920px;
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
}
.cluster-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid #e2e8f0;
}
.cluster-modal-head h3 {
  margin: 0 0 4px; font-size: 17px; font-weight: 600; color: #0f172a; font-family: inherit;
}
.cluster-modal-lead {
  margin: 0; font-size: 12.5px; color: #64748b; font-family: inherit; line-height: 1.5;
}
.cluster-modal-close {
  background: transparent; border: 0; font-size: 24px; line-height: 1; color: #64748b;
  cursor: pointer; padding: 0; width: 30px; height: 30px;
  border-radius: 6px; flex-shrink: 0;
}
.cluster-modal-close:hover { background: #f1f5f9; color: #1e293b; }
.cluster-modal-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  flex: 1; min-height: 0; overflow: hidden;
}
@media (max-width: 760px) { .cluster-modal-body { grid-template-columns: 1fr; } }
.cluster-modal-left {
  padding: 18px 22px;
  border-right: 1px solid #e2e8f0;
  overflow-y: auto;
  background: #fafbfc;
}
@media (max-width: 760px) {
  .cluster-modal-left { border-right: 0; border-bottom: 1px solid #e2e8f0; }
}
.cluster-modal-right {
  padding: 18px 22px;
  overflow-y: auto;
}
.cluster-meta-row {
  display: flex; gap: 12px;
  padding: 6px 0;
  font-size: 12.5px;
  border-bottom: 1px solid #f1f5f9;
}
.cluster-meta-row:last-of-type { border-bottom: 0; }
.cluster-meta-row .lbl { color: #64748b; min-width: 110px; flex-shrink: 0; }
.cluster-meta-row .val { color: #1e293b; font-weight: 600; }
.cluster-meta-row .muted { color: #94a3b8; font-weight: 400; }
.cluster-section-h {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
  color: #64748b; margin: 18px 0 8px; font-weight: 600; font-family: inherit;
}
.cluster-txn-table {
  width: 100%; border-collapse: collapse; font-size: 12px; font-family: inherit;
}
.cluster-txn-table thead th {
  text-align: left; padding: 6px 8px; font-weight: 600; color: #64748b;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.4px;
  background: #f1f5f9; border-bottom: 1px solid #e2e8f0;
}
.cluster-txn-table thead th.num { text-align: right; }
.cluster-txn-table tbody td {
  padding: 7px 8px; border-bottom: 1px solid #f1f5f9; color: #1e293b;
}
.cluster-txn-table tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
.cluster-txn-table tbody td.cat { color: #94a3b8; font-size: 11px; }
.cluster-txn-table tbody td.action { text-align: right; padding-right: 4px; }
.cluster-detach-btn {
  background: #fff; border: 1px solid #cbd5e1; color: #64748b;
  padding: 3px 9px; font-size: 10.5px; border-radius: 5px; cursor: pointer;
  font-family: inherit;
}
.cluster-detach-btn:hover { background: #fef2f2; border-color: #fca5a5; color: #b91c1c; }
.cluster-verdict-card {
  border-radius: 8px; padding: 16px 18px;
  border: 1px solid; line-height: 1.6;
}
.cluster-verdict-pattern {
  background: linear-gradient(135deg, #f0f9ff, #ecfeff);
  border-color: #67e8f9;
}
.cluster-verdict-individual {
  background: #fffbeb; border-color: #fde68a;
}
.cluster-verdict-nr {
  background: #f8fafc; border-color: #cbd5e1;
}
.cluster-verdict-label {
  font-size: 14px; font-weight: 700; color: #0c4a6e; margin-bottom: 4px; font-family: inherit;
}
.cluster-verdict-individual .cluster-verdict-label { color: #92400e; }
.cluster-verdict-nr .cluster-verdict-label { color: #475569; }
.cluster-verdict-doc {
  display: inline-block; margin-bottom: 10px;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(14, 165, 233, 0.12); color: #0369a1;
  font-size: 11px; font-weight: 600; font-family: inherit;
}
.cluster-verdict-individual .cluster-verdict-doc { background: rgba(245, 158, 11, 0.15); color: #92400e; }
.cluster-verdict-reason {
  margin: 8px 0 10px; font-size: 13px; color: #1e293b; font-family: inherit;
}
.cluster-verdict-meta {
  font-size: 11px; color: #64748b; padding-top: 10px;
  border-top: 1px dashed #cbd5e1; font-family: inherit;
}
/* D-129 (BUG-G7P-006) · re-evaluation states */
.cluster-verdict-refreshing {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #b45309; font-family: inherit;
  margin-bottom: 8px; padding: 6px 10px;
  background: #fffbeb; border: 1px solid #fcd34d; border-radius: 6px;
}
.cluster-verdict-spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid #fcd34d; border-top-color: #b45309;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.cluster-verdict-reevaluated {
  display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600;
  color: #047857; padding: 3px 8px;
  background: #ecfdf5; border: 1px solid #6ee7b7; border-radius: 999px;
  margin-bottom: 8px; font-family: inherit;
}
/* BUG-VERDICT-NO-INLINE-PREVIEW-001 fix (D-145) · inline preview button beside verdict */
.cluster-verdict-preview-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 3px 9px; background: #fff; color: #0c4a6e; border: 1px solid #bae6fd; border-radius: 6px; cursor: pointer; font-family: inherit; font-weight: 600; }
.cluster-verdict-preview-btn:hover { background: #f0f9ff; border-color: #0ea5e9; }
.cluster-verdict-mismatch-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.cluster-verdict-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cluster-verdict-label-actions { flex-shrink: 0; }
/* BUG-UX-001 S3 (D-134) · attached-doc-doesn't-fit guidance card */
.cluster-verdict-card.cluster-verdict-mismatch-card {
  background: #fffbeb; border-color: #fcd34d;
}
.cluster-verdict-mismatch { font-family: inherit; }
.cluster-verdict-mismatch-h {
  display: flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600; color: #b45309; margin-bottom: 6px;
}
.cluster-verdict-mismatch-p {
  font-size: 12px; color: #92400e; line-height: 1.5; margin-bottom: 10px;
}
.cluster-verdict-detach-btn {
  background: #fff; border: 1px solid #fcd34d; color: #b45309;
}
.cluster-verdict-detach-btn:hover { background: #fef3c7; border-color: #f59e0b; }
.cluster-modal-foot {
  display: flex; gap: 10px; align-items: center;
  padding: 14px 22px;
  border-top: 1px solid #e2e8f0;
  background: #fafbfc;
  border-radius: 0 0 12px 12px;
}
/* LM-G7-M Sub-A · Attach doc area inside cluster modal */
.cluster-attach-area { margin-top: 14px; }
.cluster-attach-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 14px;
  background: #f0f9ff; border: 1px dashed #67e8f9; color: #0c4a6e;
  font-family: inherit; font-size: 13px; font-weight: 600;
  border-radius: 8px; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.cluster-attach-btn:hover { background: #e0f2fe; border-color: #0ea5e9; border-style: solid; }
.cluster-attach-icon { font-size: 16px; }
.cluster-attach-hint {
  margin: 8px 2px 0; font-size: 11.5px; color: #64748b; line-height: 1.5; font-family: inherit;
}
.cluster-attach-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 8px;
}
.cluster-attach-row.attached { border-color: #34d399; background: #f0fdf4; }
.cluster-attach-row.uploading { border-color: #fde68a; background: #fffbeb; }
.cluster-attach-info { flex: 1; min-width: 0; }
.cluster-attach-name {
  font-size: 13px; font-weight: 600; color: #1e293b; font-family: inherit;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cluster-attach-meta { font-size: 11px; color: #94a3b8; margin-top: 2px; font-family: inherit; }
.cluster-attach-actions { display: flex; gap: 6px; flex-shrink: 0; }
/* D-126 LM-G7-Q Sub-3 · cluster category override + AI re-suggest */
.cluster-cat-area { margin-top: 6px; }
.cluster-cat-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 8px;
}
.cluster-cat-label { font-size: 12px; color: #64748b; font-weight: 600; min-width: 70px; }
.cluster-cat-select {
  flex: 1;
  padding: 6px 10px;
  font-family: inherit; font-size: 13px; color: #1e293b;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 6px;
  cursor: pointer;
}
.cluster-cat-select:focus { outline: none; border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,.15); }
.cluster-cat-ai {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #ecfeff 0%, #f0f9ff 100%);
  border: 1px solid #67e8f9; border-radius: 8px;
}
.cluster-cat-ai-icon { font-size: 18px; line-height: 1; flex-shrink: 0; }
.cluster-cat-ai-body { flex: 1; min-width: 0; }
.cluster-cat-ai-title { font-size: 13px; font-weight: 600; color: #0e7490; margin-bottom: 4px; }
.cluster-cat-ai-reason { font-size: 12px; color: #475569; line-height: 1.5; margin-bottom: 8px; }
.cluster-cat-ai-apply {
  font-family: inherit; font-size: 12px; font-weight: 600;
  padding: 6px 14px;
  background: #0ea5e9; color: #fff;
  border: 1px solid #0284c7; border-radius: 6px;
  cursor: pointer;
}
.cluster-cat-ai-apply:hover { background: #0284c7; }
.cluster-cat-saved {
  font-size: 11.5px; color: #047857; margin: 8px 0 0; font-family: inherit;
  padding: 6px 10px; background: #f0fdf4; border-left: 3px solid #34d399; border-radius: 0 4px 4px 0;
}
/* LM-G7-R (D-127) · proactive doc match panel inside cluster modal */
.cluster-match-area { margin: 14px 0 6px; }
.cluster-match-panel {
  padding: 12px 14px;
  background: linear-gradient(135deg, #ecfeff 0%, #f0f9ff 100%);
  border: 1px solid #67e8f9; border-radius: 10px;
}
.cluster-match-h {
  font-size: 13px; font-weight: 600; color: #0e7490; margin: 0 0 10px; font-family: inherit;
}
.cluster-match-list { display: flex; flex-direction: column; gap: 8px; }
.cluster-match-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
}
.cluster-match-row.cluster-match-greyed {
  opacity: .55; background: #f8fafc;
}
.cluster-match-tier { font-size: 16px; line-height: 1; flex-shrink: 0; }
.cluster-match-name {
  flex: 1; min-width: 0;
  font-size: 12.5px; font-weight: 500; color: #1e293b;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: inherit;
}
.cluster-match-preview-btn {
  flex-shrink: 0;
  width: 28px; height: 28px; padding: 0;
  background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 6px;
  font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.cluster-match-preview-btn:hover { background: #e0f2fe; border-color: #0ea5e9; }
.cluster-match-attach-btn {
  flex-shrink: 0;
  font-size: 12px; padding: 5px 12px; font-family: inherit;
}
.cluster-match-more {
  margin-top: 8px;
  font-size: 11.5px; color: #64748b;
}
.cluster-match-more summary {
  cursor: pointer; padding: 4px 0;
  font-family: inherit;
}
.cluster-match-more summary:hover { color: #0e7490; }
.cluster-match-more .cluster-match-list { margin-top: 8px; }

/* BUG-G7P-003 (D-127) · beefed-up Preview button on attached doc */
.cluster-preview-btn {
  font-size: 12.5px; padding: 6px 14px; font-family: inherit;
  background: #f0f9ff; color: #0c4a6e; border: 1px solid #7dd3fc;
}
.cluster-preview-btn:hover { background: #e0f2fe; border-color: #0ea5e9; }

/* LM-G7-R (D-127) · M3 batch toast (top-right notification) */
.cluster-match-toast {
  position: fixed; top: 16px; right: 16px; z-index: 6000;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: #fff; border: 1px solid #67e8f9; border-radius: 10px;
  box-shadow: 0 10px 25px rgba(15,23,42,.15);
  min-width: 360px; max-width: 480px;
  font-family: inherit; font-size: 13px;
  opacity: 0; transform: translateY(-12px);
  transition: opacity .2s ease, transform .2s ease;
}
.cluster-match-toast.show { opacity: 1; transform: translateY(0); }
.cluster-match-toast-icon { font-size: 18px; line-height: 1; flex-shrink: 0; }
.cluster-match-toast-text { flex: 1; color: #0f172a; line-height: 1.4; }
.cluster-match-toast-btn { flex-shrink: 0; padding: 5px 12px; font-size: 12px; }
.cluster-match-toast-close {
  flex-shrink: 0; background: transparent; border: 0; color: #94a3b8;
  font-size: 18px; line-height: 1; cursor: pointer; padding: 4px 6px; font-family: inherit;
}
.cluster-match-toast-close:hover { color: #1e293b; }

/* LM-G7-V (D-132) · pick-from-library overlay (layered above cluster modal) */
.cluster-attach-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.cluster-pick-btn { background: #f8fafc; }
.cluster-docpicker-overlay { z-index: var(--z-cluster-layered); }   /* BUG-UPLOAD-DUP-STUCK-001 fix · was 5300 · layered picker above modal */
.cluster-docpicker-modal {
  max-width: 600px; padding: 0; border-radius: 12px; background: #fff; font-family: inherit;
}
.cluster-docpicker-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #e2e8f0;
}
.cluster-docpicker-head h3 { margin: 0; font-size: 16px; font-weight: 600; color: #0f172a; font-family: inherit; }
.cluster-docpicker-body {
  padding: 12px 20px; max-height: 56vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
}
.cluster-docpicker-empty { padding: 24px; text-align: center; color: #64748b; font-size: 13px; line-height: 1.8; }
.cluster-docpicker-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
}
.cluster-docpicker-row.cluster-docpicker-greyed { opacity: .55; background: #f1f5f9; }
.cluster-docpicker-icon { font-size: 16px; line-height: 1; flex-shrink: 0; }
.cluster-docpicker-info { flex: 1; min-width: 0; }
.cluster-docpicker-name {
  font-size: 13px; font-weight: 600; color: #1e293b; font-family: inherit;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cluster-docpicker-type { font-size: 11px; color: #64748b; margin-top: 2px; font-family: inherit; }
.cluster-docpicker-attach { flex-shrink: 0; font-size: 12px; padding: 5px 12px; }
.cluster-docpicker-foot {
  display: flex; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid #e2e8f0;
}

/* LM-G7-R (D-127) · M3 mini-list overlay */
.cluster-match-mini-modal {
  max-width: 640px;
  padding: 0;
  border-radius: 12px;
  font-family: inherit;
  background: #fff;
}
.cluster-match-mini-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}
.cluster-match-mini-head h3 {
  margin: 0; font-size: 16px; font-weight: 600; color: #0f172a; font-family: inherit;
}
.cluster-match-mini-body {
  padding: 12px 20px;
  max-height: 60vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
}
.cluster-match-mini-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
}
.cluster-match-mini-info { flex: 1; min-width: 0; }
.cluster-match-mini-doc {
  font-size: 13px; font-weight: 600; color: #1e293b;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: inherit;
}
.cluster-match-mini-cluster {
  font-size: 11.5px; color: #64748b; margin-top: 2px; font-family: inherit;
}
.cluster-match-mini-foot {
  display: flex; justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid #e2e8f0;
}
/* D-123 LM-G7-N · Disagree sub-overlay (Upload your own / Skip) */
.cluster-disagree-modal {
  max-width: 480px;
  padding: 22px 26px;
  border-radius: 12px;
  font-family: inherit;
}
.cluster-disagree-h {
  margin: 0 0 6px; font-size: 16px; font-weight: 600; color: #0f172a; font-family: inherit;
}
.cluster-disagree-lead {
  margin: 0 0 16px; font-size: 12.5px; color: #64748b; font-family: inherit;
}
.cluster-disagree-cards {
  display: grid; gap: 12px; grid-template-columns: 1fr;
}
.cluster-disagree-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px; text-align: left;
  background: #fff; border: 1.5px solid #cbd5e1; border-radius: 10px;
  cursor: pointer; font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.cluster-disagree-card:hover {
  border-color: #0ea5e9; background: #f0f9ff;
  transform: translateY(-1px);
}
.cluster-disagree-icon {
  font-size: 22px; line-height: 1;
}
.cluster-disagree-card-title {
  font-size: 13.5px; font-weight: 600; color: #0f172a; margin-top: 4px;
}
.cluster-disagree-card-hint {
  font-size: 11.5px; color: #64748b; line-height: 1.4;
}
.cluster-disagree-skip:hover { border-color: #94a3b8; background: #f1f5f9; }

/* BUG-G7P-001 (D-126) · GL category expand pager */
.gl-pager {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: #fafbfc; border-top: 1px solid #e2e8f0;
  font-family: inherit; font-size: 12px;
}
.gl-pager-btn {
  padding: 5px 12px; font-size: 11.5px; font-weight: 600;
  background: #0ea5e9; color: #fff; border: 0; border-radius: 6px;
  cursor: pointer; font-family: inherit;
}
.gl-pager-btn:hover { background: #0284c7; }
.gl-pager-btn-ghost {
  background: transparent; color: #0369a1; border: 1px solid #bae6fd;
}
.gl-pager-btn-ghost:hover { background: #f0f9ff; }
.gl-pager-meta { color: #64748b; font-variant-numeric: tabular-nums; flex: 1; }

/* G1.6.2 F3.B · Duplicate detection modal (period+bank match prompt) */
.dup-modal-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal-interactive);
  background: rgba(15, 23, 42, .55);
  display: grid; place-items: center;
  backdrop-filter: blur(2px);
  animation: dupOverlayIn .12s ease-out;
}
@keyframes dupOverlayIn { from { opacity: 0 } to { opacity: 1 } }
.dup-modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px 30px 24px;
  max-width: 480px; width: calc(100vw - 40px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, .35);
  animation: dupModalIn .18s cubic-bezier(.4, 0, .2, 1);
}
@keyframes dupModalIn { from { transform: translateY(8px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
.dup-modal-h {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 700; color: var(--slate-900);
  margin-bottom: 8px;
  letter-spacing: -.2px;
}
.dup-modal-h svg { width: 22px; height: 22px; color: var(--amber-500); stroke-width: 2.2; }
.dup-modal-p { font-size: 13.5px; color: var(--slate-600); margin-bottom: 14px; line-height: 1.55; }
.dup-modal-p b { color: var(--slate-900); }
.dup-list {
  list-style: none; margin: 0; padding: 12px 14px;
  background: var(--slate-50); border: 1px solid var(--slate-200); border-radius: 10px;
  margin-bottom: 18px;
  font-size: 12.5px;
}
.dup-list li { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.dup-list li + li { border-top: 1px solid var(--slate-100); }
.dup-list .bk { font-weight: 700; color: var(--slate-800); min-width: 70px; }
.dup-list .pd { font-family: 'SF Mono', monospace; color: var(--sky-700); }
.dup-list .meta { margin-left: auto; color: var(--slate-500); font-size: 11.5px; }
.dup-modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  flex-wrap: wrap;
}
.dup-btn {
  padding: 9px 16px;
  font-size: 13px; font-weight: 600;
  border-radius: 8px; border: 1px solid var(--slate-200);
  background: #fff; color: var(--slate-700);
  cursor: pointer;
  font-family: inherit;
  transition: background .12s, border-color .12s, transform .08s;
}
.dup-btn:hover { background: var(--slate-50); border-color: var(--slate-300); }
.dup-btn:active { transform: translateY(1px); }
.dup-btn-cancel { color: var(--slate-500); }
.dup-btn-keep { color: var(--sky-700); border-color: var(--sky-200, #bae6fd); }
.dup-btn-keep:hover { background: var(--sky-50); }
.dup-btn-replace {
  background: linear-gradient(135deg, var(--rose-500), var(--rose-700));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(244, 63, 94, .28);
}
.dup-btn-replace:hover { filter: brightness(1.05); }

/* Empty / error */
.ws-empty { display: grid; place-items: center; padding: 56px 24px; color: var(--slate-500); text-align: center; }
/* G1.6.1 F4.B · per-stage empty state — icon + h + p + CTA */
.ws-empty .ws-empty-ic {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--sky-50), var(--slate-50));
  border: 1px solid var(--sky-100);
  color: var(--sky-600);
  display: grid; place-items: center;
  margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(14, 165, 233, .08);
}
.ws-empty .ws-empty-ic svg { width: 32px; height: 32px; stroke-width: 1.6; }
.ws-empty h2 { font-size: 19px; font-weight: 700; color: var(--slate-900); letter-spacing: -.3px; margin-bottom: 8px; }
.ws-empty p { font-size: 13.5px; color: var(--slate-500); max-width: 480px; line-height: 1.6; margin: 0; }
.ws-error { max-width: 420px; margin: 64px auto; padding: 24px; background: var(--rose-50); border: 1px solid var(--rose-100); border-radius: 12px; text-align: center; color: var(--rose-700); }

/* Responsive */
@media (max-width: 980px) {
  body.ws { grid-template-columns: 200px 1fr; }
  .upload-grid { grid-template-columns: 1fr; }
  .graph-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  body.ws { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { max-height: 300px; }
}

/* ============================================================
   V42.B · Documents Panel (#16+#12 hybrid · floating bottom-left)
   ============================================================ */

/* Trigger pill — always visible at bottom-left */
.dp-trigger {
  position: fixed;
  bottom: 14px; left: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .12), 0 0 0 1px rgba(15, 23, 42, .03);
  cursor: pointer;
  font: 600 11.5px/1 'Inter', system-ui, sans-serif;
  color: var(--slate-700);
  z-index: 90;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.dp-trigger:hover {
  transform: translateY(-2px);
  border-color: var(--sky-500);
  box-shadow: 0 10px 26px rgba(14, 165, 233, .2);
}
.dp-trigger-dots { display: inline-flex; gap: 3px; }
.dp-trigger-dots i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dp-trigger-l { letter-spacing: .1px; }
.dp-trigger-c {
  background: var(--slate-100); color: var(--slate-700);
  padding: 1px 7px; border-radius: 6px;
  font-size: 10.5px; font-variant-numeric: tabular-nums; font-weight: 700;
}
.dp-trigger-warn {
  background: var(--violet-500, #8b5cf6); color: #fff;
  padding: 1px 6px; border-radius: 9px;
  font-size: 9.5px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  animation: dp-warn-pulse 2.4s ease-in-out infinite;
}
@keyframes dp-warn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, .55); }
  50%      { box-shadow: 0 0 0 6px rgba(139, 92, 246, 0); }
}

/* V42.C-1.1 F1+F2 · panel width via CSS var · default 400px · maximized 720px */
:root {
  --dp-panel-width: 400px;
  --dp-panel-width-max: 720px;
}
body.dp-maximized {
  --dp-panel-width: var(--dp-panel-width-max);
}

/* Panel — floating mini panel, slides up from bottom-left */
.dp-panel {
  position: fixed;
  bottom: 56px; left: 14px;
  width: var(--dp-panel-width); height: 460px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .18), 0 0 0 1px rgba(15, 23, 42, .03);
  display: flex; flex-direction: column;
  overflow: hidden;
  z-index: 91;
  opacity: 0;
  transform: translateY(12px) scale(.97);
  transform-origin: bottom left;
  transition: opacity .18s ease-out,
              transform .18s cubic-bezier(.2,.9,.4,1),
              width .25s cubic-bezier(.2,.9,.4,1);
}
.dp-panel.open { opacity: 1; transform: translateY(0) scale(1); }

/* F2 · Maximize button — sits between header content and X close */
.dp-h-maximize {
  width: 26px; height: 26px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--slate-400);
  cursor: pointer;
  display: grid; place-items: center;
  margin-right: 4px;
  transition: background .12s, color .12s, transform .15s;
}
.dp-h-maximize:hover { background: var(--slate-100); color: var(--slate-700); }
.dp-h-maximize svg { width: 14px; height: 14px; transition: transform .2s; }
body.dp-maximized .dp-h-maximize svg { transform: rotate(180deg); }

/* When maximized, polaroid grid auto-adapts (more columns since panel wider) */
body.dp-maximized .dp-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }

/* Panel header */
.dp-h {
  display: flex; align-items: center;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--slate-100);
}
.dp-h-l { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.dp-h-icon {
  display: inline-grid; grid-template-columns: 1fr 1fr; gap: 2px;
  width: 22px; height: 22px;
  padding: 2px; background: var(--slate-50); border-radius: 6px;
}
.dp-h-icon i { border-radius: 2px; }
.dp-h-title { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--slate-800); letter-spacing: -.1px; }
.dp-h-count {
  background: var(--slate-100); color: var(--slate-600);
  padding: 1px 8px; border-radius: 8px;
  font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
/* V42.C-1.1 F1 · count moved inline into title to free header right side for upload button */
.dp-h-title-c {
  background: var(--slate-100); color: var(--slate-600);
  padding: 1px 7px; border-radius: 6px;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  margin-left: 4px;
  vertical-align: middle;
}
/* V42.C-1.1 F6 · upload icon button replaces drop zone as primary action */
.dp-h-upload {
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: 8px;
  padding: 5px 11px;
  background: linear-gradient(135deg, var(--sky-500), var(--indigo-500));
  color: #fff;
  border: 0;
  border-radius: 7px;
  font-size: 11px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(14, 165, 233, .25);
  transition: transform .12s, box-shadow .12s;
}
.dp-h-upload:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(14, 165, 233, .35); }
.dp-h-upload svg { color: #fff; }

/* BUG-G7G-002b (D-117 follow-up) · .dp-h-match dead CSS removed · button render eliminated D-117 */

/* V42.D · Polaroid matched / unmatched badges (sit at bottom of card under tag) */
.dp-pol-matched, .dp-pol-unmatched {
  display: inline-block;
  margin-top: 3px;
  padding: 1.5px 6px;
  border-radius: 4px;
  font-size: 8px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .3px;
}
.dp-pol-matched {
  background: var(--emerald-100, #d1fae5);
  color: var(--emerald-700, #047857);
}
.dp-pol-unmatched {
  background: transparent;
  color: var(--slate-400);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  font-style: italic;
}
.dp-pol.matched .dp-pol-photo {
  box-shadow: 0 0 0 2px var(--emerald-500, #10b981);
}
.dp-h-x {
  width: 26px; height: 26px;
  background: transparent; border: 0;
  border-radius: 6px;
  font-size: 18px; line-height: 1;
  color: var(--slate-400);
  cursor: pointer;
  display: grid; place-items: center;
  margin-left: auto;
}
.dp-h-x:hover { background: var(--slate-100); color: var(--slate-700); }

/* Tab strip — Review tab pinned right, others compact */
.dp-tabs {
  display: flex; gap: 1px;
  padding: 8px 8px 0;
  border-bottom: 1px solid var(--slate-100);
}
.dp-tab {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 7px;
  background: transparent; border: 0;
  border-radius: 6px 6px 0 0;
  font-size: 10.5px; font-weight: 600;
  color: var(--slate-500);
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  border-bottom: 0;
  margin-bottom: -1px;
  transition: background .12s, color .12s;
  flex: 0 1 auto;
}
/* Pin the Review (warn) tab to the right edge so it's always visible */
.dp-tab.warn { margin-left: auto; }
.dp-tab:hover { color: var(--slate-700); background: var(--slate-50); }
.dp-tab.act {
  background: var(--white);
  color: var(--slate-800);
  border-color: var(--slate-100);
  box-shadow: 0 1px 0 0 var(--white);
}
.dp-tab.warn {
  color: var(--violet-700);
}
.dp-tab.warn.act {
  background: linear-gradient(180deg, #fff, #faf5ff);
  border-color: var(--violet-500);
}
.dp-tab-c {
  background: var(--slate-100); color: var(--slate-600);
  padding: 0 6px; border-radius: 5px;
  font-size: 9.5px; font-variant-numeric: tabular-nums; font-weight: 700;
}
.dp-tab.act .dp-tab-c { background: var(--sky-100); color: var(--sky-700); }
.dp-tab.warn .dp-tab-c { background: var(--violet-100); color: var(--violet-700); }
.dp-tab.warn.act .dp-tab-c { background: var(--violet-500); color: #fff; }

/* V42.C-1.1 F4 · search input takes drop zone position (drop zone removed — uploads via header button → Stage 1) */
.dp-search {
  display: flex; align-items: center; gap: 6px;
  margin: 8px 14px 8px 10px;
  padding: 7px 11px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  transition: border-color .12s, background .12s;
}
.dp-search:focus-within {
  border-color: var(--sky-500);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .12);
}
.dp-search-ic { color: var(--slate-400); flex-shrink: 0; }
.dp-search input {
  flex: 1; min-width: 0;
  border: 0; background: transparent;
  font: 12px 'Inter', system-ui, sans-serif;
  color: var(--slate-800);
  outline: 0;
}
.dp-search input::placeholder { color: var(--slate-400); }
.dp-search input::-webkit-search-cancel-button { display: none; } /* hide native to use our × */
.dp-search-clear {
  border: 0; background: transparent;
  color: var(--slate-400);
  cursor: pointer;
  font-size: 16px; line-height: 1;
  padding: 0 3px;
  flex-shrink: 0;
}
.dp-search-clear:hover { color: var(--slate-700); }

/* Polaroid grid — 3 cols (V42.C-1 polish · right padding bumped to clear scrollbar) */
.dp-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 14px 10px 10px;
}
.dp-body::-webkit-scrollbar { width: 6px; }
.dp-body::-webkit-scrollbar-thumb { background: var(--slate-200); border-radius: 3px; }
.dp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.dp-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--slate-400);
  font-size: 11.5px;
  line-height: 1.55;
}

/* Polaroid card */
.dp-pol {
  background: var(--white);
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .08), 0 0 0 1px rgba(15, 23, 42, .04);
  padding: 5px 5px 8px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
  transition: transform .12s, box-shadow .12s;
  position: relative;
}
.dp-pol:hover {
  transform: translateY(-2px) rotate(-.5deg);
  box-shadow: 0 6px 16px rgba(15, 23, 42, .14);
}
.dp-pol.uncat {
  border: 1px dashed var(--violet-500);
  background: linear-gradient(180deg, #faf5ff, #fff);
}
.dp-pol-photo {
  width: 100%; height: 56px;
  border-radius: 3px;
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.dp-pol-letter {
  font-size: 22px; font-weight: 800;
  color: rgba(255, 255, 255, .95);
  text-shadow: 0 2px 6px rgba(0, 0, 0, .2);
  font-family: 'Inter', system-ui;
}
.dp-pol-conf {
  position: absolute; bottom: 3px; right: 4px;
  background: rgba(255, 255, 255, .8);
  color: var(--violet-700);
  font-size: 8.5px; font-weight: 800;
  padding: 1px 5px; border-radius: 4px;
}
.dp-pol-name {
  font-size: 9.5px; font-weight: 600;
  color: var(--slate-700);
  line-height: 1.2;
  word-break: break-all;
  padding: 0 2px;
  min-height: 24px;
}
.dp-tag {
  font-size: 8.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .3px;
  padding: 2px 6px;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  align-self: flex-start;
  font-family: 'Inter', sans-serif;
  transition: filter .12s;
}
.dp-tag:hover { filter: brightness(.95); }
.dp-tag-ai {
  background: transparent;
  color: var(--violet-700);
  border: 1px dashed var(--violet-500);
  animation: dp-ai-pulse 2.6s ease-in-out infinite;
}
@keyframes dp-ai-pulse {
  0%, 100% { background: rgba(139, 92, 246, 0); }
  50%      { background: rgba(139, 92, 246, .08); }
}
.dp-tag-un { background: var(--slate-100); color: var(--slate-500); }

/* V42.C-2 · classifier in-flight state */
.dp-tag-classifying {
  background: linear-gradient(90deg, var(--sky-100, #e0f2fe), var(--violet-100, #ede9fe));
  color: var(--violet-700, #6d28d9);
  font-weight: 700;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 8.5px;
  text-transform: uppercase; letter-spacing: .3px;
}
.dp-tag-retry {
  background: var(--rose-100, #ffe4e6);
  color: var(--rose-700, #be123c);
  border: 1px dashed var(--rose-500, #f43f5e);
}
.dp-tag-retry:hover { background: var(--rose-500, #f43f5e); color: #fff; }

.dp-spinner {
  width: 9px; height: 9px;
  border: 1.5px solid var(--violet-200, #ddd6fe);
  border-top-color: var(--violet-700, #6d28d9);
  border-radius: 50%;
  animation: dp-spin 0.6s linear infinite;
  display: inline-block;
}
.dp-spinner-lg {
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: dp-spin 0.6s linear infinite;
}
@keyframes dp-spin { to { transform: rotate(360deg); } }

.dp-pol-classifying-overlay {
  position: absolute; inset: 0;
  background: rgba(139, 92, 246, .35);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  border-radius: 3px;
  pointer-events: none;
}
.dp-pol.classifying { box-shadow: 0 0 0 2px var(--violet-500, #8b5cf6), 0 4px 12px rgba(139, 92, 246, .25); }

/* V42.B BUG-V42B-04 fix · explicit chevron on confirmed tags + tag-edit dropdown menu */
.dp-tag-edit { display: inline-flex; align-items: center; }

.dp-tag-menu {
  position: fixed;
  width: 200px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .2), 0 0 0 1px rgba(15, 23, 42, .04);
  padding: 6px;
  z-index: 110;
  animation: dp-tag-menu-in .12s ease-out;
}
@keyframes dp-tag-menu-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dp-tag-menu-h {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--slate-400);
  padding: 6px 9px 4px;
}
.dp-tag-menu-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 7px 9px;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px; font-weight: 500;
  color: var(--slate-700);
  text-align: left;
}
.dp-tag-menu-item:hover { background: var(--slate-50); }
.dp-tag-menu-item.cur { background: var(--sky-50); color: var(--sky-700); font-weight: 700; }
.dp-tag-menu-sw {
  width: 22px; height: 22px;
  border-radius: 5px;
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 11px;
  flex-shrink: 0;
}
.dp-tag-menu-l { flex: 1; }
.dp-tag-menu-ck { color: var(--sky-600); font-weight: 800; }

/* V42.C-1 · Toast (per-error feedback during upload pipeline) */
.dp-toast {
  position: fixed;
  bottom: 70px; left: 14px;
  max-width: 360px;
  padding: 11px 16px;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .25);
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  z-index: 120;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s, transform .18s cubic-bezier(.2,.9,.4,1);
}
.dp-toast.show { opacity: 1; transform: translateY(0); }
.dp-toast-success { background: linear-gradient(135deg, var(--emerald-500, #10b981), #059669); }
.dp-toast-error   { background: linear-gradient(135deg, var(--rose-500, #f43f5e), #be123c); }
.dp-toast-info    { background: linear-gradient(135deg, var(--slate-700), var(--slate-800)); }

/* V42.C-1 · Storage-quota-full modal */
.dp-quota-modal {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(4px);
  z-index: 130;
  display: grid; place-items: center;
  animation: dp-fade-in .15s ease-out;
}
@keyframes dp-fade-in { from { opacity: 0; } to { opacity: 1; } }
.dp-quota-card {
  width: 90%; max-width: 380px;
  background: var(--white);
  border-radius: 14px;
  padding: 24px 22px 18px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, .35);
  text-align: center;
  animation: dp-pop-in .2s cubic-bezier(.2,.9,.4,1);
}
@keyframes dp-pop-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
.dp-quota-ic { font-size: 36px; margin-bottom: 8px; }
.dp-quota-card h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; color: var(--slate-800); }
.dp-quota-msg { margin: 0 0 6px; font-size: 12.5px; color: var(--slate-600); font-family: ui-monospace, monospace; }
.dp-quota-help { margin: 0 0 16px; font-size: 11.5px; color: var(--slate-500); line-height: 1.5; }
.dp-quota-actions { display: flex; gap: 8px; justify-content: center; }
.dp-quota-cancel, .dp-quota-up {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  border: 0;
}
.dp-quota-cancel { background: var(--slate-100); color: var(--slate-700); }
.dp-quota-cancel:hover { background: var(--slate-200); }
.dp-quota-up {
  background: linear-gradient(135deg, var(--amber-500, #f59e0b), #f97316);
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, .35);
}
.dp-quota-up:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(245, 158, 11, .45); }

/* Footer — storage bar + upgrade */
.dp-f {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-top: 1px solid var(--slate-100);
  background: linear-gradient(180deg, #fafbfc, #f1f5f9);
}
.dp-f-q { flex: 1; min-width: 0; }
.dp-f-q-text {
  display: block;
  font-size: 9.5px;
  color: var(--slate-500);
  font-variant-numeric: tabular-nums;
  margin-bottom: 3px;
}
.dp-f-bar {
  width: 100%; height: 4px;
  background: var(--slate-200);
  border-radius: 4px;
  overflow: hidden;
}
.dp-f-bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--sky-500), var(--amber-500));
  border-radius: 4px;
  transition: width .25s;
}
.dp-f-up {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px;
  background: linear-gradient(135deg, var(--amber-500), #f97316);
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-size: 10px; font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(245, 158, 11, .35);
  transition: transform .12s, box-shadow .12s;
}
.dp-f-up:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, .45);
}

/* Responsive — narrower screens get a slightly smaller panel */
@media (max-width: 600px) {
  .dp-panel { width: calc(100vw - 28px); height: 70vh; }
  .dp-trigger-l { display: none; }
}

/* ============================================================
   V42.A · Phase 1 MVP — Tools sidebar collapse (kept; overlay removed)
   ============================================================ */

/* W1 · Sidebar collapse — single-column icon-only mode (56px) */
body.ws.sb-collapsed {
  grid-template-columns: 56px 1fr;
}
body.ws.sb-collapsed .sidebar { padding: 0; }
body.ws.sb-collapsed .sb-brand { padding: 12px 8px 10px; gap: 0; }
body.ws.sb-collapsed .sb-brand .nm { display: none; }
body.ws.sb-collapsed .sb-brand .sb-logo { width: 32px; height: 32px; }
body.ws.sb-collapsed .sb-tools { grid-template-columns: 1fr; gap: 4px; padding: 8px 6px; }
body.ws.sb-collapsed .sb-tool { padding: 8px 4px; gap: 0; }
body.ws.sb-collapsed .sb-tool-lbl { display: none; }
body.ws.sb-collapsed .sb-tool-ic { width: 32px; height: 32px; border-radius: 7px; }
body.ws.sb-collapsed .sb-tool-ic svg { width: 16px; height: 16px; }
body.ws.sb-collapsed .sb-stmt-head,
body.ws.sb-collapsed .sb-stmt-list { display: none; }

/* V42.B BUG-V42B-03 fix · Collapse btn at sidebar BOTTOM (not top — was blocking the brand logo).
   Expanded mode: bottom-right of sidebar (clear of viewport-bottom-left Documents pill).
   Collapsed mode: lifted up to bottom:84px so it clears Documents pill (pill at viewport
   y ~670–706 in 720px capture), centered horizontally in the 56px sidebar. */
.sb-collapse-btn {
  position: absolute; bottom: 14px; right: 8px;
  width: 26px; height: 26px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 7px;
  color: var(--slate-400);
  cursor: pointer;
  display: grid; place-items: center;
  transition: all .15s;
  z-index: 5;
}
.sb-collapse-btn:hover { color: var(--sky-500); border-color: var(--sky-500); box-shadow: 0 4px 10px rgba(14,165,233,.15); }
.sb-collapse-btn svg { width: 13px; height: 13px; transition: transform .2s; }
body.ws.sb-collapsed .sb-collapse-btn svg { transform: rotate(180deg); }
body.ws.sb-collapsed .sb-collapse-btn {
  bottom: 84px;
  right: 50%;
  transform: translateX(50%);
}
.sidebar { position: relative; }

/* ═══════════════════════════════════════════════════════════════════
   V42.G G1.3 · Year × Month hierarchical navigation (atoms B1-B5)
   Year tabs at top of main pane · month rail vertical 60px on left.
   Ported from V42G-Stage-Gallery v10 demo (founder-picked V05 layout).
   ═══════════════════════════════════════════════════════════════════ */

/* V42.G G1.6 D-048 · Year tab strip · proper tab-shape design (tuned via V42G-Bar-Interactive-Tuner.html, founder 2026-05-08) */
.ym-nav {
  display: flex;
  gap: 4px;
  padding: 6px 16px 0;
  border-bottom: 1px solid var(--slate-200);
  background: var(--slate-50);
  align-items: flex-end;
  min-height: 48px;
  overflow-x: auto;
  flex-wrap: nowrap;
}
.ym-tab {
  position: relative;
  padding: 12.5px 18px;
  font-size: 17.5px;
  font-weight: 500;
  color: var(--slate-500);
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: 0;
  border-top-left-radius: 13px;
  border-top-right-radius: 13px;
  background: transparent;
  margin-bottom: -1px;
  transition: color .15s, background .15s;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ym-tab:hover { color: var(--sky-700); background: rgba(255, 255, 255, .6); }
.ym-tab.active {
  color: var(--sky-700);
  background: #fff;
  border-color: var(--slate-200);
  font-weight: 600;
  z-index: 1;
}
.ym-tab.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 11px;
  right: 11px;
  height: 3.5px;
  background: linear-gradient(90deg, var(--sky-500), var(--indigo-500));
  border-radius: 0 0 3.5px 3.5px;
}
.ym-tab .badge {
  font-size: 9.5px; padding: 1px 6px; border-radius: 999px;
  background: var(--rose-100); color: var(--rose-700); font-weight: 700;
}
.ym-tab.active .badge { background: var(--rose-500); color: #fff; }
.ym-tab .badge.ok { background: var(--emerald-100); color: var(--emerald-700); }
.ym-tab.active .badge.ok { background: var(--emerald-500); color: #fff; }
/* V42.G G1.5 atom F · gap badge (overrides review/ok when year has missing months) */
.ym-tab .badge.gap { background: var(--amber-100); color: var(--amber-700); }
.ym-tab.active .badge.gap { background: var(--amber-500); color: #fff; }
.ym-tab.empty { color: var(--slate-400); font-style: italic; }

/* ym-frame · row 3 grid: month-rail (76px tuned) + stage-host (rest) */
.ym-frame {
  display: grid;
  grid-template-columns: 76px 1fr;
  overflow: hidden;
  min-height: 0; /* allow inner scroll */
}

.month-rail {
  background: var(--slate-50);
  border-right: 1px solid var(--slate-200);
  padding: 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  align-items: center;
  overflow-y: auto;
}
.month-rail.empty {
  opacity: 0.55;
  pointer-events: none;
}

/* Mini-gauge · circular progress indicator per month (D-048 tuned) */
.mini-gauge {
  width: 42px; height: 42px;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  border: 0; padding: 0; background: transparent;
  transition: width .25s, height .25s;
}
.mini-gauge::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--emerald-500) 0 var(--p, 88%), var(--slate-200) var(--p, 88%) 100%);
  transition: background .35s;
}
.mini-gauge::after {
  content: '';
  position: absolute; inset: 3px;
  background: #fff;
  border-radius: 50%;
}
.mini-gauge.warn::before {
  background: conic-gradient(var(--amber-500) 0 var(--p, 70%), var(--slate-200) var(--p, 70%) 100%);
}
.mini-gauge.review::before {
  background: conic-gradient(var(--rose-500) 0 var(--p, 50%), var(--slate-200) var(--p, 50%) 100%);
}
.mini-gauge.empty::before { background: var(--slate-200); }
.mini-gauge.empty::after { background: var(--slate-50); border: 2px dashed var(--slate-300); inset: 2px; }
/* V42.G G1.5 atom F · period gap visual · amber pulse + ! indicator */
.mini-gauge.gap {
  animation: ym-gap-pulse 1.6s ease-in-out infinite;
  border-radius: 50%;
}
.mini-gauge.gap::before { background: var(--slate-100); }
.mini-gauge.gap::after { background: var(--amber-50); border: 2px solid var(--amber-500); inset: 2px; }
.mini-gauge.gap .v { color: var(--amber-700); font-size: 11px; }
@keyframes ym-gap-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .45); }
  50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}
.mini-gauge.processing::before {
  background: conic-gradient(var(--sky-500) 0 var(--p, 33%), var(--slate-200) var(--p, 33%) 100%);
  animation: ym-spin 2s linear infinite;
}
@keyframes ym-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.mini-gauge .v {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  color: var(--slate-900); z-index: 1;
  font-family: inherit;
}
.mini-gauge.empty .v { color: var(--slate-400); }
.mini-gauge.active {
  width: 38px; height: 38px;
  box-shadow: 0 0 0 2px var(--sky-500), 0 0 12px rgba(14, 165, 233, .25);
  border-radius: 50%;
}
.mini-gauge.active .v { color: var(--sky-700); }

/* D-048 (founder 2026-05-08): multi-bank stack (.mb-block / .mb-bank-tag / .mb-bank-row) removed.
 * Multiple stmts in same (year, month) now render as sequential gauges in the rail,
 * no sky-tinted wrapper, no "2BK" label, no bank tags — gauge title attr conveys bank+period. */

/* Empty / no-stmts state */
.ym-nav.empty .ym-tab.empty { padding: 12.5px 18px; }
.month-rail.empty .mini-gauge.empty { cursor: default; }

/* BUG-G7M-001 (D-123) · Path B · ym-nav default-hide · only Sheet + Review show month picker.
 * Founder rationale: Stats / Report aggregate at FY level by default. Settings has no use
 * for month picker. Sheet + Review still need it for per-statement drill-down.
 * Replaces D-047 inverse rule (only hide upload) which leaked picker into 4 wrong stages. */
.ym-nav, .month-rail { display: none; }
.main[data-stage="sheet"] .ym-nav,
.main[data-stage="sheet"] .month-rail,
.main[data-stage="review"] .ym-nav,
.main[data-stage="review"] .month-rail {
  display: block;
}
.main[data-stage="sheet"] .month-rail,
.main[data-stage="review"] .month-rail {
  display: flex;
}
/* When month-rail hidden, full-width stage-host */
.main:not([data-stage="sheet"]):not([data-stage="review"]) .ym-frame {
  grid-template-columns: 1fr;
}


/* ─────────────── LM-G2.1 A3 · Upload Dock (floating, always-mounted) ─────────────── */
.udk-root {
  position: fixed;
  bottom: 140px;            /* above byte-fab (90px tall + 32px gap + 18px clearance) */
  right: 24px;
  width: 340px;
  max-height: 60vh;
  z-index: 9990;            /* below byte-fab (9999), above modals would block — modals at 5000 take precedence visually */
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .12), 0 2px 8px rgba(15, 23, 42, .06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateY(20px) scale(.96);
  transition: opacity .22s ease-out, transform .22s ease-out;
}
.udk-root.visible {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
}
.udk-root.collapsed { max-height: 56px; }
.udk-root.collapsed .udk-list { display: none; }

.udk-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--slate-100);
  background: linear-gradient(135deg, #f0f9ff, #fff);
  flex-shrink: 0;
}
.udk-h-row1 { display: flex; align-items: center; gap: 10px; }
.udk-h-title { font-weight: 700; font-size: 13px; color: var(--slate-800); flex: 1; }
.udk-h-count { font-size: 12px; color: var(--slate-500); font-variant-numeric: tabular-nums; }
.udk-h-row2 { display: flex; align-items: center; gap: 10px; margin-top: 4px; min-height: 16px; }
.udk-h-summary { font-size: 11px; color: var(--slate-500); flex: 1; }
.udk-h-batch-actions { display: flex; gap: 8px; }

.udk-list {
  list-style: none;
  padding: 4px 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}
.udk-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--slate-100);
}
.udk-row:last-child { border-bottom: none; }
.udk-row.state-cancelled { opacity: .55; }
.udk-row.state-cancelled .udk-bar-fill { background: var(--slate-300); }
.udk-row.state-failed { background: var(--rose-50); }
.udk-row.state-failed .udk-bar-fill { background: var(--rose-500); }
.udk-row.state-done .udk-bar-fill { background: var(--emerald-500); }
.udk-row.state-paused .udk-bar-fill { background: var(--amber-500); }

.udk-line1 { display: flex; align-items: center; gap: 6px; }
.udk-name { flex: 1; font-size: 12.5px; color: var(--slate-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.udk-actions { display: flex; gap: 4px; }
.udk-btn {
  width: 22px; height: 22px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  color: var(--slate-500);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  font-family: inherit;
}
.udk-btn:hover { background: var(--slate-100); color: var(--slate-700); border-color: var(--slate-200); }
.udk-cancel:hover { background: var(--rose-50); color: var(--rose-700); border-color: var(--rose-100); }
.udk-collapse, .udk-clear-all { font-size: 14px; }

.udk-bar {
  height: 4px;
  background: var(--slate-100);
  border-radius: 2px;
  margin: 6px 0;
  overflow: hidden;
}
.udk-bar-fill {
  height: 100%;
  background: var(--sky-500);
  border-radius: 2px;
  transition: width .25s ease-out;
}
.udk-line2 { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--slate-600); }
.udk-stage { font-weight: 500; }
.udk-pct { font-variant-numeric: tabular-nums; color: var(--slate-500); }
.udk-detail { font-size: 11px; color: var(--slate-400); margin-top: 3px; line-height: 1.4; }

.udk-link {
  background: none; border: none; padding: 0;
  font-size: 11px; color: var(--sky-700); cursor: pointer; font-family: inherit;
  text-decoration: underline; text-decoration-color: var(--sky-200);
}
.udk-link:hover { color: var(--sky-600); text-decoration-color: var(--sky-500); }
.udk-link-warn { color: var(--rose-700); text-decoration-color: var(--rose-200); }
.udk-link-warn:hover { color: var(--rose-600); text-decoration-color: var(--rose-500); }

/* Byte fab nudges left when dock is visible to avoid overlap (when byte fab also at bottom-right) */
body:has(.udk-root.visible) .byte-fab {
  /* dock occupies ~340px wide @ right:24px → keep byte-fab below dock since dock is at bottom:140px */
  /* No nudge needed since dock starts above byte-fab vertically · keep this rule as safety hook */
}

@media (max-width: 600px) {
  .udk-root { width: calc(100vw - 32px); right: 16px; left: 16px; bottom: 120px; }
}

/* ─────────────── LM-G2.2 L2C · Resume Banner (after F5/close-tab interruption) ─────────────── */
.urb-root {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9500;
  background: #fff;
  border: 1px solid var(--amber-500);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(245, 158, 11, .18), 0 2px 6px rgba(15, 23, 42, .08);
  padding: 14px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  max-width: 720px;
  width: calc(100vw - 48px);
  font-size: 13px;
}
.urb-icon { flex-shrink: 0; color: var(--amber-700); display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: var(--amber-50); border-radius: 8px; }
.urb-icon svg { width: 18px; height: 18px; }
.urb-body { flex: 1; min-width: 0; }
.urb-title { font-weight: 700; color: var(--slate-800); font-size: 14px; margin-bottom: 4px; }
.urb-summary { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.urb-tag { font-size: 11px; padding: 2px 8px; border-radius: 12px; background: var(--slate-100); color: var(--slate-700); font-weight: 500; }
.urb-tag.urb-ok { background: #d1fae5; color: var(--emerald-700); }
.urb-tag.urb-warn { background: #fef3c7; color: var(--amber-700); }
.urb-tag.urb-err { background: #ffe4e6; color: var(--rose-700); }
.urb-tag.urb-mute { background: var(--slate-100); color: var(--slate-500); }
.urb-pending { font-size: 12px; color: var(--slate-600); }
.urb-pending summary { cursor: pointer; user-select: none; padding: 2px 0; font-weight: 500; }
.urb-pending summary:hover { color: var(--slate-800); }
.urb-pending ul { margin: 6px 0 0 16px; list-style: disc; color: var(--slate-500); font-size: 11.5px; line-height: 1.55; }
.urb-pending li.urb-more { color: var(--slate-400); list-style: none; margin-left: -16px; padding: 2px 0; font-style: italic; }
.urb-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.urb-btn-primary, .urb-btn-ghost {
  border: 1px solid; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  font-size: 12px; font-weight: 600; font-family: inherit; white-space: nowrap;
}
.urb-btn-primary { background: var(--sky-500); color: #fff; border-color: var(--sky-500); }
.urb-btn-primary:hover { background: var(--sky-600); border-color: var(--sky-600); }
.urb-btn-ghost { background: #fff; color: var(--slate-600); border-color: var(--slate-200); }
.urb-btn-ghost:hover { background: var(--slate-50); border-color: var(--slate-300); }

@media (max-width: 600px) {
  .urb-root { flex-direction: column; gap: 10px; padding: 12px; }
  .urb-actions { flex-direction: row; }
  .urb-btn-primary, .urb-btn-ghost { flex: 1; }
}

/* ─────────────── LM-G3-V · File Viewer (PDF / image / DOCX / XLSX) ─────────────── */
.fv-root { position: fixed; inset: 0; z-index: 6000; pointer-events: none; }
.fv-root.open { pointer-events: auto; }
.fv-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); opacity: 0; transition: opacity .2s ease-out; }
.fv-root.open .fv-backdrop { opacity: 1; }
.fv-modal {
  position: absolute;
  top: 5vh; left: 5vw; right: 5vw; bottom: 5vh;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, .25);
  display: flex; flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(.96);
  transition: opacity .22s ease-out, transform .22s ease-out;
}
.fv-root.open .fv-modal { opacity: 1; transform: translateY(0) scale(1); }
body.fv-open { overflow: hidden; }

.fv-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--slate-200);
  background: linear-gradient(135deg, #f8fafc, #fff);
  flex-shrink: 0;
}
.fv-title { font-weight: 700; color: var(--slate-800); flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-meta { font-size: 12px; color: var(--slate-500); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.fv-close {
  width: 32px; height: 32px;
  border: 1px solid var(--slate-200);
  background: #fff; color: var(--slate-600);
  border-radius: 8px; cursor: pointer; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.fv-close:hover { background: var(--rose-50); color: var(--rose-700); border-color: var(--rose-200); }

.fv-body {
  flex: 1;
  overflow: auto;
  padding: 24px;
  background: var(--slate-50);
  display: flex; align-items: flex-start; justify-content: center;
}
.fv-body .fv-pdf-canvas {
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .12);
  border: 1px solid var(--slate-200);
  display: block;
}
.fv-img-wrap { padding: 20px; display: flex; align-items: center; justify-content: center; min-height: 100%; }
.fv-img-canvas { max-width: 100%; box-shadow: 0 4px 16px rgba(15, 23, 42, .12); border: 1px solid var(--slate-200); transform-origin: center top; transition: transform .2s; }
.fv-docx-html { max-width: 850px; width: 100%; padding: 32px; background: #fff; border: 1px solid var(--slate-200); border-radius: 6px; line-height: 1.7; color: var(--slate-800); }
.fv-docx-html h1, .fv-docx-html h2, .fv-docx-html h3 { color: var(--slate-900); margin: 14px 0 8px; }
.fv-docx-html p { margin: 8px 0; }
.fv-xlsx-table { background: #fff; border: 1px solid var(--slate-200); border-radius: 6px; padding: 6px; overflow: auto; max-width: 100%; }
.fv-xlsx-table table { border-collapse: collapse; font-size: 12px; }
.fv-xlsx-table td, .fv-xlsx-table th { border: 1px solid var(--slate-200); padding: 4px 8px; }
.fv-xlsx-table th { background: var(--slate-100); font-weight: 600; }

.fv-loading { padding: 60px; text-align: center; color: var(--slate-500); font-size: 13px; }
.fv-empty { padding: 60px 24px; text-align: center; color: var(--slate-600); max-width: 460px; }
.fv-empty-ic { font-size: 56px; margin-bottom: 16px; }
.fv-empty-h { font-weight: 700; color: var(--slate-800); font-size: 16px; margin-bottom: 8px; }
.fv-empty-msg { font-size: 13px; line-height: 1.6; color: var(--slate-600); }

.fv-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  border-top: 1px solid var(--slate-200);
  background: #fff;
  flex-shrink: 0;
  font-size: 12px;
}
.fv-footer:empty { display: none; }
.fv-page-info { color: var(--slate-500); font-variant-numeric: tabular-nums; min-width: 60px; text-align: center; }
.fv-zoom-group { margin-left: auto; display: flex; gap: 4px; }
.fv-btn {
  border: 1px solid var(--slate-200);
  background: #fff; color: var(--slate-700);
  padding: 6px 12px; border-radius: 6px;
  cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 500;
}
.fv-btn:hover:not(:disabled) { background: var(--slate-50); border-color: var(--slate-300); }
.fv-btn:disabled { opacity: .4; cursor: not-allowed; }
.fv-btn.active { background: var(--sky-500); color: #fff; border-color: var(--sky-500); }

.recon-view-src {
  margin-top: 10px;
  padding: 6px 14px;
  background: #fff; color: var(--sky-700);
  border: 1px solid var(--sky-100); border-radius: 8px;
  cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  /* BUG-UI-RECON-CARD-LAYOUT-001 fix · prevent narrow grid auto column from
     wrapping the button text into "View / source / PDF" stacks. */
  white-space: nowrap;
  flex-shrink: 0;
  /* BUG-G7P-008 fix · in the `.recon-card.ok` branch viewSrc is a bare grid
     child of a `50px 1fr auto` grid → it landed in the 50px column and the
     border box no longer wrapped the text. Span all columns + left-align so
     the button sizes to its own content. Harmless inside `.recon-actions`
     (a flex container ignores grid-* on its items). */
  grid-column: 1 / -1;
  justify-self: start;
}
.recon-view-src:hover { background: var(--sky-50); border-color: var(--sky-500); }
.recon-view-src svg { width: 14px; height: 14px; flex-shrink: 0; }
/* Same nowrap rule for the per-row review queue action buttons */
.recon-review-btn { white-space: nowrap; }

/* ─────────────── LM-G3-F1 · 2-engine recon-card layout ─────────────── */
/* BUG-UI-RECON-CARD-LAYOUT-001 fix · grid icon column matches --t-recon-ic-size
   (50px) instead of stale 32px hardcode · column-gap 14px gives the title room
   so the green tick no longer overlaps "Statement verified". */
.recon-card { display: grid; gap: 12px; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--slate-200); background: #fff; }
.recon-card.ok,
.recon-card.warn,
.recon-card.fail { grid-template-columns: var(--t-recon-ic-size, 50px) 1fr auto; column-gap: 14px; align-items: start; }
.recon-card.ok { border-color: var(--emerald-100); background: linear-gradient(135deg, #ecfdf5, #fff); }
.recon-card.warn { border-color: var(--amber-500); background: linear-gradient(135deg, #fffbeb, #fff); }
.recon-card.fail { border-color: var(--rose-500); background: linear-gradient(135deg, #fff1f2, #fff); }
.recon-card .recon-engines { grid-column: 2 / -1; padding-top: 6px; border-top: 1px dashed var(--slate-200); margin-top: 4px; display: flex; flex-direction: column; gap: 4px; }
.recon-card .recon-actions { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.recon-eng-line {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; line-height: 1.4;
  padding: 4px 0;
}
.recon-eng-line.ok    { color: var(--emerald-700); }
.recon-eng-line.warn  { color: var(--amber-700); }
.recon-eng-line.mute  { color: var(--slate-500); }
.recon-eng-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  padding: 2px 8px; border-radius: 4px;
  background: rgba(15, 23, 42, .06); color: var(--slate-600);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.recon-eng-line.ok .recon-eng-tag    { background: var(--emerald-100); color: var(--emerald-700); }
.recon-eng-line.warn .recon-eng-tag  { background: #fef3c7; color: var(--amber-700); }
.recon-eng-line.mute .recon-eng-tag  { background: var(--slate-100); color: var(--slate-600); }
.recon-eng-name { color: inherit; }
.recon-eng-line.footer-advisory { font-style: italic; }

.recon-review-btn {
  border: 1px solid var(--slate-200);
  background: #fff; color: var(--slate-700);
  padding: 8px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.recon-review-btn:hover { background: var(--slate-50); border-color: var(--slate-300); }
.recon-review-btn.primary { background: var(--amber-500); border-color: var(--amber-500); color: #fff; }
.recon-review-btn.primary:hover { background: var(--amber-700); border-color: var(--amber-700); }

/* ─────────────── LM-G3-F2 · Per-row disagreement review queue ─────────────── */
.rd-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.rd-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.rd-h { display: flex; align-items: center; gap: 12px; }
.rd-type {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  padding: 4px 10px; border-radius: 5px;
}
.rd-type-amount { background: #fef3c7; color: var(--amber-700); }
.rd-type-date   { background: #ddd6fe; color: #6d28d9; }
.rd-type-rule   { background: #dbeafe; color: #1e40af; }
.rd-type-ai     { background: #f5d0fe; color: #86198f; }
.rd-row { font-size: 12px; color: var(--slate-500); margin-left: auto; font-variant-numeric: tabular-nums; }
.rd-descr { font-size: 14px; font-weight: 600; color: var(--slate-800); line-height: 1.4; }
.rd-compare {
  display: flex; align-items: center; gap: 14px;
  background: var(--slate-50); padding: 12px 16px; border-radius: 10px;
  font-variant-numeric: tabular-nums;
}
.rd-side { flex: 1; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.rd-side-tag { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--slate-500); font-weight: 600; }
.rd-vs { font-size: 11px; color: var(--slate-400); padding: 0 8px; font-style: italic; }
.rd-amt { font-size: 16px; font-weight: 700; }
.rd-amt.pos { color: var(--emerald-700); }
.rd-amt.neg { color: var(--rose-700); }
.rd-date { font-size: 14px; font-weight: 600; color: var(--slate-700); }
.rd-amt-row { display: flex; padding: 8px 0; }
.rd-diff { font-size: 12.5px; color: var(--slate-600); padding: 0 16px; font-variant-numeric: tabular-nums; }
.rd-explain { font-size: 12.5px; color: var(--slate-600); line-height: 1.6; padding: 4px 0; }
.rd-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.rd-btn {
  border: 1px solid var(--slate-200);
  background: #fff; color: var(--slate-700);
  padding: 8px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: inherit;
}
.rd-btn:hover { background: var(--slate-50); border-color: var(--slate-300); }
.rd-btn-primary { background: var(--sky-500); border-color: var(--sky-500); color: #fff; }
.rd-btn-primary:hover { background: var(--sky-600); border-color: var(--sky-600); }
.rd-btn-warn { color: var(--rose-700); }
.rd-btn-warn:hover { background: var(--rose-50); border-color: var(--rose-200); }
.rd-btn-link {
  background: none; border: none; padding: 0;
  color: var(--sky-700); text-decoration: underline; text-decoration-color: var(--sky-200);
  cursor: pointer; font-family: inherit; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
  align-self: flex-start;
}
.rd-btn-link:hover { color: var(--sky-600); text-decoration-color: var(--sky-500); }
.rd-btn-link svg { width: 14px; height: 14px; }

/* edit modal */
.rd-edit-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal-interactive);  /* BUG-UPLOAD-DUP-STUCK-001 fix · was 5500 */
  background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.rd-edit-modal {
  background: #fff; border-radius: 14px;
  width: 100%; max-width: 480px;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 48px rgba(15, 23, 42, .25);
}
.rd-edit-h {
  display: flex; align-items: center; padding: 14px 18px;
  border-bottom: 1px solid var(--slate-200);
  font-weight: 700; color: var(--slate-800);
}
.rd-edit-x {
  margin-left: auto;
  width: 28px; height: 28px;
  border: 1px solid var(--slate-200);
  background: #fff; color: var(--slate-600);
  border-radius: 6px; cursor: pointer; font-size: 16px;
  font-family: inherit;
}
.rd-edit-x:hover { background: var(--rose-50); color: var(--rose-700); border-color: var(--rose-200); }
.rd-edit-body { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.rd-edit-row { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--slate-700); }
.rd-edit-row span { font-weight: 600; }
.rd-edit-row input {
  border: 1px solid var(--slate-200);
  border-radius: 8px; padding: 8px 12px; font-size: 13px;
  font-family: inherit;
}
.rd-edit-row input:focus { outline: none; border-color: var(--sky-500); box-shadow: 0 0 0 3px rgba(14, 165, 233, .12); }
.rd-edit-footer { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--slate-200); }

/* F-002 fix · row-count sanity warning banner inside recon-card */
.recon-warning {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 4px;
  grid-column: 1 / -1;
}
.recon-warning-ic { color: var(--amber-700); flex-shrink: 0; line-height: 1; }
.recon-warning-ic svg { width: 16px; height: 16px; }
.recon-warning-text { font-size: 12.5px; color: var(--amber-700); line-height: 1.5; }

/* LM-G4-H · PDF row highlight overlay (絕殺) */
.fv-pdf-wrap { position: relative; display: inline-block; }
.fv-highlight-overlay {
  position: absolute;
  pointer-events: none;
  border: 2px solid var(--amber-500);
  background: rgba(245, 158, 11, .18);
  border-radius: 4px;
  width: 0; height: 0;
  opacity: 0;
  transition: opacity .25s ease-out;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, .35);
}
.fv-highlight-overlay.fv-visible { opacity: 1; }
@keyframes fv-flash-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); background: rgba(245, 158, 11, .18); }
  20% { box-shadow: 0 0 0 8px rgba(245, 158, 11, .35); background: rgba(245, 158, 11, .42); }
  60% { box-shadow: 0 0 0 4px rgba(245, 158, 11, .15); background: rgba(245, 158, 11, .28); }
}
.fv-highlight-overlay.fv-flash { animation: fv-flash-pulse 1.2s ease-out 1; }

/* BUG-SHEET-NO-VIEWER-001 · per-row [Src] action in Sheet */
.sheet-src-cell { text-align: center; padding: 4px !important; }
.sheet-src-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: #fff; border: 1px solid var(--slate-200);
  border-radius: 6px; cursor: pointer;
  color: var(--sky-700);
  padding: 0;
}
.sheet-src-btn:hover { background: var(--sky-50); border-color: var(--sky-500); }
.sheet-src-btn svg { width: 14px; height: 14px; stroke-width: 1.75; }
.sheet-src-na { color: var(--slate-300); font-size: 11px; }
/* BUG-SHEET-SRC-LLM-MPA-001 (D-149) · Q2 affordance — clickable but visually
   softer (dashed border + muted color) to signal "stmt-level open · no precise bbox" */
.sheet-src-stmt {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0;
  background: transparent;
  border: 1px dashed var(--slate-300);
  border-radius: 4px;
  color: var(--slate-500);
  cursor: pointer;
  transition: all .15s;
}
.sheet-src-stmt:hover { background: var(--slate-100); border-color: var(--sky-500); border-style: solid; color: var(--sky-700); }
.sheet-src-stmt svg { width: 12px; height: 12px; stroke-width: 1.5; opacity: 0.7; }
.sheet-src-stmt:hover svg { opacity: 1; }

/* D-091 #11 · Sheet inline edit save/fail flash · 700ms */
@keyframes cellFlashOk { 0% { background: #d1fae5; } 100% { background: transparent; } }
@keyframes cellFlashErr { 0% { background: #fee2e2; } 100% { background: transparent; } }
.cell-flash-ok { animation: cellFlashOk 700ms ease-out; }
.cell-flash-err { animation: cellFlashErr 700ms ease-out; }

/* ============================================================
   D-088 #8 · Mobile responsive (≤ 600px) — comprehensive block
   covering topbar progress, tables, modals, touch targets.
   ============================================================ */
@media (max-width: 600px) {
  /* MOB-B · Topbar progress steps · horizontal scroll instead of overflow */
  .topbar {
    grid-template-columns: 1fr auto;
    padding: 10px 14px;
    gap: 12px;
  }
  .progress {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;     /* Firefox */
    flex-wrap: nowrap;
    min-width: 0;
  }
  .progress::-webkit-scrollbar { display: none; }
  .pstep { flex-shrink: 0; padding: 3px 2px; gap: 5px; }
  .pstep .plbl { font-size: 11px; }
  .pline { width: 12px; margin: 0 2px; }
  /* MOB-H · topbar user info · hide email + shrink avatar */
  .tb-user { padding: 3px 4px 3px 8px; gap: 6px; }
  .tb-umail { display: none; }
  .tb-uname { font-size: 11.5px; max-width: 80px; }
  /* MOB-C · Sheet table horizontal scroll wrapper */
  .sheet-tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .sheet-tbl table { min-width: 900px; }
  .sheet-toolbar { flex-wrap: wrap; gap: 8px; }
  .sheet-toolbar input { min-width: 0; flex: 1 1 100%; }
  .sheet-chips { flex-wrap: wrap; gap: 6px; }
  .sheet-pager { flex-wrap: wrap; font-size: 11.5px; gap: 8px; }
  /* MOB-E · Review queue cards · stack rd-compare vertically · narrow padding */
  .rd-card { padding: 14px 14px; }
  .rd-compare { grid-template-columns: 1fr; gap: 8px; }
  .rd-vs { display: none; }
  .rd-actions { flex-wrap: wrap; gap: 6px; }
  .rd-actions .rd-btn { flex: 1 1 calc(50% - 3px); padding: 8px 10px; font-size: 12px; }
  /* MOB-F · Modal sizing fluid · works for review-edit + delete-data + onb-name */
  .rd-edit-modal,
  .f3-modal-panel { max-width: calc(100vw - 24px); margin: 12px; }
  .rd-edit-body { padding: 12px 14px; }
  .rd-edit-row input { font-size: 16px; }   /* prevent iOS zoom on focus */
  /* MOB-G · Touch target ≥ 44px (WCAG 2.1 AAA) for primary buttons */
  .tb-btn,
  .tb-btn-pri,
  .report-tab,
  .recon-review-btn,
  .recon-view-src,
  .f3-btn-primary,
  .f3-btn-confirm,
  .udk-btn { min-height: 44px; min-width: 44px; padding: 10px 14px; }
  /* Sheet chips can stay smaller (tap secondary action) but not too tight */
  .sheet-chip { min-height: 36px; padding: 6px 10px; }
  /* Stage h headlines · shrink slightly to keep on one line */
  .stage-h { font-size: 17px; }
  .stage-mute { font-size: 12px; }
  /* Welcome card · already mostly fluid · trim padding */
  .welcome { padding: 18px 16px; }
  .welcome-h { font-size: 19px; }
  /* Reports stage tabs scroll instead of wrap-broken */
  .report-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .report-tabs::-webkit-scrollbar { display: none; }
  .report-tab { flex-shrink: 0; }
}

/* Tablet portrait (601-900) · refine grid + sidebar */
@media (min-width: 601px) and (max-width: 900px) {
  .sheet-tbl { overflow-x: auto; }
  .sheet-tbl table { min-width: 800px; }
  .report-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .report-tab { flex-shrink: 0; }
}

/* D-100 LM-G6-R · T&C / Privacy consent modal · fullscreen · forced */
.perspic-tc-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.85);
  z-index: 100000; display: flex; align-items: center; justify-content: center;
  padding: 24px; backdrop-filter: blur(4px);
}
.perspic-tc-card {
  background: #fff; border-radius: 12px; max-width: 920px; width: 100%;
  max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.4); padding: 24px 28px;
}
.perspic-tc-card h2 {
  margin: 0 0 4px; font-size: 22px; color: #0f172a;
}
.perspic-tc-sub {
  margin: 0 0 16px; font-size: 13.5px; color: #64748b;
}
.perspic-tc-iframes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 14px; flex: 1; min-height: 0;
}
.perspic-tc-iframe-wrap {
  display: flex; flex-direction: column; min-height: 0;
}
.perspic-tc-iframe-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: #475569; padding: 6px 0;
  border-bottom: 1px solid #e2e8f0; margin-bottom: 6px;
}
.perspic-tc-iframe-wrap iframe {
  flex: 1; min-height: 320px; border: 1px solid #e2e8f0; border-radius: 6px;
  background: #f8fafc;
}
.perspic-tc-checkbox {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 8px; cursor: pointer; font-size: 13.5px; color: #334155;
  margin-bottom: 14px;
}
.perspic-tc-checkbox input[type="checkbox"] {
  margin-top: 2px; width: 18px; height: 18px; cursor: pointer; accent-color: #0ea5e9;
}
.perspic-tc-actions {
  display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 8px;
}
.perspic-tc-btn {
  padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
}
.perspic-tc-btn-decline {
  background: #fff; color: #b91c1c; border-color: #fecaca;
}
.perspic-tc-btn-decline:hover { background: #fef2f2; }
.perspic-tc-btn-accept {
  background: #0ea5e9; color: #fff;
}
.perspic-tc-btn-accept:not(:disabled):hover { background: #0284c7; }
.perspic-tc-btn-accept:disabled {
  background: #cbd5e1; color: #fff; cursor: not-allowed;
}
.perspic-tc-note {
  margin: 0; font-size: 11.5px; color: #94a3b8; text-align: center;
}
@media (max-width: 720px) {
  .perspic-tc-iframes { grid-template-columns: 1fr; }
  .perspic-tc-iframe-wrap iframe { min-height: 220px; }
}

/* D-102 LM-G6-T · INV · OCR fields display on Documents pill cards */
.dp-pol-ocr {
  margin-top: 6px; padding: 6px 8px; border-radius: 4px;
  background: #f0f9ff; border: 1px solid #bae6fd;
  font-size: 11px; color: #0c4a6e; line-height: 1.4;
}
.dp-pol-ocr.extracting {
  background: #fef9c3; border-color: #fde68a; color: #78350f;
  display: flex; align-items: center; gap: 6px;
}
.dp-pol-ocr-btn {
  margin-top: 6px; padding: 4px 10px; border-radius: 4px;
  background: #fff; border: 1px solid #cbd5e1; color: #0369a1;
  font-size: 11px; cursor: pointer; font-weight: 600;
}
.dp-pol-ocr-btn:hover { background: #f0f9ff; border-color: #38bdf8; }
.dp-pol-ocr-err { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.dp-pol-ocr-err:hover { background: #fee2e2; }

/* D-103 LM-G6-U · UMR · Unmatched / Orphan review section */
.umr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
@media (max-width: 900px) { .umr-grid { grid-template-columns: 1fr; } }
.umr-col { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 14px; }
.umr-col-h { font-weight: 700; font-size: 13.5px; color: #1e293b; padding-bottom: 8px; border-bottom: 2px solid #e2e8f0; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.umr-count { font-size: 11px; color: #fff; background: #f59e0b; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.umr-list { max-height: 360px; overflow-y: auto; font-size: 12px; }
.umr-row { padding: 8px 6px; border-bottom: 1px solid #f1f5f9; }
.umr-row:last-child { border-bottom: 0; }
.umr-row-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.umr-date { font-family: 'SF Mono', monospace; color: #64748b; font-size: 11px; }
.umr-descr { flex: 1; color: #334155; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.umr-amt { font-family: 'SF Mono', monospace; font-weight: 700; }
.umr-amt.in { color: #047857; }
.umr-amt.out { color: #b91c1c; }
.umr-doc-name { font-weight: 600; color: #1e293b; }
.umr-doc-info { color: #64748b; font-size: 11px; }
.umr-cands { padding-left: 12px; }
.umr-cand { display: flex; gap: 6px; align-items: center; padding: 4px 0; font-size: 11px; }
.umr-cand-name { flex: 1; color: #475569; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.umr-cand-score { font-weight: 700; color: #f59e0b; font-size: 10.5px; }
.umr-confirm, .umr-skip { padding: 3px 9px; border-radius: 4px; font-size: 10.5px; font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.umr-confirm { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.umr-confirm:hover { background: #d1fae5; }
.umr-skip { background: #fff; color: #94a3b8; border-color: #cbd5e1; }
.umr-skip:hover { background: #f1f5f9; color: #475569; }
.umr-no-cand, .umr-empty { color: #94a3b8; font-style: italic; padding: 4px 0; font-size: 11px; }

/* D-105 LM-G6-W · Sheet 11b/c/d · date editable + add/delete row */
.cell-edit-date { font-family: 'SF Mono', monospace; min-width: 88px; display: inline-block; }
.sheet-del-btn {
  background: #fff; border: 1px solid #cbd5e1; color: #94a3b8;
  width: 22px; height: 22px; border-radius: 4px;
  cursor: pointer; padding: 0; font-size: 11px; line-height: 1;
}
.sheet-del-btn:hover { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

/* ═══════════════════════════════════════════════════════════════════════
 * LM-G7-T · Client workspace + dedup overlay
 * ═══════════════════════════════════════════════════════════════════════ */

/* Topbar workspace pill (W4) — sits left of user chip */
.tb-workspace {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 18px;
  background: #f0f9ff; color: #0c4a6e; border: 1px solid #bae6fd;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  margin-right: 8px; max-width: 220px;
  transition: background .15s;
}
.tb-workspace:hover { background: #e0f2fe; }
.tb-workspace .tbw-label { font-size: 10px; color: #0284c7; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.tb-workspace .tbw-name { font-weight: 600; color: #0c4a6e; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-workspace .tbw-caret { font-size: 10px; color: #64748b; }

.tb-workspace-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15,23,42,.12);
  min-width: 240px; max-height: 320px; overflow-y: auto;
  padding: 6px 0; z-index: 1000;
}
.tb-workspace-menu .tbwm-item {
  padding: 9px 14px; cursor: pointer; font-size: 13px; color: #1e293b;
  display: flex; align-items: center; gap: 8px;
}
.tb-workspace-menu .tbwm-item:hover { background: #f8fafc; }
.tb-workspace-menu .tbwm-item.current { background: #ecfdf5; color: #047857; }
.tb-workspace-menu .tbwm-item.current::before { content: '✓'; font-weight: 700; }
.tb-workspace-menu .tbwm-divider { border-top: 1px solid #e2e8f0; margin: 6px 0; }
.tb-workspace-menu .tbwm-action { padding: 9px 14px; cursor: pointer; font-size: 13px; color: #0ea5e9; font-weight: 600; }
.tb-workspace-menu .tbwm-action:hover { background: #f0f9ff; }

/* Sidebar All-workspaces icon (W5) — sits above the existing tool buttons */
.sb-allws {
  width: 44px; height: 44px; margin: 6px auto 12px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #e2e8f0; border-radius: 10px; background: #fff;
  color: #64748b; cursor: pointer; font-size: 18px;
  transition: all .15s;
}
.sb-allws:hover { background: #f0f9ff; color: #0ea5e9; border-color: #bae6fd; }

/* Workspaces home (W3 · CPSS-simple-style) */
.ws-home {
  min-height: calc(100vh - 80px); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 40px 24px;
  background: #fff;
}
.ws-home-title {
  font-size: 36px; font-weight: 700; color: #1e293b; margin: 0 0 8px;
  letter-spacing: -.5px;
}
.ws-home-title .accent { color: #0ea5e9; }
.ws-home-sub {
  font-size: 14px; color: #64748b; margin: 0 0 40px; text-align: center;
  max-width: 480px; line-height: 1.6;
}
.ws-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; width: 100%; max-width: 920px;
}
.ws-card {
  border: 1px solid #e2e8f0; border-radius: 14px; background: #fff;
  padding: 24px 20px; cursor: pointer; transition: all .15s;
  display: flex; flex-direction: column; gap: 8px; min-height: 140px;
}
.ws-card:hover { border-color: #0ea5e9; box-shadow: 0 4px 16px rgba(14,165,233,.08); transform: translateY(-2px); }
.ws-card-name { font-size: 16px; font-weight: 600; color: #1e293b; line-height: 1.3; }
.ws-card-cr { font-size: 11px; color: #94a3b8; font-family: 'SF Mono', monospace; }
.ws-card-meta { font-size: 11.5px; color: #64748b; margin-top: auto; display: flex; gap: 10px; }
.ws-card-meta span { display: flex; align-items: center; gap: 3px; }
.ws-card-new {
  border-style: dashed; border-color: #cbd5e1; align-items: center; justify-content: center;
  color: #0ea5e9; font-weight: 600; gap: 12px;
}
.ws-card-new:hover { background: #f0f9ff; border-color: #0ea5e9; }
.ws-card-new .plus { font-size: 28px; font-weight: 300; line-height: 1; }

/* Create dialog (W3b) */
.ws-dialog-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.32); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.ws-dialog {
  background: #fff; border-radius: 14px; padding: 28px 32px;
  min-width: 380px; max-width: 480px;
  box-shadow: 0 20px 50px rgba(15,23,42,.2);
}
.ws-dialog h3 { margin: 0 0 6px; font-size: 18px; color: #1e293b; }
.ws-dialog .ws-dialog-sub { font-size: 13px; color: #64748b; margin: 0 0 20px; }
.ws-dialog label { display: block; font-size: 12px; font-weight: 600; color: #475569; margin: 12px 0 6px; }
.ws-dialog input {
  width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px;
  font-size: 14px; color: #1e293b; outline: none; transition: border-color .15s;
}
.ws-dialog input:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,.12); }
.ws-dialog .ws-dialog-err { color: #dc2626; font-size: 12px; margin-top: 6px; min-height: 14px; }
.ws-dialog .ws-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.ws-dialog .ws-btn { padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.ws-dialog .ws-btn-cancel { background: #fff; color: #64748b; border-color: #cbd5e1; }
.ws-dialog .ws-btn-cancel:hover { background: #f8fafc; }
.ws-dialog .ws-btn-confirm { background: #0ea5e9; color: #fff; }
.ws-dialog .ws-btn-confirm:hover { background: #0284c7; }
.ws-dialog .ws-btn-confirm:disabled { background: #cbd5e1; cursor: not-allowed; }

/* Dedup overlay (D5) · side-by-side PDF preview */
.ddo-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 10000;
  display: flex; align-items: center; justify-content: center;
}
.ddo-shell {
  background: #fff; border-radius: 14px;
  width: min(1280px, 95vw); height: min(820px, 90vh);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 60px rgba(15,23,42,.25);
}
.ddo-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid #e2e8f0;
}
.ddo-title { margin: 0; font-size: 16px; font-weight: 600; color: #1e293b; }
.ddo-close-btn {
  width: 32px; height: 32px; border: none; background: transparent;
  font-size: 22px; color: #64748b; cursor: pointer; border-radius: 8px;
}
.ddo-close-btn:hover { background: #f1f5f9; color: #1e293b; }

.ddo-body {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 16px; overflow: hidden; background: #f8fafc;
}
.ddo-pane { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.ddo-pane-label {
  font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase;
  letter-spacing: .05em; padding: 4px 8px;
}
.ddo-pdf-wrap {
  flex: 1; overflow: auto; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px;
}
.ddo-pdf-canvas { display: block; max-width: 100%; height: auto; }
.ddo-pdf-fallback {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: #94a3b8; font-size: 13px; padding: 40px; text-align: center;
}

.ddo-pager-row {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 10px; border-top: 1px solid #e2e8f0; background: #f8fafc;
}
.ddo-pager-btn {
  width: 36px; height: 32px; border: 1px solid #cbd5e1; background: #fff;
  border-radius: 6px; cursor: pointer; font-size: 13px; color: #475569;
}
.ddo-pager-btn:hover { background: #f0f9ff; border-color: #0ea5e9; color: #0ea5e9; }
.ddo-pager-text { display: flex; gap: 24px; font-size: 12px; color: #475569; font-variant-numeric: tabular-nums; }
.ddo-pager-info { min-width: 80px; text-align: center; }
.ddo-pager-sep { color: #cbd5e1; }

.ddo-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 24px; border-top: 1px solid #e2e8f0; background: #fff;
}
.ddo-btn {
  padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
}
.ddo-btn-cancel  { background: #fff;   color: #64748b; border-color: #cbd5e1; }
.ddo-btn-cancel:hover { background: #f8fafc; }
.ddo-btn-keep    { background: #f0f9ff; color: #0284c7; border-color: #bae6fd; }
.ddo-btn-keep:hover    { background: #e0f2fe; }
.ddo-btn-replace { background: #0ea5e9; color: #fff; }
.ddo-btn-replace:hover { background: #0284c7; }

/* Source-filename badge in Sheet (D7 Keep-both visual differentiator) */
.sheet-source-badge {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  background: #f1f5f9; color: #64748b; font-size: 10.5px;
  font-family: 'SF Mono', monospace; margin-left: 6px;
}

/* LM-G7-U · Workspace transition full-screen overlay */
.ws-transition-overlay {
  position: fixed; inset: 0; z-index: 10001;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 120ms ease-out;
  pointer-events: all;
}
.ws-transition-overlay.ws-transition-visible { opacity: 1; }
.ws-transition-overlay.ws-transition-fading  { opacity: 0; transition: opacity 200ms ease-in; }

.ws-transition-card {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 32px 48px;
}
.ws-transition-spinner {
  width: 44px; height: 44px;
  border: 3px solid #e2e8f0;
  border-top-color: #0ea5e9;
  border-radius: 50%;
  animation: ws-transition-spin 0.85s linear infinite;
}
@keyframes ws-transition-spin {
  to { transform: rotate(360deg); }
}
.ws-transition-label {
  font-size: 14px; font-weight: 500; color: #475569;
  letter-spacing: 0.02em;
}

/* D-177 · Workspace card overflow menu (rename / delete) */
.ws-card { position: relative; }
.ws-card-menu-btn {
  position: absolute; top: 8px; right: 10px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; cursor: pointer;
  color: #94a3b8; font-size: 18px; font-weight: 700;
  letter-spacing: 1px; line-height: 1;
  transition: background .15s;
}
.ws-card-menu-btn:hover { background: #f1f5f9; color: #475569; }
.ws-card-menu {
  position: absolute; top: 36px; right: 8px; z-index: 10;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  box-shadow: 0 8px 20px rgba(15,23,42,.1);
  min-width: 180px; padding: 4px 0;
}
.ws-card-menu-item {
  padding: 9px 14px; font-size: 13px; color: #1e293b; cursor: pointer;
}
.ws-card-menu-item:hover { background: #f8fafc; }
.ws-card-menu-item.danger { color: #dc2626; }
.ws-card-menu-item.danger:hover { background: #fef2f2; }
.ws-card-menu-item.disabled { color: #cbd5e1; cursor: not-allowed; pointer-events: none; }
.ws-btn-danger {
  background: #dc2626; color: #fff; border: 1px solid #dc2626;
}
.ws-btn-danger:hover { background: #b91c1c; }

/* ═══════════════════════════════════════════════════════════════════════
 * LM-G7-V · Big Report v2 (Reports stage redesign)
 * ═══════════════════════════════════════════════════════════════════════ */
.rpt-v2-root { display: flex; flex-direction: column; height: 100%; min-height: 600px; }
.rpt-v2-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 26px 14px; border-bottom: 1px solid #e2e8f0;
}
.rpt-v2-title { display: flex; flex-direction: column; }
.rpt-v2-name { font-size: 20px; font-weight: 700; color: #1e293b; }
.rpt-v2-sub  { font-size: 12px; color: #94a3b8; margin-top: 3px; }
.rpt-v2-export-btn {
  padding: 10px 20px; border-radius: 10px; background: #0ea5e9; color: #fff;
  border: none; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.rpt-v2-export-btn:hover { background: #0284c7; }

.rpt-v2-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 26px; border-bottom: 1px solid #e2e8f0; background: #f8fafc;
}
.rpt-v2-tab {
  padding: 6px 12px; border-radius: 999px;
  background: #fff; border: 1px solid #e2e8f0;
  color: #475569; font-size: 12px; cursor: pointer;
  transition: all .15s;
}
.rpt-v2-tab:hover { border-color: #0ea5e9; color: #0ea5e9; }
.rpt-v2-tab.active {
  background: #0ea5e9; color: #fff; border-color: #0ea5e9;
}
.rpt-v2-tab.coming-soon {
  opacity: 0.55; cursor: not-allowed; font-style: italic;
}
.rpt-v2-tab.coming-soon:hover { border-color: #e2e8f0; color: #475569; }

.rpt-v2-main { flex: 1; padding: 22px 26px; overflow-y: auto; background: #fff; }
.rpt-v2-loading { padding: 32px; color: #94a3b8; font-size: 14px; }

.rpt-v2-sheet { max-width: 920px; }
.rpt-v2-sheet-title {
  font-size: 18px; font-weight: 700; color: #1e293b;
  margin: 0 0 16px; padding-bottom: 6px; border-bottom: 2px solid #0ea5e9;
}
.rpt-v2-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rpt-v2-table td {
  padding: 8px 12px; border-bottom: 1px solid #f1f5f9;
  vertical-align: top; color: #475569;
}
.rpt-v2-table td:first-child { font-weight: 500; color: #334155; min-width: 220px; }
.rpt-v2-blank-row { padding: 6px !important; border-bottom: none !important; }

.rpt-v2-empty {
  padding: 40px; text-align: center; color: #94a3b8;
}
.rpt-v2-empty h3 { color: #334155; margin: 0 0 8px; font-size: 16px; }
.rpt-v2-empty p { font-size: 13px; margin: 4px 0; }

.rpt-v2-modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 10000;
  display: flex; align-items: center; justify-content: center;
}
.rpt-v2-modal {
  background: #fff; padding: 28px 32px; border-radius: 14px;
  width: min(480px, 92vw); box-shadow: 0 20px 50px rgba(15,23,42,.25);
}
.rpt-v2-modal h3 { margin: 0 0 8px; font-size: 18px; color: #1e293b; }
.rpt-v2-modal p { color: #475569; font-size: 13px; line-height: 1.6; }
.rpt-v2-modal-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px;
}
.rpt-v2-modal-actions button {
  padding: 10px 18px; border-radius: 10px; border: 1px solid #cbd5e1;
  background: #fff; color: #475569; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.rpt-v2-modal-actions button:hover { border-color: #0ea5e9; color: #0ea5e9; }
.rpt-v2-modal-actions button[data-export-xlsx],
.rpt-v2-modal-actions button[data-export-pdf] {
  background: #0ea5e9; color: #fff; border-color: #0ea5e9;
}
.rpt-v2-modal-actions button[data-export-xlsx]:hover,
.rpt-v2-modal-actions button[data-export-pdf]:hover {
  background: #0284c7; color: #fff;
}
.rpt-v2-modal-cancel {
  background: #f8fafc !important; color: #94a3b8 !important; border-color: #e2e8f0 !important;
}
.rpt-v2-modal-status {
  margin-top: 14px; padding: 10px 14px; border-radius: 8px;
  background: #f0f9ff; color: #0c4a6e; font-size: 12.5px; min-height: 18px;
}
.rpt-v2-modal-status:empty { display: none; }
