:root {
  --b900: #1F3A5F;
  --b800: #1F497D;
  --b700: #3A6AA4;
  --b600: #4F81BD;
  --b500: #5B8DC7;
  --b400: #7FA7D4;
  --b300: #A8C2E0;
  --b200: #CEDCEC;
  --b100: #E6EEF7;
  --b050: #F3F7FC;

  --ink: #0F1A2B;
  --ink2: #2A3A52;
  --ink3: #5C6A80;
  --ink4: #8A96A8;

  --line: #E2E8EF;
  --line2: #CDD6E0;
  --surf: #FFFFFF;
  --surf2: #F6F8FB;
  --surf3: #EEF2F7;

  --success: #2E9E6A;
  --success-bg: #E6F4EC;
  --warning: #E0A42D;
  --warning-bg: #FBF1DD;
  --danger: #C0504D;
  --pink: #F6DEDD;
  --pink-line: #E4B9B7;

  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Barlow Condensed', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: #E7ECF2;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0; }
p { margin: 0; }
a { color: var(--b600); }
input, select, textarea, button { font-family: inherit; font-size: 100%; }
button { cursor: pointer; }

.italic { font-style: italic; }
.hidden { display: none !important; }
.fw-700 { font-weight: 700; }
.mb-10 { margin-bottom: 10px; }
.w-54 { width: 54px; }
.w-70 { width: 70px; }
.text-fine { font-size: 11.5px; color: var(--ink4); }
.text-center { text-align: center; }
.text-ink { color: var(--ink); }
.text-b800 { color: var(--b800); }
.w-fit { width: fit-content; }
.pl-30 { padding-left: 30px; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(31, 73, 125, .22); border-radius: 9px; }
::-webkit-scrollbar-track { background: transparent; }

@keyframes sl-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sl-pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.sl-scr { animation: sl-fade .28s cubic-bezier(.2,.7,.2,1); }
.portal-form { display: flex; flex-direction: column; height: 100%; }

.skip-link {
  position: absolute; left: -999px; top: auto;
  background: var(--b900); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- portal shell ---------- */
.portal-page {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: 0;
}
@media (min-width: 640px) {
  .portal-page { padding: 28px 16px; align-items: flex-start; }
}

.portal-shell {
  width: 100%;
  max-width: 560px;
  background: var(--surf);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
@media (min-width: 640px) {
  .portal-shell {
    min-height: min(820px, calc(100dvh - 56px));
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(15,26,43,.18), 0 4px 14px rgba(15,26,43,.08);
    border: 1px solid var(--line);
    overflow: hidden;
  }
}

.portal-header {
  padding: 14px 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.portal-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 800; font-size: 21px;
  letter-spacing: .02em; color: var(--b600); text-transform: uppercase;
}
.portal-logo-mark {
  height: 24px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.portal-logo-mark svg { width: 100%; height: 100%; display: block; }
.portal-header-sub { font-size: 12px; padding-top: 10px; color: var(--ink4); }

.portal-progress { padding: 0 20px 10px; flex-shrink: 0; }
.portal-progress-track { height: 4px; background: var(--surf3); border-radius: 99px; overflow: hidden; }
.portal-progress-fill { height: 100%; background: var(--b600); border-radius: 99px; transition: width .3s; }

.portal-main {
  flex: 1;
  padding: 5px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}
.portal-main--center {
  align-items: center; justify-content: center; text-align: center; padding: 40px 26px;
}
.portal-main--tight { gap: 14px; }

.portal-title { font-size: 26px; line-height: 1.05; color: var(--ink); }
.portal-title--sm { font-size: 25px; }
.portal-title--lg { font-size: 30px; }
.portal-subtitle { font-size: 14px; color: var(--ink3); line-height: 1.55; }
.portal-subtitle--md { font-size: 15px; }
.portal-subtitle--lg { font-size: 15.5px; }

.icon-circle { border-radius: 99px; display: flex; align-items: center; justify-content: center; }
.icon-circle--success { width: 76px; height: 76px; background: var(--success-bg); }
.icon-circle--warning { width: 64px; height: 64px; background: var(--warning-bg); }

.portal-footer {
  padding: 14px 22px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surf);
  display: flex; flex-direction: column; gap: 10px;
  flex-shrink: 0;
}

/* ---------- buttons ---------- */
.btn-primary {
  width: 100%; padding: 15px; border-radius: 999px; border: none;
  background: var(--b600); color: #fff; font-size: 16px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(79,129,189,.35); transition: background .15s;
}
.btn-primary:hover { background: var(--b700); }
.btn-primary:disabled { background: var(--b200); box-shadow: none; cursor: not-allowed; }

.btn-ghost {
  width: 100%; padding: 13px; border-radius: 999px; border: 1px solid var(--line2);
  background: #fff; color: var(--ink2); font-size: 15px; font-weight: 600;
}
.btn-ghost:hover { background: var(--surf2); }

.btn-text {
  width: 100%; padding: 11px; border: none; background: none; color: var(--ink3);
  font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-text:hover { color: var(--ink2); }
.btn-text--wrap { white-space: normal; }

.btn-soft {
  width: 100%; padding: 12px; border-radius: 999px; border: 1px solid var(--b200);
  background: var(--b050); color: var(--b700); font-size: 14px; font-weight: 600;
}
.btn-soft:hover { background: var(--b100); }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; color: var(--ink4); padding: 0;
}

/* ---------- form controls ---------- */
.field-label { font-size: 13px; font-weight: 600; color: var(--ink2); }
.text-input, .text-select, .text-area {
  padding: 15px 16px; font-size: 16px; border: 2px solid var(--line2);
  outline: none; width: 100%; letter-spacing: .02em; background: #fff; color: var(--ink);
}
.text-input, .text-area {
  border-radius: 12px;
}
.text-input:focus, .text-select:focus, .text-area:focus { border-color: var(--b400); }
.text-input.has-error { border-color: var(--danger); }
.text-area { min-height: 64px; resize: vertical; font-size: 14px; padding: 10px 12px; }
.field-error { font-size: 13.5px; color: var(--danger); font-weight: 600; }
.char-count { text-align: right; font-size: 11px; color: var(--ink4); }
.char-count.over { color: var(--danger); }

.lang-option {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-radius: 14px; border: 2px solid var(--line); background: #fff;
  font-size: 18px; font-weight: 600; color: var(--ink); transition: all .15s;
}
.lang-option.selected { border-color: var(--b600); background: var(--b050); }
.lang-radio {
  width: 24px; height: 24px; border-radius: 99px; border: 2px solid var(--line2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.lang-option.selected .lang-radio { border-color: var(--b600); }
.lang-radio-dot { width: 12px; height: 12px; border-radius: 99px; background: var(--b600); }

.identity-locked-note { font-size: 15px; color: var(--ink); font-weight: 600; }
.identity-locked-phone { font-size: 22px; font-weight: 700; color: var(--b600); font-family: var(--font-display); }

/* ---------- pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.pill-blue { background: var(--b100); color: var(--b800); }
.pill-green { background: var(--success-bg); color: var(--success); }

/* ---------- calendar ---------- */
.cal-banner {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; margin-bottom: 15px;
}
.cal-banner--ok { background: var(--success-bg); color: var(--success); }
.cal-banner--warn { background: var(--pink); color: var(--danger); }

.cal-nav { display: flex; align-items: center; justify-content: space-between; }
.cal-nav-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff;
  color: var(--ink2); display: inline-flex; align-items: center; justify-content: center;
}
.cal-nav-btn:hover { background: var(--surf2); }
.cal-nav-btn:disabled { opacity: .4; cursor: not-allowed; }
.cal-month-label {
  font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--ink);
  text-transform: uppercase; letter-spacing: .02em;
}

.cal-dow { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; text-align: center; }
.cal-dow span { font-size: 11px; font-weight: 700; color: var(--ink4); padding: 2px 0; display: block; }
.cal-dow span.locked { color: var(--b200); }

.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.cal-day {
  aspect-ratio: 1; border-radius: 11px; border: 2px solid transparent; background: transparent;
  color: var(--ink); font-size: 15px; font-weight: 500; display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.cal-day:disabled { color: var(--b200); cursor: default; }
.cal-day.today { border-color: var(--b500); color: var(--b700); font-weight: 700; }
.cal-day.blocked { background: var(--pink); color: var(--danger); border-color: var(--pink-line); font-weight: 700; }
.cal-day.editing { border-color: var(--b500); }
.cal-day.editing.blocked { border-color: var(--danger); }
.cal-day:not(:disabled):hover { background: var(--surf3); }
.cal-day.blocked:hover { background: var(--pink); }

.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11px; color: var(--ink4); padding-top: 2px; }
.cal-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend-swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

.time-panel {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--surf2);
  display: flex; flex-direction: column; gap: 8px; animation: sl-pop .2s; margin-top: 10px;
}
.time-panel-date { font-size: 14px; font-weight: 700; color: var(--ink); }
.time-panel-eyebrow { font-size: 11.5px; color: var(--ink4); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; margin: 2px 0; }

.check-row {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 10px;
  border: 2px solid var(--line2); background: #fff; font-size: 14.5px; font-weight: 700; color: var(--ink2); width: 100%;
}
.check-row.on { border-color: var(--warning); background: var(--warning-bg); color: #9a6f14; }
.check-box {
  width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--line2); background: #fff;
  display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}
.check-row.on .check-box { border-color: var(--warning); background: var(--warning); }

.win-row {
  display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink2); font-size: 14px; font-weight: 500; width: 100%;
}
.win-row .win-tag { font-size: 11px; font-weight: 500; color: var(--ink4); margin-left: 8px; }
.win-row.on { border-color: var(--pink-line); background: var(--pink); color: var(--danger); font-weight: 700; }
.win-row.on .win-tag { color: var(--danger); }
.win-row .check-box { width: 18px; height: 18px; }
.win-row.on .check-box { border-color: var(--danger); background: var(--danger); }

.chip-row { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 11px; border-radius: 999px;
  background: #fff; border: 1px solid var(--pink-line); font-size: 12px; font-weight: 600; color: var(--danger);
}
.chip-x {
  width: 26px; height: 26px; border-radius: 99px; background: var(--pink); display: flex; align-items: center;
  justify-content: center; color: var(--danger); border: none;
}

/* ---------- questionnaire ---------- */
.measurements-card {
  display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surf2);
}
.measurements-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.measurements-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.measurements-group { display: flex; flex-direction: column; gap: 5px; }
.measurements-group-label { font-size: 12px; color: var(--ink3); font-weight: 600; }
.measurements-inputs { display: flex; align-items: center; gap: 6px; }
.measurements-inputs input { padding: 11px 12px; font-size: 15px; border-radius: 10px; border: 1.5px solid var(--line2); outline: none; text-align: center; }
.measurements-inputs input::placeholder { color: var(--ink4); }
.measurements-unit { font-size: 13px; color: var(--ink3); }

.question-row {
  display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px;
  border: 1px solid var(--line); background: #fff; transition: all .15s;
}
.question-row.yes { border-color: var(--b200); background: var(--b050); }
.question-top { display: flex; align-items: center; gap: 12px; }
.question-text { flex: 1; font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.seg-toggle { display: flex; gap: 2px; background: var(--surf3); border-radius: 9px; padding: 3px; width: 118px; flex-shrink: 0; }
.seg-toggle button {
  flex: 1; padding: 9px; border: none; border-radius: 8px; background: transparent; color: var(--ink3);
  font-size: 14px; font-weight: 700;
}
.seg-toggle button.selected-no { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15,26,43,.12); }
.seg-toggle button.selected-yes { background: var(--b600); color: #fff; }
.upload-hint { font-size: 12px; color: var(--b700); font-weight: 600; display: flex; align-items: center; gap: 6px; }

.mobility-fields { display: flex; flex-direction: column; gap: 10px; }
.mobility-field { display: flex; flex-direction: column; gap: 5px; }

.history-list { display: flex; flex-direction: column; gap: 8px; }
.entry-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 10px 12px; background: #fff;
  display: flex; flex-direction: column; gap: 7px; position: relative;
}
.entry-card-head { display: flex; justify-content: space-between; align-items: center; }
.entry-card-eyebrow { font-size: 11px; font-weight: 700; color: var(--ink4); text-transform: uppercase; letter-spacing: .04em; }
.entry-card input { padding: 9px 11px; font-size: 14px; border-radius: 8px; border: 1.5px solid var(--line2); outline: none; width: 100%; }
.btn-add-row {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 1.5px dashed var(--b300);
  background: var(--b050); color: var(--b700); border-radius: 9px; padding: 8px 14px; font-size: 13.5px; font-weight: 700;
}
.btn-add-row:hover { background: var(--b100); }

/* ---------- upload ---------- */
.dropzone {
  border: 2px dashed var(--b300); border-radius: 14px; padding: 30px 18px; background: var(--b050);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; cursor: pointer;
}
.dropzone input[type=file] { display: none; }
.dropzone-title { font-size: 15px; font-weight: 700; color: var(--b700); }
.dropzone-sub { font-size: 12px; color: var(--ink4); }
.file-row {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line); font-size: 13.5px; color: var(--ink);
}
.file-row-name { display: inline-flex; align-items: center; gap: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row-status { margin-left: auto; padding: 0 10px; font-size: 12px; color: var(--ink4); white-space: nowrap; }
.file-row[data-state="uploading"] { border-color: var(--b600); }
.file-row[data-state="error"] { border-color: var(--danger); }
.file-row[data-state="error"] .file-row-name { color: var(--ink3); }
.upload-list { margin: 0; padding-left: 20px; color: var(--ink); font-size: 14.5px; line-height: 1.8; }
.file-list { display: flex; flex-direction: column; gap: 6px; }
.upload-onfile-label { color: var(--ink3); }

/* ---------- review ---------- */
.review-section { margin-bottom: 16px; }
.review-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--b600); margin-bottom: 6px; }
.review-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.review-row span:first-child { color: var(--ink3); }
.review-row span:last-child { color: var(--ink); font-weight: 600; text-align: right; }
.review-row.last { border-bottom: none; }
.review-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.review-chip { padding: 5px 10px; border-radius: 999px; background: var(--pink); color: var(--danger); font-size: 12px; font-weight: 600; }
.review-available { font-size: 13.5px; color: var(--success); font-weight: 600; }
.review-doc-count { font-size: 13.5px; color: var(--ink); }
.review-title { font-size: 25px; margin-bottom: 6px; }

/* ---------- generic panels ---------- */
.notice-panel {
  display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink4);
}
.notice-panel--push-top { margin-top: auto; }
.notice-panel--stacked { flex-direction: column; align-items: flex-start; gap: 4px; }

.contact-panel {
  margin-top: 6px; padding: 14px 18px; border-radius: 12px; background: var(--surf2);
  border: 1px solid var(--line); font-size: 14px; color: var(--ink3);
}

/* ---------- home / demo launcher ---------- */
.launcher-page { max-width: 880px; margin: 0 auto; padding: 40px 20px 64px; }
.launcher-eyebrow { font-size: 12px; color: var(--b300); font-weight: 500; }
.launcher-heading { font-size: 38px; text-transform: uppercase; margin: 6px 0 10px; color: var(--ink); }
.launcher-lede { font-size: 15.5px; color: var(--ink3); max-width: 640px; line-height: 1.6; margin-bottom: 28px; }
.launcher-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .launcher-grid { grid-template-columns: 1fr 1fr 1fr; } }
.launcher-card {
  text-align: left; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 18px;
  display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 2px rgba(15,26,43,.05); transition: all .18s;
}
.launcher-card:hover { box-shadow: 0 8px 24px rgba(31,73,125,.12); transform: translateY(-2px); border-color: var(--b300); }
.launcher-card-title { font-weight: 700; font-size: 16px; color: var(--ink); }
.launcher-card-sub { font-size: 13.5px; color: var(--ink3); line-height: 1.5; }
.launcher-card-cta { margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--b600); display: flex; align-items: center; gap: 5px; }
.launcher-note {
  margin-top: 30px; padding: 14px 16px; background: var(--b050); border: 1px solid var(--b200); border-radius: 10px;
  font-size: 12.5px; color: var(--ink3); line-height: 1.55;
} 
