/* =====================================================================
   FOA kit · shared design for GSFO self-check tools (TRC, CAC, …)
   Version 1.0.0 — tokens, shell, components. Tool-specific report visuals
   live in each tool's own stylesheet and use these variables.
   ===================================================================== */
:root {
  --bg: #f5f6f2;
  --paper: #fff;
  --soft: #fbfcf8;
  --ink: #192d29;
  --muted: #66766e;
  --faint: #8c978f;
  --green: #174b3c;
  --green-2: #587859;
  --accent: #749164;
  --lime: #d8eb9f;
  --mint: #eef3e7;
  --mint-2: #e8eee3;
  --line: #e0e6de;
  --line-2: #d5ddd3;
  --orange: #a5632b;
  --amber-bg: #fbf2e5;
  --red: #ac4943;
  --red-bg: #faeeea;
  --radius: 11px;
  --radius-sm: 7px;
  --shadow: 0 18px 35px #123f2a10;
  --header-h: 82px;
  --sidebar-w: 220px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.7 var(--font);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
a {
  color: var(--green);
  text-underline-offset: 4px;
}
:focus-visible {
  outline: 3px solid #7fa88e;
  outline-offset: 3px;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1 {
  font-size: clamp(30px, 4.1vw, 54px);
  letter-spacing: -1.6px;
  line-height: 1.22;
  font-weight: 550;
}
h2 {
  font-size: 25px;
  line-height: 1.4;
  font-weight: 550;
}
h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
}
h4 {
  font-size: 13px;
  font-weight: 600;
}
small,
.small {
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.tiny {
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 60;
  background: #fff;
  padding: 8px 12px;
  border-radius: 6px;
}
.skip-link:focus {
  left: 8px;
}

/* ------------------------------------------------------------- shell */
.kit-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  background: #ffffffdf;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  gap: 12px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}
.brandmark {
  flex: none;
  width: 42px;
  height: 42px;
  border: 1px solid #2e6550;
  background: var(--green);
  color: var(--lime);
  display: grid;
  place-items: center;
  border-radius: 10px;
  font: 24px/1 Georgia, "Times New Roman", serif;
}
.brandtype strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 2px;
  font-weight: 650;
}
.brand-sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.brand-sub small {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--faint);
  margin-left: 6px;
  padding-left: 8px;
  border-left: 1px solid var(--line-2);
}
.header-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  background: var(--mint);
  border: 1px solid #dce7d2;
  padding: 4px 10px;
  border-radius: 30px;
  font-size: 11px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.dot {
  height: 6px;
  width: 6px;
  background: #779d50;
  border-radius: 50%;
  display: inline-block;
}
.language-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}
.language-switch button {
  border: 0;
  background: transparent;
  padding: 8px 13px;
  font-size: 12px;
  color: var(--muted);
}
.language-switch button[aria-pressed="true"] {
  background: var(--green);
  color: #fff;
}
.kit-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
  /* paints the sidebar column for the full page height */
  background: linear-gradient(to right, var(--soft) calc(var(--sidebar-w) - 1px), var(--line) calc(var(--sidebar-w) - 1px), var(--line) var(--sidebar-w), transparent var(--sidebar-w));
}
.sidebar {
  background: var(--soft);
  border-right: 1px solid var(--line);
  padding: 30px 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow: auto;
}
.sidebar > label {
  font-size: 10px;
  color: var(--faint);
  letter-spacing: 2px;
  padding: 5px 15px 12px;
  text-transform: uppercase;
}
.nav {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  color: #61726a;
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 14px;
}
.nav:hover {
  background: #f0f4ec;
}
.nav.active {
  background: var(--mint-2);
  color: var(--green);
  font-weight: 600;
}
.nav b {
  font-size: 12px;
  font-weight: 400;
  color: #8b9b8d;
}
.sidebar-note {
  margin-top: auto;
  padding: 60px 15px 5px;
  color: #839087;
  font-size: 11px;
  line-height: 1.8;
}
.sidebar-note strong {
  font-size: 12px;
  color: var(--green);
  display: block;
}
.sidebar-note a {
  color: #839087;
}
.kit-main {
  padding: 34px 44px 30px;
  max-width: 1400px;
  width: 100%;
  min-width: 0;
}
#app:focus {
  outline: none;
}
.kit-footer {
  font-size: 11px;
  color: #8c968e;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 34px;
  line-height: 1.9;
}

/* ------------------------------------------------------------- page scaffolding */
.breadcrumb {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 28px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: #7d8a7e;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.page-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.page-title h1 {
  font-size: clamp(26px, 2.6vw, 34px);
  letter-spacing: -0.6px;
}
.page-title p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: end;
  margin: 34px 0 18px;
}
.section-head p {
  color: var(--muted);
  font-size: 12px;
}
.numberline {
  font-family: Georgia, serif;
  font-size: 12px;
  letter-spacing: 1px;
}

/* ------------------------------------------------------------- buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green);
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-size: 13px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  line-height: 1.5;
}
.btn:hover {
  border-color: #b9cbb0;
}
.btn.primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.btn.primary:hover {
  background: #0f3c30;
}
.btn.light {
  background: var(--lime);
  border-color: var(--lime);
}
.btn.quiet {
  background: transparent;
  border: 0;
  padding: 9px 0;
}
.btn.danger {
  color: var(--red);
}
.btn .lock {
  font-size: 11px;
  opacity: 0.75;
}

/* ------------------------------------------------------------- home */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding: 12px 0 42px;
}
.hero h1 em {
  font-style: normal;
  color: var(--green-2);
}
.hero p {
  color: var(--muted);
  font-size: 15px;
  max-width: 460px;
  margin: 24px 0;
}
.hero .actions {
  margin-top: 0;
}
.hero .fineprint {
  color: var(--muted);
  font-size: 13px;
  margin: 18px 0 0;
}
.hero-art {
  border-radius: 16px;
  padding: 28px;
  background: var(--green);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-art:before {
  content: "";
  position: absolute;
  border: 1px solid #ffffff12;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  top: -115px;
  right: -80px;
  pointer-events: none;
}
.hero-art .eyebrow {
  color: #a9c5af;
}
.art-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hero-art h3 {
  font-size: 19px;
  font-weight: 500;
}
.art-flow {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  padding: 25px 0;
}
.art-node {
  font-size: 11px;
  border: 1px solid #779884;
  background: #ffffff09;
  padding: 12px 9px;
  border-radius: 6px;
  flex: 1;
  text-align: center;
  max-width: 110px;
}
.art-line {
  height: 1px;
  min-width: 12px;
  background: #6e977f;
}
.art-result {
  background: #f2f5e9;
  color: var(--green);
  padding: 17px 18px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 5px;
  text-decoration: none;
  width: 100%;
  border: 0;
  text-align: left;
}
.art-result b {
  font-size: 15px;
  font-weight: 600;
  display: block;
}
.art-result small {
  display: block;
  color: #758172;
  font-size: 10px;
}
.art-result .arrow {
  font-size: 22px;
}
.hero .hero-art .art-foot,
.art-foot {
  font-size: 10px;
  color: #bdd0c1;
  margin: 17px 0 0;
  max-width: none;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 23px;
  min-width: 0;
}
.card p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 9px;
}
.card-number {
  display: block;
  font-size: 11px;
  color: #91a18c;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}
.card .big {
  font-size: 28px;
  line-height: 1.3;
  font-weight: 500;
  color: var(--green);
}
.line-box {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding: 20px 0;
  display: flex;
  gap: 25px;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.line-box strong {
  color: var(--green);
  display: block;
}

/* ------------------------------------------------------------- generic blocks */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.stat span {
  font-size: 12px;
  color: var(--muted);
}
.stat .num {
  font-size: 30px;
  color: var(--green);
  line-height: 1.4;
  margin-top: 6px;
  font-weight: 500;
}
.stat .num small {
  font-size: 12px;
  color: var(--muted);
}
.stat > small {
  font-size: 11px;
  color: var(--faint);
}
.notice {
  padding: 13px 16px;
  border-left: 3px solid #bccd95;
  background: #eef2e7;
  font-size: 12px;
  color: #5c705e;
  margin: 20px 0;
  line-height: 1.8;
}
.notice.warn {
  border-left-color: #c7935e;
  background: var(--amber-bg);
  color: #845a30;
}
.sample {
  background: #f8ebd4;
  color: #8b6837;
  padding: 9px 14px;
  font-size: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
}
.pill {
  display: inline-block;
  font-size: 10px;
  background: #eaf0e5;
  border-radius: 4px;
  padding: 2px 7px;
  color: #597047;
  white-space: nowrap;
}
.pill.high {
  color: #a74a41;
  background: var(--red-bg);
}
.pill.medium {
  color: #8c652e;
  background: #faf0e0;
}
.status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #f3eee1;
  color: #8a703c;
  align-self: start;
  white-space: nowrap;
}
.status.ok {
  background: #e9f1e5;
  color: #416742;
}
.status.bad {
  background: var(--red-bg);
  color: var(--red);
}
.row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-size: 13px;
}
.row:last-child {
  border-bottom: 0;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--soft);
  position: sticky;
  top: 0;
}
tr:last-child td {
  border-bottom: 0;
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.tabs button {
  border: 0;
  background: none;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button[aria-selected="true"] {
  color: var(--green);
  border-bottom-color: var(--green);
  font-weight: 600;
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.toolbar input,
.toolbar select {
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
  font-size: 14px;
}
.toolbar input {
  flex: 1;
  min-width: 200px;
}
.method-list {
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
}
.method-list li {
  margin: 10px 0;
}
.sources {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}
.source {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.source p {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0;
}
.source-links {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  font-size: 12px;
  margin-top: 15px;
}
.empty {
  padding: 50px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #c8d3c1;
  border-radius: 10px;
}
.empty h3 {
  color: var(--ink);
  margin-bottom: 6px;
}
.empty .actions {
  justify-content: center;
}
.history-row {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
  padding: 21px 0;
  border-bottom: 1px solid var(--line);
}
.history-row .actions {
  margin: 0;
}
.history-row p {
  font-size: 12px;
  color: var(--muted);
}
.file-btn {
  position: relative;
  overflow: hidden;
}
.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.loading {
  color: var(--muted);
  font-size: 12px;
}
.loading::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border: 2px solid #c9d8bf;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: kit-spin 0.8s linear infinite;
  vertical-align: -1px;
}
@keyframes kit-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------- questionnaire */
.quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 24px;
  align-items: start;
}
.quiz-card {
  padding: 30px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.quiz-top {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  gap: 16px;
  margin-bottom: 14px;
}
.progress {
  height: 4px;
  background: #e7ece2;
  border-radius: 9px;
  margin-bottom: 32px;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.25s;
}
.quiz-card h2 {
  font-size: 24px;
  margin-bottom: 12px;
}
.quiz-card .why {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 22px;
}
.options {
  display: grid;
  gap: 10px;
}
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 14px;
  cursor: pointer;
  background: #fff;
  width: 100%;
  text-align: left;
  color: var(--ink);
}
.option:hover {
  border-color: #b9cbb0;
}
.option.selected,
.option:has(input:checked) {
  background: #edf3e7;
  border-color: #8ba47c;
  color: #285239;
}
.option .mark {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #a9b8a1;
  display: grid;
  place-items: center;
}
.option.selected .mark {
  border-color: var(--green);
}
.option.selected .mark::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}
.option input {
  accent-color: var(--green);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.quiz-bottom {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 28px;
}
.rail {
  font-size: 12px;
  color: var(--muted);
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
.rail h3 {
  margin-bottom: 4px;
  color: var(--ink);
}
.rail-step {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
}
.rail-step.current {
  color: var(--green);
  font-weight: 600;
}
.rail-step.done {
  color: #4f6b55;
}
.rail-step span:first-child {
  color: #9aac92;
}
.rail .notice {
  margin-top: 22px;
}

/* ------------------------------------------------------------- forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
  margin-top: 20px;
}
.form-grid .wide {
  grid-column: 1 / -1;
}
.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.field + .field {
  margin-top: 18px;
}
.form-grid .field + .field {
  margin-top: 0;
}
.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: #fff;
  padding: 11px;
  color: var(--ink);
  font-size: 16px;
}
.field textarea {
  min-height: 96px;
  resize: vertical;
}
.field .hint {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}
.field .req {
  color: var(--orange);
  margin-left: 2px;
}
.field .err {
  display: none;
  font-size: 11px;
  color: var(--red);
}
.field.invalid input,
.field.invalid select {
  border-color: #d29b6c;
  background: #fffaf4;
}
.field.invalid .err {
  display: block;
}
.checkline {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--muted);
  margin: 16px 0;
  line-height: 1.7;
}
.checkline input {
  margin-top: 5px;
  accent-color: var(--green);
  flex: none;
}
.chip-group {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-group legend {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  padding: 0;
}
.chip {
  position: relative;
  cursor: pointer;
}
.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.chip span {
  display: inline-block;
  border: 1px solid var(--line-2);
  border-radius: 30px;
  padding: 7px 13px;
  font-size: 12px;
  color: var(--ink);
  background: #fff;
}
.chip input:checked + span {
  background: #edf3e7;
  border-color: #8ba47c;
  color: #285239;
  font-weight: 600;
}
.chip input:focus-visible + span {
  outline: 3px solid #7fa88e;
  outline-offset: 2px;
}
.lead-more {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 14px;
}
.lead-more summary {
  font-size: 13px;
  color: var(--green);
  cursor: pointer;
}
.hp {
  position: absolute;
  left: -5000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ------------------------------------------------------------- report frame */
.report-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 28px;
}
.report-head h1 {
  font-size: clamp(26px, 2.6vw, 34px);
  letter-spacing: -0.6px;
}
.report-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}
.report-toolbar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 20px 0 6px;
}
.report-toolbar .actions {
  margin: 0;
}
.report-toolbar p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}
.report-toolbar p b {
  color: var(--green);
}
.report-section {
  margin-top: 36px;
}
.report-section > h3 {
  margin-bottom: 14px;
  font-size: 18px;
}
.report-section > h3 .numberline {
  color: var(--faint);
  margin-right: 6px;
}
.report-cta {
  background: var(--green);
  color: #fff;
  border-radius: 14px;
  padding: 26px 28px;
  margin-top: 36px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.report-cta .eyebrow {
  color: #a9c5af;
  margin-bottom: 8px;
}
.report-cta h3 {
  font-size: 20px;
  font-weight: 500;
}
.report-cta p {
  color: #c9dccd;
  font-size: 13px;
  margin-top: 6px;
}
.report-cta .btn.primary {
  background: var(--lime);
  color: var(--green);
  border-color: var(--lime);
  flex: none;
}
.shared-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #d6e4cc;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 12px;
}

/* ------------------------------------------------------------- consult */
.consult-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.consult-grid .lead-form .form-grid {
  grid-template-columns: 1fr;
}

/* ------------------------------------------------------------- dialogs & toast */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #102a2270;
  display: grid;
  place-items: center;
  padding: 18px;
  animation: kit-fade 0.15s ease;
}
@keyframes kit-fade {
  from {
    opacity: 0;
  }
}
.dialog {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  width: min(620px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 30px;
  color: var(--ink);
  position: relative;
  box-shadow: 0 30px 80px #1c2e2640;
}
.dialog.narrow {
  width: min(460px, 100%);
}
.dialog h2 {
  font-size: 23px;
  margin-bottom: 8px;
  padding-right: 34px;
}
.dialog > p,
.lead-head p {
  font-size: 13px;
  color: var(--muted);
}
.dialog .actions {
  justify-content: flex-end;
}
.dialog .close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: 0;
  background: #f1f4ec;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  color: #6c7c66;
}
.lead-note {
  font-size: 11px;
  color: var(--faint);
  margin-top: 14px;
  line-height: 1.8;
}
.share-link {
  display: flex;
  gap: 8px;
}
.share-link input {
  flex: 1;
  min-width: 0;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: #fff;
  padding: 12px 22px;
  border-radius: 7px;
  z-index: 70;
  max-width: 90%;
  font-size: 13px;
  display: none;
  box-shadow: var(--shadow);
}
.print-locked,
.print-only {
  display: none;
}

/* ------------------------------------------------------------- mobile tab bar (shell) */
.tabbar {
  display: none;
}

/* ------------------------------------------------------------- responsive */
@media (min-width: 1500px) {
  .kit-main {
    padding-left: 64px;
    padding-right: 64px;
  }
  .hero {
    gap: 70px;
  }
}
@media (max-width: 1100px) {
  .kit-main {
    padding: 28px;
  }
  .kit-layout {
    --sidebar-w: 190px;
  }
  .hero {
    gap: 24px;
  }
  .quiz-layout {
    grid-template-columns: 1fr;
  }
  .rail {
    display: none;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .consult-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  :root {
    --header-h: 64px;
  }
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }
  .kit-header {
    padding: 0 16px;
  }
  .brandmark {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
  .brandtype strong {
    font-size: 18px;
  }
  .brand-sub {
    font-size: 10px;
  }
  .brand-sub small,
  .kit-header .tag {
    display: none;
  }
  .language-switch button {
    padding: 7px 10px;
  }
  .language-switch:has(button:nth-child(4)) button {
    padding: 7px 8px;
  }
  .kit-layout {
    display: block;
    /* no sidebar on phones: drop the painted sidebar column and its divider line */
    background: none;
    min-height: 0;
  }
  .sidebar {
    display: none;
  }
  .tabbar {
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    background: #ffffffef;
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar button {
    border: 0;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    color: #6f7f76;
    padding: 4px 0;
    white-space: nowrap;
  }
  .tabbar button b {
    font: 11px/1 Georgia, serif;
    color: #9aac92;
    padding: 4px 10px;
    border-radius: 20px;
  }
  .tabbar button.active {
    color: var(--green);
    font-weight: 600;
  }
  .tabbar button.active b {
    background: var(--mint-2);
    color: var(--green);
  }
  .kit-main {
    padding: 22px 18px;
  }
  .breadcrumb {
    margin-bottom: 19px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-top: 5px;
    padding-bottom: 24px;
  }
  .hero h1 {
    font-size: 38px;
  }
  .hero p {
    margin: 18px 0;
  }
  .hero .actions .btn {
    flex: 1;
  }
  .hero-art {
    padding: 24px;
  }
  .art-flow {
    padding: 20px 0;
  }
  .cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .card-number {
    margin-bottom: 8px;
  }
  .card,
  .quiz-card {
    padding: 20px;
  }
  .line-box {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }
  .form-grid,
  .two-col {
    grid-template-columns: 1fr;
  }
  .page-title,
  .report-head {
    flex-direction: column;
    gap: 10px;
  }
  .report-toolbar .actions .btn {
    flex: 1 1 45%;
  }
  .report-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .history-row {
    flex-direction: column;
    align-items: stretch;
  }
  .quiz-bottom .btn.primary {
    flex: 1;
  }
  .overlay {
    align-items: end;
    padding: 0;
  }
  .overlay .dialog {
    border-radius: 18px 18px 0 0;
    max-height: 92vh;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  }
  .toast {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
  th,
  td {
    padding: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ------------------------------------------------------------- print (shared) */
@page {
  margin: 14mm 12mm;
}
@media print {
  body {
    background: #fff;
    padding: 0;
    font-size: 12px;
  }
  .kit-header,
  .sidebar,
  .tabbar,
  .breadcrumb,
  .report-toolbar,
  .report-cta,
  .shared-banner,
  .toast,
  .overlay,
  .no-print,
  details.howto {
    display: none !important;
  }
  .kit-layout {
    display: block;
  }
  .kit-main {
    padding: 0;
    max-width: none;
  }
  .print-only {
    display: block;
  }
  .card,
  .stat {
    break-inside: avoid;
  }
  a.source-link::after {
    content: " (" attr(href) ")";
    font-size: 9px;
    color: #777;
    word-break: break-all;
  }
  details > *:not(summary) {
    display: block;
  }
  /* Print lock: printing from the browser menu shows a prompt unless a gated button unlocked it. */
  body:not(.print-ok) .kit-layout {
    display: none !important;
  }
  body:not(.print-ok) .print-locked {
    display: block;
    padding: 60px 30px;
    text-align: center;
    font-size: 14px;
    line-height: 2;
  }
}
.btn.primary.danger-fill {
  background: var(--red);
  border-color: var(--red);
}

/* Six interface languages: on narrow phones keep the brand to its code so the language switch fits. */
@media (max-width: 480px) {
  .kit-header:has(.language-switch button:nth-child(4)) .brand-sub {
    display: none;
  }
}
