:root {
  color-scheme: light;
  --bg: #f3f5f2;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --ink: #18211f;
  --muted: #63706b;
  --line: #dce3dd;
  --green: #20744f;
  --blue: #285f99;
  --amber: #ae6618;
  --red: #b83d35;
  --purple: #684b8f;
  --shadow: 0 16px 36px rgba(24, 33, 31, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #fbfcfa;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
}

.brand-mark svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.brand strong,
.brand small,
.side-note strong,
.side-note small {
  display: block;
}

.brand small,
.side-note small {
  color: var(--muted);
  font-size: 0.84rem;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  text-align: left;
  cursor: pointer;
}

.nav-item span {
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 850;
}

.nav-item:hover,
.nav-item.is-active {
  background: #eaf0ec;
  color: var(--ink);
}

.side-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--muted);
}

.status-dot.ok {
  background: var(--green);
}

.status-dot.warn {
  background: var(--amber);
}

.status-dot.fail {
  background: var(--red);
}

.main {
  min-width: 0;
  overflow-x: hidden;
  padding: 24px clamp(18px, 3vw, 40px) 42px;
}

.topbar,
.section-heading,
.panel-head,
.status-strip,
.flow-row,
.segmented {
  display: flex;
  align-items: center;
}

.topbar > div,
.section-heading > div,
.p0-banner > div,
.panel-head > div {
  min-width: 0;
  max-width: 100%;
}

.topbar {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.topbar h1,
.section-heading h2,
.p0-banner h2,
.panel h3 {
  margin: 0;
}

.topbar h1 {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  line-height: 1.08;
}

.lead,
.p0-banner p,
.muted {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.lead {
  max-width: 760px;
  margin: 8px 0 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-strip {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.pill.ok {
  background: rgba(32, 116, 79, 0.12);
  color: var(--green);
}

.pill.warn {
  background: rgba(174, 102, 24, 0.14);
  color: var(--amber);
}

.pill.fail {
  background: rgba(184, 61, 53, 0.12);
  color: var(--red);
}

.pill.neutral {
  background: rgba(40, 95, 153, 0.12);
  color: var(--blue);
}

.p0-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid rgba(184, 61, 53, 0.24);
  border-left: 5px solid var(--red);
  border-radius: var(--radius);
  background: #fff8f6;
  box-shadow: var(--shadow);
}

.transparency-strip {
  display: grid;
  grid-template-columns: minmax(220px, 0.68fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(40, 95, 153, 0.22);
  border-left: 5px solid var(--blue);
  border-radius: var(--radius);
  background: #f7fbff;
  box-shadow: var(--shadow);
}

.transparency-intro h2,
.transparency-intro p {
  margin: 0;
}

.transparency-intro h2 {
  font-size: 1.25rem;
}

.transparency-intro p {
  margin-top: 8px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.transparency-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.transparency-grid article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.transparency-grid strong,
.transparency-grid span {
  display: block;
}

.transparency-grid span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.p0-banner p {
  margin: 8px 0 0;
}

.p0-score {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.p0-score strong {
  color: var(--red);
  font-size: 2.6rem;
  line-height: 1;
}

.p0-score span {
  color: var(--muted);
  font-size: 0.84rem;
  text-align: right;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.section-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.source-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 122px;
  padding: 16px;
}

.metric-card .label {
  color: var(--muted);
  font-size: 0.88rem;
}

.metric-card strong {
  font-size: 2rem;
  line-height: 1;
}

.metric-card small {
  color: var(--muted);
  font-size: 0.84rem;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.onboarding-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel.wide {
  grid-column: 1 / -1;
}

.onboarding-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.onboarding-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.onboarding-form input {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
}

.onboarding-form input:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(40, 95, 153, 0.16);
}

.check-row {
  align-content: center;
  grid-template-columns: 18px minmax(0, 1fr);
  grid-column: 1 / -1;
}

.check-row input {
  min-height: 18px;
  padding: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  grid-column: 1 / -1;
}

.primary-action,
.secondary-action {
  min-height: 40px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 14px;
  font-weight: 850;
  cursor: pointer;
}

.primary-action {
  background: var(--green);
  color: #fff;
}

.secondary-action {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.activation-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}

.activation-card strong,
.activation-card span {
  display: block;
  overflow-wrap: anywhere;
}

.activation-card strong {
  font-size: 1.2rem;
}

.activation-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.panel-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head span:not(.pill) {
  color: var(--muted);
  font-size: 0.84rem;
}

.flow-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.flow-row div,
.stack-item,
.readiness-item,
.alert-item,
.gate-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.flow-row div {
  padding: 14px;
}

.flow-row strong,
.flow-row span,
.stack-item strong,
.stack-item span,
.readiness-item strong,
.readiness-item span,
.alert-item strong,
.alert-item span,
.gate-item strong,
.gate-item span {
  display: block;
}

.flow-row span,
.stack-item span,
.readiness-item span,
.alert-item span,
.gate-item span {
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.87rem;
}

.readiness-list,
.stack-list,
.alert-list,
.gate-list,
.gap-list,
.channel-grid {
  display: grid;
  gap: 10px;
}

.readiness-item,
.stack-item,
.alert-item,
.gate-item,
.channel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
}

.readiness-item > div,
.stack-item > div,
.alert-item > div,
.gate-item > div,
.channel-item > div {
  min-width: 0;
}

.channel-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.channel-item {
  align-items: flex-start;
  flex-direction: column;
}

.channel-item strong,
.channel-item span,
.channel-item small {
  display: block;
}

.channel-item span,
.channel-item small {
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.84rem;
}

.channel-item .pill {
  margin-bottom: 4px;
}

.bar {
  width: min(180px, 34vw);
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e9e5;
}

.bar-fill {
  display: block;
  height: 100%;
  width: var(--value);
  border-radius: inherit;
  background: var(--green);
}

.bar-fill.warn {
  background: var(--amber);
}

.bar-fill.fail {
  background: var(--red);
}

.gap-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.gap-list li {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.segmented {
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  cursor: pointer;
}

.segmented button.is-selected {
  background: var(--ink);
  color: #fff;
}

.placeholder-value {
  margin: 8px 0;
  font-size: 2.2rem;
  font-weight: 850;
}

.privacy-grid,
.exclusion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.privacy-grid span,
.exclusion-list span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0 10px;
  font-size: 0.88rem;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  padding: 13px 15px;
  box-shadow: var(--shadow);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(40, 95, 153, 0.22);
  outline-offset: 2px;
}

@media (max-width: 1080px) {
  .metric-grid,
  .flow-row,
  .channel-grid,
  .transparency-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-note {
    margin-top: 0;
  }

  .topbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar > div,
  .section-heading > div,
  .p0-banner > div,
  .panel-head > div {
    width: 100%;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .p0-banner,
  .content-grid,
  .onboarding-grid,
  .channel-grid,
  .transparency-strip {
    grid-template-columns: 1fr;
  }

  .p0-score {
    justify-items: start;
  }
}

@media (max-width: 620px) {
  .main {
    padding: 18px 14px 36px;
  }

  .main > *,
  .topbar,
  .section-heading,
  .p0-banner,
  .transparency-strip,
  .view,
  .metric-grid,
  .content-grid,
  .lead,
  .p0-banner p,
  .topbar h1 {
    max-width: calc(100vw - 28px);
  }

  .lead {
    max-width: 320px;
  }

  .p0-banner p {
    max-width: 300px;
  }

  .nav-list,
  .metric-grid,
  .flow-row,
  .onboarding-form,
  .channel-grid,
  .transparency-grid {
    grid-template-columns: 1fr;
  }

  .readiness-item,
  .stack-item,
  .alert-item,
  .gate-item,
  .channel-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .bar {
    width: 100%;
  }
}
/* Final 5% activation card */
.final-five-card {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid rgba(174, 102, 24, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(174, 102, 24, 0.12), rgba(40, 95, 153, 0.08));
}

.final-five-card strong {
  font-size: 1.45rem;
  line-height: 1;
}

.final-five-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.final-five-next {
  margin-top: 12px;
  padding: 12px;
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  background: rgba(40, 95, 153, 0.08);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}
