:root {
  color-scheme: dark;
  --bg: #07101f;
  --bg-elevated: #0b1729;
  --surface: #101e33;
  --surface-soft: #13243d;
  --surface-hover: #182b47;
  --border: #2b405e;
  --border-strong: #3b5b83;
  --text: #f5f8fc;
  --text-secondary: #bdc9da;
  --text-muted: #92a3ba;
  --primary: #68a1ff;
  --primary-strong: #2f7df4;
  --primary-soft: rgba(83, 145, 255, 0.15);
  --cyan: #38c7f4;
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-soft: #edf3fb;
  --surface-hover: #e6eef9;
  --border: #cbd7e7;
  --border-strong: #9eb2cd;
  --text: #0d1b2e;
  --text-secondary: #3d5069;
  --text-muted: #5b6f89;
  --primary: #155fc7;
  --primary-strong: #0f54b8;
  --primary-soft: rgba(21, 95, 199, 0.1);
  --cyan: #087aa4;
  --success: #147a3d;
  --success-soft: rgba(20, 122, 61, 0.1);
  --warning: #9a5800;
  --warning-soft: rgba(183, 106, 0, 0.1);
  --danger: #b4233d;
  --danger-soft: rgba(180, 35, 61, 0.09);
  --shadow: 0 24px 70px rgba(35, 63, 98, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 78% -10%, rgba(47, 125, 244, 0.14), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

a {
  color: var(--primary);
}

a:focus-visible,
button:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-weight: 750;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: flex;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  width: 300px;
  height: 100dvh;
  flex: 0 0 300px;
  overflow-y: auto;
  padding: 28px 24px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
  backdrop-filter: blur(16px);
  z-index: 20;
}

.sidebar-top,
.brand-wrapper,
.sidebar-actions,
.status-card,
.page-header-top,
.policy-badge,
.portfolio-link,
.section-heading,
.summary-card,
.flow-step,
.callout,
.contact-card,
.copy-button,
.provider-links,
.meta-bar {
  display: flex;
  align-items: center;
}

.sidebar-top {
  justify-content: space-between;
  gap: 12px;
}

.brand-wrapper {
  min-height: 52px;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-logo-frame {
  width: 52px;
  height: 52px;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: #08255c;
  box-shadow: 0 10px 28px rgba(15, 84, 184, 0.25);
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-details {
  display: grid;
  line-height: 1.25;
}

.brand-name {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-sub {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.icon-button:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  color: var(--text);
}

.theme-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-theme="dark"] .theme-icon-moon,
html[data-theme="light"] .theme-icon-sun {
  display: none;
}

.status-card {
  gap: 10px;
  margin: 24px 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--success) 30%, var(--border));
  border-radius: var(--radius-md);
  background: var(--success-soft);
}

.status-card span:last-child {
  display: grid;
}

.status-card strong {
  font-size: 0.78rem;
  font-weight: 750;
}

.status-card small {
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 13%, transparent);
}

.nav-menu {
  display: grid;
  gap: 22px;
}

.nav-section-title {
  margin: 0 0 5px 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nav-link {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 9px 12px;
  border-radius: 11px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.nav-link:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.nav-link.is-active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-link.is-active::before {
  position: absolute;
  left: 0;
  width: 3px;
  height: 22px;
  border-radius: 4px;
  background: var(--primary);
  content: "";
}

.content-area {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 64px 64px 80px;
}

.page-header {
  scroll-margin-top: 24px;
  padding-bottom: 52px;
  border-bottom: 1px solid var(--border);
}

.page-header-top {
  justify-content: space-between;
  gap: 16px;
}

.policy-badge,
.portfolio-link {
  min-height: 44px;
  gap: 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
}

.policy-badge {
  padding: 8px 14px;
  border: 1px solid color-mix(in srgb, var(--success) 30%, var(--border));
  background: var(--success-soft);
  color: var(--success);
}

.policy-badge svg,
.portfolio-link svg,
.card-icon svg,
.callout svg,
.copy-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portfolio-link {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  text-decoration: none;
}

.portfolio-link:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.portfolio-link svg {
  width: 15px;
  height: 15px;
}

.eyebrow,
.section-kicker,
.network-label,
.contact-label {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 44px 0 12px;
}

.eyebrow span {
  padding: 0 6px;
  color: var(--text-muted);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.page-description {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--text-secondary);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.7;
}

.meta-bar {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.meta-bar > span {
  display: grid;
  min-width: 150px;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.meta-bar small {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.meta-bar strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 0.89rem;
}

.doc-section {
  max-width: 820px;
  padding-top: 72px;
  scroll-margin-top: 20px;
}

.section-heading {
  gap: 15px;
  margin-bottom: 26px;
}

.section-num {
  display: inline-grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 750;
}

.section-kicker {
  margin: 0 0 2px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.doc-section > p {
  max-width: 74ch;
  margin: 0 0 18px;
  color: var(--text-secondary);
}

.doc-section > p strong,
.callout strong,
.plain-note strong {
  color: var(--text);
}

.summary-grid,
.data-map,
.feature-grid,
.retention-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.summary-card,
.data-map article,
.feature-grid article,
.retention-list article {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.summary-card {
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
}

.card-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  background: var(--primary-soft);
  color: var(--primary);
}

.summary-card h3,
.data-map h3,
.feature-grid h3,
.retention-list h3,
.network-row h3,
.flow-step h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.summary-card p,
.data-map p,
.feature-grid p,
.retention-list p,
.flow-step p {
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.62;
}

.plain-note {
  margin-top: 18px;
  padding: 16px 18px;
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--primary-soft);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.flow-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-step {
  position: relative;
  align-items: flex-start;
  gap: 18px;
  min-height: 110px;
  padding: 0 0 26px;
}

.flow-step:not(:last-child)::after {
  position: absolute;
  top: 46px;
  bottom: 4px;
  left: 22px;
  width: 1px;
  background: var(--border-strong);
  content: "";
}

.flow-number {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  z-index: 1;
}

.flow-step > div {
  padding-top: 8px;
}

.data-map article,
.feature-grid article,
.retention-list article {
  padding: 21px;
}

.callout {
  align-items: flex-start;
  gap: 13px;
  margin: 22px 0;
  padding: 17px 19px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.callout svg {
  width: 22px;
  height: 22px;
  margin-top: 1px;
}

.callout p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.91rem;
}

.callout-success {
  border-color: color-mix(in srgb, var(--success) 30%, var(--border));
  background: var(--success-soft);
  color: var(--success);
}

.callout-warning {
  border-color: color-mix(in srgb, var(--warning) 32%, var(--border));
  background: var(--warning-soft);
  color: var(--warning);
}

.callout-danger {
  border-color: color-mix(in srgb, var(--danger) 32%, var(--border));
  background: var(--danger-soft);
  color: var(--danger);
}

.network-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.network-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(220px, 1.35fr) minmax(170px, 1fr);
  gap: 20px;
  padding: 20px;
}

.network-row + .network-row {
  border-top: 1px solid var(--border);
}

.network-label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.63rem;
}

.network-row > p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.58;
}

.network-row .network-recipient {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.provider-links {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.provider-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.provider-links a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.provider-links span {
  font-size: 0.75rem;
}

.check-list {
  display: grid;
  gap: 11px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding: 15px 17px 15px 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
}

.check-list li::before {
  position: absolute;
  top: 17px;
  left: 18px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  content: "✓";
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
}

.check-list strong {
  color: var(--text);
}

.contact-card {
  position: relative;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 25px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--surface), var(--surface-soft));
  box-shadow: var(--shadow);
}

.contact-label {
  margin: 0 0 7px;
}

.contact-email {
  color: var(--text);
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 750;
  text-underline-offset: 4px;
}

.contact-card div > p:last-child {
  max-width: 540px;
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.copy-button {
  min-height: 46px;
  flex: 0 0 auto;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
}

.copy-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.copy-status {
  position: absolute;
  right: 25px;
  bottom: 15px;
  min-height: 20px;
  margin: 0;
  color: var(--success);
  font-size: 0.76rem;
  font-weight: 700;
}

.page-footer {
  display: grid;
  gap: 10px;
  max-width: 820px;
  margin-top: 80px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.page-footer div {
  display: flex;
  gap: 10px;
  color: var(--text-secondary);
}

.page-footer p {
  max-width: 70ch;
  margin: 0;
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    width: 100%;
    height: auto;
    padding: 12px 18px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .brand-logo-frame {
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }

  .brand-wrapper {
    min-height: 48px;
  }

  .status-card {
    display: none;
  }

  .nav-menu {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 0 6px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .nav-group {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
  }

  .nav-section-title {
    display: none;
  }

  .nav-link {
    min-height: 44px;
    flex: 0 0 auto;
    padding-inline: 13px;
    white-space: nowrap;
  }

  .nav-link.is-active::before {
    right: 10px;
    bottom: 3px;
    left: 10px;
    width: auto;
    height: 2px;
  }

  .content-area {
    padding: 48px 28px 64px;
  }

  .doc-section,
  .page-header {
    scroll-margin-top: 120px;
  }
}

@media (max-width: 700px) {
  .content-area {
    padding: 36px 18px 52px;
  }

  .page-header {
    padding-bottom: 40px;
  }

  .page-header-top {
    align-items: stretch;
    flex-direction: column;
  }

  .policy-badge,
  .portfolio-link {
    align-self: flex-start;
  }

  .eyebrow {
    margin-top: 34px;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 3.4rem);
  }

  .meta-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .summary-grid,
  .data-map,
  .feature-grid,
  .retention-list {
    grid-template-columns: 1fr;
  }

  .doc-section {
    padding-top: 58px;
  }

  .network-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .network-row .network-recipient {
    padding-top: 10px;
    border-top: 1px dashed var(--border);
  }

  .contact-card {
    flex-direction: column;
    padding-bottom: 54px;
  }

  .copy-button {
    width: 100%;
    justify-content: center;
  }

  .copy-status {
    right: 24px;
    bottom: 20px;
    left: 24px;
    text-align: center;
  }

  .page-footer div {
    flex-direction: column;
    gap: 0;
  }
}

@media (max-width: 390px) {
  .brand-sub {
    display: none;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-num {
    width: 42px;
    height: 42px;
  }

  .summary-card {
    padding: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  :root,
  html[data-theme="light"] {
    color-scheme: light;
    --bg: #ffffff;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-soft: #f5f7fa;
    --border: #c9d1dc;
    --border-strong: #aab7c7;
    --text: #111827;
    --text-secondary: #374151;
    --text-muted: #4b5563;
    --primary: #154fa6;
  }

  body {
    background: #ffffff;
  }

  .sidebar,
  .skip-link,
  .portfolio-link,
  .theme-toggle,
  .copy-button {
    display: none !important;
  }

  .content-area {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .doc-section {
    break-inside: avoid-page;
    padding-top: 32px;
  }

  .page-header {
    padding-bottom: 28px;
  }

  .summary-card,
  .data-map article,
  .feature-grid article,
  .retention-list article,
  .network-list,
  .contact-card {
    box-shadow: none;
  }
}
