:root {
  --ink: #0C131B;
  --panel: #141E28;
  --line: #223141;
  --text: #E2EBF4;
  --muted: #7C92A8;
  --hot: #FF7A45;
  --warm: #E9A93F;
  --mid: #6FA9C9;
  --cold: #79D6EE;
  --bad: #E86A6A;

  --ramp: linear-gradient(90deg, var(--hot) 0%, var(--warm) 34%, var(--mid) 72%, var(--cold) 100%);

  --mono: ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --pad: 18px;
  --r: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

body { padding-bottom: 96px; }

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- type ---------- */

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 600;
  margin: 30px 0 10px;
}

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

h1 {
  font-size: 15px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 0;
}

h2 { font-size: 21px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }

p { margin: 0 0 12px; }
p.hint { color: var(--muted); font-size: 13.5px; }

/* ---------- chrome ---------- */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 4px;
}

header .mark { display: flex; align-items: center; gap: 10px; }

header .seal {
  width: 16px; height: 16px; border-radius: 3px;
  background: var(--ramp);
}

.iconbtn {
  background: none; border: 1px solid var(--line); color: var(--muted);
  width: 34px; height: 34px; border-radius: 9px; font-size: 15px;
  cursor: pointer; display: grid; place-items: center;
}
.iconbtn:hover { color: var(--text); border-color: var(--mid); }

/* ---------- budget meter ---------- */

.meter { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.meter .row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); }
.meter .row strong { color: var(--text); font-family: var(--mono); font-size: 15px; font-weight: 500; }
.meter .track { height: 6px; border-radius: 3px; background: #1D2A38; margin: 10px 0 8px; overflow: hidden; }
.meter .fill { height: 100%; background: var(--mid); border-radius: 3px; transition: width .5s ease; }
.meter .fill.over { background: var(--bad); }
.meter .claims { font-size: 12.5px; color: var(--muted); }

/* ---------- item cards ---------- */

.card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
}
.card:hover { border-color: #2E4358; }

/* the temperature strip: full ramp, masked from the right */
.strip { position: relative; height: 4px; border-radius: 2px; overflow: hidden; background: var(--ramp); margin-bottom: 12px; }
.strip .shade { position: absolute; top: 0; right: 0; bottom: 0; background: var(--panel); opacity: .9; transition: width .6s ease; }
@media (prefers-reduced-motion: reduce) { .strip .shade, .meter .fill { transition: none; } }

.card .title { font-size: 17px; font-weight: 500; margin-bottom: 3px; }
.card .facts { display: flex; gap: 10px; align-items: baseline; font-size: 13px; color: var(--muted); }
.card .facts .price { font-family: var(--mono); color: var(--text); }
.card .why { font-size: 13px; color: var(--muted); margin-top: 8px; font-style: italic; }

.badge-cold { color: var(--cold); font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- forms ---------- */

label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); font-weight: 600; margin: 18px 0 7px; }

input[type=text], input[type=number], input[type=url], textarea, select {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  padding: 12px 13px;
}
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, .card:focus-visible {
  outline: 2px solid var(--cold); outline-offset: 2px;
}
input::placeholder, textarea::placeholder { color: #55697D; }
textarea { resize: vertical; min-height: 62px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: none; color: var(--muted);
  border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13.5px; cursor: pointer;
}
.chip[aria-pressed=true] { border-color: var(--warm); color: var(--warm); background: rgba(233,169,63,.08); }

/* ---------- buttons ---------- */

.btn {
  display: block; width: 100%; padding: 14px; border-radius: 11px;
  font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); margin-top: 10px;
}
.btn.primary { background: var(--cold); color: #06222C; border-color: var(--cold); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: none; color: var(--muted); }
.btn:hover { filter: brightness(1.08); }

.dock {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--ink) 62%, transparent);
}
.dock .inner { max-width: 560px; margin: 0 auto; }
.dock .btn { margin-top: 0; }

/* ---------- decision / verdict ---------- */

.verdict { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-top: 16px; }
.verdict .big { font-family: var(--mono); font-size: 30px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.verdict .lab { font-size: 12px; color: var(--muted); }
.verdict .corrected { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--warm); }

.locknote {
  border: 1px dashed var(--line); border-radius: var(--r); padding: 12px 14px;
  font-size: 13px; color: var(--muted); margin-top: 16px;
}

/* ---------- review ---------- */

.factor { text-align: center; padding: 26px 0 10px; }
.factor .big { font-family: var(--mono); font-size: 62px; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; line-height: 1; }
.factor .cap { font-size: 13px; color: var(--muted); max-width: 300px; margin: 12px auto 0; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.stat { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.stat .v { font-family: var(--mono); font-size: 20px; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-top: 3px; }

.log { border-top: 1px solid var(--line); padding: 11px 0; display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.log .meta { color: var(--muted); font-size: 12.5px; font-family: var(--mono); white-space: nowrap; }
.log .kept { color: var(--muted); text-decoration: line-through; }

.empty { border: 1px dashed var(--line); border-radius: var(--r); padding: 22px 16px; text-align: center; color: var(--muted); font-size: 14px; }

.back { background: none; border: none; color: var(--muted); font: inherit; font-size: 13px; padding: 20px 0 0; cursor: pointer; }

.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 10px 16px; border-radius: 999px; font-size: 13.5px; z-index: 20;
}
