/* Soren — answer.css: chat messages, answer modes, explore chips */

  /* ── CHAT MESSAGES ── */
  .chat-msg { display: flex; flex-direction: column; gap: 4px; animation: msgIn 0.3s ease both; }
  @keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

  .chat-msg-role {
    font-size: 10px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--stone);
  }

  .chat-msg-bubble {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 18px; max-width: 100%; overflow-wrap: break-word; word-break: break-word;
  }

  .chat-msg.user .chat-msg-bubble {
    background: #EDEAE2; border: 1px solid #E0DBD0; border-radius: 14px 14px 4px 14px;
    font-size: 15.5px; color: #1C2521; line-height: 1.5; padding: 13px 18px;
    margin-left: auto; max-width: 520px;
  }
  .chat-msg.user { align-items: flex-end; }
  .chat-msg-web-tag {
    border: 1px solid #B7C5D0; color: #52606B; font-size: 9.5px; letter-spacing: 0.12em;
    padding: 2px 6px; border-radius: 3px; flex: none; text-transform: uppercase; margin-left: 14px;
  }

  .chat-msg.assistant .chat-msg-bubble { font-size: 14px; color: var(--dark); line-height: 1.6; }

  /* ── Phase 2: new answer rendering (Semantics redesign) ── */
  .ans-header { display:flex; align-items:center; justify-content:space-between; margin:4px 0 14px; }
  .ans-eyebrow { font-size:11px; letter-spacing:.18em; text-transform:uppercase; color:#1A5238; font-weight:700; }
  .ans-semantics-pill {
    display:inline-flex; align-items:center; gap:7px; background:#DCE6EE; border:1px solid #C3D2DD;
    color:#3A4A54; font-size:12px; font-weight:600; padding:5px 12px; border-radius:20px; cursor:pointer;
  }
  .ans-semantics-pill:hover { background:#CFE0EA; }
  .ans-prose { font-size:17px; line-height:1.5; color:#1C2521; margin-bottom:22px; }

  /* concept hover tooltip — the dotted-underline term + its popover */
  .concept-term {
    position: relative; font-family:'Newsreader', serif; font-style: italic; cursor: help;
    border-bottom: 1px dotted #1A5238;
  }
  .concept-term.term-undefined { border-bottom-color: #C97752; }
  .concept-tip {
    display: none; position: absolute; top: 100%; left: 0; margin-top: 9px; width: 290px;
    background: #FBFAF7; border: 1px solid #C6D4DF; border-radius: 9px;
    box-shadow: 0 12px 32px rgba(18,40,30,.2); padding: 15px 16px; z-index: 60;
    font-style: normal; text-align: left; cursor: default;
  }
  .concept-term:hover .concept-tip { display: block; }
  .concept-tip-head { display:flex; align-items:center; justify-content:space-between; }
  .concept-tip-name { font-family:'Newsreader', serif; font-size:18px; color:#1C2521; }
  .concept-tip-type { font-family:'Hanken Grotesk', sans-serif; font-size:9.5px; letter-spacing:.14em; text-transform:uppercase; color:#8A969E; }
  .concept-tip-type.is-inferred { color:#9A4F2E; }
  .concept-tip-def { display:block; font-family:'Hanken Grotesk', sans-serif; font-size:12.5px; line-height:1.5; color:#4A544E; margin-top:8px; }
  .concept-tip-chip {
    display:inline-flex; align-items:center; gap:6px; margin-top:11px; font-family:'Hanken Grotesk', sans-serif;
    font-size:11px; font-weight:700; padding:3px 9px; border-radius:5px;
  }
  .concept-tip-chip.chip-defined { background:#DDE54C; color:#1A5238; }
  .concept-tip-chip.chip-undefined { background:rgba(201,119,82,.14); border:1px solid rgba(201,119,82,.4); color:#9A4F2E; }
  .concept-tip-chip-dot { width:5px; height:5px; border-radius:50%; }

  /* breakdown table (grouped query results — Vertical | Bookings | Customers) */
  .ans-table-head {
    display:grid; gap:22px; padding:0 0 10px; border-bottom:1px solid #DCD6CA;
  }
  .ans-table-head > div { font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:#8A857A; font-weight:600; }
  .ans-table-row { display:grid; gap:22px; padding:13px 0; border-bottom:1px solid #ECE8DF; align-items:start; }
  .ans-table-row-label { font-family:'Newsreader', serif; font-size:16.5px; color:#1C2521; padding-top:1px; }
  .ans-bar-value { font-variant-numeric: tabular-nums; font-size:13px; font-weight:500; color:#1A5238; }
  .ans-bar-value.is-lead { font-weight:700; color:#1C2521; }
  .ans-bar-track { height:6px; background:#E7E2D8; border-radius:3px; overflow:hidden; margin-top:6px; }
  .ans-bar-fill { height:100%; background:#1A5238; border-radius:3px; }
  .ans-table-row-customers { font-size:14.5px; line-height:1.5; color:#4A544E; }

  /* dedupe affordances */
  .dedupe-fuzzy-trigger { border-bottom:1.5px dotted #C97752; color:#9A4F2E; cursor:pointer; font-weight:500; }
  .dedupe-chip {
    display:inline-flex; align-items:center; gap:5px; margin-left:8px; background:rgba(201,119,82,.13);
    border:1px solid rgba(201,119,82,.35); color:#9A4F2E; font-size:11px; font-weight:600;
    padding:1px 9px; border-radius:20px; vertical-align:middle;
  }
  .dedupe-chip.is-clickable { cursor:pointer; }
  .dedupe-chip-dot { width:5px; height:5px; border-radius:50%; background:#C97752; }
  .dedupe-merged-tag { color:#1A5238; font-size:12px; font-weight:600; }
  .dedupe-confirm-box {
    margin-top:10px; background:#FBF1EA; border:1px solid rgba(201,119,82,.4); border-radius:7px; padding:12px 13px;
  }
  .dedupe-confirm-text { font-size:13px; color:#39434B; line-height:1.5; }
  .dedupe-confirm-actions { display:flex; gap:9px; margin-top:11px; }
  .dedupe-btn-merge { background:#1A5238; color:#F6F4EF; font-size:13px; font-weight:600; padding:7px 16px; border-radius:5px; cursor:pointer; border:none; }
  .dedupe-btn-keep { background:transparent; color:#5C6660; font-size:13px; font-weight:500; padding:7px 14px; border-radius:5px; border:1px solid #d8d3c8; cursor:pointer; }

  /* insight callout */
  .ans-insight {
    margin-top:24px; display:flex; align-items:flex-start; gap:11px; background:#EFEDE6;
    border:1px solid #E4DFD4; border-radius:7px; padding:14px 16px;
  }
  .ans-insight-arrow { width:18px; flex:none; font-variant-numeric:tabular-nums; font-size:12px; font-weight:700; color:#1A5238; padding-top:1px; }
  .ans-insight-text { font-size:14.5px; line-height:1.55; color:#39434B; }

  /* ── ANSWER MODE SYSTEM ── */
  .mode-kicker { font-size:10px;font-weight:700;letter-spacing:.16em;text-transform:uppercase;color:#9A958A;margin-bottom:14px;display:flex;align-items:center;gap:8px; }
  .mode-kicker-dot { width:6px;height:6px;border-radius:50%;background:#1A5238;flex-shrink:0; }
  .mode-kicker-label { color:#1A5238; }
  .mode-switch-btn { margin-left:auto;font-size:10px;font-weight:500;color:#9A958A;background:none;border:1px solid #E4DFD4;border-radius:5px;padding:2px 8px;cursor:pointer;text-transform:none;letter-spacing:0;font-family:var(--font-body); }
  .mode-switch-btn:hover { color:#1A5238;border-color:#1A5238; }
  .mode-metric-hero { font-family:var(--font-display);font-size:72px;font-weight:400;color:#1A5238;line-height:1;letter-spacing:-.02em;margin-bottom:6px; }
  .mode-metric-sub { font-size:14px;color:#9A958A;margin-bottom:16px; }
  .mode-bar-row { display:grid;grid-template-columns:160px 1fr 90px;align-items:center;gap:12px;padding:8px 0;border-bottom:1px solid #ECE8DF; }
  .mode-bar-row:last-child { border-bottom:none; }
  .mode-bar-name { font-size:13.5px;color:#1C2521;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
  .mode-bar-row.is-lead .mode-bar-name { font-weight:600; }
  .mode-bar-track { background:#E7E2D8;border-radius:3px;height:6px;position:relative;overflow:hidden; }
  .mode-bar-fill { background:#1A5238;border-radius:3px;height:6px;position:absolute;left:0;top:0; }
  .mode-bar-fill.neg { background:#6B2B2F; }
  .mode-bar-value { font-size:13px;font-weight:600;color:#1A5238;text-align:right;font-variant-numeric:tabular-nums; }
  .mode-pie-row { display:flex;align-items:center;gap:10px;padding:7px 0;border-bottom:1px solid #ECE8DF;font-size:13px; }
  .mode-pie-swatch { width:10px;height:10px;border-radius:2px;flex-shrink:0; }
  .mode-wf-row { display:grid;grid-template-columns:140px 1fr 90px;align-items:center;gap:10px;padding:7px 0;border-bottom:1px solid #ECE8DF; }
  .mode-briefing-finding { font-family:var(--font-display);font-size:22px;line-height:1.3;color:#1C2521;margin-bottom:16px;font-weight:400; }
  .mode-briefing-para { font-size:16px;line-height:1.65;color:#39434B;margin-bottom:14px; }
  .mode-briefing-pull { border-left:3px solid #1A5238;padding:8px 16px;margin:16px 0;font-family:var(--font-display);font-size:17px;font-style:italic;color:#1C2521;line-height:1.45; }
  .mode-rec-step { padding:10px 0;border-bottom:1px solid #ECE8DF; }
  .mode-rec-label { font-size:9.5px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:#9A958A;margin-bottom:4px; }
  .mode-rec-content { font-size:15px;line-height:1.5;color:#1C2521; }
  .mode-rec-next { background:#1A5238;border-radius:8px;padding:14px 18px;margin-top:14px; }
  .mode-rec-next-label { font-size:9.5px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:#9FBAA6;margin-bottom:6px; }
  .mode-rec-next-content { font-size:15px;color:#F6F4EF;line-height:1.45; }
  .mode-rec-citron { display:inline-block;background:#DDE54C;color:#1A5238;font-weight:700;border-radius:4px;padding:2px 8px;font-size:12px;margin-top:8px; }
  .mode-def-hero { font-family:var(--font-display);font-size:30px;color:#1C2521;margin-bottom:10px;font-weight:400; }
  .mode-def-sentence { font-family:var(--font-display);font-size:18px;line-height:1.55;color:#39434B;margin-bottom:14px; }
  .mode-sim-card { border:1px solid #E4DFD4;border-radius:8px;padding:12px 16px;margin-bottom:8px; }
  .mode-sim-label { font-size:10px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:#9A958A;margin-bottom:6px; }

  /* Explore chips (intent-typed follow-ups) */
  .ans-explore-label { font-size:11px; letter-spacing:.16em; text-transform:uppercase; color:#8A857A; font-weight:600; margin-bottom:12px; }
  .explore-chip {
    display:flex; align-items:center; gap:14px; border-radius:8px; padding:12px 15px; cursor:pointer;
    border:1px solid #E4DFD4; background:#FBFAF7; transition: transform 0.1s, box-shadow 0.15s;
  }
  .explore-chip:hover { box-shadow: 0 2px 8px rgba(18,40,30,.08); transform: translateY(-1px); }
  .explore-chip.intent-define { background:#FBF1EA; border-color:rgba(201,119,82,.35); }
  .explore-chip-intent { flex:none; width:74px; font-size:9.5px; letter-spacing:.1em; text-transform:uppercase; font-weight:700; color:#1A5238; }
  .explore-chip.intent-define .explore-chip-intent { color:#9A4F2E; }
  .explore-chip-text { font-size:14.5px; color:#1C2521; }
  .explore-chip-arrow { margin-left:auto; color:#A8A398; }
  .explore-chip-fix-note { margin-left:auto; font-size:11px; font-weight:600; color:#9A4F2E; }

  /* result findings inside chat */
  .result-finding {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 9px 12px; border-radius: 7px; margin-bottom: 7px;
    font-size: 13px; line-height: 1.55;
  }
  .finding-error { background: var(--rose-light); color: #7A2A2A; border-left: 3px solid var(--rose); }
  .finding-warn { background: var(--accent-light); color: var(--accent-ink); border-left: 3px solid var(--accent); }
  .finding-ok { background: var(--green-light); color: #1A4A30; border-left: 3px solid var(--green); }
  .finding-icon { flex-shrink: 0; margin-top: 1px; }

  /* finding refine button */
  .finding-wrap { position: relative; }

  .finding-refine {
    display: none; /* replaced by two buttons below */
  }

  .finding-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
    margin-left: 8px;
    align-self: flex-start;
    padding-top: 1px;
  }

  .finding-action-btn {
    font-size: 10px; font-weight: 500;
    padding: 3px 9px; border-radius: 5px;
    border: 1px solid currentColor;
    background: none; cursor: pointer;
    opacity: 0.6; transition: opacity 0.15s;
    font-family: var(--font-body);
    white-space: nowrap; flex-shrink: 0;
  }
  .finding-action-btn:hover { opacity: 1; }
  .finding-action-btn.action-item-btn { color: var(--green); }
  .finding-action-btn.edit-def-btn { color: var(--primary); }

  /* inline rule editor */
  .rule-editor {
    background: var(--surface); border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm); padding: 12px 14px;
    margin-top: 6px; margin-bottom: 8px; display: none;
    animation: msgIn 0.2s ease both;
  }
  .rule-editor.open { display: block; }

  .rule-editor-label {
    font-size: 11px; font-weight: 600; color: var(--primary);
    letter-spacing: 0.5px; margin-bottom: 8px;
  }

  .rule-editor-input {
    width: 100%; background: var(--bg); border: 1.5px solid var(--border);
    border-radius: 8px; padding: 8px 12px; font-size: 13px;
    font-family: var(--font-body); color: var(--dark); outline: none;
    resize: none; min-height: 60px; line-height: 1.5; transition: border-color 0.15s;
    margin-bottom: 8px;
  }
  .rule-editor-input:focus { border-color: var(--primary); }
  .rule-editor-input::placeholder { color: var(--stone); }

  .rule-scope-row {
    display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap;
  }

  .rule-scope-label { font-size: 11px; color: var(--muted); }

  .rule-scope-btn {
    font-size: 11px; font-weight: 500; padding: 4px 10px; border-radius: 20px;
    border: 1.5px solid var(--border); background: var(--bg); color: var(--mid);
    cursor: pointer; font-family: var(--font-body); transition: all 0.15s;
  }
  .rule-scope-btn.selected { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

  .rule-editor-actions { display: flex; gap: 7px; justify-content: flex-end; }

  .rule-save-btn {
    font-size: 12px; font-weight: 500; padding: 6px 14px; border-radius: 7px;
    background: var(--primary); color: white; border: none; cursor: pointer;
    font-family: var(--font-body); transition: opacity 0.15s;
  }
  .rule-save-btn:hover { opacity: 0.88; }

  .rule-cancel-btn {
    font-size: 12px; font-weight: 500; padding: 6px 14px; border-radius: 7px;
    background: none; border: 1.5px solid var(--border); color: var(--mid);
    cursor: pointer; font-family: var(--font-body); transition: all 0.15s;
  }
  .rule-cancel-btn:hover { border-color: var(--primary); color: var(--primary); }

  /* rules list in definitions panel */
  .rules-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }

  .rule-chip {
    display: flex; align-items: flex-start; gap: 8px;
    background: var(--primary-light); border: 1px solid var(--primary-mid);
    border-radius: 8px; padding: 8px 12px; font-size: 12px;
  }

  .rule-chip-icon { color: var(--primary); flex-shrink: 0; font-size: 12px; margin-top: 1px; }
  .rule-chip-text { flex: 1; color: var(--dark); line-height: 1.4; }
  .rule-chip-scope { font-size: 10px; color: var(--primary); margin-top: 2px; }
  .rule-chip-stamp { font-size: 10px; color: var(--muted); }

  .rule-chip-remove {
    background: none; border: none; color: var(--muted); cursor: pointer;
    font-size: 14px; line-height: 1; padding: 0; transition: color 0.15s; flex-shrink: 0;
  }
  .rule-chip-remove:hover { color: var(--rose); }

  .add-rule-inline {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--primary); cursor: pointer;
    padding: 6px 0; transition: opacity 0.15s; background: none; border: none;
    font-family: var(--font-body); font-weight: 500;
  }
  .add-rule-inline:hover { opacity: 0.7; }

  .result-body p { margin-bottom: 10px; }
  .result-body p:last-child { margin-bottom: 0; }

  /* ── ACTION ITEMS ── */
  .action-items {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; margin-top: 12px;
  }

  .action-items-header {
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--surface);
  }

  .action-items-title { font-size: 12px; font-weight: 600; color: var(--dark); }
  .action-items-count { font-size: 11px; color: var(--muted); }

  .action-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 11px 16px; border-bottom: 1px solid var(--border);
    transition: background 0.15s;
  }
  .action-item:last-child { border-bottom: none; }
  .action-item:hover { background: var(--surface); }
  .action-item.done { opacity: 0.5; }

  .action-checkbox {
    width: 16px; height: 16px; border-radius: 4px;
    border: 1.5px solid var(--border); flex-shrink: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s; margin-top: 2px;
  }
  .action-checkbox.checked { background: var(--green); border-color: var(--green); color: white; font-size: 10px; }

  .action-text { flex: 1; }
  .action-title { font-size: 13px; color: var(--dark); line-height: 1.4; }
  .action-item.done .action-title { text-decoration: line-through; color: var(--muted); }
  .action-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }

  .action-recheck {
    font-size: 11px; font-weight: 500; padding: 4px 9px; border-radius: 6px;
    background: var(--primary-light); color: var(--primary); border: none;
    cursor: pointer; font-family: var(--font-body); flex-shrink: 0; transition: all 0.15s;
  }
  .action-recheck:hover { background: var(--primary); color: white; }

  /* ── CHAT FOOTER ── */
  .chat-msg-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 8px;
  }

  .chat-stamp { font-size: 10px; color: var(--stone); font-family: monospace; }

  .chat-save-btn {
    font-size: 11px; font-weight: 500; padding: 4px 10px; border-radius: 6px;
    background: var(--primary); color: white; border: none; cursor: pointer;
    font-family: var(--font-body); transition: opacity 0.15s;
  }
  .chat-save-btn:hover { opacity: 0.88; }
  .chat-save-btn:disabled { opacity: 0.5; cursor: default; }

  /* ── THINKING ── */
  .thinking { display: flex; align-items: center; gap: 10px; padding: 16px 18px; font-size: 13px; color: var(--muted); }
  .thinking-dots { display: flex; gap: 4px; }
  .thinking-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); opacity: 0.3; animation: blink 1.2s ease infinite; }
  .thinking-dot:nth-child(2) { animation-delay: 0.2s; }
  .thinking-dot:nth-child(3) { animation-delay: 0.4s; }
  @keyframes blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

  /* ── COLOR SWATCH INLINE ── */
  .hex-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 5px; padding: 1px 6px 1px 3px;
    font-family: monospace; font-size: 11px; font-weight: 500;
    color: var(--mid); vertical-align: middle; white-space: nowrap;
  }

  .hex-swatch {
    width: 12px; height: 12px; border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.12); flex-shrink: 0; display: inline-block;
  }

  /* ── EXPANDABLE ANSWER ── */
  .answer-summary {
    font-size: 14px; font-weight: 500; color: var(--dark);
    margin-bottom: 10px; cursor: default;
  }

  .findings-wrap { }

  .findings-toggle {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; color: var(--primary); font-weight: 500;
    cursor: pointer; background: none; border: none;
    font-family: var(--font-body); padding: 4px 0; margin-top: 4px;
    transition: opacity 0.15s;
  }
  .findings-toggle:hover { opacity: 0.7; }
  .findings-toggle .toggle-arrow { transition: transform 0.2s; display: inline-block; }
  .findings-toggle.open .toggle-arrow { transform: rotate(90deg); }

  /* ── GLOBAL ACTION ITEMS PANEL ── */
  .action-panel-wrap {
    flex: 1; overflow-y: auto; padding: 24px; display: none;
  }
  .action-panel-wrap.active { display: block; }

  .action-filter-row {
    display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap;
  }

  .action-filter-btn {
    font-size: 11px; font-weight: 500; padding: 5px 12px; border-radius: 20px;
    border: 1.5px solid var(--border); color: var(--mid); background: var(--surface);
    cursor: pointer; font-family: var(--font-body); transition: all 0.15s;
  }
  .action-filter-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
  .action-filter-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

  .action-group { margin-bottom: 20px; }

  .action-group-label {
    font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
    color: var(--stone); margin-bottom: 8px;
    display: flex; align-items: center; gap: 8px;
  }

  .action-group-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

  .action-item-global {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); margin-bottom: 7px; transition: all 0.15s;
  }

  .action-item-global:hover { border-color: var(--primary-mid); }
  .action-item-global.done { opacity: 0.5; }

  .action-checkbox-global {
    width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--border);
    flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.15s; margin-top: 2px;
  }
  .action-checkbox-global.checked { background: var(--green); border-color: var(--green); color: white; font-size: 10px; }

  .action-item-global-content { flex: 1; }
  .action-item-global-title { font-size: 13px; color: var(--dark); line-height: 1.4; margin-bottom: 4px; }
  .action-item-global.done .action-item-global-title { text-decoration: line-through; color: var(--muted); }
  .action-item-global-meta { font-size: 11px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
  .action-source-chip {
    font-size: 10px; padding: 2px 7px; border-radius: 10px;
    background: var(--primary-light); color: var(--primary); font-weight: 500;
  }
  .action-priority-chip {
    font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 500;
  }
  .priority-high { background: var(--rose-light); color: var(--rose); }
  .priority-med { background: var(--accent-light); color: var(--accent-ink); }

  .action-recheck-global {
    font-size: 11px; font-weight: 500; padding: 5px 10px; border-radius: 6px;
    background: var(--primary-light); color: var(--primary); border: none;
    cursor: pointer; font-family: var(--font-body); flex-shrink: 0; transition: all 0.15s;
    white-space: nowrap;
  }
  .action-recheck-global:hover { background: var(--primary); color: white; }

  .action-empty {
    text-align: center; padding: 60px 20px; color: var(--muted); font-size: 13px;
  }

  .action-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--rose); color: white; font-size: 9px; font-weight: 600;
    margin-left: 4px; flex-shrink: 0;
  }

  /* ── DEFINITIONS PANEL ── */
  .panel-title {
    font-family: var(--font-display); font-size: 20px; font-weight: 400;
    color: var(--dark); margin-bottom: 4px;
  }
  .panel-sub { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 20px; }

  .def-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; margin-bottom: 10px;
  }

  .def-card-header {
    padding: 14px 16px; display: flex; align-items: center; gap: 10px; cursor: pointer;
    transition: background 0.15s;
  }
  .def-card-header:hover { background: var(--bg); }

  .def-card-icon { font-size: 18px; flex-shrink: 0; }
  .def-card-name { font-size: 14px; font-weight: 500; color: var(--dark); flex: 1; }
  .def-card-meta { font-size: 11px; color: var(--muted); }
  .def-card-status { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
  .status-green { background: var(--green); }
  .status-amber { background: var(--accent); border: 1px solid var(--accent-ink); }

  .def-card-body { border-top: 1px solid var(--border); padding: 14px 16px; background: var(--bg); display: none; }
  .def-card-body.open { display: block; }

  .def-detail { font-size: 12px; color: var(--mid); line-height: 1.6; margin-bottom: 10px; }

  .def-action-row { display: flex; gap: 7px; }

  .def-btn {
    font-size: 11px; font-weight: 500; padding: 6px 12px; border-radius: 7px;
    border: 1.5px solid var(--border); color: var(--mid); background: var(--surface);
    cursor: pointer; font-family: var(--font-body); transition: all 0.15s;
  }
  .def-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
  .def-btn.danger:hover { border-color: var(--rose); color: var(--rose); background: var(--rose-light); }

  .add-def-btn {
    width: 100%; padding: 11px; border-radius: var(--radius-sm); background: none;
    border: 1.5px dashed var(--border); color: var(--muted); font-family: var(--font-body);
    font-size: 13px; cursor: pointer; transition: all 0.15s; margin-top: 4px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
  }
  .add-def-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

  /* ── SETTINGS PANEL ── */
  .settings-section { margin-bottom: 24px; }
  .settings-section-title { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--stone); margin-bottom: 10px; }

  .settings-row {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 13px 16px; display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
  }

  .settings-row-icon { font-size: 16px; flex-shrink: 0; }
  .settings-row-label { font-size: 13px; font-weight: 500; color: var(--dark); flex: 1; }
  .settings-row-value { font-size: 12px; color: var(--muted); }
  .settings-row-btn {
    font-size: 11px; font-weight: 500; padding: 5px 10px; border-radius: 6px;
    border: 1.5px solid var(--border); color: var(--mid); background: none;
    cursor: pointer; font-family: var(--font-body); transition: all 0.15s; flex-shrink: 0;
  }
  .settings-row-btn:hover { border-color: var(--primary); color: var(--primary); }

  /* ── MODAL ── */
  .modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 500;
    display: none; align-items: center; justify-content: center; padding: 20px;
  }
  .modal-overlay.open { display: flex; }
  .modal {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    width: 100%; max-width: 420px; overflow: hidden;
    animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }
  @keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
  .modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
  .modal-title { font-family: var(--font-display); font-size: 16px; font-weight: 500; color: var(--dark); }
  .modal-close { background: none; border: none; font-size: 18px; color: var(--muted); cursor: pointer; line-height: 1; }
  .modal-body { padding: 20px; }
  .modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
  .modal-btn { font-size: 13px; font-weight: 500; padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer; font-family: var(--font-body); transition: opacity 0.15s; }
  .modal-btn.primary { background: var(--primary); color: white; }
  .modal-btn.primary:hover { opacity: 0.88; }
  .modal-btn.ghost { background: var(--bg); color: var(--mid); border: 1.5px solid var(--border); }

  @media (max-width: 640px) {
    .rail { display: none; }
    .topnav { padding: 0 12px; }
  }

  .editable-meta:hover {
    background: var(--primary-light);
    border-radius: 4px;
    outline: 1px dashed var(--primary);
  }


  /* ── METRICS & RELATIONSHIPS V2 ── */
  .metric-card, .rel-v2-card, .template-card, .constant-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 9px;
    padding: 12px 14px; margin-bottom: 8px;
  }
  /* Citron is reserved for badges and "moment" highlights only — never used
     as a structural border/panel accent, per brand palette rules. Metric and
     Template cards use Racing Green instead. */
  .metric-card { border-left: 3px solid #1A5238; }
  .rel-v2-card { border-left: 3px solid var(--primary); }
  .template-card { border-left: 3px solid #1A5238; }
  .card-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
  .card-meta { font-size: 11px; color: var(--stone); margin-bottom: 6px; }
  .card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

  .condition-row {
    display: flex; gap: 6px; align-items: center; margin-bottom: 6px;
    background: var(--bg-soft); padding: 6px 8px; border-radius: 6px;
  }
  .condition-row select, .condition-row input {
    padding: 4px 7px; border: 1px solid var(--border); border-radius: 5px;
    font-size: 12px; background: white;
  }
  .field-map-row {
    display: flex; gap: 6px; align-items: center; margin-bottom: 5px; font-size: 12px;
  }
  .field-map-label { width: 80px; flex-shrink: 0; font-weight: 600; color: var(--stone); font-size: 11px; }

  .placeholder-row {
    padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 12px;
    display: flex; align-items: center; gap: 8px;
  }
  .placeholder-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
  .placeholder-status.resolved { background: #1A5238; }
  .placeholder-status.flagged { background: #F59E0B; }
  .placeholder-status.unresolved { background: var(--border); }
  .placeholder-text { flex: 1; color: var(--text); }
  .placeholder-metric { font-size: 11px; color: var(--primary); font-weight: 600; }

  .three-q-step {
    background: white; border: 1px solid var(--border); border-radius: 8px;
    padding: 14px; margin-bottom: 10px;
  }
  .three-q-step h4 { font-size: 12px; font-weight: 600; color: var(--text); margin: 0 0 10px; }
  .three-q-option {
    display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px;
    border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
    margin-bottom: 6px; transition: all .12s;
  }
  .three-q-option:hover, .three-q-option.selected { border-color: var(--primary); background: var(--primary-light); }
  .three-q-option-title { font-size: 12px; font-weight: 600; color: var(--text); }
  .three-q-option-desc { font-size: 11px; color: var(--stone); margin-top: 1px; }

  /* ── CHART ── */
  .chart-type-btn {
    font-size: 10px; padding: 3px 10px; border-radius: 4px;
    border: 1px solid var(--border); background: white; cursor: pointer;
    color: var(--stone); transition: all .12s; font-weight: 500;
  }
  .chart-type-btn:hover { border-color: var(--primary); color: var(--primary); }
  .chart-type-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

  /* ── DATA RESULT CONTROLS ── */
  .data-result-controls {
    display: flex; align-items: center; gap: 8px; margin-top: 8px;
    padding-top: 8px; border-top: 1px solid var(--border);
  }
  .data-download-btn {
    font-size: 11px; padding: 4px 12px; border-radius: 5px;
    border: 1px solid var(--border); background: white; cursor: pointer;
    color: var(--text); transition: all .12s; font-weight: 500;
  }
  .data-download-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

  /* ── PROVENANCE THREAD ── */
  .prov-step {
    display: flex; gap: 10px; padding: 8px 12px;
    border-bottom: 1px solid var(--border);
  }
  .prov-step-num {
    width: 18px; height: 18px; border-radius: 50%; background: var(--primary);
    color: white; font-size: 10px; font-weight: 700; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px;
  }
  .prov-step-title {
    font-size: 11px; font-weight: 600; color: var(--text); margin-bottom: 3px;
  }
  .prov-step-detail {
    font-size: 11px; color: var(--stone); line-height: 1.5; margin-bottom: 2px;
  }

  /* ── RAIL SUBSECTIONS ── */
  .rail-subsection { margin: 2px 0; }
  .rail-subsection-header {
    display: flex; align-items: center; padding: 7px 8px; border-radius: 8px;
    cursor: pointer; gap: 8px; transition: background .12s; font-size: 12px; color: var(--mid);
  }
  .rail-subsection-header:hover { background: rgba(19,34,30,0.06); }
  .rail-subsection-header.open > .subsection-arrow { transform: rotate(90deg); }
  .subsection-arrow { font-size: 10px; color: var(--stone); flex-shrink: 0; display: inline-block; transition: transform .15s; }
  .subsection-label { flex: 1; font-size: 12px; font-weight: 500; color: var(--mid); }
  .rail-subsection-body { padding-left: 12px; }

  /* ── FIELD LINKS ── */
  .link-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 9px;
    padding: 11px 13px; margin-bottom: 8px;
  }
  .link-card-header { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
  .link-card-name { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; }
  .link-field-row {
    display: flex; align-items: center; gap: 6px; font-size: 12px;
    background: var(--bg-soft); border-radius: 6px; padding: 6px 8px; margin-bottom: 5px;
  }
  .link-source-name { font-size: 10px; font-weight: 600; color: var(--stone); text-transform: uppercase; letter-spacing: .4px; }
  .link-col-name { font-weight: 600; color: var(--text); }
  .link-arrow { color: var(--stone); font-size: 14px; flex-shrink: 0; }
  .link-primacy-badge {
    font-size: 9px; padding: 1px 5px; border-radius: 3px; font-weight: 600;
    background: var(--primary-light); color: var(--primary); flex-shrink: 0;
  }

  /* ── FOLDERS ── */
  .folder-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 10px;
    padding: 12px 14px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s;
  }
  .folder-card:hover { border-color: var(--primary); }
  .folder-card-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
  .folder-card-meta { font-size: 11px; color: var(--stone); }
  .extract-field-row {
    display: flex; align-items: center; gap: 8px; padding: 6px 8px;
    background: var(--bg-soft); border-radius: 6px; margin-bottom: 5px; font-size: 12px;
  }
  .extract-field-key { font-family: monospace; font-size: 11px; color: var(--primary); flex-shrink: 0; min-width: 80px; }

  /* ── RECENT ACTIVITY ── */
  .recent-item {
    display: flex; align-items: flex-start; gap: 8px; padding: 7px 0;
    border-bottom: 1px solid var(--border); font-size: 12px;
  }
  .recent-item:last-child { border-bottom: none; }
  .recent-item-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
  .recent-item-name { font-weight: 600; color: var(--text); }
  .recent-item-detail { color: var(--stone); }
  .recent-item-time { font-size: 10px; color: var(--stone); margin-top: 2px; }

  /* ── ACTION ITEM BUTTONS IN CHAT ── */
  .finding-action-row { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
  .finding-action-btn {
    font-size: 11px; padding: 3px 10px; border-radius: 5px; border: 1px solid var(--border);
    background: white; cursor: pointer; color: var(--text); transition: all .12s;
  }
  .finding-action-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
  .finding-action-btn.added { border-color: var(--green); color: var(--green); background: var(--green-light); cursor: default; }

  /* ── FOLDER FILE TABLE ── */
  .folder-files-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 10px; }
  .folder-files-table th { background: var(--bg-soft); padding: 6px 10px; text-align: left; font-size: 10px; font-weight: 600; color: var(--stone); border-bottom: 1px solid var(--border); }
  .folder-files-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); color: var(--text); }
  .folder-files-table tr:hover td { background: var(--primary-light); }
  .extract-status { font-size: 10px; padding: 2px 6px; border-radius: 3px; font-weight: 600; }
  .extract-status.done { background: #E8F5E9; color: #2E7D32; }
  .extract-status.pending { background: #FFF8E1; color: #F57F17; }
  .extract-status.error { background: #FFEBEE; color: #C62828; }

  /* ── DATA PANEL ── */
  .data-source-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color .15s;
  }
  .data-source-card:hover { border-color: var(--primary); }
  .data-source-card-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
  .data-source-card-meta { font-size: 11px; color: var(--stone); }
  .data-source-card-badges { display:flex; gap:5px; margin-top:6px; flex-wrap:wrap; }
  .type-badge {
    font-size: 10px; padding: 2px 7px; border-radius: 4px; font-family: monospace;
    background: var(--bg-soft); color: var(--stone); border: 1px solid var(--border);
  }
  .type-badge.number { background:#EEF6EE;color:#2E7D32;border-color:#C8E6C9; }
  .type-badge.currency { background:#FFF8E1;color:#F57F17;border-color:#FFE082; }
  .type-badge.date { background:#E3F2FD;color:#1565C0;border-color:#BBDEFB; }
  .type-badge.boolean { background:#F3E5F5;color:#6A1B9A;border-color:#CE93D8; }
  .type-badge.text { background:#FAFAFA;color:#555;border-color:#DDD; }
  .type-badge.defined { background:#E8F5E9;color:#1B5E20;border-color:#A5D6A7; }

  .data-table-wrap th {
    background: var(--bg-soft); border-bottom: 2px solid var(--border);
    padding: 7px 10px; text-align: left; font-size: 11px; font-weight: 600;
    color: var(--stone); white-space: nowrap; position: sticky; top: 0; z-index: 1;
  }
  .data-table-wrap td {
    padding: 6px 10px; border-bottom: 1px solid var(--border);
    font-size: 12px; color: var(--text); max-width: 240px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .data-table-wrap tr:hover td { background: var(--primary-light); }
  .data-table-wrap td.editing { padding:0; }
  .data-table-wrap td.editing input {
    width: 100%; padding: 6px 10px; border: none; outline: 2px solid var(--primary);
    font-size: 12px; background: white; box-sizing: border-box;
  }
  .row-action-btn {
    background: none; border: none; cursor: pointer; font-size: 11px;
    color: var(--stone); padding: 2px 5px; border-radius: 3px;
  }
  .row-action-btn:hover { background: var(--bg-soft); color: var(--text); }
  .row-action-btn.del:hover { color: #c0392b; }
  .col-chip {
    display:flex;align-items:center;gap:4px;padding:3px 8px 3px 6px;
    border-radius:5px;border:1px solid var(--border);background:white;
    font-size:11px;cursor:pointer;transition:border-color .15s;
  }
  .col-chip:hover { border-color: var(--primary); }
  .col-chip.has-def { border-color: #A5D6A7; background: #F1F8F1; }

  /* Upload modal */
  .upload-modal-overlay {
    position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:200;
    display:flex;align-items:center;justify-content:center;
  }
  .upload-modal {
    background:white;border-radius:14px;padding:28px 28px 24px;width:420px;
    box-shadow:0 20px 60px rgba(0,0,0,.2);
  }
  .upload-modal h3 { margin:0 0 4px;font-size:16px;font-weight:600; }
  .upload-modal p { margin:0 0 16px;font-size:13px;color:var(--stone); }
  .upload-modal input[type=text] {
    width:100%;padding:8px 12px;border:1px solid var(--border);border-radius:7px;
    font-size:13px;margin-bottom:12px;box-sizing:border-box;
  }
  .upload-modal input[type=text]:focus { outline:none;border-color:var(--primary); }
  .upload-drop-zone {
    border:2px dashed var(--border);border-radius:9px;padding:24px;text-align:center;
    cursor:pointer;transition:border-color .15s;margin-bottom:14px;
  }
  .upload-drop-zone:hover,.upload-drop-zone.drag-over { border-color:var(--primary); }
  .upload-drop-zone p { margin:4px 0;font-size:13px;color:var(--stone); }
  .upload-drop-zone .drop-icon { font-size:28px;margin-bottom:6px; }
  .col-def-drawer {
    position:fixed;right:0;top:0;bottom:0;width:340px;background:white;
    box-shadow:-4px 0 24px rgba(0,0,0,.12);z-index:150;padding:24px;
    transform:translateX(100%);transition:transform .2s;overflow-y:auto;
  }
  .col-def-drawer.open { transform:translateX(0); }
  .col-def-drawer h3 { margin:0 0 4px;font-size:15px;font-weight:600; }
  .col-def-drawer label { display:block;font-size:11px;font-weight:600;color:var(--stone);margin:12px 0 4px;text-transform:uppercase;letter-spacing:.4px; }
  .col-def-drawer input,.col-def-drawer textarea,.col-def-drawer select {
    width:100%;padding:7px 10px;border:1px solid var(--border);border-radius:6px;
    font-size:13px;box-sizing:border-box;font-family:inherit;
  }
  .col-def-drawer textarea { min-height:72px;resize:vertical; }
  .col-def-drawer input:focus,.col-def-drawer textarea:focus,.col-def-drawer select:focus {
    outline:none;border-color:var(--primary);
  }


/* ── PROJECTION (entity list + appended columns, per-column trust) ── */
.proj-wrap { overflow-x:auto; border:1px solid var(--border); border-radius:8px; margin-top:12px; }
.proj-table { width:100%; border-collapse:collapse; font-family: var(--font-body); }
.proj-table thead th {
  padding:8px 12px; font-size:11px; font-weight:600; color:var(--stone);
  background:#F1EEE7; border-bottom:2px solid var(--border); white-space:nowrap;
  text-transform:none; letter-spacing:0;
}
.proj-table tbody td { padding:7px 12px; font-size:12.5px; border-bottom:1px solid var(--border); color:#1C2521; }
.proj-table tbody tr:nth-child(even) td { background:#FAF8F3; }
.proj-rank { display:inline-block; min-width:18px; color:var(--stone); font-size:11px; font-variant-numeric:tabular-nums; }
.proj-sortmark { color:var(--primary); font-size:9px; }

/* per-column trust chips — governed vs web must read differently */
.proj-chip {
  display:inline-block; font-size:9px; font-weight:700; letter-spacing:.06em;
  text-transform:uppercase; padding:1px 6px; border-radius:5px; margin-left:6px; vertical-align:middle;
}
.proj-chip-key { background:transparent; color:var(--stone); font-weight:500; }
.proj-chip-governed { background:rgba(26,82,56,.1); color:#1A5238; border:1px solid rgba(26,82,56,.3); }
.proj-chip-field { background:#DCE6EE; color:#2F5168; border:1px solid #C6D4DF; }
.proj-chip-web { background:#F4E9D6; color:#8A5A1E; border:1px solid #E4CFA6; }
.proj-chip-web-cert { background:rgba(26,82,56,.1); color:#1A5238; border:1px solid rgba(26,82,56,.3); }

.proj-refresh {
  margin-left:6px; border:1px solid var(--border); background:#fff; color:var(--stone);
  border-radius:5px; padding:0 6px; font-size:12px; cursor:pointer; line-height:1.6;
}
.proj-refresh:hover { color:#1A5238; border-color:#A9C3B4; }
.proj-refresh:disabled { opacity:.6; cursor:default; }

.proj-source { font-size:11px; color:var(--stone); margin-top:7px; }
.proj-source a { color:#2F5168; }
.proj-foot { font-size:11px; color:var(--stone); margin-top:5px; }

.proj-flag {
  font-size:12px; color:#8A5A1E; background:#F8F1E3; border:1px solid #E4CFA6;
  border-radius:7px; padding:8px 11px; margin-top:12px; line-height:1.45;
}
.proj-flag a { color:#1A5238; font-weight:600; }

.proj-confirm {
  border:1px solid #E4CFA6; background:#FBF6EC; border-radius:9px; padding:14px 16px; margin-top:12px;
}
.proj-confirm-title { font-family: var(--font-display); font-size:15px; color:#1C2521; margin-bottom:5px; }
.proj-confirm-body { font-size:12.5px; color:#5C6660; line-height:1.5; margin-bottom:11px; }
.proj-confirm-btn {
  background:#1A5238; color:#F6F4EF; border:none; border-radius:7px; padding:8px 15px;
  font-size:12.5px; font-weight:600; cursor:pointer; font-family: var(--font-body);
}
.proj-confirm-btn:hover { background:#16442F; }
.proj-confirm-btn:disabled { opacity:.7; cursor:default; }

/* projection Keep/Delete (web columns → governed field) */
.proj-keep {
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  margin-top:12px; padding:10px 12px; border:1px solid #E4CFA6; background:#FBF6EC; border-radius:8px;
}
.proj-keep-label { font-size:12px; color:#5C6660; flex:1; min-width:200px; }
.proj-keep-btn { background:#1A5238; color:#F6F4EF; border:none; border-radius:6px; padding:5px 13px; font-size:12px; font-weight:600; cursor:pointer; font-family:var(--font-body); }
.proj-keep-btn:hover { background:#16442F; }
.proj-del-btn { background:transparent; color:#9A4F2E; border:1px solid #D9B89A; border-radius:6px; padding:5px 13px; font-size:12px; cursor:pointer; font-family:var(--font-body); }
.proj-del-btn:hover { background:#F3E7DA; }
.proj-keep-btn:disabled, .proj-del-btn:disabled { opacity:.6; cursor:default; }

/* ════════════════════════════════════════════════════════════════════════
   ANSWER CARD — eight regions, two trust states, three-station provenance.
   Color roles (one job each): green=governed/metric/action · citron=review/
   model · ice-blue=field/from-layer · slate=table · oxblood=destructive.
   ════════════════════════════════════════════════════════════════════════ */
.ans-card.assistant { background:transparent; border:none; padding:0; }
.ans-card-body {
  background:#FBFAF7; border:1px solid #E1DBCF; border-radius:6px;
  box-shadow:0 1px 4px rgba(20,30,25,.08); padding:22px 24px 14px;
}

/* 1 · meta row */
.ans-meta { display:flex; align-items:center; gap:7px; margin-bottom:12px; }
.ans-kdot { width:8px; height:8px; border-radius:50%; background:#C7CF3A; flex-shrink:0; }
.k-metric,.k-ranking,.k-segmentation,.k-trend,.k-matrix,.k-position { background:#1A5238; }
.ans-klabel { font-size:11px; font-weight:700; letter-spacing:.13em; color:#1C2521; font-family:'Hanken Grotesk',sans-serif; }
.ans-ksub { font-size:11px; color:#A39E92; font-family:'Hanken Grotesk',sans-serif; }

/* 2 · lede */
.ans-lede { margin-bottom:16px; }
.ans-q { font-size:10px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:#A39E92; margin-bottom:8px; font-family:'Hanken Grotesk',sans-serif; }
.ans-headline { font-family:'Newsreader',serif; font-size:29px; line-height:1.22; font-weight:500; color:#1C2521; letter-spacing:-.01em; }
.ans-headline strong { font-weight:600; }

/* 3 · hero */
.ans-hero { margin:6px 0 16px; }
.ans-hero:empty { display:none; }
.hero { position:relative; }
.hero-quote { background:#F2F4EF; border-radius:12px; padding:26px 30px 28px; position:relative; overflow:hidden; }
.hero-quote-mark { position:absolute; top:-6px; left:14px; font-family:'Newsreader',serif; font-size:96px; color:rgba(26,82,56,.10); line-height:1; }
.hero-quote-text { position:relative; font-family:'Newsreader',serif; font-size:22px; line-height:1.4; color:#1C2521; font-style:italic; }
.hero-quote-text strong { font-style:normal; background:linear-gradient(transparent 62%, #F3F4D8 62%); padding:0 2px; }
.hero-quote-cite { margin-top:12px; font-size:12px; color:#7E852A; font-family:'Hanken Grotesk',sans-serif; }
.hero-image { margin:0; border-radius:12px; overflow:hidden; background:#F2F4EF; }
.hero-image img { width:100%; max-height:300px; object-fit:cover; display:block; }
.hero-image figcaption { font-family:'Newsreader',serif; font-style:italic; font-size:11px; color:#9A958A; padding:8px 12px; }

/* Position hero — percentile / rank-in-context */
.hero-position { background:#F2F4EF; border-radius:12px; padding:22px 24px; }
.pos-focal { font-family:'Newsreader',serif; font-size:21px; color:#1C2521; margin-bottom:16px; }
.pos-rank { font-family:'Hanken Grotesk',sans-serif; font-size:13px; color:#7E852A; font-weight:600; margin-left:6px; }
.pos-track { position:relative; height:8px; background:#DCE6EE; border-radius:5px; }
.pos-fill { position:absolute; left:0; top:0; bottom:0; background:#9FB6C8; border-radius:5px; }
.pos-marker { position:absolute; top:50%; width:16px; height:16px; border-radius:50%; background:#1A5238; border:3px solid #FBFAF7; transform:translate(-50%,-50%); box-shadow:0 1px 3px rgba(20,30,25,.25); }
.pos-scale { display:flex; justify-content:space-between; margin-top:10px; font-size:11px; color:#9A958A; font-family:'Hanken Grotesk',sans-serif; }
.pos-pct { color:#1A5238; font-weight:600; }
.pos-val { margin-top:12px; font-family:'JetBrains Mono',monospace; font-size:14px; color:#1C2521; }

/* 4 · support */
.ans-support { font-size:14px; line-height:1.62; color:#4A544E; margin-bottom:4px; }
.ans-support p { margin:0 0 8px; }

/* 5 · status row */
.ans-status { display:flex; align-items:center; justify-content:space-between; margin:14px -24px 0; padding:10px 24px; background:#F8F6F0; border-top:1px solid #ECE8DF; }
.ans-status-l { display:flex; align-items:center; gap:8px; }
.trust-chip { display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:700; letter-spacing:.04em; padding:3px 10px; border-radius:20px; font-family:'Hanken Grotesk',sans-serif; }
.trust-chip .trust-dot { width:7px; height:7px; border-radius:50%; }
.trust-chip.governed { background:#E6F0EB; color:#1A5238; } .trust-chip.governed .trust-dot { background:#1A5238; }
.trust-chip.review { background:#F3F4D8; color:#7E852A; } .trust-chip.review .trust-dot { background:#C7CF3A; }
.ans-i { background:none; border:none; cursor:pointer; font-size:14px; color:#A39E92; padding:0 2px; line-height:1; }
.ans-i:hover,.ans-i.open { color:#1A5238; }
.ans-status-r { display:flex; align-items:center; gap:14px; }
.ans-act { background:none; border:none; cursor:pointer; font-size:12.5px; color:#7C766A; font-family:'Hanken Grotesk',sans-serif; padding:0; }
.ans-act:hover { color:#1A5238; }

/* 6 · provenance panel — ALWAYS ice-blue inset, both trust states */
.prov-wrap { margin:0 -24px; padding:0; border-top:1px solid #ECE8DF; background:#FBFAF7; }
.prov-inner { margin:16px 22px 22px; padding:24px 26px; border:1px solid #9FB6C8; background:#EBF1F5; border-radius:12px; }
.prov-heading { font-family:'Newsreader',serif; font-size:20px; color:#1C2521; margin-bottom:20px; }
.prov-thread { position:relative; }
.pthread-rail { position:absolute; left:6px; top:8px; bottom:40px; width:2px; background:#BBD0DD; }
.pstation { position:relative; padding-left:30px; padding-bottom:24px; }
.pstation.last { padding-bottom:0; }
.pnode { position:absolute; left:0; top:2px; width:14px; height:14px; border-radius:50%; border:3px solid #EBF1F5; background:#C6C0B2; }
.pnode.green { background:#1A5238; } .pnode.citron { background:#C7CF3A; } .pnode.mute { background:#C6C0B2; }
.pst-h { font-size:9px; letter-spacing:.16em; text-transform:uppercase; font-weight:700; color:#7C8A92; margin-bottom:8px; font-family:'Hanken Grotesk',sans-serif; }
.pst-h.muted { color:#9A958A; }
.pst-empty { font-family:'Newsreader',serif; font-style:italic; font-size:13px; color:#9A958A; }
.ptoks { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
.ptok { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; color:#1C2521; background:#fff; border:1px solid #C6D4DF; border-radius:7px; padding:3px 9px; font-family:'Hanken Grotesk',sans-serif; }
.ptok-dot { width:9px; height:9px; flex-shrink:0; }
.ptok-dot.metric { border-radius:50%; background:#1A5238; }
.ptok-dot.field { border-radius:2px; background:#3A6076; }
.ptok-dot.table { border-radius:1px; background:#8A93A0; }
.pst-how { font-size:12.5px; color:#3F4945; }
.pst-tag { display:inline-block; font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:#7E852A; background:#F3F4D8; border:1px solid #DDE0A0; border-radius:5px; padding:3px 8px; }
.pst-src { display:block; font-size:12px; color:#2F5168; background:#fff; border:1px solid #C6D4DF; border-radius:6px; padding:4px 9px; margin-top:6px; text-decoration:none; }
.pst-src:hover { border-color:#9FB6C8; }
.pst-rechead { display:flex; justify-content:flex-end; margin-bottom:8px; }
.pst-csv { font-size:11px; color:#2F5168; background:#fff; border:1px solid #C6D4DF; border-radius:6px; padding:4px 10px; cursor:pointer; font-weight:600; font-family:'Hanken Grotesk',sans-serif; }
.prec { width:100%; border-collapse:collapse; font-size:12px; border:1px solid #C6D4DF; border-radius:8px; overflow:hidden; background:#fff; }
.prec th { text-align:left; padding:7px 10px; font-size:9px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:#7C8A92; background:#F2F6F8; border-bottom:1px solid #E4ECF1; }
.prec td { padding:6px 10px; color:#1C2521; border-bottom:1px solid #ECEFEA; }
.prec tr:last-child td { border-bottom:none; }
.prec td.num { text-align:right; font-family:'JetBrains Mono',monospace; }
.pst-recfoot { display:flex; justify-content:space-between; align-items:center; margin-top:8px; font-size:11px; color:#9A958A; }
.prec-pager button { background:none; border:none; cursor:pointer; font-size:11px; color:#2F5168; font-weight:600; font-family:'Hanken Grotesk',sans-serif; padding:0 4px; }
.prec-pager button:disabled { color:#C2BCAF; cursor:default; }
.pconf { margin-top:20px; padding-top:16px; border-top:1px solid #C6D4DF; }
.pconf-label { font-size:9px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:#A39E92; font-family:'Hanken Grotesk',sans-serif; }
.pconf-text { display:block; font-size:13px; color:#3F4945; margin-top:5px; }

/* 7 · credit line */
.ans-credit { font-family:'JetBrains Mono',monospace; font-size:11px; color:#A39E92; padding:12px 0 4px; }

/* 8 · follow-up */
.ans-followup { display:flex; align-items:center; gap:8px; margin-top:14px; background:#FBFAF7; border:1px solid #E4DFD4; border-radius:10px; padding:8px 12px; }
.ans-followup input { flex:1; background:none; border:none; outline:none; font-family:'Hanken Grotesk',sans-serif; font-size:14px; color:#1C2521; }
.ans-followup button { width:34px; height:34px; border-radius:8px; background:#1A5238; color:#F6F4EF; border:none; font-size:15px; cursor:pointer; flex-shrink:0; }

/* thinking placeholder — answer-panel shaped, holds the question while working */
.ans-thinking .k-thinking { background:#C7CF3A; }
.ans-think { display:flex; align-items:center; gap:12px; padding:18px 0 8px; }
.ans-think-dots { display:flex; gap:5px; }
.ans-think-dots span { width:7px; height:7px; border-radius:50%; background:#1A5238; opacity:.35; animation:athink 1.1s infinite; }
.ans-think-dots span:nth-child(2){ animation-delay:.18s; } .ans-think-dots span:nth-child(3){ animation-delay:.36s; }
@keyframes athink { 0%,100%{ opacity:.25; transform:translateY(0); } 40%{ opacity:.9; transform:translateY(-3px); } }
.ans-think-label { font-family:'Newsreader',serif; font-style:italic; font-size:15px; color:#7C766A; }

/* Should / recommendation — hypotheses + data diagnosis */
.mode-rec-hyps { margin:6px 0 0; padding-left:20px; }
.mode-rec-hyps li { font-size:14.5px; line-height:1.5; color:#1C2521; margin-bottom:8px; padding-left:4px; }
.mode-rec-hyps li::marker { color:#1A5238; font-weight:700; }

/* Should — forecast bridge to goal + ranked contribution table */
.hero-bridge { background:#F2F4EF; border-radius:12px; padding:22px 24px; }
.brg-head { display:flex; align-items:baseline; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.brg-verdict { font-size:12px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; padding:3px 10px; border-radius:20px; }
.brg-verdict.good { background:#E6F0EB; color:#1A5238; }
.brg-verdict.short { background:#F3F4D8; color:#7E852A; }
.brg-sub { font-size:13px; color:#3F4945; font-family:'JetBrains Mono',monospace; }
.brg-track { position:relative; height:30px; background:#E4E7E0; border-radius:6px; overflow:hidden; }
.brg-seg { position:absolute; top:0; bottom:0; background:#1A5238; border-right:1.5px solid #F2F4EF; }
.brg-seg.cushion { background:#7FA890; }
.brg-seg.cross { background:#2A7A56; }
.brg-goal { position:absolute; top:-4px; bottom:-4px; width:2px; background:#7B2D26; }
.brg-goal span { position:absolute; top:-15px; left:50%; transform:translateX(-50%); font-size:9px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:#7B2D26; }
.brg-note { margin-top:12px; font-size:13px; color:#3F4945; }
.brg-table-wrap { margin:16px 0 4px; overflow-x:auto; }
.brg-table { width:100%; border-collapse:collapse; font-size:12.5px; }
.brg-table th { text-align:left; padding:7px 10px; font-size:9px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:#9A958A; border-bottom:1px solid #E1DBCF; }
.brg-table td { padding:7px 10px; color:#1C2521; border-bottom:1px solid #F1EEE7; }
.brg-table td.num, .brg-table th.num { text-align:right; font-family:'JetBrains Mono',monospace; }
.brg-table tr.cross td { background:#EBF1F5; font-weight:600; }
.brg-table tr.cross td:first-child { box-shadow:inset 3px 0 0 #1A5238; }
.brg-assumed { margin:14px 0; padding:10px 14px; background:#F3F4D8; border:1px solid #DDE0A0; border-radius:8px; font-size:13px; color:#5C6212; }
.brg-assumed-mark { color:#7E852A; }
.brg-assumed strong { color:#1A5238; }

/* forecast weighting — keep/delete the assumed column */
.brg-table td.assumed-col { color:#7E852A; }
.brg-table th.num.assumed-col { color:#7E852A; }
.brg-assumed { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:14px 0; padding:10px 14px; background:#F3F4D8; border:1px solid #DDE0A0; border-radius:8px; font-size:13px; color:#5C6212; }
.brg-assumed.plain { background:#F2F4EF; border-color:#E1DBCF; color:#7C766A; }
.brg-assumed-mark { color:#7E852A; }
.brg-acts { display:inline-flex; gap:8px; margin-left:auto; }
.brg-keep, .brg-del { font-size:12px; font-weight:600; padding:4px 11px; border-radius:6px; cursor:pointer; font-family:'Hanken Grotesk',sans-serif; border:1px solid; }
.brg-keep { background:#1A5238; color:#F6F4EF; border-color:#1A5238; }
.brg-keep:hover { background:#16352C; }
.brg-del { background:#fff; color:#7B2D26; border-color:#C8A39E; }
.brg-del:hover { background:#FBF3F1; }

  /* ── Drill-down (aggregate → entities → records) ─────────────────────── */
  .drill-hint { color: var(--stone); font-size: 11px; }
  .mode-pie-row[onclick]:hover, .mode-bar-row[onclick]:hover { background: #F2F5F0; border-radius: 6px; }
  .drill-panel { margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
  .drill-crumbs { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--divider); background: #F3F1EB; font-size: 12.5px; flex-wrap: wrap; }
  .drill-crumb { color: #3A6076; cursor: pointer; font-weight: 600; }
  .drill-crumb:hover { text-decoration: underline; }
  .drill-crumb.current { color: var(--dark); cursor: default; }
  .drill-crumb.current:hover { text-decoration: none; }
  .drill-sep { color: var(--stone); font-size: 10px; }
  .drill-x { margin-left: auto; color: var(--stone); cursor: pointer; font-size: 12px; }
  .drill-x:hover { color: var(--rose); }
  .drill-loading { padding: 14px; font-size: 12.5px; color: var(--stone); }
  .drill-row { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--divider); font-size: 13px; cursor: pointer; }
  .drill-row:hover { background: #F2F5F0; }
  .drill-row:last-child { border-bottom: none; }
  .drill-row-name { flex: 1; color: var(--dark); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .drill-row-count { color: var(--stone); font-size: 12px; white-space: nowrap; }
  .drill-row-share { color: var(--primary); font-weight: 600; min-width: 36px; text-align: right; }
  .drill-row-val { color: var(--dark); font-variant-numeric: tabular-nums; min-width: 70px; text-align: right; }
  .drill-rec-head, .drill-rec { display: flex; gap: 12px; padding: 7px 14px; font-size: 12.5px; border-bottom: 1px solid var(--divider); }
  .drill-rec-head { background: #F1EEE7; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
  .drill-rec:last-child { border-bottom: none; }
  .drill-rec-head span, .drill-rec span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .drill-rec span.num { text-align: right; font-variant-numeric: tabular-nums; flex: 0 0 90px; }
  .drill-rec-head span:first-child, .drill-rec span:first-child { flex: 2; }
