/* DMD AI Practice Operations - shared base styles (extracted from legacy index.html) */

  :root {
    --bg: #f4f6f9;
    --bg2: #ffffff;
    --ink: #16233a;
    --muted: #5c6b84;
    --rule: #dfe5ee;
    --accent: #14508c;
    --accent2: #0e8f7e;
    --ok: #1a8a5c;
    --warn: #c2780a;
    --danger: #c23b3b;
    --na: #8a94a6;
    --radius: 10px;
  }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    background: var(--bg); color: var(--ink);
    font-family: 'Outfit', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    font-size: 15px; line-height: 1.6;
  }
  .mono, code, pre { font-family: 'JetBrainsMono', 'Microsoft YaHei', monospace; }
  .wrap { max-width: 1400px; margin: 0 auto; padding: 0 24px 60px; }

  /* ---------- header ---------- */
  header {
    background: linear-gradient(135deg, #10365e 0%, #14508c 60%, #0e6a86 100%);
    color: #fff; padding: 18px 0 0;
  }
  .h-wrap { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
  .h-top { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
  .h-brand { font-size: 13px; letter-spacing: 0.14em; opacity: 0.85; text-transform: uppercase; }
  .h-title { font-size: 26px; font-weight: 700; }
  .h-asat { margin-left: auto; font-size: 12.5px; opacity: 0.85; }
  .h-asat b { font-family: 'JetBrainsMono'; }

  #server-strip { display: flex; gap: 8px; padding: 12px 0 16px; flex-wrap: wrap; }
  .server {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.22);
    border-radius: 8px; padding: 7px 14px; color: #fff; cursor: pointer;
    font-family: inherit; font-size: 13px; transition: background 0.15s;
  }
  .server:hover { background: rgba(255,255,255,0.18); }
  .server.active { background: rgba(255,255,255,0.95); color: var(--ink); border-color: #fff; }
  .server .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
  .server.live .dot { background: #4ade80; }
  .server.down .dot { background: #f87171; }
  .server.idle .dot { background: #fbbf24; }
  .server.active .dot { box-shadow: 0 0 0 3px rgba(20,80,140,0.15); }
  .s-name { font-family: 'JetBrainsMono'; font-size: 12.5px; }
  .s-org { opacity: 0.75; font-size: 12.5px; }
  .s-status { font-size: 11.5px; opacity: 0.7; }

  #tenant-note {
    display: none; background: #fff7ea; border: 1px solid #f0d9ac; border-left: 4px solid var(--warn);
    border-radius: 8px; padding: 14px 18px; margin-top: 18px; font-size: 13.5px;
  }
  #tenant-note b { color: var(--warn); }

  /* ---------- section ---------- */
  section { margin-top: 28px; }
  .sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; padding: 0 0 10px 14px; border-bottom: 1px solid var(--rule); position: relative; }
  .sec-head::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 10px; width: 4px; border-radius: 2px; background: linear-gradient(180deg, var(--accent), var(--accent2)); }
  .sec-num { font-family: 'JetBrainsMono'; font-size: 13px; color: var(--accent); font-weight: 700; }
  .sec-title { font-size: 19px; font-weight: 700; }
  .sec-sub { font-size: 12.5px; color: var(--muted); }
  .sec-note { margin-left: auto; font-size: 12px; color: var(--muted); }

  /* ---------- KPI ---------- */
  #kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
  .kpi { background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px 14px; }
  .kpi.main { grid-column: span 3; border-top: 3px solid var(--accent); padding: 18px 22px 16px; }
  .kpi.main .kpi-label { font-size: 13px; font-weight: 600; }
  .kpi.main .kpi-value { font-size: 33px; }
  .kpi.main .kpi-sub { font-size: 12.5px; }
  .kpi-label { font-size: 12px; color: var(--muted); }
  .kpi-row { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 2px; flex-wrap: wrap; }
  .kpi-value { font-family: 'JetBrainsMono'; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
  .kpi-trend { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 20px; }
  .t-up { color: var(--ok); background: rgba(26,138,92,0.10); }
  .t-down { color: var(--danger); background: rgba(194,59,59,0.10); }
  .t-warn { color: var(--warn); background: rgba(194,120,10,0.12); }
  .t-ok { color: var(--accent2); background: rgba(14,143,126,0.10); }
  .kpi-sub { font-size: 11.8px; color: var(--muted); }

  /* ---------- charts ---------- */
  .chart-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .chart-card { background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 16px 8px; }
  .chart-card.wide { grid-column: span 2; }
  .chart-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
  .chart-card .c-sub { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
  .chart-box { width: 100%; height: 250px; }

  /* ---------- AR / cash biz blocks ---------- */
  .biz-layout { display: grid; grid-template-columns: minmax(330px, 5fr) 7fr; gap: 14px; align-items: stretch; }
  .biz-chart { background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 16px 8px; }
  .biz-chart h3 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
  .biz-chart .c-sub { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
  .biz-table { background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px 0 2px; display: flex; flex-direction: column; }
  .biz-table .table-wrap { max-height: 400px; overflow-x: auto; overflow-y: auto; }
  .filter-note {
    display: flex; align-items: center; gap: 10px; margin: 8px 2px 6px;
    background: rgba(20,80,140,0.07); border-radius: 7px; padding: 7px 12px; font-size: 12.5px;
  }
  .filter-note b { color: var(--accent); }
  .filter-reset {
    margin-left: auto; background: none; border: 1px solid var(--rule); border-radius: 20px;
    padding: 2px 12px; font-size: 11.5px; cursor: pointer; color: var(--muted); font-family: inherit; font-weight: 600;
  }
  .filter-reset:hover { color: var(--accent); border-color: var(--accent); }
  tr.hl td { background: rgba(20,80,140,0.07); }
  .cash-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 14px; margin-top: 14px; align-items: stretch; }
  .cash-table { background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px 0 2px; }
  .cash-side { background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
  .cash-side h4 { font-size: 13.5px; }
  .rec-item { display: flex; justify-content: space-between; gap: 10px; font-size: 12.8px; padding: 8px 10px; background: var(--bg); border-radius: 7px; }
  .rec-item b { font-family: 'JetBrainsMono'; }
  .rec-item.bad b { color: var(--danger); }
  .rec-item.warn b { color: var(--warn); }
  .txn-info { margin: 6px 2px 8px; background: var(--bg); border-radius: 7px; padding: 8px 12px; font-size: 12.5px; display: flex; gap: 16px; flex-wrap: wrap; }
  .txn-info b { font-family: 'JetBrainsMono'; }

  /* ---------- fn groups ---------- */
  .fn-group { margin-bottom: 26px; }
  .fn-group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
  .fg-num {
    font-family: 'JetBrainsMono'; font-size: 12px; font-weight: 700; color: #fff;
    background: var(--accent); border-radius: 6px; padding: 2px 8px;
  }
  .fg-name { font-size: 15.5px; font-weight: 700; }
  .fg-sub { font-size: 12px; color: var(--muted); }

  /* ---------- tables ---------- */
  .tabs { display: flex; gap: 8px; margin-bottom: 0; }
  .tab {
    background: var(--bg2); border: 1px solid var(--rule); border-bottom: none;
    border-radius: 8px 8px 0 0; padding: 8px 18px; cursor: pointer;
    font-family: inherit; font-size: 13.5px; color: var(--muted); font-weight: 600;
  }
  .tab.active { color: var(--accent); border-color: var(--accent); position: relative; top: 1px; }
  .table-panel { display: none; background: var(--bg2); border: 1px solid var(--rule); border-radius: 0 var(--radius) var(--radius) var(--radius); padding: 6px 0 2px; }
  .table-panel.active { display: block; }
  .table-wrap { overflow-x: auto; overflow-y: auto; max-height: 520px; }
  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  th { position: sticky; top: 0; background: var(--bg); color: var(--muted); font-size: 12px; text-align: left; padding: 9px 14px; border-bottom: 1.5px solid var(--rule); font-weight: 600; z-index: 2; }
  td { padding: 7.5px 14px; border-bottom: 1px solid var(--rule); }
  tr:last-child td { border-bottom: none; }
  th.num, td.num { text-align: right; font-family: 'JetBrainsMono'; font-size: 12.5px; white-space: nowrap; }
  .pos { color: var(--ok); } .neg { color: var(--danger); }
  .total-row td { font-weight: 700; background: var(--bg); }
  .bucket { font-size: 11.5px; padding: 2px 9px; border-radius: 20px; white-space: nowrap; font-weight: 600; }
  .b0 { color: var(--accent); background: rgba(20,80,140,0.10); }
  .b1 { color: var(--accent2); background: rgba(14,143,126,0.10); }
  .b2 { color: var(--warn); background: rgba(194,120,10,0.12); }
  .b3 { color: var(--danger); background: rgba(194,59,59,0.10); }

  /* ---------- QC console ---------- */
  .qc-layout { display: grid; grid-template-columns: 280px 1fr; gap: 14px; align-items: start; }
  .qc-side { background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; }
  .qc-side h4 { font-size: 13px; margin-bottom: 8px; }
  .qc-stat { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; }
  .qc-stat b { font-family: 'JetBrainsMono'; }
  .qc-stat .ok b { color: var(--ok); } .qc-stat .warn b { color: var(--warn); }
  .qc-stat .na b { color: var(--na); } .qc-stat .bl b { color: var(--danger); }
  #qc-search {
    width: 100%; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 8px;
    font-family: inherit; font-size: 13px; margin-top: 12px; background: var(--bg); color: var(--ink);
  }
  #qc-search:focus { outline: 2px solid rgba(20,80,140,0.25); border-color: var(--accent); }
  .chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
  .chip {
    background: var(--bg); border: 1px solid var(--rule); border-radius: 20px;
    padding: 3px 12px; font-size: 12px; cursor: pointer; color: var(--muted); font-family: inherit; font-weight: 600;
  }
  .chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
  .qc-main { background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 16px; }
  .qc-toolbar { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); margin-bottom: 6px; }
  .qc-count { font-size: 12.5px; color: var(--muted); margin-left: auto; font-family: 'JetBrainsMono'; }
  .qc-row { border-bottom: 1px solid var(--rule); }
  .qc-row:last-child { border-bottom: none; }
  .qc-head { display: flex; align-items: center; gap: 10px; padding: 9px 4px; cursor: pointer; }
  .qc-head:hover { background: var(--bg); border-radius: 6px; }
  .qc-id { font-size: 11.5px; color: var(--muted); width: 64px; flex: none; }
  .qc-name { font-size: 13.5px; font-weight: 600; }
  .qc-phase { font-size: 11.5px; color: var(--muted); }
  .qc-res { margin-left: auto; font-size: 11.5px; font-weight: 700; padding: 1px 10px; border-radius: 20px; flex: none; }
  .qc-res.ok { color: var(--ok); background: rgba(26,138,92,0.10); }
  .qc-res.warn { color: var(--warn); background: rgba(194,120,10,0.12); }
  .qc-res.na { color: var(--na); background: rgba(138,148,166,0.14); }
  .qc-res.blocker { color: #fff; background: var(--danger); }
  .qc-detail { display: none; padding: 2px 4px 12px 78px; font-size: 12.5px; }
  .qc-row.open .qc-detail { display: block; }
  .qc-dt { color: var(--muted); }
  .qc-act { margin-top: 4px; color: var(--accent); font-weight: 600; }
  .qc-empty { padding: 30px; text-align: center; color: var(--muted); font-size: 13px; }

  /* ---------- function console ---------- */
  #fn-grid, .fn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 14px; }
  .fn-card { background: var(--bg2); border: 1px solid var(--rule); border-top: 3px solid var(--accent); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 9px; }
  .fn-head { display: flex; gap: 12px; align-items: center; }
  .fn-icon {
    width: 40px; height: 40px; flex: none; border-radius: 9px; display: flex; align-items: center; justify-content: center;
    background: rgba(20,80,140,0.09); color: var(--accent); font-weight: 700; font-size: 14px;
  }
  .fn-title { font-size: 15.5px; font-weight: 700; line-height: 1.3; }
  .fn-tool { font-size: 11.5px; color: var(--accent2); background: none; padding: 0; }
  .fn-desc { font-size: 12.8px; color: var(--muted); }
  .fn-phases { display: flex; flex-wrap: wrap; gap: 5px; }
  .pchk { font-size: 12px; display: flex; align-items: center; gap: 4px; color: var(--ink); background: var(--bg); border: 1px solid var(--rule); border-radius: 6px; padding: 2px 8px; cursor: pointer; }
  .pchk input { accent-color: var(--accent); }
  .fn-select { padding: 7px 10px; border: 1px solid var(--rule); border-radius: 8px; font-family: inherit; font-size: 13px; background: var(--bg); color: var(--ink); width: 100%; }
  .fn-journal { background: var(--bg); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; font-size: 11.5px; overflow-x: auto; color: var(--ink); }
  .fn-cmd { background: #10233d; border-radius: 8px; padding: 11px 14px; }
  .fn-cmd code { color: #9fc7ee; font-size: 12.3px; line-height: 1.55; word-break: break-all; }
  .fn-actions { display: flex; align-items: center; gap: 10px; margin-top: auto; }
  .btn-copy {
    background: var(--accent); color: #fff; border: none; border-radius: 7px;
    padding: 7px 16px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  }
  .btn-copy:hover { background: #0f4275; }
  .copy-done { font-size: 12px; color: var(--ok); font-weight: 700; opacity: 0; transition: opacity 0.3s; }

  /* ---------- ops console ---------- */
  .ops-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .ops-card { background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; }
  .ops-card h3 { font-size: 14.5px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
  .ops-badge { font-size: 11.5px; font-weight: 600; color: var(--accent); background: rgba(20,80,140,0.09); border-radius: 20px; padding: 1px 10px; }
  .ops-badge.warn { color: var(--danger); background: rgba(194,59,59,0.10); }
  .proj-item { border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
  .proj-item:last-child { margin-bottom: 0; }
  .proj-item.overdue { border-left: 3px solid var(--danger); }
  .proj-item.due { border-left: 3px solid var(--ok); }
  .proj-name { font-size: 13.5px; font-weight: 700; }
  .proj-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 12px; color: var(--muted); }
  .proj-meta b { font-family: 'JetBrainsMono'; color: var(--ink); font-weight: 700; }
  .proj-flag { font-size: 11px; font-weight: 700; padding: 1px 9px; border-radius: 20px; }
  .proj-flag.late { color: #fff; background: var(--danger); }
  .proj-flag.ok { color: var(--ok); background: rgba(26,138,92,0.10); }
  .doc-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--rule); font-size: 13px; }
  .doc-row:last-of-type { border-bottom: none; }
  .doc-icon { width: 30px; height: 30px; flex: none; border-radius: 7px; background: rgba(20,80,140,0.09); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; font-family: 'JetBrainsMono'; }
  .doc-name { font-weight: 600; word-break: break-all; }
  .doc-meta { margin-left: auto; text-align: right; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
  .ops-note { margin-top: 10px; font-size: 11.8px; color: var(--muted); background: var(--bg); border-radius: 7px; padding: 8px 12px; }
  .email-stat-row { display: flex; gap: 8px; margin-bottom: 10px; }
  .email-chip { flex: 1; text-align: center; border-radius: 8px; padding: 7px 4px; font-size: 11.5px; }
  .email-chip b { display: block; font-size: 16px; font-family: 'JetBrainsMono'; }
  .ec-biz { color: var(--accent); background: rgba(20,80,140,0.09); }
  .ec-mkt { color: var(--na); background: rgba(138,148,166,0.14); }
  .ec-sec { color: var(--warn); background: rgba(194,120,10,0.12); }
  .email-row { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-bottom: 1px solid var(--rule); font-size: 12.5px; cursor: pointer; border-radius: 6px; }
  .email-row:hover { background: var(--bg); }
  .email-item.open .email-row { background: var(--bg); border-bottom-color: transparent; }
  .email-item { border-bottom: 1px solid var(--rule); }
  .email-list-box { max-height: 560px; overflow-y: auto; }
  .email-item:last-child { border-bottom: none; }
  .email-caret { color: var(--muted); font-size: 10px; flex: none; transition: transform 0.15s; }
  .email-item.open .email-caret { color: var(--accent); }
  .email-detail { background: var(--bg); margin: 0 4px 10px; border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; animation: edIn 0.18s ease; }
  @keyframes edIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
  .ed-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 11.8px; color: var(--muted); padding-bottom: 8px; border-bottom: 1px dashed var(--rule); margin-bottom: 9px; }
  .ed-meta b { color: var(--ink); font-weight: 600; margin-right: 4px; }
  .ed-body { font-size: 12.8px; line-height: 1.7; color: var(--ink); }
  .ed-att { margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--rule); font-size: 12px; }
  .ed-att b { color: var(--accent); font-size: 11.5px; display: block; margin-bottom: 5px; }
  .att-file { display: inline-block; background: var(--bg2); border: 1px solid var(--rule); border-radius: 6px; padding: 3px 10px; margin: 0 6px 5px 0; font-size: 11.5px; font-family: 'JetBrainsMono'; }
  .att-file i { color: var(--muted); font-style: normal; font-size: 10.5px; }
  .ed-actions { margin-top: 10px; display: flex; gap: 8px; }
  .email-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
  .email-dot.biz { background: var(--accent); } .email-dot.mkt { background: var(--na); } .email-dot.sec { background: var(--warn); }
  .email-subj { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .email-from { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
  .email-date { color: var(--muted); font-size: 11px; font-family: 'JetBrainsMono'; white-space: nowrap; }
  .email-unread { font-weight: 700; }
  .tax-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tax-row { display: flex; justify-content: space-between; align-items: center; background: var(--bg); border: 1px solid var(--rule); border-radius: 7px; padding: 8px 12px; font-size: 12.5px; }
  .tax-row b { font-family: 'JetBrainsMono'; color: var(--accent); }

  /* ---------- AI analysis ---------- */
  .ai-top { display: grid; grid-template-columns: 300px 1fr 290px; gap: 14px; }
  .score-card, .metrics-card, .insight-card, .risk-card { background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; }
  .score-card h3, .metrics-card h3, .insight-head h3 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
  .score-verdict { text-align: center; font-size: 12.8px; color: var(--muted); margin: -4px 0 8px; }
  .score-verdict b { font-size: 15px; }
  .v-ok { color: var(--ok); } .v-warn { color: var(--warn); } .v-danger { color: var(--danger); }
  .dim-row { display: grid; grid-template-columns: 62px 1fr 32px 28px; align-items: center; gap: 8px; font-size: 12px; padding: 3.5px 0; }
  .dim-name { color: var(--muted); cursor: help; }
  .dim-bar { height: 6px; background: var(--bg); border-radius: 4px; overflow: hidden; display: block; }
  .dim-fill { height: 100%; border-radius: 4px; display: block; }
  .dim-score { font-family: 'JetBrainsMono'; font-weight: 700; text-align: right; }
  .dim-w { color: var(--muted); font-size: 10.5px; }
  .metric-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; background: var(--bg); border-radius: 7px; font-size: 12.5px; margin-bottom: 7px; }
  .metric-row:last-child { margin-bottom: 0; }
  .metric-row b { font-family: 'JetBrainsMono'; }
  .ai-mid { display: grid; grid-template-columns: 5fr 7fr; gap: 14px; margin-top: 14px; align-items: stretch; }
  .insight-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
  .insight-head .c-sub { margin-bottom: 0; }
  #ai-insights { max-height: 380px; overflow-y: auto; }
  .insight-row { border-left: 3px solid var(--na); padding: 8px 12px; margin-bottom: 8px; background: var(--bg); border-radius: 0 7px 7px 0; }
  .insight-row:last-child { margin-bottom: 0; }
  .insight-row.danger { border-left-color: var(--danger); }
  .insight-row.warn { border-left-color: var(--warn); }
  .insight-row.ok { border-left-color: var(--ok); }
  .insight-title { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .insight-ev { font-size: 12.3px; color: var(--muted); margin-top: 2px; line-height: 1.55; }
  .insight-act { font-size: 12.3px; margin-top: 3px; color: var(--accent); font-weight: 600; line-height: 1.5; }
  .insight-link { margin-left: auto; font-size: 12px; color: var(--accent); text-decoration: none; white-space: nowrap; }
  .badge-sev { font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 20px; flex: none; }
  .bs-danger { color: #fff; background: var(--danger); }
  .bs-warn { color: var(--warn); background: rgba(194,120,10,0.12); }
  .bs-ok { color: var(--ok); background: rgba(26,138,92,0.10); }
  .bs-info { color: var(--na); background: rgba(138,148,166,0.14); }
  .rp { font-family: 'JetBrainsMono'; font-weight: 700; font-size: 11.5px; padding: 1px 8px; border-radius: 6px; }
  .rp.p1 { color: #fff; background: var(--danger); }
  .rp.p2 { color: var(--warn); background: rgba(194,120,10,0.12); }
  .rp.p3 { color: var(--muted); background: rgba(138,148,166,0.14); }
  .btn-cmd { background: rgba(20,80,140,0.09); color: var(--accent); border: 1px solid transparent; border-radius: 6px; padding: 3px 10px; font-size: 11.5px; cursor: pointer; font-family: inherit; font-weight: 600; white-space: nowrap; }
  .btn-cmd:hover { border-color: var(--accent); }

  /* ---------- sticky nav ---------- */
  html { scroll-behavior: smooth; }
  #top-nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,0.93); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--rule);
  }
  .nav-wrap { max-width: 1400px; margin: 0 auto; padding: 4px 24px; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
  .nav-brand { font-weight: 700; font-size: 12.5px; color: var(--ink); display: flex; align-items: center; padding-right: 10px; white-space: nowrap; }
  .nav-brand::after { content: ''; width: 1px; height: 14px; background: var(--rule); margin-left: 10px; }
  #top-nav a {
    padding: 8px 11px; font-size: 12.5px; color: var(--muted); text-decoration: none;
    font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; transition: color 0.15s;
    border-radius: 6px 6px 0 0;
  }
  #top-nav a:hover { color: var(--ink); }
  #top-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }
  section { scroll-margin-top: 54px; }

  #back-top {
    position: fixed; right: 22px; bottom: 26px; width: 42px; height: 42px; border-radius: 50%;
    border: none; background: var(--accent); color: #fff; font-size: 17px; cursor: pointer;
    opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 60;
    box-shadow: 0 4px 14px rgba(20,80,140,0.35);
  }
  #back-top.show { opacity: 1; pointer-events: auto; }
  #back-top:hover { background: #0f4275; }

  /* ---------- MCP 直连控制台 ---------- */
  #dc-console { background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; }
  .dc-offline { background: #fdf1f0; border: 1px solid #f0c8c4; border-left: 4px solid var(--danger); border-radius: 8px; padding: 14px 16px; font-size: 13.5px; color: #8f2f2f; }
  .dc-offline code { background: #fbe9e7; padding: 1px 6px; border-radius: 4px; font-size: 12.5px; }
  .dc-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
  #dc-tenants { display: flex; gap: 6px; }
  .dc-tenant { border: 1px solid var(--rule); background: var(--bg); border-radius: 6px; padding: 5px 12px; font-family: 'JetBrainsMono'; font-size: 12.5px; cursor: pointer; color: var(--ink); }
  .dc-tenant:hover { border-color: var(--accent); }
  .dc-tenant.active { background: var(--accent); border-color: var(--accent); color: #fff; }
  .dc-tenant.bad { opacity: 0.55; }
  .dc-badge { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: #eef3f9; color: var(--muted); }
  .dc-badge.ok { background: #e6f4ec; color: var(--ok); }
  .dc-badge.bad { background: #fdeeed; color: var(--danger); }
  #dc-count { font-size: 12.5px; color: var(--muted); }
  #dc-search { margin-left: auto; border: 1px solid var(--rule); border-radius: 6px; padding: 6px 12px; font-size: 13px; width: 220px; outline: none; }
  #dc-search:focus { border-color: var(--accent); }
  #dc-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
  .dc-qbtn { border: 1px solid #c9dcf0; background: #f0f6fc; color: var(--accent); border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
  .dc-qbtn:hover { background: #e2eefa; }
  .dc-main { display: grid; grid-template-columns: 320px 1fr; gap: 14px; }
  #dc-tools { border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); max-height: 560px; overflow-y: auto; padding: 8px; }
  .dc-cat-head { font-size: 12px; font-weight: 700; color: var(--accent); padding: 8px 8px 4px; text-transform: uppercase; letter-spacing: 0.05em; }
  .dc-cat-head i { font-style: normal; color: var(--muted); font-weight: 400; }
  .dc-tool { padding: 7px 9px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
  .dc-tool:hover { background: var(--bg2); border-color: var(--rule); }
  .dc-tool.sel { background: #eaf2fb; border-color: var(--accent); }
  .dc-tool-name { font-family: 'JetBrainsMono'; font-size: 12.5px; display: block; color: var(--ink); }
  .dc-w { font-style: normal; font-size: 10px; background: #fdf3e4; color: var(--warn); border-radius: 3px; padding: 0 4px; margin-left: 4px; }
  .dc-tool.write .dc-tool-name { color: #7a5307; }
  .dc-tool-desc { font-size: 11.5px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #dc-panel { display: none; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg2); padding: 16px; min-height: 300px; }
  #dc-form-title { font-family: 'JetBrainsMono'; font-size: 15px; color: var(--accent); margin-bottom: 4px; }
  #dc-form-desc { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
  .dc-field { display: block; margin-bottom: 10px; }
  .dc-field span { display: block; font-size: 12px; font-family: 'JetBrainsMono'; color: var(--muted); margin-bottom: 3px; }
  .dc-field.req span { color: var(--danger); font-weight: 700; }
  .dc-field input { width: 100%; border: 1px solid var(--rule); border-radius: 6px; padding: 8px 10px; font-size: 13px; font-family: 'JetBrainsMono'; outline: none; }
  .dc-field input:focus { border-color: var(--accent); }
  .dc-noparams { font-size: 13px; color: var(--muted); background: var(--bg); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
  #dc-run { display: none; background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 9px 28px; font-size: 14px; font-weight: 700; cursor: pointer; margin: 6px 0 12px; }
  #dc-run:hover { background: #0f4275; }
  #dc-run:disabled { opacity: 0.6; cursor: wait; }
  .dc-loading { font-size: 13px; color: var(--muted); padding: 12px; }
  .dc-err { font-size: 13px; color: var(--danger); background: #fdeeed; border-radius: 6px; padding: 12px; }
  .dc-res-head { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
  .dc-res-body { background: #101a2c; color: #cfe3f5; border-radius: 8px; padding: 14px; font-size: 12px; line-height: 1.55; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-all; }

  @media (max-width: 1024px) {
    .dc-main { grid-template-columns: 1fr; }
    #dc-tools { max-height: 320px; }
  }

  /* ---------- footer ---------- */
  footer { margin-top: 46px; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--muted); }
  footer p { margin-bottom: 4px; }

  @media (max-width: 1024px) {
    .chart-grid { grid-template-columns: 1fr 1fr; }
    .chart-card.wide { grid-column: span 2; }
    .qc-layout { grid-template-columns: 1fr; }
    .ops-grid { grid-template-columns: 1fr; }
    .biz-layout { grid-template-columns: 1fr; }
    .cash-grid { grid-template-columns: 1fr; }
    #kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .kpi.main { grid-column: span 2; }
    .ai-top { grid-template-columns: 1fr 1fr; }
    .metrics-card { grid-column: span 2; }
    .ai-mid { grid-template-columns: 1fr; }
  }
  @media (max-width: 680px) {
    .chart-grid { grid-template-columns: 1fr; }
    .chart-card.wide { grid-column: span 1; }
    #fn-grid, .fn-grid { grid-template-columns: 1fr; }
    #kpi-grid { grid-template-columns: 1fr; }
    .kpi.main { grid-column: span 1; }
    .h-title { font-size: 20px; }
    .email-from { display: none; }
    .ai-top { grid-template-columns: 1fr; }
    .metrics-card { grid-column: span 1; }
  }
  @media print {
    header { padding: 16px 0; }
    .tabs, .btn-copy, #qc-search, .chip-row { display: none !important; }
    .table-panel { display: block !important; }
  }
  /* ===== 04 功能台 interactive ===== */
  .fn-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 6px; }
  .fn-form label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
  .fn-form input[type="date"], .fn-form input[type="text"], .fn-form input[type="email"], .fn-form input[type="number"], .fn-form textarea {
    border: 1px solid var(--rule); border-radius: 6px; padding: 6px 9px; font-size: 13px;
    font-family: 'JetBrainsMono', 'Microsoft YaHei', monospace; background: var(--bg2); color: var(--ink); width: 150px;
  }
  .fn-form textarea { width: 100%; min-height: 88px; resize: vertical; font-size: 12px; }
  .fn-run {
    background: var(--accent); color: #fff; border: none; border-radius: 6px; padding: 7px 16px;
    font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s, opacity 0.15s;
  }
  .fn-run:hover { background: #0f3d6e; }
  .fn-run:disabled { opacity: 0.55; cursor: wait; }
  .fn-run.run-write { background: var(--warn); }
  .fn-run.run-write:hover { background: #a36408; }
  .fn-result { margin-top: 8px; background: var(--bg); border: 1px solid var(--rule); border-radius: 7px; padding: 10px 12px; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; max-height: 340px; overflow-y: auto; }
  .fn-result.ok { border-left: 3px solid var(--ok); }
  .fn-result.err { border-left: 3px solid var(--danger); color: var(--danger); }
  .fn-result h5 { font-size: 12.5px; margin: 6px 0 2px; color: var(--accent); }
  .fn-result table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 4px 0; }
  .fn-result table th, .fn-result table td { border: 1px solid var(--rule); padding: 4px 8px; text-align: left; }
  .fn-result table th { background: var(--bg2); color: var(--muted); font-weight: 600; }
  .fn-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; margin-right: 4px; }
  .fn-badge.b-ok { background: rgba(26,138,92,0.12); color: var(--ok); }
  .fn-badge.b-warn { background: rgba(194,120,10,0.14); color: var(--warn); }
  .fn-badge.b-blocker { background: rgba(194,59,59,0.14); color: var(--danger); }
  .fn-badge.b-na { background: rgba(138,148,166,0.16); color: var(--na); }

  /* KB chat markdown */
  .chat-msg.bot h4 { font-size: 14px; margin: 8px 0 4px; color: var(--accent); }
  .chat-msg.bot h5 { font-size: 13px; margin: 6px 0 3px; }
  .chat-msg.bot b { color: var(--ink); }
  .chat-msg.bot table { border-collapse: collapse; margin: 6px 0; font-size: 12px; }
  .chat-msg.bot table th, .chat-msg.bot table td { border: 1px solid var(--rule); padding: 3px 8px; }
  .chat-msg.bot hr { border: none; border-top: 1px dashed var(--rule); margin: 8px 0; }
  .chat-msg.bot code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

  /* KB chat */
  .fn-chat { grid-column: 1 / -1; display: flex; flex-direction: column; }
  .fn-chat-log { flex: 1; min-height: 200px; max-height: 320px; overflow-y: auto; background: var(--bg); border: 1px solid var(--rule); border-radius: 8px; padding: 12px; margin: 10px 0 8px; }
  .chat-msg { max-width: 88%; margin-bottom: 10px; padding: 9px 13px; border-radius: 10px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
  .chat-msg.user { background: var(--accent); color: #fff; margin-left: auto; border-bottom-right-radius: 3px; }
  .chat-msg.bot { background: var(--bg2); border: 1px solid var(--rule); margin-right: auto; border-bottom-left-radius: 3px; }
  .chat-msg.bot .src { display: block; margin-top: 6px; font-size: 11.5px; color: var(--muted); border-top: 1px dashed var(--rule); padding-top: 5px; }
  .chat-msg.loading { color: var(--muted); font-style: italic; }
  .fn-chat-input { display: flex; gap: 8px; }
  .fn-chat-input input { flex: 1; border: 1px solid var(--rule); border-radius: 7px; padding: 9px 13px; font-size: 13.5px; background: var(--bg2); color: var(--ink); }
  .fn-chat-input button { background: var(--accent); color: #fff; border: none; border-radius: 7px; padding: 0 20px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
  .fn-chat-input button:hover { background: #0f3d6e; }
  .fn-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
  .fn-chip { background: var(--bg2); border: 1px solid var(--rule); border-radius: 14px; padding: 4px 12px; font-size: 12px; color: var(--accent); cursor: pointer; }
  .fn-chip:hover { border-color: var(--accent); background: rgba(20,80,140,0.06); }

  /* classification list */
  .fn-cls-group { margin: 8px 0 2px; font-size: 12.5px; font-weight: 700; color: var(--accent); }
  .fn-cls-item { font-size: 12.5px; padding: 5px 8px; border-bottom: 1px dashed var(--rule); display: flex; gap: 8px; align-items: baseline; }
  .fn-cls-item .id { font-family: 'JetBrainsMono'; color: var(--muted); font-size: 11.5px; flex: none; }
  .fn-cls-item .sub { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fn-cls-item .from { font-size: 11.5px; color: var(--muted); flex: none; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* workpapers full-width + fullscreen */
  .fn-card.full { grid-column: 1 / -1; }
  .fn-result.tall { max-height: 800px; }
  .fn-result.fs { position: fixed; top: 56px; left: 24px; right: 24px; bottom: 24px; max-height: none; z-index: 120; background: var(--bg2); box-shadow: 0 12px 48px rgba(0,0,0,0.35); padding: 16px 20px; }
  .fn-result-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
  .fn-result-head .spacer { flex: 1; }
  .fn-result-head button { background: var(--bg2); color: var(--accent); border: 1px solid var(--accent); border-radius: 6px; padding: 6px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
  .fn-result-head button:hover { background: rgba(20,80,140,0.08); }
  .fn-result-head button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
  .fn-result-head button.primary:hover { background: #0f3d6e; }
  .fn-result-head button:disabled { opacity: 0.55; cursor: wait; }

  /* tenant selector */
  .fn-tenant { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
  .fn-tenant select { border: 1px solid var(--rule); border-radius: 6px; padding: 4px 8px; font-size: 12px; background: var(--bg2); color: var(--ink); }
  /* ===== live data / invoice center / project board / docs ===== */
  .live-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 14px 0 4px; background: var(--bg2); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 14px; }
  .live-bar label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
  .live-bar input[type="date"], .live-bar input[type="text"], .live-bar input[type="number"] {
    border: 1px solid var(--rule); border-radius: 6px; padding: 6px 9px; font-size: 13px; background: var(--bg2); color: var(--ink);
    font-family: 'JetBrainsMono', 'Microsoft YaHei', monospace;
  }
  .live-btn { background: var(--accent); color: #fff; border: none; border-radius: 6px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
  .live-btn:hover { background: #0f3d6e; }
  .live-btn:disabled { opacity: 0.55; cursor: wait; }
  .live-btn.ghost { background: var(--bg2); color: var(--accent); border: 1px solid var(--accent); }
  .live-btn.ghost:hover { background: rgba(20,80,140,0.08); }
  .live-btn.write { background: var(--warn); }
  .live-out { margin-top: 10px; background: var(--bg2); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; max-height: 420px; overflow-y: auto; }
  .live-out table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  .live-out th { text-align: left; color: var(--muted); font-size: 11.5px; border-bottom: 1.5px solid var(--rule); padding: 6px 8px; position: sticky; top: 0; background: var(--bg2); }
  .live-out td { border-bottom: 1px dashed var(--rule); padding: 5px 8px; }
  .live-out tr:hover td { background: rgba(20,80,140,0.04); }
  .live-out .sec-row td { background: var(--bg); font-weight: 700; color: var(--accent); }
  .live-out .sum-row td { font-weight: 700; border-top: 1.5px solid var(--rule); }
  .live-out .num { text-align: right; font-family: 'JetBrainsMono'; }
  .live-out h5 { margin: 8px 0 4px; color: var(--accent); font-size: 12.5px; }
  .live-msg { color: var(--muted); font-size: 12.5px; padding: 6px 2px; }
  .live-err { color: var(--danger); font-size: 12.5px; padding: 6px 2px; }

  /* bank balance cards */
  .bank-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
  .bank-card { background: var(--bg); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; }
  .bank-card.total { border-color: var(--accent); background: rgba(20,80,140,0.04); }
  .bc-name { font-weight: 700; font-size: 13px; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px dashed var(--rule); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bc-row { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 0; font-size: 12px; color: var(--muted); }
  .bc-row b { font-family: 'JetBrainsMono'; font-size: 12.5px; color: var(--ink); font-weight: 600; }
  .bc-row b.neg { color: var(--danger); }
  .bc-row b.pos { color: var(--ok); }
  .bc-row.closing { margin-top: 6px; padding-top: 7px; border-top: 1px solid var(--rule); }
  .bc-row.closing span { font-weight: 700; color: var(--ink); }
  .bc-row.closing b { font-size: 15px; font-weight: 700; color: var(--accent); }

  /* tabs-like pill group for inv center */
  .inv-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 8px; }
  .inv-tab { background: var(--bg2); border: 1px solid var(--rule); border-radius: 16px; padding: 5px 14px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
  .inv-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

  /* project board */
  .proj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 12px; }
  .proj-card { background: var(--bg2); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; }
  .proj-card h4 { font-size: 14.5px; margin-bottom: 2px; }
  .proj-meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
  .proj-status { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 11.5px; font-weight: 700; }
  .ps-INPROGRESS { background: rgba(20,80,140,0.12); color: var(--accent); }
  .ps-CLOSED { background: rgba(138,148,166,0.18); color: var(--na); }
  .proj-task { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; padding: 4px 0; border-bottom: 1px dashed var(--rule); }
  .proj-task .t-name { flex: 1; }
  .proj-task .t-charge { font-family: 'JetBrainsMono'; color: var(--muted); font-size: 11.5px; }

  /* AI doc review */
  .doc-review { margin: 12px 0; padding: 12px 14px; background: var(--bg); border: 1px solid var(--rule); border-radius: 10px; }
  .dr-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 8px; color: var(--accent); }
  .dr-head svg { flex: none; }
  .dr-sub { font-size: 11.5px; color: var(--muted); font-weight: 400; }
  .dr-head .spacer { flex: 1; }
  .doc-review select, .doc-review textarea { width: 100%; border: 1px solid var(--rule); border-radius: 7px; padding: 8px 10px; font-size: 12.5px; font-family: inherit; background: var(--bg2); color: var(--ink); margin-bottom: 8px; }
  .doc-review textarea { min-height: 58px; resize: vertical; }
  .dr-actions { display: flex; align-items: center; gap: 10px; }
  .dr-out { margin-top: 10px; }

  /* doc upload workbench */
  .doc-upload { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10px 0 8px; padding: 16px; border: 2px dashed var(--rule); border-radius: 10px; cursor: pointer; font-size: 13px; color: var(--muted); transition: all 0.15s; background: var(--bg); }
  .doc-upload:hover, .doc-upload.drag { border-color: var(--accent); color: var(--accent); background: rgba(20,80,140,0.05); }
  .doc-upload svg { flex: none; }
  .doc-progress { margin: 8px 0; display: flex; align-items: center; gap: 10px; }
  .dp-bar { flex: 1; height: 8px; background: var(--bg); border: 1px solid var(--rule); border-radius: 5px; overflow: hidden; }
  .dp-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width 0.2s; }
  .dp-text { font-size: 11.5px; color: var(--muted); font-family: 'JetBrainsMono'; white-space: nowrap; }
  .doc-del { background: none; border: none; color: var(--na); cursor: pointer; font-size: 13px; padding: 0 4px; flex: none; }
  .doc-del:hover { color: var(--danger); }

  /* docs interactive */
  .doc-row { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-bottom: 1px dashed var(--rule); font-size: 12.5px; cursor: pointer; }
  .doc-row:hover { background: rgba(20,80,140,0.05); }
  .doc-row .doc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .doc-search { display: flex; gap: 6px; margin: 8px 0; }
  .doc-search input { flex: 1; border: 1px solid var(--rule); border-radius: 6px; padding: 6px 10px; font-size: 12.5px; background: var(--bg2); color: var(--ink); }
  .doc-view { margin-top: 8px; background: var(--bg); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; font-size: 12px; max-height: 300px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
