/* ============================================================
   AWBGuru design system — tokens + component idioms
   Ported from design/awbguru.html so the app UI matches the brand.
   Fonts: Instrument Sans / Newsreader / Martian Mono. Vendoring the
   actual webfonts is a follow-up; system fallbacks are used until then
   (no CDN — CSP/offline safe).
   ============================================================ */
:root {
  --bg: #f6f7f3; --bg2: #eef0e9; --surface: #ffffff; --surface2: #f3f5ee; --surface3: #e9ece2;
  --line: rgba(18, 30, 12, .09); --line2: rgba(18, 30, 12, .15);
  --fg: #13170e; --muted: #575d51; --dim: #868c7d; --faint: #b6bbac;
  --c-blue: #3f7cf0; --c-lime: #8ed24e;
  --grad: linear-gradient(100deg, #3f7cf0 0%, #8ed24e 100%);
  --grad-soft: linear-gradient(100deg, rgba(63, 124, 240, .13), rgba(142, 210, 78, .13));
  --glow-b: rgba(63, 124, 240, .28); --glow-g: rgba(142, 210, 78, .34);
  --good: #5aa62a; --good-bg: rgba(142, 210, 78, .18); --good-line: rgba(142, 210, 78, .55);
  --warn: #bb8a1c; --warn-bg: rgba(224, 169, 46, .15); --warn-line: rgba(224, 169, 46, .42);
  --bad: #c0492b; --bad-bg: rgba(192, 73, 43, .12); --bad-line: rgba(192, 73, 43, .4);
  --shadow: 0 26px 60px -36px rgba(24, 44, 16, .4), 0 2px 8px -3px rgba(24, 44, 16, .08);
  --sans: 'Instrument Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --mono: 'Martian Mono', ui-monospace, 'SF Mono', Consolas, monospace;
}

body {
  font-family: var(--sans); color: var(--fg);
  background:
    radial-gradient(rgba(18, 30, 12, .045) 1px, transparent 1px) 0 0/30px 30px,
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

.display { font-family: var(--serif); font-weight: 500; letter-spacing: -.02em; line-height: 1.1; }
.kicker {
  font-family: var(--mono); font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: .14em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  display: inline-block;
}
.grad-word { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mono { font-family: var(--mono); }

/* ---- buttons ---------------------------------------------------- */
.awb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 10px; border: none;
  font: 600 14.5px/1 var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .18s ease, box-shadow .25s ease, filter .18s ease;
}
.awb-btn:disabled { opacity: .55; cursor: not-allowed; }
.awb-btn-primary { background: var(--grad); color: #0e1e07; }
.awb-btn-primary:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 12px 28px -12px var(--glow-b), 0 12px 28px -14px var(--glow-g); }
.awb-btn-ghost { background: var(--surface); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line2); }
.awb-btn-ghost:not(:disabled):hover { background: var(--surface2); }
.awb-btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 9px; }

/* ---- pills (confidence / validation status) -------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.pill-pass { color: var(--good); background: var(--good-bg); box-shadow: inset 0 0 0 1px var(--good-line); }
.pill-warn { color: var(--warn); background: var(--warn-bg); box-shadow: inset 0 0 0 1px var(--warn-line); }
.pill-bad  { color: var(--bad);  background: var(--bad-bg);  box-shadow: inset 0 0 0 1px var(--bad-line); }
.pill-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }

/* ---- chips ------------------------------------------------------ */
.awb-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .06em;
  padding: 6px 11px; border-radius: 999px; background: var(--surface2); color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap;
}

/* ---- cards ------------------------------------------------------ */
.awb-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 24px; position: relative;
}

/* ---- mono key-value rows --------------------------------------- */
.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  font-family: var(--mono); font-size: 11.5px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--dim); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 500; }
.kv .v { font-weight: 600; text-align: right; color: var(--fg); }

/* ---- confidence bar -------------------------------------------- */
.conf-bar { position: relative; height: 6px; width: 68px; border-radius: 999px; background: var(--surface3); overflow: hidden; }
.conf-bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--grad); }
.conf-num { font-family: var(--mono); font-weight: 600; font-size: 11px; }
