:root {
  --ink: #16212e;
  --muted: #5b6b7c;
  --line: #dbe3ea;
  --paper: #ffffff;
  --bg: #f4f7fa;
  --accent: #0f4c81;
  --higher: #8a1c1c;
  --lower: #1d6b45;
  --warn-bg: #fff7e6;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
main {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 56rem;
  margin: 0 auto;
  padding: 1rem;
}
.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand a {
  color: inherit;
  text-decoration: none;
}
.brand .tag {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
}
.topbar nav a {
  margin-left: 1rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}
.hero h1 {
  font-size: 1.5rem;
  margin: 1.25rem 0 0.5rem;
}
.muted {
  color: var(--muted);
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
}
/* Assessment funnel base rules; compound funnel selectors live further down. */
.identity h2,
.domain-group h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}
.hp-field {
  display: none;
}
.steps,
.steps li {
  list-style: none;
  margin: 0;
  padding: 0;
}
.step {
  display: flex;
  gap: 0.9rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.step:last-child {
  border-bottom: none;
}
.step-no {
  flex: 0 0 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
}
.step-body {
  flex: 1;
}
.step-body > label:first-child {
  font-weight: 600;
}
.hint {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.15rem 0 0.4rem;
}
select,
input[type="number"],
input[type="date"] {
  width: 100%;
  max-width: 26rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: white;
}
.step-body label.bool {
  display: block;
  font-weight: 400;
  margin-top: 0.35rem;
}
.size-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  max-width: 34rem;
}
.chip {
  display: inline-block;
  background: #e7f0ee;
  color: var(--lower);
  border-radius: 999px;
  padding: 0.05rem 0.6rem;
  font-size: 0.8rem;
}
.badge {
  display: inline-block;
  border-radius: 6px;
  padding: 0.35rem 0.8rem;
  font-weight: 700;
  color: white;
}
.badge-higher {
  background: var(--higher);
}
.badge-lower {
  background: var(--lower);
}
.badge-out {
  background: var(--muted);
}
.badge-review {
  background: #a05e03;
}
.badge-carveout {
  background: var(--accent);
}
.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
#print-btn,
.delivery button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  font: inherit;
}
.delivery {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 0.6rem;
}
/* Secondary action: available, but never competing with the deliverable. */
.delivery button.linklike {
  border: none;
  background: none;
  padding: 0.4rem 0.2rem;
  color: var(--muted);
  text-decoration: underline;
}
/* Secondary button, e.g. the waitlist CTA next to the purchasable tier. */
.btn-secondary {
  display: inline-block;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  text-decoration: none;
  font: inherit;
}
.reasons {
  padding-left: 1.2rem;
}
.penalty {
  background: var(--warn-bg);
  border: 1px solid #eedfb5;
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
}
.warning {
  color: #7a4b00;
  font-size: 0.92rem;
}
.missing {
  background: var(--warn-bg);
  border: 1px solid #eedfb5;
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
}
.missing.muted {
  background: none;
  border: none;
  padding: 0;
}
.result.error {
  border-left: 4px solid #a03030;
}
.result.error h2 {
  margin-top: 0;
}
.next {
  padding-left: 1.2rem;
}
/* Funnel score table; before .timeline so its td rule keeps ascending specificity. */
.domain-scores {
  border-collapse: collapse;
  width: 100%;
  margin: 0.75rem 0;
}
.domain-scores th,
.domain-scores td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
.timeline .date {
  white-space: nowrap;
  font-weight: 600;
}
.timeline tr.practice td {
  color: var(--muted);
}
.incident-ref {
  padding-left: 1.2rem;
}
.permalink-box code {
  display: block;
  overflow-wrap: anywhere;
  background: var(--bg);
  border-radius: 6px;
  padding: 0.5rem;
  font-size: 0.78rem;
}
footer {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Generic buttons shared by the calculator and the assessment funnel. */
.btn {
  display: inline-block;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 6px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 600;
}

/* Assessment funnel (hodnoceni.html, src/assessment/render.ts). */
.identity,
.domain-group {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
}
.identity {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem 1rem;
}
.identity h2,
.identity .consent,
.identity .hp-field {
  grid-column: 1 / -1;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.field input,
.field select {
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  background: white;
}
.field.consent {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.field.consent input {
  margin-top: 0.25rem;
}
.question {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 0.75rem 0;
}
.question legend {
  font-weight: 600;
  padding: 0;
  float: left;
  width: 100%;
  margin-bottom: 0.4rem;
}
.answer-options {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  clear: both;
}
.answer-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}
.disclaimer {
  margin: 1rem 0;
}
.score-headline {
  font-size: 1.15rem;
}
.gap-list {
  padding-left: 1.2rem;
}
.next-steps {
  margin-top: 1rem;
}

/* Paid gap stage (src/ui/views-gap.ts): measure grid, offer cards, gate note. */
.gap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 0.75rem 1.25rem;
  margin: 0.75rem 0;
}
.gap-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.92rem;
}
.gap-item select {
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  background: white;
}
.offers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
}
.offers .offer {
  margin: 0;
}
.offer h3 {
  margin-top: 0;
}
.price {
  font-weight: 600;
}
.gate-honesty {
  color: var(--muted);
  font-size: 0.85rem;
}

@media print {
  body {
    background: white;
  }
  .topbar nav,
  #print-btn,
  .delivery,
  .permalink-box {
    display: none;
  }
  .card {
    break-inside: avoid;
    border: none;
    padding: 0.5rem 0;
  }
}
