.demo-page { min-height: 100vh; background: #f5f6f2; color: #17241e; }
.demo-header { min-height: 68px; padding: 12px max(var(--gutter), env(safe-area-inset-right, 0px)) 12px max(var(--gutter), env(safe-area-inset-left, 0px)); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; border-bottom: 1px solid #dfe4df; background: #fff; }
.demo-brand { color: inherit; text-decoration: none; }
.demo-brand .brand-name { font-weight: 600; }
.demo-badge { border: 1px solid #a6d2bd; border-radius: 999px; padding: 7px 12px; color: #176946; background: #eaf7ef; font: 500 11px 'IBM Plex Mono', monospace; letter-spacing: .06em; }
.demo-exit { color: #4a6053; font-size: 14px; }
.demo-wrap { width: 100%; max-width: none; margin: 40px 0 72px; padding: 0 max(var(--gutter), env(safe-area-inset-right, 0px)) 0 max(var(--gutter), env(safe-area-inset-left, 0px)); }
.demo-wrap > h1 { margin: 8px 0 10px; font-size: clamp(34px, 6vw, 48px); line-height: 1.1; }
.demo-intro { max-width: 630px; color: #53645a; font-size: 17px; line-height: 1.65; }
.demo-notice { margin: 24px 0; border: 1px solid #c6ddce; border-radius: 10px; padding: 14px 17px; background: #edf6ee; color: #314c39; font-size: 14px; line-height: 1.6; }
.demo-notice strong { display: block; margin-bottom: 2px; color: #214d36; }
.demo-shell { border: 1px solid #dce3dd; border-radius: 14px; padding: 25px 28px 18px; background: #fff; box-shadow: 0 12px 36px rgb(25 48 34 / 6%); scroll-margin-top: 18px; }
.demo-progress-line { display: flex; justify-content: space-between; color: #56675d; font-size: 13px; }
.demo-progress-track { height: 6px; margin: 9px 0 18px; overflow: hidden; border-radius: 999px; background: #e9eee9; }
#demo-progress-bar { display: block; width: 0; height: 100%; border-radius: inherit; background: #39a777; transition: width .22s ease-out; }
#demo-progress-bar[data-progress="1"] { width: 14.286%; }
#demo-progress-bar[data-progress="2"] { width: 28.571%; }
#demo-progress-bar[data-progress="3"] { width: 42.857%; }
#demo-progress-bar[data-progress="4"] { width: 57.143%; }
#demo-progress-bar[data-progress="5"] { width: 71.429%; }
#demo-progress-bar[data-progress="6"] { width: 85.714%; }
#demo-progress-bar[data-progress="7"] { width: 100%; }
.demo-step-nav { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; padding-bottom: 20px; border-bottom: 1px solid #e5eae5; }
.demo-step-nav span { text-align: center; color: #859188; font-size: 11px; }
.demo-step-nav .is-current { color: #176946; font-weight: 600; }
.demo-step-nav .is-complete { color: #364f40; }
.demo-stage-heading { padding: 23px 0 2px; }
.demo-stage-heading .eyebrow { margin-bottom: 7px; }
.demo-stage-heading h2 { margin: 0; font-size: 25px; line-height: 1.22; }
.demo-stage-body { color: #53645a; line-height: 1.65; }
.demo-stage-body > p { margin: 12px 0 18px; }
.demo-stage-body code { border-radius: 4px; padding: 2px 5px; background: #eef2ed; }
.demo-sample-row { display: flex; justify-content: space-between; gap: 18px; padding: 13px 0; border-bottom: 1px solid #ebefeb; font-size: 14px; }
.demo-sample-row > span { color: #758178; }
.demo-sample-row strong { text-align: right; color: #21392b; font-weight: 500; }
.demo-fake-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 19px 0; }
.demo-fake-form label { display: grid; gap: 5px; color: #5d6e62; font-size: 12px; }
.demo-fake-form input { width: 100%; min-width: 0; border: 1px solid #d7dfd9; border-radius: 7px; padding: 10px 11px; background: #fafbf9; color: #24382b; font: inherit; }
.demo-stage-body > .btn { margin: 12px 0; }
.demo-status:not(:empty) { margin-top: 17px; border-left: 3px solid #3eaa7a; padding: 9px 12px; color: #24603f; background: #f0f8f2; font-size: 13px; }
.demo-flow-callout { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; margin: 20px 0; border: 1px solid #e4eae4; border-radius: 8px; padding: 15px; background: #fbfcfa; font-size: 14px; }
.demo-flow-callout span { color: #69796f; }
.demo-flow-callout .demo-pending { color: #896322; }
.demo-consent { margin: 18px 0; border: 1px solid #e3eae3; border-radius: 9px; padding: 18px; background: #fafcf9; }
.demo-consent-mark { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; color: #1f7549; background: #e3f3e8; }
.demo-consent p { color: #34493b; }
.demo-materials { display: grid; gap: 9px; margin: 18px 0; }
.demo-materials > div { display: flex; align-items: center; gap: 12px; border: 1px solid #e5ebe5; border-radius: 8px; padding: 11px 13px; }
.demo-file-icon { display: grid; flex: 0 0 38px; height: 38px; place-items: center; border-radius: 7px; color: #26704b; background: #eaf5ed; font: 12px 'IBM Plex Mono', monospace; }
.demo-materials > div > span:nth-child(2) { display: grid; line-height: 1.4; }
.demo-materials strong { color: #293d30; font-size: 14px; font-weight: 500; }
.demo-materials small { color: #77847a; font-size: 12px; }
.demo-received { margin-left: auto; color: #26704b; font-size: 12px; }
.demo-match { display: grid; gap: 5px; margin: 18px 0; border: 1px solid #e5ebe5; border-radius: 9px; padding: 16px; background: #fbfcfa; font-size: 14px; }
.demo-match strong { color: #293d30; }
.demo-match > span:not(.eyebrow) { color: #6b796f; }
.demo-score { display: flex; align-items: center; gap: 11px; color: #557062; }
.demo-score strong { color: #24764b; font: 600 32px 'Barlow Condensed', sans-serif; }
.demo-club-card { margin: 14px 0; border: 1px solid #dce6df; border-radius: 10px; padding: 18px; background: #fbfdfb; }
.demo-club-card h3 { margin: 4px 0 15px; color: #253b2d; font-size: 22px; }
.demo-club-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 16px; font-size: 14px; }
.demo-club-facts span { color: #728076; }
.demo-club-facts strong { color: #33493a; font-weight: 500; }
.demo-consent-ok { margin: 15px 0 4px; color: #26704b; font-size: 13px; }
.demo-family-access { margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid #e4ebe4; }
.demo-family-access > .btn { margin: 0 0 4px; }
.demo-family-access > .small { margin: 2px 0 10px; }
.demo-family-preview { overflow: hidden; border: 1px solid #dce3dd; border-radius: 10px; background: #f8f9f7; }
.demo-family-page { display: block; width: min(100%, 390px); padding: 0 12px 16px; }
.demo-family-page .family-stats { grid-template-columns: 1fr; }
.demo-family-page .family-message { padding: 12px 13px; font-size: 11.5px; line-height: 1.48; }
.demo-family-page .family-hero { padding: 14px 13px; border-radius: 0 0 9px 9px; }
.demo-family-page .family-hero h3 { margin: 6px 0; color: #f7faf7; font: 700 26px/.98 'Barlow Condensed', sans-serif; }
.demo-family-page .family-kicker { margin-bottom: 4px; }
.demo-family-brand { display: block; margin-bottom: 8px; color: #fff; font: 700 13px 'Barlow Condensed', sans-serif; letter-spacing: .12em; }
.demo-family-page .family-consent { font-size: 10px; }
.demo-family-page .family-section h4 { margin: 0 0 7px; color: #13201a; font: 700 17px/1.08 'Barlow Condensed', sans-serif; }
.demo-family-page .family-milestone h4 { color: #f7faf7; }
.demo-family-page .family-section { margin-bottom: 10px; }
.demo-family-page .family-stat { min-height: 31px; }
.demo-family-page .family-club { padding: 8px 10px; }
.demo-family-page .family-bottom { padding-top: 0; }
.demo-family-page .family-open { cursor: not-allowed; opacity: .72; }
.demo-family-disclaimer { margin: 9px 0 0; color: #68796d; font-size: 11px; }
.demo-transfer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.demo-transfer-card { display: grid; align-content: start; gap: 7px; min-width: 0; border: 1px solid #e2e9e2; border-radius: 9px; padding: 15px; background: #fbfcfa; }
.demo-transfer-card h3 { margin: 0; color: #293d30; font-size: 18px; line-height: 1.25; }
.demo-transfer-card p { margin: 0 0 5px; color: #68796d; font-size: 13px; line-height: 1.5; }
.demo-transfer-card .btn { justify-self: start; white-space: normal; }
.demo-transfer-card .eyebrow { margin: 0; }
.demo-transfer-status { color: #24603f; font-size: 12px; }
.demo-import-results { min-height: 1em; color: #34493b; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.demo-import-preview { margin-top: 12px; padding-top: 11px; border-top: 1px solid #e2e9e2; }
.demo-import-preview h4 { margin: 0 0 4px; color: #293d30; font-size: 15px; }
.demo-import-preview > p { margin: 0 0 8px; color: #68796d; font-size: 11px; }
.demo-import-table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid #e2e9e2; border-radius: 7px; background: #fff; }
.demo-import-table-scroll:focus-visible { outline: 2px solid #24764b; outline-offset: 2px; }
.demo-import-table-scroll table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 11px; line-height: 1.4; }
.demo-import-table-scroll th, .demo-import-table-scroll td { padding: 8px 9px; border-bottom: 1px solid #edf0ed; text-align: left; vertical-align: top; }
.demo-import-table-scroll th { color: #56675d; background: #f6f8f5; font-size: 10px; font-weight: 600; }
.demo-import-table-scroll tbody tr:last-child td { border-bottom: 0; }
.demo-import-result { display: inline-block; border-radius: 999px; padding: 2px 7px; white-space: nowrap; font-size: 10px; font-weight: 600; }
.demo-import-result-added { color: #176946; background: #eaf7ef; }
.demo-import-result-duplicate { color: #805d20; background: #fff4df; }
.demo-import-result-invalid { color: #933f35; background: #fff0ed; }
.demo-import-safety { margin: 15px 0; border-left: 3px solid #3eaa7a; padding: 10px 12px; color: #53645a; background: #f0f8f2; font-size: 13px; line-height: 1.55; }
.demo-import-safety strong { color: #24603f; }
.demo-controls { display: flex; align-items: center; gap: 9px; margin-top: 17px; padding-top: 14px; border-top: 1px solid #e5eae5; }
.demo-controls #demo-next { margin-left: auto; }
.demo-controls button:disabled { opacity: .48; cursor: not-allowed; }
.demo-reset { border: 0; padding: 9px 6px; color: #66746a; background: transparent; font: inherit; font-size: 13px; cursor: pointer; }
.demo-footnote { margin-top: 17px; color: #78857b; text-align: center; font-size: 12px; }
.demo-entry { margin: 18px 0 0; text-align: center; font-size: 14px; }
.demo-entry a { margin-left: 4px; color: #24764b; font-weight: 600; }
[hidden] { display: none !important; }
@media (max-width: 580px) {
  .demo-header { padding: 10px max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px)); }
  .demo-wrap { margin: 20px 0 36px; padding: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px)); }
  .demo-wrap > h1 { font-size: 35px; }
  .demo-shell { padding: 18px 16px 14px; }
  .demo-step-nav { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .demo-step-nav span { min-height: 1.5em; font-size: 10px; }
  .demo-fake-form { grid-template-columns: 1fr; gap: 10px; }
  .demo-transfer-grid { grid-template-columns: 1fr; }
  .demo-controls { flex-wrap: wrap; }
  .demo-reset { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  #demo-progress-bar { transition: none; }
  html { scroll-behavior: auto !important; }
}

.demo-shell, .demo-stage-body, #demo-stage { min-width: 0; max-width: 100%; }
.demo-transfer-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.demo-import-table-scroll { display: block; width: 100%; }

@media (min-width: 900px) {
  .demo-transfer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
  .demo-step-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .demo-flow-callout, .demo-club-facts { grid-template-columns: 1fr; }
}

.demo-family-page { width: 100%; max-width: none; }
.demo-family-preview { min-width: 0; }
@media (min-width: 760px) {
  .demo-family-page { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; padding: 0 16px 16px; }
  /* Real family pages have 12 tracks; their span rules must not create
     implicit tracks inside this two-column embedded preview. */
  .demo-family-page > .family-section { grid-column: auto; min-width: 0; }
  .demo-family-page > .family-hero, .demo-family-page > .family-bottom, .demo-family-page > .demo-family-disclaimer { grid-column: 1 / -1; }
  .demo-family-page .family-hero { border-radius: 0 0 9px 9px; margin: 0 -16px 12px; }
}
.demo-transfer-card { grid-template-columns: minmax(0, 1fr); }
.demo-transfer-card > *, .demo-import-results, .demo-import-preview, .demo-import-preview > * { min-width: 0; max-width: 100%; }
.demo-import-table-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.demo-step-nav button { min-width: 0; overflow-wrap: anywhere; }
.demo-actions > *, .demo-controls > * { max-width: 100%; }
.demo-wrap h1, .demo-note, .demo-status { overflow-wrap: anywhere; }
@media (max-width: 580px) {
  .demo-step-nav button { min-height: 44px; }
  .demo-exit, .demo-reset { display: inline-flex; align-items: center; min-height: 44px; }
}
