:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --surface-soft: #faf7f1;
  --surface-muted: #f1ece2;
  --border: #e5ddd0;
  --border-strong: #d4c8b6;

  --ink: #1a2420;
  --ink-secondary: #4e5b55;
  --ink-muted: #7c8882;

  --pine: #214e3d;
  --pine-hover: #183b2e;
  --pine-soft: #e8f3ee;
  --pine-mid: #32745b;

  --crimson: #a4242b;
  --crimson-soft: #fceef0;
  --amber: #c07119;
  --amber-soft: #fdf4e5;
  --sky: #25648a;
  --sky-soft: #eaf4fa;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(24, 38, 32, 0.05), 0 1px 2px rgba(24, 38, 32, 0.03);
  --shadow-md: 0 10px 28px rgba(24, 38, 32, 0.08);
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.tabular { font-variant-numeric: tabular-nums; }
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-muted);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--pine);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 8px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s ease; text-decoration: none;
  font-family: inherit;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--pine); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--pine-hover); }
.btn-crimson { background: var(--crimson); color: #fff; }
.btn-crimson:hover:not(:disabled) { background: #891b22; }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--ink); }
.btn-outline:hover:not(:disabled) { background: var(--surface-soft); border-color: var(--pine); color: var(--pine); }
.btn-soft { background: var(--pine-soft); color: var(--pine); }
.btn-soft:hover:not(:disabled) { background: #d8ebe2; }
.btn-ghost { background: transparent; color: var(--ink-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-muted); color: var(--ink); }
.btn-ghost-danger { background: transparent; color: var(--crimson); border-color: #f0d4d6; }
.btn-ghost-danger:hover:not(:disabled) { background: var(--crimson-soft); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-xs { padding: 5px 9px; font-size: 12px; border-radius: 7px; }
.btn-full { width: 100%; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink-secondary); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
}
.icon-btn:hover { background: var(--surface-soft); color: var(--ink); }

/* Login Screen */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 28px 20px;
  background:
    radial-gradient(circle at 12% 18%, rgba(33, 78, 61, 0.08), transparent 45%),
    radial-gradient(circle at 88% 82%, rgba(164, 36, 43, 0.06), transparent 40%),
    var(--bg);
}
.login-shell {
  width: 100%; max-width: 1040px;
  display: grid; grid-template-columns: 1.2fr 0.85fr; gap: 36px; align-items: center;
}
.brand-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--pine-soft); color: var(--pine);
  font-size: 12px; font-weight: 700; margin-bottom: 18px;
}
.brand-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--pine);
  box-shadow: 0 0 0 3px rgba(33, 78, 61, 0.2);
}
.login-hero h1 {
  margin: 0; font-size: 30px; line-height: 1.3; font-weight: 800; color: var(--ink);
  letter-spacing: -0.01em;
}
.login-hero h1 span { color: var(--pine); }
.hero-desc {
  margin: 14px 0 24px; color: var(--ink-secondary); font-size: 14.5px; line-height: 1.75;
}
.hero-feature-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.hero-feat {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 15px;
}
.feat-title { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.feat-sub { font-size: 12px; color: var(--ink-muted); margin-top: 3px; }

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.login-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--pine); color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.login-card-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.login-card-head p { margin: 2px 0 0; font-size: 12px; color: var(--ink-muted); }
.login-form label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-secondary); margin-bottom: 6px; }
.login-form input {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); font-size: 14px; font-family: inherit;
  outline: none; transition: border-color 0.15s;
}
.login-form input:focus { border-color: var(--pine); box-shadow: 0 0 0 3px rgba(33, 78, 61, 0.12); }
.dev-hint {
  margin-top: 10px; padding: 9px 12px; border-radius: 9px;
  background: var(--amber-soft); border: 1px dashed #e1b87d;
  font-size: 12px; color: #784812;
}
.form-error {
  margin-top: 10px; padding: 9px 12px; border-radius: 9px;
  background: var(--crimson-soft); color: var(--crimson); font-size: 12.5px; font-weight: 600;
}
.login-form .btn { margin-top: 16px; padding: 11px 16px; font-size: 14px; }
.login-foot {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; color: var(--ink-muted); flex-wrap: wrap;
}
.link-subtle { color: var(--pine); font-weight: 600; text-decoration: none; }
.link-subtle:hover { text-decoration: underline; }

/* App Shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0;
  background: #173429; color: #eef5f1;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  z-index: 30;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 18px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.logo-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #3c8669, #225441);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: #fff;
}
.logo-title { font-size: 15px; font-weight: 800; letter-spacing: 0.02em; }
.logo-sub { font-size: 11.5px; color: rgba(238, 245, 241, 0.65); }

.sidebar-nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  width: 100%; border: none; background: transparent; color: rgba(238, 245, 241, 0.78);
  padding: 10px 12px; border-radius: 10px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left;
  transition: all 0.14s; font-family: inherit;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, 0.16); color: #fff; box-shadow: inset 3px 0 0 #79d4ad; }
.nav-badge {
  margin-left: auto; background: rgba(121, 212, 173, 0.22); color: #b5f0d6;
  padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-variant-numeric: tabular-nums;
}

.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255, 255, 255, 0.09); display: flex; flex-direction: column; gap: 10px; }
.sync-card {
  background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px; padding: 10px 12px;
}
.sync-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; }
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: pulseGlow 2.2s infinite;
}
.pulse-dot.offline { background: #f59e0b; animation: none; }
@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.65); }
  70% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.sync-meta { margin-top: 4px; font-size: 11px; color: rgba(238, 245, 241, 0.65); }

.preview-tools {
  background: rgba(255, 255, 255, 0.07); border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px;
}
.preview-tools-title { font-size: 11px; color: #fde68a; font-weight: 700; letter-spacing: 0.03em; }
.preview-btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sidebar .btn-outline { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); color: #fff; }
.sidebar .btn-outline:hover { background: rgba(255,255,255,0.18); color: #fff; }
.sidebar .btn-soft { background: rgba(121, 212, 173, 0.2); color: #d1fae5; }
.sidebar .btn-soft:hover { background: rgba(121, 212, 173, 0.32); }
.sidebar .btn-ghost { color: rgba(238, 245, 241, 0.75); }
.sidebar .btn-ghost:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
.sidebar .btn-ghost-danger { color: #fca5a5; border-color: rgba(252, 165, 165, 0.3); }
.sidebar .btn-ghost-danger:hover { background: rgba(239, 68, 68, 0.18); }

/* Main Content */
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-title { margin: 0; font-size: 18px; font-weight: 800; color: var(--ink); }
.page-subtitle { margin: 2px 0 0; font-size: 12px; color: var(--ink-muted); }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mobile-only { display: none; }

.filter-bar {
  background: var(--surface-soft); border-bottom: 1px solid var(--border);
  padding: 10px 24px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.filter-group { display: flex; align-items: center; gap: 7px; }
.filter-group label { font-size: 12px; font-weight: 600; color: var(--ink-muted); white-space: nowrap; }
.filter-group select, .input-field {
  border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: 8px; padding: 5px 10px; font-size: 12.5px; color: var(--ink);
  font-family: inherit; outline: none;
}
.filter-group select:focus, .input-field:focus { border-color: var(--pine); }
.toggle-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); font-size: 12px; font-weight: 600; color: var(--ink-secondary);
  cursor: pointer; user-select: none;
}
.toggle-chip input { accent-color: var(--pine); margin: 0; }

.view-root { padding: 22px 24px 48px; max-width: 1380px; width: 100%; margin: 0 auto; }
.loading-box { padding: 64px 20px; text-align: center; color: var(--ink-muted); font-size: 14px; }

/* Cards & Grids */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-12 { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.card-title { margin: 0; font-size: 15px; font-weight: 800; color: var(--ink); }
.card-desc { margin: 2px 0 0; font-size: 12px; color: var(--ink-muted); }

.kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--pine);
}
.kpi-card.accent-emerald::before { background: #1e8759; }
.kpi-card.accent-amber::before { background: var(--amber); }
.kpi-card.accent-crimson::before { background: var(--crimson); }
.kpi-card.accent-sky::before { background: var(--sky); }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.kpi-value {
  margin-top: 6px; font-size: 28px; font-weight: 800; line-height: 1.15;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.kpi-sub { margin-top: 6px; font-size: 12px; color: var(--ink-secondary); }

/* Pills & Badges */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  white-space: nowrap;
}
.pill-green { background: var(--pine-soft); color: var(--pine); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-crimson { background: var(--crimson-soft); color: var(--crimson); }
.pill-sky { background: var(--sky-soft); color: var(--sky); }
.pill-slate { background: var(--surface-muted); color: var(--ink-secondary); }

/* Sub-tabs */
.subtabs {
  display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap;
}
.subtab-btn {
  border: none; background: transparent; padding: 10px 16px;
  font-size: 13.5px; font-weight: 700; color: var(--ink-muted);
  border-bottom: 2.5px solid transparent; cursor: pointer; font-family: inherit;
  transition: all 0.14s;
}
.subtab-btn:hover { color: var(--ink); }
.subtab-btn.active { color: var(--pine); border-bottom-color: var(--pine); }

/* Live Feed */
.feed-list { display: flex; flex-direction: column; gap: 8px; max-height: 410px; overflow-y: auto; padding-right: 4px; }
.feed-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface-soft); cursor: pointer; transition: all 0.15s;
}
.feed-item:hover { border-color: var(--pine); background: #fff; }
.feed-item.is-fresh { animation: flashNew 2.5s ease; }
@keyframes flashNew {
  0% { background: #d5f5e5; border-color: #1e8759; }
  100% { background: var(--surface-soft); border-color: var(--border); }
}
.feed-main { min-width: 0; }
.feed-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; font-weight: 700; }
.feed-meta { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }
.feed-right { text-align: right; flex-shrink: 0; }

/* Progress bars */
.bar-row { margin-bottom: 11px; }
.bar-row-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; gap: 8px; }
.bar-track { height: 9px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--pine); transition: width 0.35s ease; }
.bar-fill.crimson { background: var(--crimson); }
.bar-fill.amber { background: var(--amber); }
.bar-fill.sky { background: var(--sky); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; text-align: left; }
table.data-table th {
  background: var(--surface-soft); color: var(--ink-secondary); font-weight: 700;
  padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data-table td {
  padding: 10px 12px; border-bottom: 1px solid #f0eae0; vertical-align: middle;
}
table.data-table tbody tr:hover { background: #faf7f0; }
table.data-table tbody tr.clickable { cursor: pointer; }
.mono { font-family: var(--font-mono); font-size: 12px; }

/* Executive Summary Report Paper */
.report-paper {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 30px 34px; box-shadow: var(--shadow-sm);
}
.report-header {
  border-bottom: 2px solid var(--pine); padding-bottom: 18px; margin-bottom: 22px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap;
}
.report-kicker { font-size: 12px; font-weight: 700; color: var(--crimson); letter-spacing: 0.08em; text-transform: uppercase; }
.report-title { margin: 4px 0 6px; font-size: 22px; font-weight: 800; color: var(--ink); }
.report-meta { font-size: 12.5px; color: var(--ink-muted); }
.report-headline {
  background: var(--pine-soft); border-left: 4px solid var(--pine);
  border-radius: 0 12px 12px 0; padding: 14px 18px;
  font-size: 14.5px; font-weight: 700; color: var(--pine-hover); line-height: 1.7;
  margin-bottom: 22px;
}
.report-section { margin-bottom: 22px; }
.report-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sec-num {
  width: 28px; height: 28px; border-radius: 8px; background: var(--pine); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
}
.report-section-head h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--ink); }
.report-bullets { margin: 0; padding-left: 20px; color: var(--ink-secondary); line-height: 1.8; }
.report-bullets li { margin-bottom: 7px; }

.rec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rec-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 15px 16px;
  background: var(--surface-soft);
}
.rec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.rec-title { font-weight: 800; font-size: 14px; color: var(--ink); }
.rec-basis { font-size: 12.5px; color: var(--ink-muted); margin-bottom: 6px; }
.rec-action { font-size: 13px; color: var(--ink); line-height: 1.65; }

/* Question Cards */
.q-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
  background: var(--surface-soft); margin-bottom: 12px;
}
.q-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.q-prompt { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.q-scenario { font-size: 12px; color: var(--ink-muted); margin-top: 4px; background: #fff; padding: 6px 10px; border-radius: 8px; border-left: 3px solid var(--border-strong); }

/* Quote Cards (Open Text) */
.quote-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quote-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; background: var(--surface-soft);
}
.quote-text { font-size: 13.5px; color: var(--ink); line-height: 1.7; margin: 0 0 10px; }
.quote-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-muted); }

/* Drawer */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(15, 25, 21, 0.45); z-index: 50;
}
.detail-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 95vw);
  background: var(--surface); z-index: 60; box-shadow: -8px 0 32px rgba(0, 0, 0, 0.16);
  display: flex; flex-direction: column;
}
.drawer-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.drawer-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.drawer-sub { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.drawer-body { padding: 18px 20px 30px; overflow-y: auto; flex: 1; }
.qa-row {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  margin-bottom: 8px; background: var(--surface-soft);
}
.qa-q { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.qa-a { margin-top: 4px; font-size: 13px; color: var(--pine); font-weight: 600; }

/* Code / Import box */
.code-block {
  background: #1a2420; color: #e2f1ea; border-radius: 10px; padding: 14px 16px;
  font-family: var(--font-mono); font-size: 12px; overflow-x: auto; line-height: 1.6;
}
textarea.import-area {
  width: 100%; min-height: 140px; border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 12px; font-family: var(--font-mono); font-size: 12px;
  resize: vertical; outline: none;
}
textarea.import-area:focus { border-color: var(--pine); }

/* Toast */
.toast-stack {
  position: fixed; bottom: 20px; right: 20px; z-index: 80;
  display: flex; flex-direction: column; gap: 8px; max-width: 360px;
}
.toast {
  background: #173429; color: #fff; padding: 11px 15px; border-radius: 11px;
  font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  border-left: 4px solid #4ade80;
}
.toast.warn { border-left-color: #f59e0b; }
.toast.err { background: #7f1d1d; border-left-color: #fca5a5; }

/* SVG Charts */
.chart-box { width: 100%; overflow-x: auto; }
.chart-svg { display: block; width: 100%; height: auto; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-secondary); margin-top: 8px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; }

/* Responsive */
@media (max-width: 1120px) {
  .kpi-grid, .kpi-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-12, .grid-2, .grid-3, .rec-grid, .quote-grid { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: -260px; transition: left 0.2s ease; }
  .sidebar.open { left: 0; }
  .mobile-only { display: inline-flex; }
  .topbar, .filter-bar, .view-root { padding-left: 14px; padding-right: 14px; }
}

/* Print Report Mode */
@media print {
  .no-print, .sidebar, .topbar, .filter-bar, .toast-stack { display: none !important; }
  body, .view-root, .report-paper { background: #fff !important; padding: 0 !important; margin: 0 !important; border: none !important; box-shadow: none !important; }
}
