:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-soft: #f8fbfc;
  --ink: #101827;
  --muted: #5e6d7f;
  --line: #d8e0ea;
  --teal: #176f72;
  --blue: #245f9f;
  --gold: #a96f19;
  --red: #9a3f3f;
  --green: #2d7c52;
  --violet: #6750a4;
  --shadow: 0 14px 34px rgba(16, 24, 39, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(36, 95, 159, 0.052) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 111, 114, 0.052) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 3px solid rgba(23, 111, 114, 0.42);
  outline-offset: 3px;
}

.wave-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 56px;
}

.wave-header,
.boundary,
.module-card,
.panel,
.module-nav,
.state-card,
.handoff-band {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.wave-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  align-items: start;
  border-top: 5px solid var(--blue);
  padding: 24px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 8px;
  font-size: 48px;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 24px;
  line-height: 1.16;
  letter-spacing: 0;
}

h3 {
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

.label {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lead {
  max-width: 820px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 17px;
}

.status-stack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
}

.status-stack div {
  min-height: 76px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.status-stack div:nth-child(2) {
  border-left-color: var(--gold);
}

.status-stack div:nth-child(3) {
  border-left-color: var(--red);
}

.status-stack span,
.module-card span,
.state-card span,
.fact-row span,
.fact-row em,
.lane-row span,
.lane-row em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.status-stack strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.boundary {
  margin-top: 12px;
  border-left: 5px solid var(--red);
  padding: 13px 15px;
}

.module-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
}

.module-return-nav {
  grid-template-columns: minmax(220px, 320px);
}

.module-nav a {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: #25364b;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.module-nav a:hover {
  background: #eef6f7;
}

.module-grid,
.panel-grid,
.state-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

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

.panel-grid,
.state-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.module-card,
.panel,
.state-card,
.handoff-band {
  padding: 18px;
}

.module-card {
  display: grid;
  min-height: 188px;
  border-top: 4px solid var(--blue);
  text-decoration: none;
}

.module-card:nth-child(2) {
  border-top-color: var(--green);
}

.module-card:nth-child(3) {
  border-top-color: var(--violet);
}

.module-card:nth-child(4) {
  border-top-color: var(--gold);
}

.module-card:nth-child(5) {
  border-top-color: var(--teal);
}

.module-card:nth-child(6) {
  border-top-color: var(--red);
}

.module-card:nth-child(7) {
  border-top-color: var(--blue);
}

.module-card:nth-child(8) {
  border-top-color: var(--gold);
}

.module-card:nth-child(9) {
  border-top-color: var(--green);
}

.module-card:nth-child(10) {
  border-top-color: var(--violet);
}

.module-card:nth-child(11) {
  border-top-color: var(--blue);
}

.module-card:nth-child(12) {
  border-top-color: var(--red);
}

.module-card:nth-child(13) {
  border-top-color: var(--green);
}

.module-card:nth-child(14) {
  border-top-color: var(--teal);
}

.module-card h3,
.panel h3,
.state-card h3 {
  margin-top: 8px;
}

.module-card p,
.panel p,
.state-card p {
  margin-top: 10px;
  color: var(--muted);
}

.module-page {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.side-rail {
  align-self: start;
  position: sticky;
  top: 12px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 10px;
}

.side-rail a {
  display: flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.content-stack {
  display: grid;
  gap: 12px;
}

.fact-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.state-contract-panel {
  border-top: 5px solid var(--blue);
}

.role-flow-continuation {
  border-top: 5px solid var(--teal);
}

.state-table {
  display: grid;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.fact-row,
.lane-row,
.state-row {
  display: grid;
  grid-template-columns: 0.8fr minmax(0, 1.1fr) 0.9fr;
  gap: 10px;
  align-items: center;
  min-height: 50px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.state-row {
  grid-template-columns: 0.78fr 0.85fr minmax(0, 1fr) minmax(0, 1fr);
}

.fact-row:last-child,
.lane-row:last-child,
.state-row:last-child {
  border-bottom: 0;
}

.fact-row.head,
.state-row.head {
  background: #eaf1f7;
  font-weight: 800;
}

.fact-row > *,
.lane-row > *,
.state-row > * {
  min-width: 0;
}

.fact-row span,
.fact-row strong,
.fact-row em,
.lane-row span,
.lane-row strong,
.lane-row em,
.state-row span,
.state-row strong,
.state-row em {
  overflow-wrap: anywhere;
}

.state-key {
  color: var(--blue);
  font-weight: 800;
}

.state-route {
  color: var(--green);
  font-weight: 800;
}

.state-blocked {
  color: var(--red);
  font-weight: 800;
}

.lane-row {
  border-left: 5px solid var(--teal);
  background: #fbfcfe;
}

.lane-row:nth-child(2) {
  border-left-color: var(--blue);
}

.lane-row:nth-child(3) {
  border-left-color: var(--gold);
}

.lane-row:nth-child(4) {
  border-left-color: var(--green);
}

.state-card {
  border-left: 5px solid var(--red);
  background: #fffafa;
}

.state-card span {
  display: block;
  color: var(--red);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.evidence-submit-panel {
  border-top: 5px solid var(--green);
}

.sponsor-scope-review-panel {
  border-top: 5px solid var(--gold);
}

.owl-note-review-panel {
  border-top: 5px solid var(--violet);
}

.product-disclosure {
  margin-top: 16px;
}

.product-disclosure summary {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
  background: #fbfcfe;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.product-disclosure summary:hover {
  background: #f4f8fb;
}

.product-disclosure summary:focus-visible {
  outline: 3px solid rgba(169, 111, 25, 0.32);
  outline-offset: 3px;
}

.interaction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.product-action {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--teal);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.product-action:hover {
  background: #115d60;
}

.product-action:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.interaction-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.interaction-result {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  padding: 12px;
  background: #f7fbf8;
}

.interaction-result[hidden] {
  display: none;
}

.local-adapter-readback {
  margin-top: 12px;
  border-left: 5px solid var(--teal);
  background: #f8fbfc;
}

.result-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.3fr) minmax(0, 1fr);
  gap: 10px;
}

.result-row span,
.interaction-result p {
  color: var(--muted);
}

.result-row strong {
  overflow-wrap: anywhere;
}

.handoff-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
  gap: 18px;
  margin-top: 12px;
  border-top: 5px solid var(--green);
}

.handoff-band ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

@media (max-width: 1050px) {
  .wave-header,
  .status-stack,
  .module-nav,
  .module-grid,
  .panel-grid,
  .state-grid,
  .module-page,
  .handoff-band {
    grid-template-columns: 1fr;
  }

  .side-rail {
    position: static;
  }

  .fact-row,
  .lane-row,
  .state-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  h1 {
    font-size: 40px;
  }
}

@media (max-width: 680px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .wave-shell {
    width: min(100%, 100vw);
    max-width: 100%;
    padding: 12px 12px 56px;
    overflow-x: clip;
  }

  .wave-shell * {
    min-width: 0;
    max-width: 100%;
  }

  .wave-header,
  .module-card,
  .panel,
  .state-card,
  .handoff-band {
    padding: 16px;
  }

  .wave-header,
  .module-page,
  .content-stack {
    display: block;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 21px;
  }

  .wave-header,
  .wave-header .panel,
  .status-stack,
  .wave-header > *,
  .status-stack > *,
  .boundary,
  .module-page,
  .side-rail,
  .content-stack,
  .panel,
  .state-card,
  .state-grid,
  .fact-table,
  .state-table,
  .handoff-band {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .module-nav a,
  .side-rail a,
  .fact-row > *,
  .lane-row > *,
  .state-row > *,
  .result-row > *,
  .handoff-band > * {
    min-width: 0;
  }

  .module-nav a,
  .side-rail a {
    justify-content: flex-start;
    overflow-wrap: anywhere;
  }

  .wave-header p,
  .lead,
  h1,
  h2,
  h3,
  p,
  strong,
  span,
  em,
  .boundary,
  .status-stack strong,
  .status-stack span,
  .state-card strong,
  .state-card p,
  .fact-row span,
  .fact-row strong,
  .fact-row em,
  .lane-row span,
  .lane-row strong,
  .lane-row em,
  .state-row span,
  .state-row strong,
  .state-row em,
  .result-row span,
  .result-row strong {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .fact-row,
  .lane-row,
  .state-row,
  .result-row {
    display: block;
    gap: 6px;
    padding: 10px;
  }

  .fact-row > *,
  .lane-row > *,
  .state-row > *,
  .result-row > * {
    display: block;
    width: 100%;
  }
}
