/* Prem visual assets; asset provenance is recorded in BRAND_ASSETS.md.
   Fonts are served by Prem's existing public CDN, never redistributed here. */
@font-face {
  font-family: "Aeonik Pro";
  src: url("https://framerusercontent.com/assets/1HrGISG4AJ4du80TSJEdeSkEo.woff2") format("woff2");
  font-style: normal; font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Aeonik Pro";
  src: url("https://framerusercontent.com/assets/NwR5FHLL9KIMS8uSsYcRiSpKPxY.woff2") format("woff2");
  font-style: normal; font-weight: 500; font-display: swap;
}
:root {
  --bg: #FAF9F5;
  --card: #FFFFFF;
  --ink: #0C0C0C;
  --ink-2: rgba(12,12,12,.75);
  --muted: rgba(12,12,12,.65);
  --line: rgba(12,12,12,.10);
  --field: #FAF9F5;
  --accent: #4D7235;
  --link: #185771;
  --accent-ink: #FAF9F5;
  --accent-soft: #DBE3D7;
  --good: #4D7235;
  --good-soft: #FAF9F5;
  --warn: #0C0C0C;
  --warn-soft: #EDEDED;
  --bad: #0C0C0C;
  --bad-soft: #EDEDED;
  --series-1: #4D7235;
  --series-2: #718E5D;
  --series-3: #4D7235;
  --mem-weights: #4D7235;
  --mem-kv: #94AA86;
  --mem-free: #EDEDED;
  --mem-res: #E0E0E0;
  --radius: 28px;
  --shadow: none;
  --focus: #0C0C0C;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C0C0C;
    --card: #0C0C0C;
    --ink: #FAF9F5;
    --ink-2: rgba(250,249,245,.80);
    --muted: rgba(250,249,245,.65);
    --line: rgba(250,249,245,.14);
    --field: #222222;
    --link: #FAF9F5;
    --accent-soft: #222222;
    --good: #B8C7AE;
    --good-soft: #222222;
    --warn: #FAF9F5;
    --warn-soft: #222222;
    --bad: #FAF9F5;
    --bad-soft: #222222;
    --series-1: #B8C7AE;
    --series-2: #94AA86;
    --series-3: #718E5D;
    --mem-weights: #4D7235;
    --mem-kv: #94AA86;
    --mem-free: #222222;
    --mem-res: #E0E0E0;
    --focus: #FAF9F5;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "Aeonik Pro", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(16px, env(safe-area-inset-left, 0px));
}
a { color: var(--link); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
.muted { color: var(--muted); }

.brand-bar, .top, .layout, .foot { max-width: 1240px; margin: 0 auto; }
.brand-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.top { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; padding: 20px 0; }
.brand h1 { font-size: 36px; font-weight: 500; letter-spacing: -0.04em; }
.brand-assets { display: flex; align-items: center; flex-shrink: 0; }
.brand-assets a { display: inline-flex; align-items: center; min-height: 44px; }
.brand-assets img { display: block; object-fit: contain; }
.logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  .logo-light { display: none !important; }
  .logo-dark { display: block !important; }
  .badge { color: var(--ink) !important; }
}
.brand p { margin: 6px 0 0; color: var(--ink-2); max-width: 70ch; }

.pill { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 13px; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.loading .dot { background: var(--warn); animation: pulse 1.2s infinite ease-in-out; }
.pill.ready .dot { background: var(--good); }
.pill.error .dot { background: var(--bad); }
@keyframes pulse { 50% { opacity: .3; } }

.layout { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 20px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- form */
.form { padding: 18px; position: sticky; top: calc(80px + env(safe-area-inset-top, 0px)); max-height: calc(100vh - 92px - env(safe-area-inset-top, 0px)); overflow: auto; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0; margin-bottom: 8px; }
label { display: block; font-size: 13px; color: var(--ink-2); margin: 0 0 4px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--field);
  border: 1px solid var(--line); border-radius: 16px; padding: 8px 10px; min-height: 38px;
}
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.grid2 > div { min-width: 0; }
.span2 { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.check { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 13px; }
.check input { width: auto; min-height: 0; }
details { border-top: 1px solid var(--line); padding: 10px 0; }
details > summary { cursor: pointer; font-size: 13px; color: var(--ink-2); font-weight: 500; }
details[open] > summary { margin-bottom: 10px; }
details label { margin-top: 8px; }
button[type=submit] {
  width: 100%; margin-top: 12px; padding: 11px; font: inherit; font-weight: 500; font-size: 15px; cursor: pointer;
  color: var(--accent-ink); background: var(--accent); border: 0; border-radius: 16px;
}
button[type=submit]:disabled { opacity: .55; cursor: progress; }
.form-error { margin-top: 10px; font-size: 13px; color: var(--bad); background: var(--bad-soft); border-radius: 16px; padding: 8px 10px; }

/* ---------- results */
.results { scroll-margin-top: 80px; display: grid; gap: 16px; min-width: 0; }
.empty { padding: 22px; }
.empty h2 { font-size: 18px; margin-bottom: 8px; }
.empty p { color: var(--ink-2); margin: 8px 0 0; max-width: 75ch; }

.verdict { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: var(--radius); border: 1px solid var(--line); }
.verdict .big { font-size: 20px; font-weight: 500; }
.verdict .sub { color: var(--ink-2); font-size: 14px; }
.verdict.good { background: var(--good-soft); border-color: transparent; }
.verdict.good .big { color: var(--good); }
.verdict.warn { background: var(--warn-soft); border-color: transparent; }
.verdict.warn .big { color: var(--warn); }
.verdict.bad { background: var(--bad-soft); border-color: transparent; }
.verdict.bad .big { color: var(--bad); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; }
.kpi .k { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.kpi .v { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 14px; font-weight: 500; color: var(--ink-2); margin-left: 3px; }
.kpi .r { font-size: 12px; color: var(--ink-2); margin-top: 2px; font-variant-numeric: tabular-nums; }

.panel { padding: 16px 18px; min-width: 0; }
.panel h3 { font-size: 14px; font-weight: 500; margin-bottom: 10px; }
.memwrap .bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--mem-free); }
.memwrap .seg { height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 6px 20px; margin-top: 12px; font-size: 13px; }
.facts div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.facts span:first-child { color: var(--muted); }
.facts span:last-child { font-variant-numeric: tabular-nums; text-align: right; }

.charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.chart { padding: 12px 12px 6px; min-width: 0; }
.chart h4 { margin: 0 0 4px; font-size: 13px; font-weight: 500; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { stroke: var(--line); }
.chart .tick { fill: var(--muted); font-size: 10px; }
.chart .grid { stroke: var(--line); stroke-dasharray: 2 3; }

.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr.chosen td { font-weight: 500; background: var(--accent-soft); }

.notes { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.notes li { margin: 4px 0; }
.notes li.caution { color: var(--warn); }
.badge { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-left: 8px; vertical-align: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions button { font: inherit; font-size: 13px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.actions code { font-size: 12px; }
pre.cli { margin: 10px 0 0; padding: 10px 12px; background: var(--field); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

.skeleton { padding: 28px; text-align: center; color: var(--ink-2); }

/* ---------- footer */
.foot { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; padding: 36px 0 40px; margin-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.foot h3 { font-size: 13px; color: var(--ink); margin-bottom: 6px; }
.foot > div { min-width: 0; }
.foot p { margin: 0 0 8px; }
.acc { margin: 6px 0 8px; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .form { position: static; max-height: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charts { grid-template-columns: 1fr; }
  .foot { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .top { flex-direction: column; gap: 12px; }
  .kpi .v { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) { .pill.loading .dot { animation: none; } }
