/* ---------- Layout ---------- */
.masthead__meta { font-size: .85rem; color: #cfc7b6; white-space: nowrap; }
.shell { max-width: 1180px; margin: 0 auto; padding: 40px 24px 80px; }

/* ---------- Welcome ---------- */
.welcome { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: start; padding-top: 24px; }
.welcome h1 { font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.2rem); line-height: 1.08; margin-bottom: .55em; }
.welcome__lead { font-size: 1.125rem; color: var(--ink-2); }
.welcome__body p { color: var(--text); max-width: 60ch; }
.welcome__cta { display: flex; align-items: center; gap: 18px; margin-top: 32px; flex-wrap: wrap; }
.welcome__aside { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.welcome__aside-head { background: var(--ink); color: #fff; padding: 22px 26px; position: relative; }
.welcome__aside-head::after { content: ""; position: absolute; left: 26px; bottom: 0; width: 48px; height: 3px; background: var(--gold); }
.welcome__aside-head h2 { color: #fff; font-size: 1.15rem; margin: 0; }
.points { list-style: none; margin: 0; padding: 8px 26px 18px; }
.points li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.points li:last-child { border-bottom: 0; }
.points svg { color: var(--gold); margin-top: 2px; }
.points strong { display: block; color: var(--ink); margin-bottom: 2px; }
.points span { color: var(--muted); font-size: .92rem; }
.resume { margin-top: 18px; padding: 14px 16px; background: var(--gold-tint-2); border: 1px solid #ecdfc2; border-radius: var(--radius-sm); font-size: .92rem; display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ---------- Wizard ---------- */
.wizard { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 40px; align-items: start; }
.rail { position: sticky; top: 24px; }
.rail__title { font: 600 .72rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 6px 0 14px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { position: relative; }
.steps button {
  display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: center; width: 100%;
  padding: 9px 10px; margin: 0; border: 0; border-radius: var(--radius-sm); background: none; text-align: left;
  font: 500 .92rem/1.3 var(--sans); color: var(--muted); cursor: default;
}
.steps button[data-reachable="true"] { cursor: pointer; }
.steps button[data-reachable="true"]:hover { background: rgba(23, 23, 23, .04); color: var(--ink); }
.steps .dot {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); background: var(--surface); font: 600 .78rem/1 var(--sans); color: var(--muted);
}
.steps li.is-done .dot { background: var(--gold); border-color: var(--gold); color: #fff; }
.steps li.is-done button { color: var(--ink-2); }
.steps li.is-current button { color: var(--ink); font-weight: 600; background: var(--surface); box-shadow: var(--shadow); }
.steps li.is-current .dot { background: var(--ink); border-color: var(--ink); color: #fff; }
.rail__time { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.progress { height: 4px; background: #efebe3; }
.progress__bar { height: 100%; width: 0; background: var(--gold); transition: width .35s ease; }
.panel__head { padding: 36px 44px 8px; }
.panel__head h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem); margin-bottom: .35em; }
.panel__head p { color: var(--muted); max-width: 62ch; margin: 0; }
.panel__body { padding: 12px 44px 8px; }
.panel__foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 22px 44px; border-top: 1px solid var(--line); background: #fcfbf8;
}
.panel__foot .saved { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* ---------- Questions ---------- */
.q { padding: 28px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 24px; }
.q:last-child { border-bottom: 0; }
.panel__body > .q { border-bottom: 0; }
.panel__body > .q:not([hidden]) ~ .q:not([hidden]) { border-top: 1px solid var(--line); }
.q__label { display: block; font: 600 1.06rem/1.4 var(--sans); color: var(--ink); margin: 0 0 4px; padding: 0; }
.q__req { color: var(--gold-deep); margin-left: 2px; }
.q__opt { font-weight: 400; color: var(--muted); font-size: .85rem; margin-left: 6px; }
.q__help { color: var(--muted); font-size: .92rem; margin: 0 0 14px; max-width: 64ch; }
.q__control { margin-top: 14px; }
.q__help + .q__control { margin-top: 0; }
.q fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.q__error { display: none; margin-top: 10px; color: var(--danger); font-size: .9rem; font-weight: 500; align-items: center; gap: 6px; }
.q.has-error .q__error { display: flex; }
.q.has-error .input, .q.has-error .textarea, .q.has-error .select { border-color: var(--danger); }
.q.has-error .opt__box { border-color: #e3b6b1; }
.counter { font-size: .8rem; color: var(--muted); margin-top: 6px; text-align: right; }

/* Option tiles (radio / checkbox) */
.opts { display: grid; gap: 10px; }
.opts--cards { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.opts--columns { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt__box {
  display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  transition: border-color .12s, background-color .12s, box-shadow .12s;
  font-size: .97rem; color: var(--ink-2);
}
.opt:hover .opt__box { border-color: #c9bfae; }
.opt__mark { pointer-events: none;
  flex: 0 0 20px; width: 20px; height: 20px; border: 1.5px solid #b5ad9f; background: #fff;
  display: grid; place-items: center; transition: all .12s;
}
.opt--radio .opt__mark { border-radius: 50%; }
.opt--check .opt__mark { border-radius: 5px; }
.opt__mark::after { content: ""; opacity: 0; transition: opacity .12s; }
.opt--radio .opt__mark::after { width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.opt--check .opt__mark::after { width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.opt input:checked + .opt__box { border-color: var(--gold); background: var(--gold-tint-2); box-shadow: inset 0 0 0 1px var(--gold); color: var(--ink); }
.opt input:checked + .opt__box .opt__mark { background: var(--ink); border-color: var(--ink); }
.opt input:checked + .opt__box .opt__mark::after { opacity: 1; }
.opt input:focus-visible + .opt__box { outline: 3px solid var(--gold); outline-offset: 2px; }
.opt input:disabled + .opt__box { opacity: .5; cursor: not-allowed; }
.other-input { margin-top: 10px; }
.limit-note { font-size: .82rem; color: var(--muted); margin-top: 8px; }

/* Scale */
.scale { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 8px; max-width: 520px; }
.scale .opt__box { justify-content: center; font: 600 1.05rem/1 var(--sans); min-height: 54px; padding: 0; }
.scale .opt__mark { display: none; }
.scale .opt input:checked + .opt__box { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: none; }
.scale__ends { display: flex; justify-content: space-between; max-width: 520px; margin-top: 8px; font-size: .84rem; color: var(--muted); }

/* Matrix */
.matrix { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.matrix__head, .matrix__row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(var(--cols), minmax(78px, 104px)); align-items: center; }
.matrix__head { background: #f4f1ea; font: 600 .76rem/1.25 var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.matrix__head > div { padding: 10px 8px; text-align: center; }
.matrix__head > div:first-child { text-align: left; padding-left: 16px; }
.matrix__row { border-top: 1px solid var(--line); }
.matrix__row:nth-child(even) { background: #fcfbf8; }
.matrix__row.is-missing { background: var(--danger-tint); }
.matrix__label { padding: 12px 16px; font-size: .95rem; color: var(--ink-2); }
.matrix__cell { display: grid; place-items: center; padding: 8px 4px; }
.matrix__cell label { position: relative; display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; border-radius: 50%; }
.matrix__cell label:hover { background: rgba(193, 146, 47, .12); }
.matrix__cell input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.matrix__cell .opt__mark { border-radius: 50%; pointer-events: none; }
.matrix__cell .opt__mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #fff; opacity: 0; }
.matrix__cell input:checked + .opt__mark { background: var(--ink); border-color: var(--ink); }
.matrix__cell input:checked + .opt__mark::after { opacity: 1; }
.matrix__cell input:focus-visible + .opt__mark { outline: 3px solid var(--gold); outline-offset: 3px; }
.matrix__cell-label { display: none; }

/* List (numbered short answers) */
.list { display: grid; gap: 10px; }
.list__item { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; }
.list__num { width: 36px; height: 36px; border-radius: 50%; background: var(--gold-tint); color: var(--gold-deep); display: grid; place-items: center; font: 600 .95rem/1 var(--serif); }

/* ---------- Thank you ---------- */
.done { max-width: 680px; margin: 40px auto 0; text-align: center; }
.done__mark { width: 72px; height: 72px; border-radius: 50%; background: var(--ink); color: var(--gold); display: grid; place-items: center; margin: 0 auto 24px; box-shadow: 0 0 0 8px var(--gold-tint); }
.done h1 { margin-bottom: .4em; }
.done p { color: var(--ink-2); font-size: 1.06rem; }
.done__ref { display: inline-flex; gap: 10px; align-items: center; margin-top: 12px; padding: 10px 18px; border: 1px dashed var(--line-strong); border-radius: 999px; font-size: .9rem; color: var(--muted); }
.done__ref strong { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; color: var(--ink); letter-spacing: .04em; }

.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 0 24px 32px; }
.footer img { height: 14px; opacity: .55; vertical-align: -2px; margin-right: 8px; }

.banner-error { margin: 0 44px 0; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--danger-tint); color: var(--danger); font-weight: 500; }

.loading { padding: 120px 0; text-align: center; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .welcome { grid-template-columns: 1fr; gap: 32px; }
  .wizard { grid-template-columns: 1fr; gap: 0; }
  .rail { display: none; }
  .mobile-step { display: block !important; }
}
.mobile-step { display: none; font-size: .82rem; color: var(--muted); padding: 14px 20px 0; }
.mobile-step strong { color: var(--gold-deep); letter-spacing: .1em; text-transform: uppercase; font-size: .72rem; }

@media (max-width: 720px) {
  .shell { padding: 20px 16px 56px; }
  .panel__head { padding: 18px 20px 4px; }
  .panel__body { padding: 4px 20px; }
  .panel__foot { padding: 16px 20px; }
  .panel__foot .saved { display: none; }
  .banner-error { margin: 0 20px; }
  .q { padding: 22px 0; }
  .opts--cards, .opts--columns { grid-template-columns: 1fr; }
  .matrix { border: 0; border-radius: 0; }
  .matrix__head { display: none; }
  .matrix__row { display: block; padding: 14px 0; background: none !important; border-top: 1px solid var(--line); }
  .matrix__row.is-missing { background: var(--danger-tint) !important; padding-inline: 10px; border-radius: var(--radius-sm); }
  .matrix__label { padding: 0 0 10px; font-weight: 500; }
  .matrix__cells { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 6px; }
  .matrix__cell { padding: 0; }
  .matrix__cell label { width: 100%; height: auto; min-height: 44px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); padding: 6px 4px; gap: 0; }
  .matrix__cell .opt__mark { display: none; }
  .matrix__cell-label { display: block; font-size: .8rem; text-align: center; line-height: 1.2; color: var(--ink-2); }
  .matrix__cell label:has(input:checked) { background: var(--ink); border-color: var(--ink); }
  .matrix__cell label:has(input:checked) .matrix__cell-label { color: #fff; }
  .scale .opt__box { min-height: 48px; }
}
@media (min-width: 721px) { .matrix__cells { display: contents; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ======================================================= Review mode */
.masthead__right { display: flex; align-items: center; gap: 22px; }
.rtoggle { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 6px 2px; color: #e6dfd2; font: 500 .85rem/1 var(--sans); cursor: pointer; }
.rtoggle:hover { color: #fff; }
.rtoggle__track { position: relative; width: 36px; height: 20px; border-radius: 99px; background: #4a4845; transition: background-color .15s; }
.rtoggle__thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.rtoggle[aria-checked="true"] { color: #fff; }
.rtoggle[aria-checked="true"] .rtoggle__track { background: var(--gold); }
.rtoggle[aria-checked="true"] .rtoggle__thumb { transform: translateX(16px); }

body.is-review .masthead { border-bottom-color: var(--gold); box-shadow: inset 0 -3px 0 var(--gold); }
body.is-review .shell:has(.wizard--review) { max-width: 1480px; }
.wizard--review { grid-template-columns: 230px minmax(0, 1fr); gap: 32px; }

.review-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 24px; background: var(--gold-tint); border-bottom: 1px solid #ecdcb8; font-size: .88rem; color: var(--ink-2);
}
.review-banner__pill { background: var(--ink); color: var(--gold); font: 600 .7rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; padding: 6px 10px; border-radius: 99px; }
.review-banner__who { margin-left: auto; display: flex; gap: 6px; align-items: baseline; }
.review-banner__who .linkbtn { color: var(--gold-deep); text-decoration: underline; font-size: .85rem; }

.panel__head--review { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; align-items: start; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.wizard--review .panel__body { padding-top: 0; }

.q--review { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; align-items: start; }
.q__cond { display: inline-block; margin: 0 0 10px; padding: 3px 10px; font-size: .8rem; color: var(--gold-deep); background: var(--gold-tint-2); border: 1px solid #efe3c8; border-radius: 99px; }
.panel__head .q__cond { margin-top: 12px; }

/* Comment box */
.cbox { background: #fbfaf7; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; font-size: .9rem; }
.cbox__head { display: flex; align-items: center; gap: 8px; font: 600 .74rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.cbox__head svg { display: block; color: var(--gold); }
.cbox__n { margin-left: auto; background: var(--ink); color: #fff; border-radius: 99px; padding: 3px 8px; letter-spacing: 0; }
.cbox__list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.cbox__item { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 4px; padding: 10px 12px; }
.cbox__item.is-resolved { border-left-color: var(--line-strong); opacity: .7; }
.cbox__meta { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.cbox__meta strong { color: var(--ink); font-size: .85rem; }
.cbox__body { margin-top: 4px; color: var(--ink-2); white-space: pre-wrap; word-wrap: break-word; }
.cbox__del { font-size: .78rem; color: var(--muted); margin-top: 6px; text-decoration: underline; }
.cbox__del:hover { color: var(--danger); }
.cbox__input { min-height: 0; font-size: .9rem; padding: 9px 11px; }
.cbox__actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.cbox__as { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbox__err { color: var(--danger); font-size: .82rem; }
.cbox__err:empty { display: none; }

.steps__count { margin-left: auto; background: var(--gold-tint); color: var(--gold-deep); border-radius: 99px; padding: 2px 8px; font-size: .72rem; font-weight: 600; }
.steps button { grid-template-columns: 28px 1fr auto; }

.rv-name { max-width: 360px; margin-top: 8px; }
.rv-name .input.is-invalid { border-color: var(--danger); }
.points__num { width: 26px; height: 26px; border-radius: 50%; background: var(--gold-tint); color: var(--gold-deep); display: grid; place-items: center; font: 600 .85rem/1 var(--serif); }

.namedlg { border: 0; border-radius: var(--radius); padding: 26px; width: min(420px, calc(100vw - 32px)); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .4); }
.namedlg::backdrop { background: rgba(23, 23, 23, .45); }
.namedlg form { display: grid; gap: 10px; }
.namedlg__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

@media (max-width: 1180px) {
  .q--review, .panel__head--review { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 720px) {
  .rtoggle__label { display: none; }
  .masthead__meta { display: none; }
  .review-banner { padding: 10px 20px; }
  .review-banner__who { margin-left: 0; }
}
.cbox--empty { background: none; border: 0; padding: 0; }
.cbox__add {
  display: inline-flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); background: none;
  font: 500 .86rem/1 var(--sans); color: var(--muted); cursor: pointer; transition: all .12s;
}
.cbox__add svg { display: block; color: var(--gold); }
.cbox__add:hover { border-color: var(--gold); color: var(--ink); background: var(--gold-tint-2); }
.cbox__btns { display: inline-flex; align-items: center; gap: 12px; }
.cbox__cancel { font-size: .82rem; color: var(--muted); }
@media (max-width: 960px) {
  .wizard--review { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 720px) {
  .rtoggle__label { display: inline; font-size: .8rem; }
  .review-banner { font-size: .84rem; }
  .review-banner__who { width: 100%; }
}
.q__variant { margin-top: 14px; padding: 10px 14px; border-left: 3px solid var(--line-strong); background: #faf8f4; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; display: grid; gap: 3px; font-size: .9rem; }
.q__variant-when { font-size: .78rem; color: var(--gold-deep); font-weight: 600; }
.q__variant-text { color: var(--ink); font-weight: 500; }
.q__variant-help { color: var(--muted); font-size: .84rem; }
