/* Discussion-ready visual layer. Business rules remain in steps.js and the API. */
:root {
  --color-bg:#f6f7fc;
  --color-primary:#5145ce;
  --color-primary-hover:#4034ad;
  --color-primary-soft:#eeedff;
  --color-primary-ink:#30276f;
  --color-border:#dde0ed;
  --color-border-strong:#9196b2;
  --color-surface-alt:#f1f2fa;
  --color-text:#25263c;
  --color-text-muted:#585b73;
  --focus-ring:3px solid #5145ce;
  --radius-lg:24px;
  --radius-md:14px;
  --layout-max:860px;
  --shadow-1:0 4px 20px #30276f05;
}
[hidden] {display:none !important;}
body {background:radial-gradient(ellipse at 90% 8%,#e9e7ff 0,transparent 44%),radial-gradient(ellipse at 5% 85%,#e7f5ed 0,transparent 45%),#fbfaf6;min-height:100dvh;}
.app-header {background:#ffffffed;box-shadow:none;border-color:#e7e7f1;}
.app-header__inner {max-width:860px;padding:22px 28px;gap:22px;}
.stepper__label {color:var(--color-primary-ink);}
.progress {height:6px;margin-top:12px;background:#e9e9f4;}
.progress__bar {background:linear-gradient(90deg,#7462dc,#5145ce);transition:width 400ms ease;}
.app-header .btn--ghost {background:transparent;border-color:transparent;white-space:nowrap;}
.app-header .btn--ghost:hover {background:var(--color-primary-soft);}
.app-main {max-width:860px;padding:48px 28px 80px;}
.app-main>.stack {gap:24px;}
.page-title {position:relative;gap:12px;padding-bottom:10px;}
.page-title h2 {font-size:clamp(25px,3.5vw,34px);font-weight:800;letter-spacing:-.055em;line-height:1.4;word-break:keep-all;}
.page-title .muted {max-width:580px;font-size:15px;line-height:1.8;word-break:keep-all;}
.step-stamp {display:grid;place-items:center;width:46px;height:46px;border-radius:16px;background:var(--color-primary-soft);color:var(--color-primary);font-size:16px;font-weight:800;margin-bottom:10px;}
.eyebrow {letter-spacing:.025em;}
.identity-form {background:white;border:1px solid var(--color-border);border-radius:28px;padding:clamp(24px,5vw,48px);box-shadow:0 16px 60px #37306606;}
.identity-form .identity-step {max-width:none;}
.identity-form .page-title {margin-bottom:10px;}
.identity-form input {background:#fafaff;box-shadow:none;border-color:#d0d3e4;border-radius:14px;min-height:58px;}
.identity-form input::placeholder {color:#71758c;}
.identity-form .identity-step:focus-within label {color:var(--color-primary);}
.identity-form button[type=submit] {margin-top:8px;}
.field-group {padding:26px;border-radius:22px;border-color:var(--color-border);}
.field-group>legend {font-size:17px;line-height:1.65;padding:0 8px;max-width:100%;}
.field-group+.field-group {margin-top:0;}
textarea {background:#fafaff;border-color:#b9bed3;padding:16px;}
.btn {min-height:48px;border-radius:14px;font-weight:700;transition:background 150ms,border-color 150ms,transform 150ms;}
.btn:active:not(:disabled) {transform:scale(.98);}
.btn--sm {min-height:40px;border-radius:11px;}
.btn--ghost {border-color:#d3d6e5;}
.actions {gap:12px;margin-top:4px;}
.actions>.btn--primary {padding-inline:32px;}
.card--sunken {background:#efeffa;border-color:transparent;font-size:14px;border-radius:16px;}
.choice {padding:18px;border-radius:16px;transition:background 180ms,border-color 180ms,box-shadow 180ms;}
.choice:has(input:checked) {background:#e9f7f5;border-color:#4b9c94;box-shadow:0 0 0 1px #4b9c9415;}
.choice input {accent-color:#257b73 !important;}
.choice input:checked+.choice__body .choice__title {color:#205f5b;}
.choice__title {font-size:15px;}
.choice__desc {font-size:13px;margin-top:4px;}
.choice-grid--chips {flex-direction:row;flex-wrap:wrap;gap:12px;margin-top:18px;}
.choice--chip {border-radius:999px;align-items:center;padding:12px 18px;min-height:48px;max-width:100%;gap:9px;}
.choice--chip input[type=checkbox] {width:17px;height:17px;margin:0;}
.choice--chip .choice__desc {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);}
.completed-question {background:#fff;border:1px solid var(--color-border);border-radius:16px;}
.completed-question summary {list-style:none;cursor:pointer;display:flex;gap:12px;align-items:center;padding:16px 20px;font-size:13px;}
.completed-question summary::-webkit-details-marker {display:none;}
.completed-question summary>span:nth-child(2) {flex:1;min-width:0;}
.completed-question__check {display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:#e1f3ed;color:#26755f;flex-shrink:0;}
.completed-question__value {display:block;color:var(--color-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;margin-top:2px;}
.completed-question__edit {color:var(--color-primary);flex-shrink:0;font-weight:700;}
.completed-question[open] summary {border-bottom:1px solid var(--color-border);}
.completed-question>.field-group {margin:20px;border-radius:12px;}
.review-bento {display:grid;grid-template-columns:minmax(0,1fr) 160px;gap:12px;}
.review-bento>div {border-radius:20px;padding:22px;background:white;border:1px solid var(--color-border);}
.review-bento .review-bento__main {grid-row:span 2;background:#eeedff;border-color:#e1dffc;display:flex;flex-direction:column;gap:12px;}
.review-bento__main strong {font-size:21px;letter-spacing:-.035em;}
.review-bento__main p {font-size:14px;color:var(--color-text-muted);line-height:1.8;}
.review-bento__metric {display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--color-text-muted);}
.review-bento__metric strong {font-size:23px;color:var(--color-primary-ink);}
.summary-sheet {width:min(600px,calc(100vw - 40px));max-height:85dvh;border:none;padding:32px;border-radius:24px;overscroll-behavior:contain;}
.sheet-heading {display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:12px;}
.sheet-heading h2 {font-size:21px;}
.sheet-handle {display:none;}
.summary-list {display:grid;gap:0;margin-top:20px;}
.summary-list>div {padding:18px 0;border-top:1px solid var(--color-border);}
.summary-list dt {font-size:12px;color:var(--color-text-subtle);margin-bottom:6px;}
.summary-list dd {font-size:15px;white-space:pre-wrap;}
body:has(dialog[open]) {overflow:hidden;}
.toast-region {position:fixed;bottom:24px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 32px);z-index:50;}
.toast {display:flex;align-items:center;gap:12px;background:#28273e;color:#fff;padding:14px 16px;border-radius:16px;box-shadow:0 8px 30px #25263c25;font-size:14px;animation:panel-enter 240ms ease;}
.toast__check {color:#9ce1cd;font-size:18px;}
.toast__close {border:0;background:none;color:#fff;font:inherit;font-size:22px;min-width:36px;min-height:36px;cursor:pointer;}
.view-enter {animation:panel-enter 360ms ease;}
@keyframes panel-enter {from {opacity:0;transform:translateY(12px);}to{opacity:1;transform:translateY(0);}}
/* Paper Pal: one shared illustration, brief motion, no obstruction of form controls. */
.welcome-scene {display:flex;flex-direction:column;gap:18px;}
.paper-pal {display:flex;align-items:center;gap:16px;margin-top:8px;}
.paper-pal__art {position:relative;flex:0 0 80px;width:80px;height:80px;isolation:isolate;}
.paper-pal__art::before {content:'';position:absolute;inset:10%;border-radius:44% 56% 55% 45%;background:#e7e2ff;z-index:-1;transform:rotate(-12deg);}
.paper-pal__art img {width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 6px 5px #5145ce12);animation:pal-hello 1.9s ease-in-out 2;}
.paper-pal__spark {position:absolute;color:#b98722;font-size:18px;z-index:1;}
.paper-pal__spark--one {left:-1px;top:9px;transform:rotate(-12deg);}
.paper-pal__spark--two {right:0;bottom:8px;color:#6b5cca;}
.paper-pal__bubble {position:relative;background:#fff9e9;border:1px solid #eee2bf;border-radius:18px 18px 18px 5px;padding:14px 18px;max-width:100%;}
.paper-pal__bubble strong {font-size:14px;color:#5c4824;}
.paper-pal__bubble p {font-size:13px;color:#6b6049;line-height:1.65;margin-top:4px;}
.paper-pal--start {margin:0;gap:26px;background:linear-gradient(125deg,#f1edff,#f6f5ff 65%,#ecf7f0);border-radius:24px;padding:18px 22px;min-height:190px;}
.paper-pal--start .paper-pal__art {width:172px;height:172px;flex-basis:172px;}
.paper-pal--start .paper-pal__spark {font-size:26px;}
.paper-pal--start .paper-pal__bubble {background:#ffffffed;border-color:white;box-shadow:0 6px 0 #e0dcf160;transform:rotate(-2deg);}
.paper-pal--start .paper-pal__bubble strong {color:var(--color-primary-ink);font-size:17px;}
.paper-pal--start .paper-pal__bubble p {color:var(--color-text-muted);}
.welcome-scene .page-title {margin-bottom:0;}
.welcome-scene .step-stamp {display:none;}
.welcome-scene .eyebrow {background:#f3f0ff;border-radius:8px;align-self:flex-start;padding:3px 9px;font-size:11px;}
.welcome-scene h2 {font-size:clamp(24px,3vw,31px);}
.journey-pills {display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 8px;}
.journey-pills>span {display:flex;align-items:center;gap:6px;font-size:11px;color:#5e5974;padding:5px 9px;background:#f6f5fa;border-radius:999px;}
.journey-pills b {display:grid;place-items:center;width:18px;height:18px;border-radius:50%;background:#e5e0fb;color:#5145ce;font-size:10px;}
.identity-form {border-color:#e5e0ed;box-shadow:0 6px 0 #ece9f5,0 22px 55px #5145ce06;}
.btn--primary {box-shadow:0 4px 0 #352c8b;}
.btn--primary:active:not(:disabled) {transform:translateY(2px);box-shadow:0 2px 0 #352c8b;}
.choice:has(input:checked) {animation:choice-pop 220ms ease;}
.step-stamp {border-radius:16px 16px 16px 5px;transform:rotate(-4deg);}
.review-bento__metric:last-child {background:#fff8e7;border-color:#eee4c8;}
.paper-pal--done .paper-pal__art::before {background:#e2f5e8;}
@keyframes pal-hello {0%,100%{transform:translateY(0) rotate(-2deg);}50%{transform:translateY(-5px) rotate(2deg);}}
@keyframes choice-pop {0%{transform:scale(1);}50%{transform:scale(1.025);}100%{transform:scale(1);}}
@media (max-width:600px) {
  .paper-pal {gap:10px;}
  .paper-pal__art {width:64px;height:64px;flex-basis:64px;}
  .paper-pal__bubble {padding:11px 13px;}
  .paper-pal__bubble strong {font-size:13px;}
  .paper-pal__bubble p {font-size:12px;}
  .paper-pal--start {gap:10px;padding:14px 10px;min-height:130px;}
  .paper-pal--start .paper-pal__art {width:100px;height:120px;flex-basis:100px;}
  .paper-pal--start .paper-pal__bubble {padding:12px 10px;}
  .paper-pal--start .paper-pal__bubble strong {font-size:14px;}
  .journey-pills {gap:5px;}
  .journey-pills>span {padding:4px 6px;font-size:10px;}
}
@media (max-width:360px) {
  .paper-pal--start {flex-direction:column;gap:0;}
  .paper-pal--start .paper-pal__art {width:96px;height:96px;flex-basis:96px;}
  .paper-pal--start .paper-pal__bubble {text-align:center;}
}
@media (max-width:600px) {
  .app-header__inner {padding:16px;gap:8px;flex-wrap:wrap;}
  .stepper {flex-basis:calc(100% - 136px);}
  .stepper__row {gap:6px;}
  .stepper__label {font-size:12px;}
  .stepper__count {font-size:11px;}
  .app-header .btn {padding:6px;font-size:12px;}
  .app-main {padding:28px 16px 60px;}
  .identity-form {padding:24px 20px;border-radius:22px;}
  .field-group {padding:18px;}
  .field-group>legend {font-size:15px;}
  .choice--chip {padding:12px 14px;}
  .choice--chip .choice__title {font-size:13px;}
  .completed-question summary {padding:14px;}
  .completed-question>.field-group {margin:12px;}
  .review-bento {grid-template-columns:1fr 1fr;}
  .review-bento .review-bento__main {grid-row:auto;grid-column:1/-1;}
  .summary-sheet {position:fixed;inset:auto 0 0;margin:0;width:100%;max-width:100%;max-height:88dvh;border-radius:24px 24px 0 0;padding:14px 24px max(28px,env(safe-area-inset-bottom));animation:panel-enter 250ms ease;}
  .sheet-handle {display:block;width:40px;height:4px;border-radius:99px;background:#c9ccdc;margin:0 auto 22px;}
  .sheet-heading h2 {font-size:18px;}
}
@media (prefers-reduced-motion:reduce) {*,*::before,*::after {animation:none !important;transition:none !important;}}
@media print {.toast-region,#summary-button,.paper-pal,.journey-pills {display:none !important;}}
.intake-bento,.candidates-bento {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;align-items:start;}
.intake-bento>* , .candidates-bento>* {grid-column:1/-1;min-width:0;margin-top:0;}
.intake-bento>.completed-question,.candidates-bento>.field-group {grid-column:auto;}
.field-group {min-width:0;display:flow-root;}
.field-group>legend {float:left;display:block;width:100%;max-width:100%;padding:0;margin:0 0 16px;line-height:1.6;overflow-wrap:anywhere;}
.field-group>legend+* {clear:both;}
.choice-grid--chips {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.choice-grid--chips .choice--chip {min-width:0;min-height:112px;border-radius:16px;padding:18px;align-items:flex-start;white-space:normal;}
.choice--chip .choice__body {min-width:0;}
.choice--chip .choice__desc {position:static;width:auto;height:auto;margin:7px 0 0;clip:auto;clip-path:none;overflow:visible;white-space:normal;display:block;font-size:13px;line-height:1.65;}
.choice--chip input {flex-shrink:0;margin-top:4px;}
.choice[data-disabled="true"] {opacity:.65;cursor:not-allowed;background:#f5f4f7;}
.choice__restriction {display:block;font-size:12px;line-height:1.5;color:#685e7a;margin-top:8px;}
.paper-pal[data-mood="thinking"] img {animation:pal-think 1.4s ease-in-out 2;}
.paper-pal[data-mood="happy"] img {animation:pal-celebrate .55s ease-in-out 2;}
@keyframes pal-think {0%,100%{transform:rotate(-3deg);}50%{transform:rotate(3deg);}}
@keyframes pal-celebrate {0%,100%{transform:translateY(0);}45%{transform:translateY(-9px) rotate(4deg);}75%{transform:translateY(-3px) rotate(-3deg);}}
@media(max-width:600px){.intake-bento,.candidates-bento,.choice-grid--chips{grid-template-columns:minmax(0,1fr);}.intake-bento>.completed-question,.candidates-bento>.field-group{grid-column:1/-1;}.choice-grid--chips .choice--chip{min-height:0;padding:16px;}}
.intake-bento>.completed-question[open] {grid-column:1/-1;}
.choice__title,.choice__desc {word-break:keep-all;overflow-wrap:anywhere;}
.complete-plan {background:#fff;border:1px solid #dedee8;border-radius:8px;padding:clamp(24px,5vw,60px);box-shadow:0 12px 40px #29234508;}
.complete-plan__header {text-align:center;border-bottom:2px solid #353047;padding-bottom:28px;margin-bottom:32px;}
.complete-plan__header h2 {font-size:28px;letter-spacing:.2em;margin:12px 0 24px;}
.complete-plan__header p {line-height:1.8;font-size:14px;}
.complete-plan__section {margin-top:32px;}
.complete-plan__section h3 {font-size:18px;margin-bottom:16px;color:#30276f;}
.complete-plan__section p {font-size:15px;line-height:2;word-break:keep-all;overflow-wrap:anywhere;margin:0 0 14px;}
.complete-plan__disclosure {border-top:1px solid #dedee8;margin-top:32px;padding-top:20px;font-size:12px;color:#656578;line-height:1.8;}
.final-confirmation {background:#f1effc;border:1px solid #ddd8f0;border-radius:18px;padding:24px;}
.final-confirmation .check-row {align-items:flex-start;line-height:1.8;}
@media print {.complete-plan-view>.page-title,.final-confirmation{display:none}.complete-plan{padding:0;border:0;box-shadow:none}.complete-plan__section{break-inside:avoid;}}
.mail-dialog {width:min(620px,calc(100vw - 32px));max-height:90dvh;overflow:auto;}
.mail-dialog .sheet-heading {margin-bottom:24px;}
.mail-body {white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;font-size:14px;line-height:1.8;background:#fafaff;border:1px solid #e4e2f0;border-radius:12px;padding:18px;}
.mail-send-card {background:#f1efff;border-color:#d9d3f2;}
.mail-send-card p {line-height:1.8;}
.admin-shell {max-width:900px;margin:40px auto;padding:24px;}
.admin-route {display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.admin-route label {display:grid;gap:8px;}
.admin-shell input {width:100%;min-width:0;}
.admin-entry {display:flex;justify-content:space-between;align-items:center;gap:16px;border-bottom:1px solid #ddd;padding:16px 0;overflow-wrap:anywhere;}
@media(max-width:600px){.admin-route{grid-template-columns:1fr}.mail-send-card .btn{white-space:normal}}
.admin-shell input {min-height:48px;padding:12px 14px;border:1px solid #c9c7db;border-radius:12px;background:#fafaff;font:inherit;box-sizing:border-box;}
.admin-shell input:focus {outline:3px solid #c9c2ff;border-color:#6555ca;}
.admin-shell h1 {font-size:clamp(24px,4vw,32px);line-height:1.5;}
.admin-shell h2 {font-size:21px;}
.admin-shell p {line-height:1.8;}
.admin-route label {font-size:14px;font-weight:600;}
