/* Semi-Custom Decision Tool. Blueprint identity, light theme, no external fonts. */
:root {
  --ink: #16202b;
  --ink-soft: #2b3947;
  --paper: #eef1f4;
  --surface: #ffffff;
  --line: #d6dde3;
  --muted: #5b6b76;
  --accent: #2c6e8f;
  --accent-soft: #e3edf2;
  --good: #3f8f5b;
  --good-soft: #e6f1ea;
  --warn: #c08a2e;
  --warn-soft: #f6ecd8;
  --stop: #b04a3f;
  --stop-soft: #f3e2df;
  --display: Cambria, Georgia, "Times New Roman", serif;
  --body: system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(22, 32, 43, 0.06), 0 4px 16px rgba(22, 32, 43, 0.05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; text-wrap: balance; margin: 0; }
.num { font-variant-numeric: tabular-nums; font-family: var(--mono); }

/* Header with faint blueprint grid */
.masthead {
  background:
    linear-gradient(rgba(22, 32, 43, 0.94), rgba(22, 32, 43, 0.94)),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(255, 255, 255, 0.06) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(255, 255, 255, 0.06) 23px 24px),
    var(--ink);
  color: #fff;
  padding: 28px 24px 0;
}
.masthead-inner { max-width: 960px; margin: 0 auto; }
.masthead h1 { font-size: 1.7rem; letter-spacing: 0.2px; }
.masthead .brand { color: var(--accent); font-family: var(--body); font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 6px; }
.masthead .tagline { color: #b9c6d0; font-size: 0.95rem; margin: 6px 0 18px; max-width: 54ch; }
.policy-chip {
  display: inline-flex; gap: 8px; align-items: center;
  font-size: 0.75rem; color: #cdd8e0;
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 100px;
  padding: 3px 11px; margin-bottom: 18px;
}
.policy-chip b { color: #fff; font-weight: 600; }

/* Tabs */
.tabs { display: flex; gap: 2px; max-width: 960px; margin: 0 auto; padding: 0 24px; flex-wrap: wrap; }
.tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: #aebcc7; font-family: var(--body); font-size: 0.92rem; font-weight: 500;
  padding: 12px 16px; border-bottom: 3px solid transparent; transition: color 0.15s;
}
.tab:hover { color: #fff; }
.tab[aria-selected="true"] { color: #fff; border-bottom-color: var(--accent); }

/* Layout */
main { max-width: 960px; margin: 0 auto; padding: 28px 24px 64px; }
.view { display: none; }
.view.active { display: block; animation: rise 0.25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view.active { animation: none; } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; margin-bottom: 18px;
}
.card.locked { opacity: 0.5; pointer-events: none; }
.step-label { font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.card h2 { font-size: 1.15rem; margin: 4px 0 4px; }
.card .hint { color: var(--muted); font-size: 0.88rem; margin: 0 0 18px; }
.lead { color: var(--ink-soft); font-size: 0.98rem; max-width: 62ch; margin: 0 0 20px; }

/* Questions */
.q { padding: 14px 0; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; }
.q .q-title { font-weight: 600; font-size: 0.98rem; }
.q .q-sub { color: var(--muted); font-size: 0.84rem; margin-top: 2px; }
.q-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }

/* Segmented control */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; flex-shrink: 0; }
.seg button {
  appearance: none; border: 0; background: var(--surface); cursor: pointer;
  font-family: var(--body); font-size: 0.85rem; color: var(--ink-soft);
  padding: 7px 14px; border-left: 1px solid var(--line); transition: background 0.12s, color 0.12s;
}
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.seg.danger button[aria-pressed="true"] { background: var(--stop); }

/* Verdict stamp (signature element) */
.verdict { display: flex; align-items: stretch; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 18px; }
.verdict .stripe { width: 8px; flex-shrink: 0; }
.verdict .body { padding: 18px 20px; background: var(--surface); flex: 1; }
.verdict .stamp { font-family: var(--display); font-size: 1.55rem; font-weight: 600; letter-spacing: 0.3px; }
.verdict .why { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }
.verdict.allowed .stripe { background: var(--good); } .verdict.allowed .stamp { color: var(--good); }
.verdict.conditional .stripe { background: var(--warn); } .verdict.conditional .stamp { color: var(--warn); }
.verdict.restricted .stripe { background: var(--stop); } .verdict.restricted .stamp { color: var(--stop); }
.verdict.idle .stripe { background: var(--line); } .verdict.idle .stamp { color: var(--muted); font-size: 1.1rem; }

/* Pills */
.pill { display: inline-block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; padding: 2px 9px; border-radius: 100px; text-transform: uppercase; }
.pill.allowed { background: var(--good-soft); color: var(--good); }
.pill.conditional { background: var(--warn-soft); color: var(--warn); }
.pill.restricted { background: var(--stop-soft); color: var(--stop); }
.pill.standardize { background: var(--good-soft); color: var(--good); }
.pill.watch { background: var(--warn-soft); color: var(--warn); }
.pill.restrict { background: var(--stop-soft); color: var(--stop); }

/* Buttons */
.btn { appearance: none; cursor: pointer; font-family: var(--body); font-size: 0.9rem; font-weight: 500; border-radius: var(--radius); padding: 9px 16px; border: 1px solid var(--accent); background: var(--accent); color: #fff; transition: filter 0.12s; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.link { background: none; border: 0; color: var(--accent); padding: 0; font-size: 0.85rem; text-decoration: underline; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Tables and lists */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 14px; border-top: 1px solid var(--line); white-space: nowrap; }
th { background: #f6f8fa; color: var(--muted); font-weight: 600; font-size: 0.76rem; letter-spacing: 0.05em; text-transform: uppercase; border-top: 0; }
td.wide { white-space: normal; min-width: 220px; }
tbody tr:hover { background: #f9fbfc; }
.bar { height: 7px; border-radius: 4px; background: var(--accent-soft); position: relative; min-width: 60px; }
.bar span { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--accent); }

.ref-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ref-col h3 { font-family: var(--body); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; padding-bottom: 8px; border-bottom: 2px solid; margin-bottom: 6px; }
.ref-col.allowed h3 { color: var(--good); border-color: var(--good); }
.ref-col.conditional h3 { color: var(--warn); border-color: var(--warn); }
.ref-col.restricted h3 { color: var(--stop); border-color: var(--stop); }
.ref-col ul { list-style: none; margin: 0; padding: 0; }
.ref-col li { font-size: 0.87rem; padding: 7px 0; border-top: 1px solid var(--line); color: var(--ink-soft); }
.ref-col li:first-child { border-top: 0; }
.ref-col .cat { color: var(--muted); font-size: 0.72rem; }

/* Forms */
.field { margin-bottom: 12px; }
label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
input[type="text"], input[type="search"], select, textarea {
  width: 100%; font-family: var(--body); font-size: 0.92rem; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 11px; background: var(--surface);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
textarea { min-height: 60px; resize: vertical; }
.search-hit { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); padding: 10px 12px; font-size: 0.85rem; margin-bottom: 12px; }
.empty { color: var(--muted); font-size: 0.9rem; padding: 20px; text-align: center; }
.formula { font-size: 0.8rem; color: var(--muted); background: #f6f8fa; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-top: 12px; }
.formula code { font-family: var(--mono); color: var(--ink-soft); }

@media (max-width: 640px) {
  .ref-grid { grid-template-columns: 1fr; }
  .q-row { flex-direction: column; align-items: flex-start; }
  .masthead h1 { font-size: 1.4rem; }
}
