/* ReClaim Vision — house style. Shares the portfolio design system with GrantMatch.
   Theme-aware, self-contained, no external assets. */
:root {
  --bg: #f7f8fa; --panel: #ffffff; --ink: #1a1f2b; --muted: #66707f;
  --line: #e4e8ee; --brand: #1f9d6b; --brand-ink: #147a51;   /* green = reclaim/reuse */
  --ok: #1f9d57; --ok-bg: #e7f6ee; --warn: #c47d00; --warn-bg: #fdf3e0;
  --miss: #d23b3b; --miss-bg: #fbe9e9; --unv: #8a6d00; --unv-bg: #fbf6df;
  --radius: 12px; --shadow: 0 1px 3px rgba(20,30,50,.06), 0 6px 20px rgba(20,30,50,.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218; --panel: #171b24; --ink: #e8ecf3; --muted: #97a1b2;
    --line: #262c39; --brand: #45c98d; --brand-ink: #7fe0b3;
    --ok: #46c980; --ok-bg: #12291d; --warn: #e0a53a; --warn-bg: #2a2110;
    --miss: #f0736f; --miss-bg: #2c1414; --unv: #d8bd52; --unv-bg: #272008;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
h1, h2 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 60px; }

/* header */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto; padding: 20px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 14px; align-items: center; }
.logo {
  font-size: 28px; color: #fff; background: var(--brand); width: 46px; height: 46px;
  display: grid; place-items: center; border-radius: 11px; box-shadow: var(--shadow);
}
.topbar h1 { font-size: 22px; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; max-width: 56ch; }
.tagline em { color: var(--ink); font-style: normal; font-weight: 600; }
.mode { display: flex; gap: 8px; flex-wrap: wrap; }
.mode-opt {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--panel); font-size: 13px; cursor: pointer;
}
.mode-opt .hint { color: var(--muted); font-size: 11.5px; }
.live-config {
  max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; gap: 14px; align-items: center;
  flex-wrap: wrap; background: var(--warn-bg); border-bottom: 1px solid var(--line); font-size: 13px;
}
.live-config input { padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink); }
.hint { color: var(--muted); }
code { background: rgba(127,127,127,.14); padding: 1px 5px; border-radius: 5px; font-size: .92em; }

/* thesis banner */
.thesis {
  margin: 20px 0; padding: 14px 18px; border-left: 3px solid var(--brand); background: var(--panel);
  border-radius: 0 var(--radius) var(--radius) 0; box-shadow: var(--shadow); font-size: 14px;
}
.thesis p { margin: 0 0 8px; }
.thesis p:last-child { margin-bottom: 0; }
.thesis strong { color: var(--brand-ink); }

/* layout */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel h2 { font-size: 15px; margin-top: 20px; }
.panel h2:first-child { margin-top: 0; }
.sub { color: var(--muted); font-size: 13px; margin: 4px 0 8px; }
a { color: var(--brand); }

/* buttons */
.actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; align-items: center; }
button, .btn { font: inherit; font-weight: 600; border-radius: 9px; padding: 10px 16px; cursor: pointer; border: 1px solid transparent; }
button.primary { background: var(--brand); color: #fff; }
button.primary:disabled { opacity: .55; cursor: default; }
button.ghost, .btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); display: inline-block; }
.sample-select, #override-select {
  font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--ink);
}

/* status */
.status { margin: 12px 0 0; font-size: 13px; padding: 8px 11px; border-radius: 8px; }
.status-info { color: var(--muted); background: rgba(127,127,127,.08); }
.status-ok { color: var(--ok); background: var(--ok-bg); }
.status-warn { color: var(--warn); background: var(--warn-bg); }
.status-error { color: var(--miss); background: var(--miss-bg); }

/* capture stage */
.capture-stage {
  position: relative; width: 100%; aspect-ratio: 4/3; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: var(--bg); display: grid; place-items: center;
}
.preview { width: 100%; height: 100%; object-fit: contain; background: #000; }
.capture-placeholder { color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; }
.capture-placeholder .ph-icon { font-size: 40px; opacity: .5; }

/* quality gate panel */
.quality { margin-top: 12px; padding: 10px 12px; border-radius: 9px; font-size: 13px; border: 1px solid var(--line); }
.quality.ok { background: var(--ok-bg); border-color: transparent; }
.quality.bad { background: var(--miss-bg); border-color: transparent; }
.quality h3 { margin: 0 0 4px; font-size: 13px; }
.quality.ok h3 { color: var(--ok); }
.quality.bad h3 { color: var(--miss); }
.quality ul { margin: 4px 0 0; padding-left: 18px; }
.quality .metrics { color: var(--muted); font-size: 11.5px; margin-top: 6px; font-family: ui-monospace, Menlo, monospace; }

/* grade card */
.gradecard { display: flex; flex-direction: column; gap: 14px; }
.gc-head { display: flex; gap: 16px; align-items: center; }
.grade-badge {
  flex: none; width: 84px; height: 84px; border-radius: 16px; display: grid; place-items: center;
  font-size: 40px; font-weight: 800; color: #fff; letter-spacing: -.02em;
  overflow: hidden; text-align: center;
}
.grade-badge.long { font-size: 17px; letter-spacing: 0; } /* multi-char classes ("Recycle") must fit the badge */
.grade-badge.refurbish { background: var(--ok); }
.grade-badge.harvest { background: var(--warn); }
.grade-badge.recycle { background: var(--miss); }
.gc-headline { flex: 1; }
.gc-headline .gc-class { font-size: 19px; font-weight: 700; }
.gc-headline .gc-def { color: var(--muted); font-size: 13px; margin-top: 2px; }
.decision-pill {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 5px 12px;
  border-radius: 999px; font-size: 13px; font-weight: 700; text-transform: capitalize;
}
.decision-pill.refurbish { background: var(--ok-bg); color: var(--ok); }
.decision-pill.harvest { background: var(--warn-bg); color: var(--warn); }
.decision-pill.recycle { background: var(--miss-bg); color: var(--miss); }

.confidence { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.conf-bar { flex: 1; height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; max-width: 180px; }
.conf-fill { height: 100%; background: var(--brand); }

.gc-section h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 6px; }
.evidence-box { background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; font-style: italic; }

.issues { display: flex; flex-direction: column; gap: 6px; }
.issue { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: baseline; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.sev { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.sev-minor { color: var(--muted); background: rgba(127,127,127,.14); }
.sev-major { color: var(--warn); background: var(--warn-bg); }
.sev-blocking { color: var(--miss); background: var(--miss-bg); }
.issue-type { font-weight: 600; }
.issue-note { grid-column: 2; color: var(--muted); font-size: 12px; }

.safety-note { font-size: 12.5px; padding: 9px 11px; border-radius: 8px; }
.safety-note.enforced { background: var(--miss-bg); color: var(--miss); font-weight: 600; }
.safety-note.clear { background: var(--ok-bg); color: var(--ok); }

.reshoot { padding: 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: 13.5px; }
.reshoot h3 { margin: 0 0 6px; color: var(--warn); }

/* override */
.override-wrap { margin-top: 8px; }
.override-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.override-note { font-size: 12.5px; margin: 8px 0 0; }
.override-note.blocked { color: var(--miss); font-weight: 600; }
.override-note.applied { color: var(--ok); font-weight: 600; }

.muted { color: var(--muted); }

/* rubric peek */
.peek { margin-top: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 18px; }
.peek summary { cursor: pointer; font-weight: 600; padding: 10px 0; font-size: 13.5px; }
.peek pre { overflow-x: auto; font-size: 11.5px; color: var(--muted); background: var(--bg); padding: 12px; border-radius: 8px; white-space: pre-wrap; }

footer { max-width: 1180px; margin: 0 auto; padding: 24px 20px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
