/* Deal Coach — a PrimeLayer build. Distinct identity: graphite "sales cockpit",
   indigo/violet primary, lime "win" accent, Geist type. Self-contained. */
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
:root {
  --bg: #0c0d11;
  --bg-2: #101218;
  --surface: #15171f;
  --surface-2: #1b1e28;
  --ink: #f4f5f8;
  --ink-2: #a7adbd;
  --muted: #6c7285;
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.15);
  --indigo: #6366f1;
  --violet: #8b5cf6;
  --radius: 14px;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* names the gauge JS reads: */
  --gridline: rgba(255,255,255,.09);
  --good: #a3e635;   /* win  */
  --good-ink: #bef264;
  --warn: #fbbf24;   /* watch */
  --serious: #fb923c;
  --crit: #fb7185;   /* risk */
  --risk-ink: #fda4af;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(99,102,241,.16), transparent 60%),
    radial-gradient(700px 380px at 5% 4%, rgba(139,92,246,.10), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}

/* ---- top nav ---- */
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 26px;
  border-bottom: 1px solid var(--line); background: rgba(12,13,17,.72);
  backdrop-filter: saturate(1.3) blur(12px); position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  color: #a3e635; font-weight: 800; font-size: 17px; background: linear-gradient(145deg, #1e2130, #14161d);
  border: 1px solid rgba(99,102,241,.4); box-shadow: 0 0 22px -6px rgba(99,102,241,.55);
}
.brand .bwrap { display: flex; flex-direction: column; line-height: 1.05; }
.brand .bname { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand .bby { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.topbar .spacer { flex: 1; }
.tnav { display: flex; align-items: center; gap: 22px; }
.tnav a { color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .15s; }
.tnav a:hover { color: var(--ink); }
.tnav a.tbtn {
  color: #0b0c10; font-weight: 700; padding: 9px 16px; border-radius: 10px;
  background: linear-gradient(135deg, #a3e635, #84cc16); box-shadow: 0 8px 20px -8px rgba(163,230,53,.5);
}
.tnav a.tbtn:hover { color: #0b0c10; filter: brightness(1.05); }
@media (max-width: 640px) { .tnav { gap: 14px; } .tnav a:not(.tbtn) { display: none; } }

.wrap { max-width: 1080px; margin: 0 auto; padding: 34px 26px 80px; }
.hero { margin-bottom: 24px; }
.hero h1 { margin: 0; font-size: clamp(28px, 4vw, 38px); font-weight: 700; letter-spacing: -.03em;
  background: linear-gradient(90deg, #fff, #c7d2fe); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { margin: 10px 0 0; color: var(--ink-2); font-size: 15.5px; max-width: 660px; }

.card { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: 0 24px 60px -34px rgba(0,0,0,.8); }

/* ---- form ---- */
.form-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin-bottom: 14px; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder, textarea::placeholder { color: var(--muted); }
.field input:focus, .field select:focus, textarea:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(99,102,241,.22); }
textarea { min-height: 210px; resize: vertical; line-height: 1.55; }
.notes-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.notes-head label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.link-btn { background: none; border: none; color: var(--indigo); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }

.actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; font-family: inherit; font-size: 14.5px; font-weight: 650;
  color: #fff; cursor: pointer; border: none; border-radius: 11px; padding: 12px 22px;
  background: linear-gradient(135deg, var(--indigo), var(--violet)); box-shadow: 0 12px 30px -12px rgba(99,102,241,.7);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn.ghost { background: none; color: var(--ink); border: 1px solid var(--line-2); box-shadow: none; }
.btn.ghost:hover { border-color: var(--indigo); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn .spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hint { color: var(--muted); font-size: 12.5px; }

.banner { margin-top: 16px; padding: 12px 15px; border-radius: 11px; font-size: 13.5px; border: 1px solid var(--line); display: flex; gap: 9px; align-items: flex-start; }
.banner.error { background: rgba(251,113,133,.1); border-color: rgba(251,113,133,.35); color: var(--risk-ink); }
.banner .i { font-weight: 800; }

/* ---- results ---- */
#results { margin-top: 24px; display: none; }
#results.show { display: block; animation: rise .5s cubic-bezier(.2,.7,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.result-top { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: center; }
@media (max-width: 720px) { .result-top { grid-template-columns: 1fr; } }
.gauge-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: radial-gradient(120px 90px at 50% 90%, rgba(99,102,241,.14), transparent 70%); border-radius: 14px; padding: 6px 0; }
.gauge-wrap .g-val { font-size: 36px; font-weight: 800; letter-spacing: -.02em; margin-top: -70px; color: var(--ink); }
.gauge-wrap .g-lab { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 650; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.pill.health-strong { color: var(--good-ink); border-color: rgba(163,230,53,.45); background: rgba(163,230,53,.08); }
.pill.health-strong .dot { background: var(--good); }
.pill.health-watch { color: var(--warn); border-color: rgba(251,191,36,.45); background: rgba(251,191,36,.08); }
.pill.health-watch .dot { background: var(--warn); }
.pill.health-at_risk { color: var(--serious); border-color: rgba(251,146,60,.45); background: rgba(251,146,60,.08); }
.pill.health-at_risk .dot { background: var(--serious); }
.pill.health-critical { color: var(--crit); border-color: rgba(251,113,133,.45); background: rgba(251,113,133,.08); }
.pill.health-critical .dot { background: var(--crit); }
.pill.sample-tag { color: #c7d2fe; border-color: rgba(99,102,241,.5); background: rgba(99,102,241,.14); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: 11px; }
.summary { font-size: 15.5px; line-height: 1.6; color: var(--ink); }

.section-title { font-family: var(--mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--indigo); margin: 30px 0 14px; display: flex; align-items: center; gap: 10px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(99,102,241,.4), transparent); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .cols { grid-template-columns: 1fr; } }

.signal { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.signal:last-child { border-bottom: none; }
.signal .mark { flex: none; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #0b0c10; margin-top: 1px; }
.signal.positive .mark { background: var(--good); }
.signal.risk .mark { background: var(--crit); color: #fff; }

.action { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; background: var(--surface-2); transition: border-color .15s, transform .15s; }
.action:hover { border-color: var(--line-2); transform: translateX(2px); }
.action .a-head { display: flex; align-items: baseline; gap: 10px; }
.action .a-title { font-weight: 650; font-size: 14.5px; color: var(--ink); }
.action .a-rat { color: var(--ink-2); font-size: 13px; margin-top: 5px; line-height: 1.5; }
.prio { flex: none; font-family: var(--mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 3px 9px; border-radius: 999px; }
.prio.high { background: rgba(251,113,133,.16); color: var(--crit); }
.prio.medium { background: rgba(251,191,36,.16); color: var(--warn); }
.prio.low { background: rgba(148,163,184,.16); color: var(--muted); }

.obj { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; background: var(--surface-2); }
.obj summary { cursor: pointer; padding: 13px 16px; font-weight: 600; font-size: 14.5px; list-style: none; display: flex; gap: 10px; align-items: center; color: var(--ink); }
.obj summary::-webkit-details-marker { display: none; }
.obj summary .chev { margin-left: auto; color: var(--muted); transition: transform .15s; }
.obj[open] summary .chev { transform: rotate(90deg); }
.obj summary .q { color: var(--serious); font-weight: 800; }
.obj .ans { padding: 0 16px 15px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }

.usage { margin-top: 28px; text-align: center; color: var(--muted); font-size: 12px; font-family: var(--mono); }
.foot-note { color: var(--muted); font-size: 12px; margin-top: 36px; text-align: center; line-height: 1.6; }
.skeleton { animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
