:root {
  --ink: #1b1f24;
  --muted: #5b6572;
  --line: #e1e4e8;
  --bg: #fafbfc;
  --card: #ffffff;
  --accent: #1a5fb4;
  --ok: #1e7d32;
  --warn: #b45309;
  --bad: #b3261e;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.site-header .brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
}

.site-header nav a {
  margin-left: 1.25rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.site-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

h1 { font-size: 1.5rem; margin: 0 0 0.25rem; }
h2 { font-size: 1.15rem; margin: 1.75rem 0 0.75rem; }
p.lede { color: var(--muted); margin-top: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.92rem; }
.field .note { color: var(--muted); font-size: 0.82rem; margin-top: 0.25rem; }
.field .unlocks { color: var(--accent); font-size: 0.78rem; margin-top: 0.2rem; }

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}

.checkbox-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  margin-bottom: 0.35rem;
}
.checkbox-list input { width: auto; }

.measurement-row {
  display: flex;
  gap: 0.5rem;
}
.measurement-row input { flex: 1 1 auto; }
.measurement-row select { flex: 0 0 auto; width: auto; }

.measurement-list-rows { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.6rem; }
.measurement-list-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.measurement-list-row select:first-child { flex: 0 0 auto; width: auto; }
.measurement-list-row input { flex: 1 1 auto; }
.measurement-list-row select:nth-child(3) { flex: 0 0 auto; width: auto; }
.measurement-list-row .remove-row { flex: 0 0 auto; padding: 0.4rem 0.7rem; font-size: 0.82rem; }
.measurement-list-field .add-row { font-size: 0.85rem; padding: 0.45rem 0.8rem; }

button, .btn {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
button.secondary, .btn.secondary {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.actions { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.5rem; }
.action-item .note { max-width: 46ch; }
.action-item .consent { display: block; font-weight: 400; font-size: 0.85rem; margin-bottom: 0.4rem; }

.recommended-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ok);
  margin-bottom: 0.35rem;
}

.btn.disabled {
  background: #fff;
  color: var(--muted);
  border: 1px dashed var(--line);
  cursor: not-allowed;
}

.state-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.flashes { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.flash {
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  background: #eef7ee;
  color: var(--ok);
  border: 1px solid #cdeacd;
  font-size: 0.9rem;
}
.flash-error { background: #fdecea; color: var(--bad); border-color: #f6c6c1; }

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 0.35rem 1rem; font-size: 0.92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.screen-nav { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.screen-nav a { font-size: 0.85rem; }
.screen-nav .locked { color: var(--muted); }

.status-resolved { color: var(--ok); font-weight: 600; }
.status-unresolved { color: var(--warn); font-weight: 600; }

/* Dimension breakdown page */
.dim-card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dim-card-header h2 { margin: 0; font-size: 1.05rem; }

.status-badge.status-pass { background: #eaf6ec; color: var(--ok); }
.status-badge.status-watch { background: #fdf3e3; color: var(--warn); }
.status-badge.status-fail { background: #fdecea; color: var(--bad); }
.status-badge.status-unknown { background: #eef0f2; color: var(--muted); }
.status-badge.status-na { background: #eef0f2; color: var(--muted); }

.rule-list { list-style: none; padding: 0; margin: 0.75rem 0 0; }
.rule-item {
  padding: 0.65rem 0.8rem;
  border-left: 3px solid var(--line);
  background: #fafbfc;
  border-radius: 0 6px 6px 0;
  margin-bottom: 0.6rem;
}
.rule-item p { margin: 0.3rem 0 0; font-size: 0.9rem; }
.rule-item.rule-pass { border-left-color: var(--ok); }
.rule-item.rule-watch { border-left-color: var(--warn); }
.rule-item.rule-fail { border-left-color: var(--bad); }
.rule-item.rule-unknown { border-left-color: var(--muted); }

.rule-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.rule-head code { font-size: 0.82rem; color: var(--muted); }

.status-chip {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.status-chip.status-pass { background: #eaf6ec; color: var(--ok); }
.status-chip.status-watch { background: #fdf3e3; color: var(--warn); }
.status-chip.status-fail { background: #fdecea; color: var(--bad); }
.status-chip.status-unknown { background: #eef0f2; color: var(--muted); }

.draft-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--warn);
  border: 1px solid var(--warn);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
}

.citation { color: var(--muted); font-size: 0.78rem; font-style: italic; }

/* Report page (taster / quickcheck / dealscan) */
.tier-badge, .verdict-badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-right: 0.5rem;
}
.tier-badge { background: #eef2ff; color: var(--accent); }
.verdict-badge.verdict-red { background: #fdecea; color: var(--bad); }
.verdict-badge.verdict-amber { background: #fdf3e3; color: var(--warn); }
.verdict-badge.verdict-green { background: #eaf6ec; color: var(--ok); }

.taster-card { text-align: center; padding: 2.5rem 1.5rem; }
.taster-card .provocation {
  font-size: 1.3rem;
  font-weight: 700;
  max-width: 44ch;
  margin: 0 auto 1.5rem;
}
.blurred-verdict {
  display: inline-block;
  padding: 1rem 2.5rem;
  border-radius: var(--radius);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  filter: blur(4px);
  opacity: 0.75;
  user-select: none;
  margin-bottom: 1.75rem;
}
.blurred-verdict.verdict-red { background: #fdecea; color: var(--bad); }
.blurred-verdict.verdict-amber { background: #fdf3e3; color: var(--warn); }
.blurred-verdict.verdict-green { background: #eaf6ec; color: var(--ok); }
.taster-card .actions { justify-content: center; }

.comps-detail { margin-top: 0.5rem; }
.comps-detail summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}
.comps-detail .table-scroll { overflow-x: auto; margin-top: 0.5rem; }
.comps-detail table { font-size: 0.82rem; }

@media print {
  .comps-detail { break-inside: avoid; }
  .site-header, .site-footer, .no-print { display: none !important; }
  body { background: #fff; }
  .card { border: 1px solid #ccc; break-inside: avoid; }
}
