:root { color-scheme: light; }

* { box-sizing: border-box; }

html { min-width: 320px; overflow-x: hidden; background: var(--aerithm-bg, #fff); }

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--aerithm-bg, #fff);
  color: var(--aerithm-txt, #17212b);
  font-family: var(--font-sans, Arial, sans-serif);
}

a { color: inherit; }
button, input, select { font: inherit; }
button { color: inherit; }
:focus-visible { outline: 3px solid var(--aerithm-hero, #315f94); outline-offset: 3px; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-160%);
  background: var(--aerithm-txt, #17212b);
  color: #fff;
}

.skip-link:focus { transform: none; }

.sandbox-banner, .owner-banner {
  padding: 7px 18px;
  border-bottom: 1px solid var(--aerithm-txt, #17212b);
  background: #e9f1cf;
  font: 750 11px/1.2 var(--font-mono, monospace);
  letter-spacing: .09em;
  text-align: center;
}

.owner-banner { background: #f4d8b1; }

.connection-header {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 82px;
  padding: 18px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid var(--aerithm-grid, #d9dee2);
}

.brand { width: 150px; }
.brand img { display: block; width: 100%; height: auto; }

.connection-header nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font: 700 11px/1.2 var(--font-mono, monospace);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.connection-header nav [aria-current="page"] { color: var(--aerithm-hero, #315f94); }
.connection-header nav a { text-underline-offset: 4px; }
.connection-header nav a { display: inline-flex; min-height: 44px; align-items: center; }

main {
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: clamp(38px, 7vw, 92px) clamp(18px, 4vw, 64px) 96px;
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--aerithm-hero, #315f94);
  font: 750 10px/1.2 var(--font-mono, monospace);
  letter-spacing: .09em;
  text-transform: uppercase;
}

h1, h2 { margin: 0; font-weight: 540; letter-spacing: -.035em; }
h1 { max-width: 800px; font-size: clamp(46px, 7vw, 92px); line-height: .94; }
h2 { font-size: clamp(25px, 3vw, 42px); line-height: 1.04; }
p { line-height: 1.62; }

.status-card {
  max-width: 780px;
  min-height: 320px;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid var(--aerithm-grid, #d9dee2);
  background: var(--aerithm-bg-soft, #f2f5f6);
}

.status-card h1 { font-size: clamp(38px, 6vw, 70px); }
.error-card { border-color: var(--aerithm-danger, #9a433f); }

.connection-hero {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(290px, 4fr);
  align-items: end;
  gap: clamp(36px, 7vw, 100px);
  padding-bottom: clamp(50px, 8vw, 108px);
}

.lede { max-width: 720px; margin-top: 24px; color: var(--aerithm-mut, #5e6872); font-size: clamp(17px, 2vw, 22px); }

.availability-card { padding: 24px 0 4px; border-top: 1px solid var(--aerithm-txt, #17212b); }
.availability-card h2 { font-size: 28px; }
.availability-card p:last-child { color: var(--aerithm-mut, #5e6872); }
.status-label { display: inline-block; margin: 0 0 18px; padding: 7px 10px; background: var(--aerithm-bg-soft, #f2f5f6); font: 750 10px/1.2 var(--font-mono, monospace); letter-spacing: .05em; text-transform: uppercase; }

.connection-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--aerithm-grid, #d9dee2);
  background: var(--aerithm-grid, #d9dee2);
}

.step-rail, .task-surface, .privacy-ledger { background: #fff; }
.step-rail { grid-column: span 3; padding: clamp(24px, 3vw, 38px); }
.task-surface { grid-column: span 6; min-width: 0; }
.privacy-ledger { grid-column: span 3; padding: clamp(24px, 3vw, 38px); background: var(--aerithm-bg-soft, #f2f5f6); }

.step-rail ol { margin: 30px 0 0; padding: 0; list-style: none; }
.step-rail li { display: grid; grid-template-columns: 36px 1fr; gap: 3px 10px; padding: 18px 0; border-top: 1px solid var(--aerithm-grid, #d9dee2); color: var(--aerithm-mut, #5e6872); }
.step-rail li:last-child { border-bottom: 1px solid var(--aerithm-grid, #d9dee2); }
.step-rail li > span { grid-row: span 2; font: 750 10px/1.4 var(--font-mono, monospace); }
.step-rail li strong { font-size: 14px; }
.step-rail li small { font-size: 12px; line-height: 1.4; }
.step-rail li[aria-current="step"] { color: var(--aerithm-txt, #17212b); }
.step-rail li[aria-current="step"] > span { color: var(--aerithm-hero, #315f94); }

.task-panel { min-height: 610px; padding: clamp(28px, 5vw, 62px); }
.task-panel > p:not(.eyebrow, .form-note, .form-message, .boundary-note) { max-width: 660px; color: var(--aerithm-mut, #5e6872); }

.scope-list, .receipt-list { margin: 34px 0 0; border-top: 1px solid var(--aerithm-txt, #17212b); }
.scope-list div, .receipt-list div { display: grid; grid-template-columns: minmax(100px, 1fr) 2fr; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--aerithm-grid, #d9dee2); }
.scope-list dt, .receipt-list dt { color: var(--aerithm-mut, #5e6872); font: 700 10px/1.4 var(--font-mono, monospace); letter-spacing: .04em; text-transform: uppercase; }
.scope-list dd, .receipt-list dd { margin: 0; font-size: 13px; line-height: 1.55; }

.consent-form { margin-top: 34px; }
.consent-check { display: grid; grid-template-columns: 22px 1fr; gap: 14px; align-items: start; padding: 18px; border: 1px solid var(--aerithm-grid-strong, #96a0aa); background: var(--aerithm-bg-soft, #f2f5f6); line-height: 1.5; }
.consent-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--aerithm-data, #162a4f); }
.form-note { max-width: 620px; color: var(--aerithm-mut, #5e6872); font-size: 12px; }

.outcome-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 34px; background: var(--aerithm-grid, #d9dee2); border: 1px solid var(--aerithm-grid, #d9dee2); }
.outcome-grid button { min-height: 148px; padding: 22px; border: 0; background: #fff; text-align: left; cursor: pointer; }
.outcome-grid button:hover, .outcome-grid button:focus-visible { background: var(--aerithm-bg-soft, #f2f5f6); outline: 2px solid var(--aerithm-data, #162a4f); outline-offset: -2px; }
.outcome-grid strong, .outcome-grid span { display: block; }
.outcome-grid strong { font-size: 15px; }
.outcome-grid span { margin-top: 10px; color: var(--aerithm-mut, #5e6872); font-size: 12px; line-height: 1.5; }

.phase-list { margin: 34px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--aerithm-txt, #17212b); }
.phase-list li { padding: 18px 0 18px 34px; border-bottom: 1px solid var(--aerithm-grid, #d9dee2); background: linear-gradient(90deg, var(--aerithm-positive, #dbe8df) 0 18px, transparent 18px); }

.field { display: grid; gap: 9px; max-width: 420px; margin-top: 30px; font-weight: 700; }
.field input { min-height: 48px; padding: 11px 13px; border: 1px solid var(--aerithm-grid-strong, #96a0aa); background: #fff; }
.field select { min-height: 48px; padding: 11px 13px; border: 1px solid var(--aerithm-grid-strong, #96a0aa); background: #fff; }
.field input:focus, .field select:focus { outline: 2px solid var(--aerithm-hero, #315f94); outline-offset: 2px; }
.compact-field { max-width: 240px; }
.form-message { min-height: 24px; color: var(--aerithm-danger, #9a433f); font-weight: 700; }

.boundary-note { margin-top: 30px; padding: 18px; border-left: 5px solid var(--aerithm-ramp-2, #c4cdda); background: var(--aerithm-bg-soft, #f2f5f6); font-size: 13px; }
.failure-panel { border-top: 7px solid var(--aerithm-caution, #9a5e4f); }
.receipt-panel { border-top: 7px solid var(--aerithm-positive, #dbe8df); }
.disconnected-panel { border-top: 7px solid var(--aerithm-grid-strong, #96a0aa); }
.unavailable-panel { border-top: 7px solid var(--aerithm-grid-strong, #96a0aa); }

.backfill-progress { margin: 30px 0 8px; padding: 18px; border: 1px solid var(--aerithm-grid, #d9dee2); background: var(--aerithm-bg-soft, #f2f5f6); }
.backfill-progress > div:first-child { display: flex; justify-content: space-between; gap: 20px; font-size: 13px; }
.backfill-progress > div:first-child span { color: var(--aerithm-mut, #5e6872); font: 700 11px/1.4 var(--font-mono, monospace); }
.backfill-progress p { margin: 12px 0 0; color: var(--aerithm-mut, #5e6872); font-size: 12px; }
.progress-track { height: 8px; margin-top: 14px; overflow: hidden; background: var(--aerithm-grid, #d9dee2); }
.progress-track span { display: block; width: 0; height: 100%; background: var(--aerithm-data, #162a4f); transition: width 180ms ease; }

.privacy-ledger h2 { font-size: 30px; }
.privacy-ledger ul { margin: 30px 0 0; padding: 0; list-style: none; }
.privacy-ledger li { padding: 17px 0; border-top: 1px solid var(--aerithm-grid, #d9dee2); }
.privacy-ledger li:last-child { border-bottom: 1px solid var(--aerithm-grid, #d9dee2); }
.privacy-ledger li strong, .privacy-ledger li span { display: block; }
.privacy-ledger li strong { font: 750 11px/1.3 var(--font-mono, monospace); text-transform: uppercase; }
.privacy-ledger li span { margin-top: 7px; color: var(--aerithm-mut, #5e6872); font-size: 12px; line-height: 1.5; }
.fallback-note { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--aerithm-txt, #17212b); font-size: 13px; }
.fallback-note p { color: var(--aerithm-mut, #5e6872); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 12px 18px; border: 1px solid var(--aerithm-txt, #17212b); background: #fff; color: var(--aerithm-txt, #17212b); font-weight: 750; text-decoration: none; cursor: pointer; }
.button-primary { background: var(--aerithm-txt, #17212b); color: #fff; }
.button-quiet { border-color: var(--aerithm-grid-strong, #96a0aa); }
.button:disabled { cursor: not-allowed; opacity: .48; }

[hidden] { display: none !important; }

@media (max-width: 1080px) {
  .step-rail { grid-column: span 4; }
  .task-surface { grid-column: span 8; }
  .privacy-ledger { grid-column: 1 / -1; }
  .privacy-ledger ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 30px; }
}

@media (max-width: 760px) {
  .connection-header { grid-template-columns: 1fr; }
  .connection-header nav { overflow-x: auto; padding-bottom: 3px; }
  .connection-hero { grid-template-columns: 1fr; }
  .connection-layout { display: flex; flex-direction: column; }
  .task-surface { order: 1; }
  .step-rail { order: 2; }
  .privacy-ledger { order: 3; }
  .task-panel { min-height: 0; }
  .step-rail ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step-rail li:nth-child(2) { border-top-color: var(--aerithm-txt, #17212b); }
}

@media (max-width: 480px) {
  main { padding-left: 16px; padding-right: 16px; }
  .connection-header nav { gap: 16px; }
  .outcome-grid, .privacy-ledger ul { grid-template-columns: 1fr; }
  .scope-list div, .receipt-list div { grid-template-columns: 1fr; gap: 7px; }
  .backfill-progress > div:first-child { align-items: flex-start; flex-direction: column; gap: 6px; }
  .actions { align-items: stretch; flex-direction: column; }
  .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
