/* ============================================================
   Hi-fi pass — warm editorial executive brief
   All rules scoped under .hifi-view so they don't bleed
   into wireframe tabs.
   ============================================================ */

.hifi-view {
  --hf-bg:          #f0ede8;
  --hf-panel:       #ffffff;
  --hf-panel2:      #f8f5f0;
  --hf-ink:         #1a1714;
  --hf-ink2:        #4a4540;
  --hf-muted:       #8a837a;
  --hf-faint:       #bdb8b0;
  --hf-line:        #e4dfd7;
  --hf-amber:       #c2610a;
  --hf-amber-soft:  #fdf1e6;
  --hf-green:       #2e7d52;
  --hf-green-soft:  #e8f4ee;
  --hf-red:         #b93a2a;
  --hf-red-soft:    #fcecea;
  --hf-shadow:      0 1px 3px rgba(26,23,20,.06), 0 4px 14px rgba(26,23,20,.05);
  --hf-shadow-lg:   0 2px 8px rgba(26,23,20,.08), 0 12px 32px rgba(26,23,20,.08);
  --hf-r:           6px;
  --hf-serif: var(--font-title, "Newsreader", Georgia, "Times New Roman", serif);
  --hf-sans:  var(--font-ui, "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif);
  --hf-mono:  var(--font-ui, "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif);

  background: var(--hf-bg);
  font-family: var(--hf-sans);
  color: var(--hf-ink);
}

/* ---- masthead ---- */
.hf-masthead {
  display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap;
  border-bottom: 2px solid var(--hf-ink);
  padding-bottom: 14px; margin-bottom: 20px;
}
.hf-brand {
  font-family: var(--hf-mono); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--hf-muted); margin-bottom: 4px;
}
.hf-masthead-left { display: flex; flex-direction: column; }
.hf-masthead-title {
  font-family: var(--hf-serif); font-size: 32px; font-weight: 700;
  line-height: 1; letter-spacing: 0; color: var(--hf-ink);
}
.hf-masthead-right { margin-left: auto; text-align: right; display: flex; flex-direction: column; gap: 4px; }
.hf-meta { font-size: 12px; color: var(--hf-muted); font-family: var(--hf-mono); letter-spacing: .06em; }
.hf-region-chips { display: flex; gap: 0; justify-content: flex-end; }
.hf-rc {
  border: 1px solid var(--hf-line); border-left: none;
  padding: 3px 11px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--hf-muted); font-family: var(--hf-mono); cursor: pointer; background: var(--hf-panel);
}
.hf-rc:first-child { border-left: 1px solid var(--hf-line); border-radius: 3px 0 0 3px; }
.hf-rc:last-child { border-radius: 0 3px 3px 0; }
.hf-rc.active { background: var(--hf-ink); color: #f0ede8; border-color: var(--hf-ink); }

/* ---- focus bar ---- */
.hf-focus-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--hf-panel); border: 1px solid var(--hf-line);
  border-radius: var(--hf-r); padding: 10px 16px; margin-bottom: 16px;
  box-shadow: var(--hf-shadow);
}
.hf-focus-label {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 700; color: var(--hf-amber); display: flex; align-items: center; gap: 7px;
  white-space: nowrap;
}
.hf-focus-count { color: var(--hf-muted); font-weight: 400; }
.hf-focus-hint { font-size: 12px; color: var(--hf-faint); }
.hf-focus-chip {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid var(--hf-amber); background: var(--hf-amber-soft);
  border-radius: 999px; padding: 4px 8px 4px 13px;
  font-size: 12px; color: var(--hf-ink2);
}
.hf-focus-chip b { color: var(--hf-amber); }
.hf-focus-chip .hf-trend { font-weight: 700; font-size: 11px; }
.hf-focus-chip .hf-trend.down { color: var(--hf-amber); }
.hf-focus-chip .hf-trend.up { color: var(--hf-green); }
.hf-focus-chip .hf-xbtn { border: none; background: none; color: var(--hf-faint); cursor: pointer; font-size: 14px; }

/* ---- claims list ---- */
.hf-claims { display: flex; flex-direction: column; gap: 12px; }
.hf-claim {
  background: var(--hf-panel); border-radius: var(--hf-r);
  box-shadow: var(--hf-shadow); overflow: hidden; position: relative;
}
.hf-claim::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--hf-line); border-radius: var(--hf-r) 0 0 var(--hf-r); }
.hf-claim.risk::before { background: var(--hf-amber); }
.hf-claim.good::before { background: var(--hf-green); }

.hf-hd {
  display: grid; grid-template-columns: 36px 1fr auto; align-items: start;
  gap: 18px; padding: 18px 20px 18px 24px; cursor: pointer;
}
.hf-hd:hover { background: var(--hf-panel2); }
.hf-num {
  font-family: var(--hf-mono); font-size: 11px; letter-spacing: .12em;
  color: var(--hf-faint); font-weight: 700; padding-top: 5px;
}
.hf-claim.risk .hf-num { color: var(--hf-amber); }
.hf-claim.good .hf-num { color: var(--hf-green); }

.hf-main { display: flex; flex-direction: column; gap: 8px; }
.hf-claim-title { font-family: var(--hf-serif); font-size: 20px; font-weight: 700; line-height: 1.2; color: var(--hf-ink); }
.hf-claim.risk .hf-claim-title { color: var(--hf-ink); }
.hf-claim-sub { font-size: 14px; color: var(--hf-ink2); line-height: 1.6; max-width: 90ch; }
.hf-claim-sub b { color: var(--hf-ink); }
.hf-claim-sub span.hi { color: var(--hf-amber); font-weight: 700; }

.hf-kpis { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.hf-kpi {
  border: 1px solid var(--hf-line); background: var(--hf-panel2); border-radius: 4px;
  padding: 7px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 130px;
}
.hf-kpi .hk-l { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--hf-muted); font-weight: 700; }
.hf-kpi .hk-v { font-family: var(--hf-mono); font-size: 20px; font-weight: 700; color: var(--hf-ink); line-height: 1.1; }
.hf-kpi .hk-d { font-size: 11px; font-weight: 700; }
.hf-kpi .hk-d.up { color: var(--hf-green); }
.hf-kpi .hk-d.down { color: var(--hf-amber); }
.hf-kpi.alert .hk-v { color: var(--hf-amber); }

.hf-hd-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hf-star-btn {
  width: 34px; height: 34px; border: 1px solid var(--hf-line); background: var(--hf-panel);
  border-radius: 4px; display: grid; place-items: center; cursor: pointer;
  font-size: 15px; color: var(--hf-faint); flex-shrink: 0;
}
.hf-star-btn:hover { border-color: var(--hf-amber); color: var(--hf-amber); }
.hf-star-btn.on { color: var(--hf-amber); border-color: var(--hf-amber); background: var(--hf-amber-soft); }
.hf-ev-btn {
  border: 1px solid var(--hf-line); background: var(--hf-panel); border-radius: 4px;
  padding: 7px 13px; cursor: pointer; font-size: 12px; letter-spacing: .07em;
  text-transform: uppercase; font-weight: 700; color: var(--hf-ink2); white-space: nowrap;
}
.hf-ev-btn:hover { border-color: var(--hf-ink2); }
.hf-assign-btn {
  border: 1px solid var(--hf-line); background: var(--hf-panel); border-radius: 4px;
  padding: 7px 13px; cursor: pointer; font-size: 12px; letter-spacing: .07em;
  text-transform: uppercase; font-weight: 700; color: var(--hf-ink2); white-space: nowrap;
}
.hf-assign-btn:hover { border-color: var(--hf-ink2); }

/* ---- evidence panel ---- */
.hf-evidence {
  display: none; border-top: 1px solid var(--hf-line);
  background: var(--hf-panel2); padding: 20px;
}
.hf-claim.open .hf-evidence { display: block; }
.hf-ev-label {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--hf-muted); font-weight: 700; display: flex; align-items: center;
  gap: 10px; margin-bottom: 16px;
}
.hf-ev-label::after { content: ""; flex: 1; height: 1px; background: var(--hf-line); }
.hf-ev-grid { display: grid; gap: 12px; }
.hf-panel {
  background: var(--hf-panel); border-radius: 4px;
  border: 1px solid var(--hf-line); overflow: hidden;
}
.hf-panel-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--hf-line);
}
.hf-panel-hd h4 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .02em; font-family: var(--hf-mono); }
.hf-panel-hd .hf-tag { margin-left: auto; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--hf-muted); font-family: var(--hf-mono); }
.hf-panel-bd { padding: 14px; }

/* charts reuse wireframe primitives with colour overrides */
.hifi-view .bar { background: #c8c0b4; }
.hifi-view .bar.dark { background: #a09891; }
.hifi-view .chart-grid { background-image: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), #ede9e3 calc(25% - 1px), #ede9e3 25%); }
.hifi-view .line-overlay polyline { stroke: var(--hf-ink); }
.hifi-view .bars-axis { color: var(--hf-muted); font-size: 11px; font-family: var(--hf-mono); }
.hifi-view .hbar .fillbar { background: #a09891; }
.hifi-view .hbar .fillbar.weak { background: #c8c0b4; opacity: .7; }
.hifi-view .hbar .lab { color: var(--hf-ink2); font-family: var(--hf-sans); }
.hifi-view .hbar .val { color: var(--hf-ink); font-family: var(--hf-mono); font-size: 11px; }
.hifi-view .legend { font-size: 11px; color: var(--hf-muted); font-family: var(--hf-sans); }

/* hf table */
.hf-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.hf-tbl th { text-align: left; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--hf-muted); font-weight: 700; padding: 7px 10px; border-bottom: 1px solid var(--hf-line); font-family: var(--hf-mono); }
.hf-tbl td { padding: 10px; border-bottom: 1px solid var(--hf-line); color: var(--hf-ink2); vertical-align: top; }
.hf-tbl tr:last-child td { border-bottom: none; }
.hf-tbl tr.flag-row { background: var(--hf-amber-soft); }
.hf-tbl tr.flag-row td:first-child { font-weight: 700; color: var(--hf-ink); }
.hf-pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border: 1.5px solid; }
.hf-pill.high { color: var(--hf-amber); border-color: var(--hf-amber); background: var(--hf-amber-soft); }
.hf-pill.med  { color: var(--hf-ink2); border-color: var(--hf-line); }

/* ai recommendation callout */
.hf-rec {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--hf-amber-soft); border: 1px solid var(--hf-amber);
  border-radius: 4px; padding: 13px 16px; margin-top: 12px;
}
.hf-rec-mark {
  flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--hf-amber);
  color: var(--hf-amber); display: grid; place-items: center; font-size: 9px;
  font-weight: 800; letter-spacing: 0; margin-top: 1px;
}
.hf-rec-body { font-size: 13px; color: var(--hf-ink2); line-height: 1.6; }
.hf-rec-body b { color: var(--hf-ink); }
.hf-rec-conf { font-size: 11px; color: var(--hf-amber); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-top: 4px; }

/* hbars override for hi-fi (narrower label col in some panels) */
.hifi-view .hbar { grid-template-columns: 170px 1fr 42px; }

/* ask bar (hi-fi) */
.hf-ask-bar {
  margin-top: 16px; background: var(--hf-panel); border: 1.5px solid var(--hf-ink);
  border-radius: var(--hf-r); padding: 14px 20px;
  box-shadow: var(--hf-shadow-lg);
}
.hf-ask-row { display: flex; align-items: center; gap: 12px; }
.hf-ask-mark { width: 26px; height: 26px; border-radius: 50%; background: var(--hf-ink); color: #f0ede8; display: grid; place-items: center; font-size: 9px; font-weight: 800; flex: none; }
.hf-ask-input {
  flex: 1; border: 1px solid var(--hf-line); background: var(--hf-panel2); border-radius: 4px;
  padding: 11px 14px; font-family: var(--hf-sans); font-size: 14px; color: var(--hf-ink);
}
.hf-ask-input:focus { outline: none; border-color: var(--hf-ink); background: var(--hf-panel); }
.hf-ask-input::placeholder { color: var(--hf-faint); }
.hf-ask-send {
  border: none; background: var(--hf-ink); color: #f0ede8;
  border-radius: 4px; padding: 11px 18px; cursor: pointer; font-family: var(--hf-sans);
  font-size: 13px; font-weight: 700; letter-spacing: .06em; white-space: nowrap;
}
.hf-ask-send:hover { background: var(--hf-ink2); }
.hf-ask-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.hf-chip-q {
  border: 1px solid var(--hf-line); background: var(--hf-panel2); border-radius: 999px;
  padding: 5px 14px; font-size: 12px; color: var(--hf-ink2); cursor: pointer;
  font-family: var(--hf-sans);
}
.hf-chip-q:hover { border-color: var(--hf-ink2); color: var(--hf-ink); }

/* kpi strip in hi-fi evidence */
.hf-kpi-strip { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 12px; }
.hf-kpi-strip.cols3 { grid-template-columns: repeat(3,1fr); }

/* bridge bars in hi-fi */
.hf-bridge { display: flex; flex-direction: column; gap: 9px; }
.hf-br { display: grid; grid-template-columns: 160px 1fr 70px; gap: 12px; align-items: center; font-size: 13px; }
.hf-br .bl { color: var(--hf-ink2); }
.hf-br .bt { height: 16px; background: var(--hf-panel2); border: 1px solid var(--hf-line); border-radius: 2px; position: relative; }
.hf-br .bf { position: absolute; left: 0; top: 0; bottom: 0; background: var(--hf-amber); border-radius: 2px; }
.hf-br .bf.pos { background: var(--hf-green); }
.hf-br .bv { text-align: right; font-family: var(--hf-mono); font-size: 12px; font-weight: 700; }
.hf-br .bv.neg { color: var(--hf-amber); }
.hf-br .bv.pos { color: var(--hf-green); }
.hf-note { font-size: 12px; color: var(--hf-muted); margin-top: 10px; line-height: 1.55; }
