:root {
  --ink: #20343a;
  --ink-soft: #607176;
  --ink-faint: #8a9899;
  --paper: #f5f1e8;
  --surface: #fffdf8;
  --surface-soft: #eee9de;
  --line: #ded9cd;
  --teal: #2f6f68;
  --teal-dark: #245752;
  --teal-pale: #dbe9e3;
  --coral: #df775f;
  --coral-pale: #f8e2da;
  --gold: #d4a753;
  --shadow: 0 18px 55px rgba(43, 57, 55, 0.1);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% -10%, rgba(223,119,95,.11), transparent 30%),
    var(--paper);
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(47, 111, 104, .28);
  outline-offset: 2px;
}

.shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px 22px;
  border-right: 1px solid var(--line);
  background: rgba(249, 246, 239, .9);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 30px; }
.brand-mark { width: 34px; height: 34px; color: var(--teal); }
.brand-name { font-family: Georgia, 'Times New Roman', serif; font-size: 24px; letter-spacing: -.02em; }

.nav-label, .eyebrow {
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-weight: 750;
  color: var(--ink-faint);
}
.nav-label { padding: 0 12px 9px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-button {
  border: 0;
  background: transparent;
  border-radius: 11px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #52666a;
  cursor: pointer;
  font-weight: 630;
  text-align: left;
}
.nav-button:hover { background: rgba(255,255,255,.7); color: var(--ink); }
.nav-button.active { background: var(--teal-pale); color: var(--teal-dark); }
.nav-icon { width: 19px; height: 19px; stroke-width: 1.8; flex: 0 0 auto; }
.nav-spacer { flex: 1; }
.help-card { border-top: 1px solid var(--line); padding: 19px 10px 0; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.help-card button { border: 0; padding: 7px 0 0; background: none; color: var(--teal); font-weight: 700; cursor: pointer; }

.main { min-width: 0; }
.topbar {
  min-height: 78px;
  padding: 15px clamp(24px, 4vw, 58px);
  border-bottom: 1px solid rgba(222,217,205,.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(245,241,232,.72);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 15;
}
.page-context { font-family: Georgia, 'Times New Roman', serif; font-size: 21px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.role-switcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 680;
}
.role-switcher select { appearance: none; border: 0; background: transparent; padding: 0 16px 0 0; color: var(--ink); font-weight: 700; cursor: pointer; }
.role-switcher::after { content: '⌄'; position: absolute; right: 13px; top: 6px; pointer-events: none; color: var(--ink-soft); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }
.avatar { width: 39px; height: 39px; border-radius: 50%; background: var(--ink); color: white; display: grid; place-items: center; font-family: Georgia, serif; font-weight: 700; }
.mobile-menu { display: none; border: 0; background: none; padding: 5px; cursor: pointer; }

.content { padding: 48px clamp(24px, 5vw, 72px) 70px; max-width: 1420px; margin: 0 auto; }
.content.narrow { max-width: 1160px; }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 36px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, .serif { font-family: Georgia, 'Times New Roman', serif; font-weight: 500; letter-spacing: -.025em; }
h1 { font-size: clamp(37px, 5vw, 57px); line-height: 1.02; margin-bottom: 13px; }
h2 { font-size: 30px; line-height: 1.15; margin-bottom: 10px; }
h3 { font-size: 16px; margin-bottom: 8px; }
.lead { color: var(--ink-soft); max-width: 620px; line-height: 1.65; font-size: 16px; margin-bottom: 0; }
.muted { color: var(--ink-soft); }
.fine { color: var(--ink-faint); font-size: 12px; line-height: 1.5; }

.button {
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 44px;
  padding: 10px 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--teal); box-shadow: 0 8px 24px rgba(47,111,104,.19); }
.button.primary:hover { background: var(--teal-dark); }
.button.secondary { background: var(--surface); border-color: var(--line); }
.button.secondary:hover { background: white; }
.button.ghost { background: transparent; color: var(--teal); padding-inline: 10px; }
.button.danger { color: #963e31; background: #fff5f2; border-color: #e8c2ba; }
.button.small { min-height: 36px; padding: 7px 14px; font-size: 13px; }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.summary-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .8fr); gap: 22px; align-items: stretch; }
.card { background: rgba(255,253,248,.88); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 7px 28px rgba(43,57,55,.045); }
.journey-card { padding: clamp(25px, 3vw, 36px); overflow: hidden; position: relative; }
.journey-card::after { content: ''; position: absolute; width: 220px; height: 220px; border: 1px solid rgba(47,111,104,.12); border-radius: 50%; right: -90px; top: -130px; box-shadow: 0 0 0 28px rgba(47,111,104,.025), 0 0 0 58px rgba(47,111,104,.018); }
.journey-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; position: relative; z-index: 1; }
.progress-ring { width: 68px; height: 68px; position: relative; display: grid; place-items: center; flex: 0 0 auto; }
.progress-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.progress-ring strong { font-size: 14px; }
.progress-track { stroke: #e4e1d7; }
.progress-value { stroke: var(--coral); stroke-linecap: round; }
.journey-stage { margin-top: 30px; padding: 22px; background: #eef1e9; border-radius: 17px; display: flex; align-items: center; gap: 17px; position: relative; z-index: 1; }
.stage-number { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%; background: var(--teal); color: white; display: grid; place-items: center; font-family: Georgia, serif; font-size: 18px; }
.stage-copy { min-width: 0; flex: 1; }
.stage-copy h3 { margin: 0 0 4px; }
.stage-copy p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.45; }
.stage-time { font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
.journey-actions { display: flex; gap: 10px; margin-top: 20px; }

.quiet-card { padding: 28px; display: flex; flex-direction: column; }
.quote-mark { color: var(--coral); font-family: Georgia, serif; font-size: 48px; line-height: .8; }
.prompt { font-family: Georgia, serif; font-size: 22px; line-height: 1.35; margin: 15px 0 25px; }
.quiet-card .button { align-self: flex-start; margin-top: auto; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 46px 0 18px; }
.section-head h2 { margin-bottom: 0; }
.milestone-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.milestone { padding: 20px; min-height: 166px; display: flex; flex-direction: column; }
.milestone-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.milestone-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; color: var(--teal); background: var(--teal-pale); }
.milestone.complete .milestone-icon { color: #597268; background: #edf1eb; }
.milestone.current { border-color: rgba(223,119,95,.45); box-shadow: 0 10px 32px rgba(223,119,95,.08); }
.milestone.current .milestone-icon { color: #a94d3b; background: var(--coral-pale); }
.check { color: var(--teal); font-weight: 800; }
.milestone h3 { margin-top: 20px; }
.milestone p { color: var(--ink-soft); font-size: 13px; line-height: 1.5; margin: 0; }
.member-row { display: flex; align-items: center; gap: 9px; }
.mini-avatar { width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: white; background: var(--teal); border: 2px solid var(--surface); }
.mini-avatar:nth-child(2) { background: var(--coral); margin-left: -15px; }
.mini-avatar:nth-child(3) { background: var(--gold); margin-left: -15px; color: var(--ink); }

.info-banner { padding: 19px 22px; border-radius: var(--radius-md); background: #e9eee9; display: flex; align-items: flex-start; gap: 14px; color: #3c5a55; font-size: 14px; line-height: 1.5; margin-bottom: 24px; }
.info-banner svg { flex: 0 0 auto; margin-top: 1px; }

.split-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: 22px; }
.panel { padding: 28px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.panel-head p { margin: 3px 0 0; color: var(--ink-soft); font-size: 13px; }
.ownership-flow { display: flex; flex-direction: column; }
.owner-row { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 14px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.owner-row:last-child { border-bottom: 0; }
.owner-avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: white; font-weight: 800; }
.owner-avatar.successor { background: var(--coral-pale); color: #9d4b3b; }
.owner-copy strong { display: block; font-size: 14px; }
.owner-copy span { font-size: 12px; color: var(--ink-soft); }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px; background: var(--surface-soft); color: var(--ink-soft); font-size: 11px; font-weight: 750; white-space: nowrap; }
.pill.green { color: var(--teal-dark); background: var(--teal-pale); }
.pill.coral { color: #9b4736; background: var(--coral-pale); }
.rule-list { list-style: none; padding: 0; margin: 0; }
.rule-list li { padding: 13px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.rule-list li:last-child { border-bottom: 0; }
.rule-list svg { color: var(--teal); flex: 0 0 auto; }

.admin-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 30px; }
.admin-tabs { display: flex; gap: 4px; padding: 4px; background: #e9e5db; border-radius: 12px; }
.tab-button { border: 0; background: transparent; padding: 9px 14px; border-radius: 9px; font-weight: 700; color: var(--ink-soft); cursor: pointer; font-size: 13px; }
.tab-button.active { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px rgba(43,57,55,.08); }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 30px; }
.metric { padding: 20px; }
.metric p { margin: 0 0 8px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.metric strong { display: block; font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.metric small { color: var(--teal); font-size: 11px; }
.route-section { margin-top: 30px; }
.route-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.route-card { padding: 24px; }
.route-title { display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; }
.route-label { display: flex; gap: 12px; }
.route-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 11px; background: var(--teal-pale); color: var(--teal); }
.route-label h3 { margin: 1px 0 3px; }
.route-label p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.provider-chain { margin-top: 21px; }
.provider { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 11px; padding: 12px; background: #f5f2eb; border-radius: 10px; margin-bottom: 7px; }
.provider-index { width: 23px; height: 23px; border-radius: 50%; background: white; color: var(--ink-soft); display: grid; place-items: center; font-size: 10px; font-weight: 800; border: 1px solid var(--line); }
.provider strong { font-size: 13px; }
.provider span { color: var(--ink-soft); font-size: 11px; }
.provider-meta { text-align: right; }
.provider-meta strong { display: block; color: var(--teal); }
.provider-meta span { display: block; }
.route-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 17px; }
.toggle-row { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--ink-soft); }
.toggle { width: 37px; height: 22px; border: 0; border-radius: 999px; background: #b8c3c0; padding: 3px; cursor: pointer; transition: background .2s; }
.toggle::after { content: ''; display: block; width: 16px; height: 16px; border-radius: 50%; background: white; transition: transform .2s; }
.toggle.on { background: var(--teal); }
.toggle.on::after { transform: translateX(15px); }
.safety-panel { margin-top: 18px; padding: 24px; }
.safety-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.safety-item { border: 1px solid var(--line); padding: 16px; border-radius: 12px; }
.safety-item strong { display: block; font-size: 13px; margin-bottom: 5px; }
.safety-item span { color: var(--ink-soft); font-size: 12px; line-height: 1.45; display: block; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(27,41,43,.47); backdrop-filter: blur(5px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade-in .2s ease; }
.modal { width: min(960px, 100%); max-height: min(760px, calc(100vh - 40px)); overflow: hidden; display: grid; grid-template-columns: 242px minmax(0, 1fr); background: var(--surface); border-radius: 26px; box-shadow: 0 30px 90px rgba(24,38,40,.28); animation: rise-in .26s ease; }
.modal-rail { background: #e8eee8; padding: 29px 24px; display: flex; flex-direction: column; }
.modal-rail .brand { padding: 0 0 34px; }
.step-list { display: flex; flex-direction: column; gap: 5px; }
.step-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; padding: 9px 0; color: #768783; font-size: 12px; font-weight: 700; }
.step-dot { width: 27px; height: 27px; border: 1px solid #bdc9c5; border-radius: 50%; display: grid; place-items: center; font-size: 10px; }
.step-item.active { color: var(--teal-dark); }
.step-item.active .step-dot { border-color: var(--teal); background: var(--teal); color: white; }
.step-item.done .step-dot { border-color: var(--teal); background: transparent; color: var(--teal); }
.modal-rail-note { margin-top: auto; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.modal-main { min-width: 0; display: flex; flex-direction: column; max-height: min(760px, calc(100vh - 40px)); }
.modal-top { display: flex; justify-content: flex-end; padding: 19px 22px 0; }
.close-button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: #f0ede5; border-radius: 50%; cursor: pointer; font-size: 19px; }
.modal-body { padding: 8px clamp(28px, 5vw, 64px) 32px; overflow-y: auto; flex: 1; }
.step-count { color: var(--coral); font-size: 11px; letter-spacing: .12em; font-weight: 800; text-transform: uppercase; }
.modal-body h2 { font-size: clamp(31px, 4vw, 43px); margin-top: 12px; max-width: 570px; }
.modal-body .lead { font-size: 15px; max-width: 600px; }
.recording-card { margin: 27px 0 21px; padding: 25px; background: #f3eee4; border-radius: 17px; }
.video-recording-card { display: grid; gap: 16px; }
.training-video { width: 100%; max-height: 360px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 13px; background: #172a29; }
.video-capture-status { display: flex; justify-content: space-between; gap: 16px; align-items: center; color: var(--ink-soft); }
.video-capture-status strong { color: var(--ink); }
.provider-statement { display: grid; gap: 8px; padding: 15px; border-radius: 12px; background: #fff; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.provider-statement q { display: block; font-size: 14px; color: var(--ink); }
.record-prompt { font-family: Georgia, serif; font-size: 21px; line-height: 1.4; margin: 0 0 22px; }
.recorder { display: flex; align-items: center; gap: 16px; }
.record-button { width: 58px; height: 58px; border: 0; border-radius: 50%; background: var(--coral); color: white; display: grid; place-items: center; cursor: pointer; box-shadow: 0 7px 20px rgba(223,119,95,.3); }
.record-button.recording { animation: pulse 1.4s infinite; }
.wave { height: 37px; display: flex; align-items: center; gap: 3px; flex: 1; }
.wave i { width: 3px; height: var(--h); background: #b5aaa0; border-radius: 4px; }
.recording .wave i, .wave.live i { background: var(--teal); animation: wave 1s ease-in-out infinite alternate; animation-delay: var(--d); }
.recorder-time { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-size: 13px; }
.tip-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.tip { padding: 13px; border: 1px solid var(--line); border-radius: 11px; font-size: 11px; line-height: 1.45; color: var(--ink-soft); }
.tip strong { display: block; color: var(--ink); margin-bottom: 3px; }
.modal-footer { padding: 18px clamp(28px, 5vw, 64px) 26px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; background: var(--surface); }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 26px; }
.choice-card { border: 1px solid var(--line); background: white; border-radius: 15px; padding: 20px; text-align: left; cursor: pointer; }
.choice-card:hover, .choice-card.selected { border-color: var(--teal); background: #f0f6f2; }
.choice-card strong { display: block; margin-bottom: 5px; }
.choice-card span { color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.consent-box { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.consent-box input { margin-top: 3px; accent-color: var(--teal); }
.field { margin-top: 18px; }
.field label { display: block; font-size: 12px; font-weight: 750; margin-bottom: 7px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: white; padding: 12px 13px; color: var(--ink); }
.field textarea { min-height: 90px; resize: vertical; }
.success-view { text-align: center; padding: 30px 0; }
.success-mark { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 22px; background: var(--teal-pale); color: var(--teal); font-size: 30px; }
.success-view .lead { margin-inline: auto; }

.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 150; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: white; padding: 13px 17px; border-radius: 11px; box-shadow: var(--shadow); font-size: 13px; animation: toast-in .25s ease; }
.empty-view { text-align: center; padding: 80px 30px; }
.empty-view svg { color: var(--teal); margin-bottom: 17px; }
.empty-view h2 { margin-bottom: 9px; }
.empty-view p { color: var(--ink-soft); max-width: 460px; margin-inline: auto; line-height: 1.6; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, .82fr) minmax(420px, 1.18fr);
  background: var(--surface);
}
.auth-card {
  width: min(510px, 100%);
  margin: auto;
  padding: 54px clamp(28px, 6vw, 70px);
}
.auth-card .brand { padding: 0 0 64px; }
.auth-card h1 { font-size: clamp(40px, 5vw, 58px); margin: 12px 0 18px; }
.auth-card .lead strong { color: var(--ink); }
.auth-form { margin-top: 30px; }
.auth-form .field { margin-top: 0; }
.auth-form input { min-height: 52px; font-size: 16px; }
.auth-form .button.primary { width: 100%; margin-top: 16px; }
.auth-form .button.ghost { width: 100%; margin-top: 8px; }
.otp-input {
  font-size: 27px !important;
  font-weight: 750;
  letter-spacing: .35em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.auth-error {
  margin-top: 13px;
  padding: 11px 13px;
  border-radius: 10px;
  background: #fff0ec;
  color: #913f31;
  font-size: 13px;
  line-height: 1.45;
}
.auth-trust {
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}
.auth-trust svg { flex: 0 0 auto; color: var(--teal); }
.auth-aside {
  min-height: 100vh;
  padding: clamp(42px, 7vw, 90px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  background:
    radial-gradient(circle at 83% 18%, rgba(255,255,255,.13), transparent 19%),
    radial-gradient(circle at 20% 85%, rgba(223,119,95,.3), transparent 28%),
    var(--teal-dark);
  overflow: hidden;
  position: relative;
}
.auth-aside::after {
  content: '';
  position: absolute;
  width: min(38vw, 520px);
  height: min(38vw, 520px);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 49% 51% 44% 56%;
  right: -9%;
  bottom: -10%;
  transform: rotate(21deg);
  box-shadow: 0 0 0 42px rgba(255,255,255,.025), 0 0 0 86px rgba(255,255,255,.018);
}
.auth-aside .eyebrow { color: rgba(255,255,255,.62); }
.auth-aside .serif { max-width: 620px; font-size: clamp(34px, 5vw, 68px); line-height: 1.08; margin-top: 22px; position: relative; z-index: 1; }
.auth-aside > span { color: rgba(255,255,255,.55); font-size: 12px; letter-spacing: .08em; position: relative; z-index: 1; }
.auth-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--teal-pale);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin-bottom: 27px;
}

.conversation-layout { display: grid; grid-template-columns: minmax(230px, 300px) minmax(0, 1fr); gap: 18px; align-items: start; }
.conversation-list { padding: 18px; display: grid; gap: 12px; }
.conversation-list .auth-form { margin-bottom: 8px; }
.conversation-list-item { width: 100%; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 14px; padding: 13px 14px; text-align: left; display: grid; gap: 4px; cursor: pointer; }
.conversation-list-item:hover, .conversation-list-item.active { border-color: var(--teal); background: var(--teal-pale); }
.conversation-list-item span { color: var(--muted); font-size: 12px; }
.conversation-thread { min-height: 610px; padding: 22px; display: flex; flex-direction: column; }
.message-thread { display: flex; flex: 1; flex-direction: column; gap: 14px; padding: 16px 0 22px; }
.conversation-message { max-width: min(78%, 680px); padding: 15px 17px; border-radius: 18px; border: 1px solid var(--line); }
.conversation-message p { white-space: pre-wrap; margin: 8px 0 0; line-height: 1.6; }
.conversation-message small { display: block; color: var(--muted); margin-top: 9px; }
.likeness-message { align-self: flex-start; background: var(--paper); }
.family-message { align-self: flex-end; background: var(--teal-pale); border-color: transparent; }
.message-meta { display: flex; gap: 9px; align-items: center; }
.conversation-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; border-top: 1px solid var(--line); padding-top: 18px; }
.conversation-composer textarea { min-height: 76px; resize: vertical; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(16px) scale(.985); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px rgba(223,119,95,.13); } }
@keyframes wave { to { height: calc(var(--h) * .45); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1050px) {
  .shell { grid-template-columns: 84px minmax(0,1fr); }
  .sidebar { padding-inline: 13px; }
  .brand-name, .nav-label, .nav-button span, .help-card { display: none; }
  .brand { justify-content: center; padding-inline: 0; }
  .nav-button { justify-content: center; padding: 12px; }
  .milestone-grid { grid-template-columns: 1fr 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; background: var(--paper); }
  .auth-card { width: min(540px, 100%); padding-top: 34px; }
  .auth-card .brand { padding-bottom: 45px; }
  .auth-aside { display: none; }
  .shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 245px; height: 100vh; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .shell.menu-open .sidebar { transform: translateX(0); }
  .sidebar .brand-name, .sidebar .nav-label, .sidebar .nav-button span, .sidebar .help-card { display: block; }
  .sidebar .brand { justify-content: flex-start; }
  .sidebar .nav-button { justify-content: flex-start; }
  .mobile-menu { display: block; }
  .topbar { padding-inline: 18px; min-height: 67px; }
  .page-context { display: none; }
  .role-switcher > span:not(.status-dot) { display: none; }
  .content { padding: 34px 18px 55px; }
  .hero-row, .admin-header { align-items: flex-start; flex-direction: column; }
  .summary-grid, .split-layout, .route-grid { grid-template-columns: 1fr; }
  .milestone-grid { grid-template-columns: 1fr 1fr; }
  .modal { grid-template-columns: 1fr; max-height: calc(100vh - 20px); }
  .modal-rail { display: none; }
  .modal-main { max-height: calc(100vh - 20px); }
  .tip-row, .safety-grid { grid-template-columns: 1fr; }
  .conversation-layout { grid-template-columns: 1fr; }
  .conversation-thread { min-height: 520px; }
  .conversation-message { max-width: 92%; }
  .conversation-composer { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .milestone-grid, .metrics, .choice-grid { grid-template-columns: 1fr; }
  .journey-stage { align-items: flex-start; flex-wrap: wrap; }
  .journey-stage .button { width: 100%; }
  .journey-actions { flex-direction: column; }
  .journey-actions .button { width: 100%; }
  .top-actions .avatar { display: none; }
  .modal-backdrop { padding: 0; }
  .modal { border-radius: 0; height: 100vh; max-height: 100vh; }
  .modal-main { max-height: 100vh; }
}

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