:root {
  --bg: #f1f5f8;
  --surface: #ffffff;
  --surface-2: #e3ebf2;
  --surface-3: #cbd9e6;
  --ink: #0f172a;
  --muted: #475569;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-ink: #ffffff;
  --link: #0e7490;
  --ok-bg: #dcfce7;
  --ok-ink: #14532d;
  --warn-bg: #fef3c7;
  --warn-ink: #78350f;
  --no-bg: #fee2e2;
  --no-ink: #7f1d1d;
  --amber: #d97706;
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --step-small: clamp(0.85rem, 0.83rem + 0.1vw, 0.92rem);
  --step-body: clamp(1.04rem, 1rem + 0.2vw, 1.125rem);
  --step-lead: clamp(1.15rem, 1.1rem + 0.22vw, 1.25rem);
  --step-h2: clamp(1.62rem, 1.26rem + 1.65vw, 2.38rem);
  --step-head: clamp(2.35rem, 1.55rem + 3.6vw, 4.25rem);
  --gap: 8px;
  --pad: 24px;
  --max-w: 1392px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: var(--step-body);
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1.5px;
  transition: color 150ms ease-out, background-color 150ms ease-out, opacity 150ms ease-out;
}

a:hover {
  color: var(--accent-hover);
}

.tile-accent a:not(.btn-dark) {
  color: var(--accent-ink);
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  margin: 0 0 0.46em;
  font-family: var(--font-sans);
  font-weight: 600;
  color: inherit;
}

h1 {
  font-size: var(--step-head);
  line-height: 0.96;
  letter-spacing: -0.042em;
}

h2 {
  font-size: var(--step-h2);
  line-height: 1.05;
  letter-spacing: -0.032em;
}

h3, h4 {
  font-size: var(--step-lead);
  line-height: 1.22;
  letter-spacing: -0.018em;
}

p, ul, ol, dl, table, pre, blockquote {
  margin: 0 0 1rem;
}

p, li {
  max-width: 64ch;
  overflow-wrap: anywhere;
}

p:last-child, ul:last-child, ol:last-child {
  margin-bottom: 0;
}

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--step-small);
}

p code, li code, td code, summary code {
  background: var(--surface-2);
  color: var(--ink);
  padding: 0.12em 0.38em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

pre {
  background: var(--ink);
  color: #f1f5f8;
  padding: 14px 16px;
  overflow-x: auto;
  max-width: 100%;
  line-height: 1.48;
}

pre code {
  background: transparent;
  padding: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.board-shell {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--pad);
}

.top-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.brand-tile {
  background: var(--ink);
  color: #ffffff;
  padding: 12px 18px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: var(--step-body);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-tile:hover {
  background: var(--accent);
  color: #ffffff;
}

.nav-tile {
  background: var(--surface);
  padding: 8px 18px;
  min-height: 46px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}

.nav-tile a {
  color: var(--ink);
  text-decoration: none;
  font-size: var(--step-small);
  font-weight: 500;
}

.nav-tile a:hover,
.nav-tile a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
}

.cta-tile {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 12px 20px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--step-small);
  text-decoration: none;
}

.cta-tile:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

.board-section {
  margin-top: clamp(56px, 7vw, 108px);
}

.board-section--first {
  margin-top: 0;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}

.tile {
  background: var(--surface);
  color: var(--ink);
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.tile--top {
  justify-content: flex-start;
}

.tile-elev {
  background: var(--surface-2);
  color: var(--ink);
}

.tile-accent {
  background: var(--accent);
  color: var(--accent-ink);
}

.tile-photo {
  padding: 0;
  position: relative;
  overflow: hidden;
  background: var(--surface);
  min-height: 268px;
}

.tile-photo img {
  width: 100%;
  height: 100%;
  min-height: 268px;
  object-fit: cover;
  display: block;
}

.photo-strip {
  background: var(--ink) !important;
  color: #ffffff !important;
  padding: 9px 14px;
  font-size: var(--step-small);
  line-height: 1.35;
}

.c-12 { grid-column: span 12; }
.c-8  { grid-column: span 8; }
.c-7  { grid-column: span 7; }
.c-6  { grid-column: span 6; }
.c-5  { grid-column: span 5; }
.c-4  { grid-column: span 4; }
.c-3  { grid-column: span 3; }
.c-2  { grid-column: span 2; }

.hero-lead {
  font-size: var(--step-lead);
  line-height: 1.48;
  color: var(--ink);
  margin: 0.85rem 0 1.35rem;
  max-width: 62ch;
}

.mask-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.mask-line > span {
  display: block;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 13px 22px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--step-small);
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-sans);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--ink);
  padding: 13px 18px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: var(--step-small);
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-sans);
}

.btn-ghost:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.stat-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.stat-pill {
  background: var(--surface-2);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-pill span,
.stat-note {
  font-size: var(--step-small);
  color: var(--muted);
  margin: 0;
}

.stat-pill strong {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

[data-ui].ui-panel {
  background: var(--surface);
  color: var(--ink);
  padding: 24px;
  border: 1px solid rgba(15, 23, 42, 0.14);
}

[data-ui].ui-split {
  display: grid;
  grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid rgba(15, 23, 42, 0.14);
}

[data-ui] .ui-controls {
  padding: 24px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

[data-ui] .ui-output {
  padding: 26px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

[data-ui] .ctrl-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

[data-ui] .ctrl-field label {
  font-size: var(--step-small);
  font-weight: 600;
  color: var(--ink);
}

[data-ui] select,
[data-ui] input[type="number"],
[data-ui] input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--surface-3);
  font-family: var(--font-sans);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

[data-ui] .ui-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

[data-ui] .ui-kpi {
  background: var(--surface-2);
  padding: 14px 16px;
}

[data-ui] .ui-kpi span {
  display: block;
  font-size: var(--step-small);
  color: var(--muted);
  margin-bottom: 4px;
}

[data-ui] .ui-kpi strong {
  display: block;
  font-size: 1.08rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ui-verdict {
  background: var(--surface-2);
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
}

.ui-verdict.is-ok {
  background: var(--ok-bg);
  color: var(--ok-ink);
  border-left-color: #15803d;
}

.ui-verdict.is-warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-left-color: #d97706;
}

.ui-verdict.is-bad {
  background: var(--no-bg);
  color: var(--no-ink);
  border-left-color: #dc2626;
}

.ui-verdict strong {
  display: block;
  font-size: var(--step-body);
  margin-bottom: 4px;
}

.ui-verdict p {
  font-size: var(--step-small);
  margin: 0;
  max-width: none;
}

.ui-blueprint {
  background: var(--ink);
  color: #f1f5f8;
  padding: 12px 14px;
  font-size: var(--step-small);
}

.sb-answer {
  background: var(--surface-2);
  color: var(--ink);
  border-left: 4px solid var(--accent);
  padding: 18px 20px;
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.sb-answer strong {
  font-size: clamp(1.22rem, 1.1rem + 0.8vw, 1.68rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.sb-answer p {
  margin: 0;
  color: var(--muted);
  max-width: 74ch;
}

.sb-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.sb-filter {
  font: inherit;
  font-size: var(--step-small);
  font-weight: 500;
  padding: 10px 14px;
  min-height: 44px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.sb-filter[aria-pressed="true"] {
  background: var(--ink);
  color: #ffffff;
}

.sb-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 6px;
}

.sb-row {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 14px;
  align-items: start;
  background: var(--surface-2);
  padding: 12px 14px;
  max-width: none;
}

.sb-row[hidden] {
  display: none;
}

.sb-row p {
  margin: 2px 0 0;
  font-size: var(--step-small);
  color: var(--muted);
  max-width: 82ch;
}

.sb-badge {
  display: inline-block;
  text-align: center;
  font-size: var(--step-small);
  font-weight: 600;
  padding: 4px 8px;
}

.sb-yes { background: var(--ok-bg); color: var(--ok-ink); }
.sb-partial { background: var(--warn-bg); color: var(--warn-ink); }
.sb-no { background: var(--no-bg); color: var(--no-ink); }

.bc-list {
  display: grid;
  gap: 6px;
}

.bc-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  background: var(--surface);
  padding: 10px 12px;
  cursor: pointer;
}

.bc-item input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.bc-item strong {
  display: block;
  font-weight: 500;
  line-height: 1.32;
  font-size: var(--step-small);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-small);
  font-variant-numeric: tabular-nums;
  margin: 0;
}

th, td {
  text-align: start;
  padding: 13px 15px;
  border-bottom: 1px solid var(--surface-2);
  vertical-align: top;
}

th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--ink);
}

.steps-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
}

.steps-list li {
  counter-increment: step;
  padding-left: 2.4em;
  position: relative;
}

.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.7em;
  height: 1.7em;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  font-size: var(--step-small);
}

.faq-list {
  display: grid;
  gap: 8px;
}

.faq-item {
  background: var(--surface-2);
  padding: 16px 18px;
}

.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  line-height: 1.35;
}

.faq-item p {
  margin: 10px 0 0;
  color: var(--ink);
  max-width: 74ch;
}

.next-row {
  margin-top: 24px;
}

.next-row-title {
  font-size: var(--step-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 10px;
}

.next-card {
  text-decoration: none;
  justify-content: flex-start;
  gap: 8px;
  border-top: 3px solid var(--accent);
}

.next-card:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.next-q {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}

.next-a {
  font-size: var(--step-small);
  color: var(--muted);
  line-height: 1.45;
  flex-grow: 1;
}

.next-go {
  font-size: var(--step-small);
  font-weight: 600;
  color: var(--accent);
}

.ad-slot {
  margin: 24px 0;
  background: var(--surface);
  padding: 10px 12px;
  overflow: hidden;
}

.ad-leader,
.ad-300 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 82px;
}

.ad-n,
.ad-native {
  display: block;
  width: 100%;
}

.ad-slot-label {
  display: block;
  font-size: var(--step-small);
  color: var(--muted);
  margin-bottom: 6px;
}

.ad-slot-pending {
  display: none;
}

.footer-board {
  margin-top: clamp(64px, 8vw, 128px);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}

.footer-wordmark {
  background: var(--ink);
  color: #ffffff;
  padding: 28px 24px;
  display: flex;
  align-items: flex-end;
  min-height: 184px;
}

.footer-wordmark span {
  font-size: clamp(2.1rem, 5vw, 4.6rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.045em;
}

.footer-cta-tile {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 24px;
  min-height: 184px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.footer-cta-tile:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

.footer-cta-tile strong {
  font-size: var(--step-lead);
  line-height: 1.2;
}

.footer-cta-arrow {
  align-self: flex-end;
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-list a {
  text-decoration: none;
  color: var(--ink);
  font-size: var(--step-small);
}

.footer-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

@media (max-width: 980px) {
  .top-bar {
    grid-template-columns: 1fr auto;
  }
  .nav-tile {
    grid-column: 1 / -1;
    order: 3;
  }
  .c-3, .c-2 {
    grid-column: span 6;
  }
  [data-ui].ui-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 759px) {
  .ad-n {
    text-align: center;
  }
}

@media (max-width: 680px) {
  :root {
    --pad: 16px;
    --gap: 6px;
  }
  .tile-grid,
  .footer-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .c-12, .c-8, .c-7, .c-6, .c-5, .c-4, .c-3, .c-2 {
    grid-column: span 2;
  }
  .tile {
    padding: 18px;
  }
  [data-ui] .ui-kpi-grid {
    grid-template-columns: 1fr;
  }
  .sb-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .sb-badge {
    justify-self: start;
  }
  .cta-row a {
    flex: 1 1 100%;
  }
}
