/* The diagnosis wizard — DW on the Design canvas, as one responsive layout.
 * Markup: tools/wizard-markup.mjs. Behaviour: sinora-wizard.js.
 *   ≥1200 the 1440 board · 1024–1199 the 1024 board · 768–1023 the 768 board
 *   (one column) · <768 the 390 board (one column, centred)
 * Heading fonts go through #tanilama: the theme sets h1–h6 with !important. */

/* the theme opens the wrap to 1800px; a result on a phone is taller than that */
#tanilama.diagnosis-open #diagnosisFormWrap { max-height: 6000px; }

.dw {
  --g: #090a09; --ink: #f8f6f2; --soft: #dedbd3; --muted: #b9b5ab; --gold: #e6ba5a; --edge: #f5d28a;
  --grad: linear-gradient(115deg, #f7d785, #e6b454 66%, #c38d35);
  --spring: linear(0, .0502, .1647, .3042, .4447, .573, .6827, .7723, .8425, .8956, .9344, .9618, .9804, .9925, .9998, 1.0039, 1.0058, 1.0063, 1.006, 1.0053, 1.0044, 1.0035, 1.0027, 1.002, 1.0015, 1);
  --ease: cubic-bezier(.32, .72, 0, 1);
  --fb: Inter, system-ui, sans-serif; --fd: Inter, system-ui, sans-serif; --dw: 750; --dt: -.035em; --dws: normal; --h2lh: 1.2; --lh: 1.7;
  --top: 90px; --bot: 90px; --wrap: 1194px; --gut: 48px; --pad: 36px; --gap: 44px; --bodyTop: 26px; --h2: 44px; --leadS: 17.5px; --qS: 32px; --optH: 60px; --optS: 16px;
  --ctrlTop: 26px; --ipad: 22px; --fieldH: 280px; --lens: 112px; --orb: 96px; --orbS: 14.5px; --rpad: 28px; --rtS: 30px; --needCols: 2; --waH: 22px; --segw: 44px;
  position: relative; isolation: isolate; padding: var(--top) 0 var(--bot); color: var(--ink); font-family: var(--fb); text-align: start; overflow-x: clip;
}
.dw--fa { --fb: IranSans, Tahoma, sans-serif; --fd: "w_Ray Extra Black", IranSans, sans-serif; --dw: 900; --dt: normal; --dws: .12em; --h2lh: 1.4; --lh: 1.95; }
.dw *, .dw *::before, .dw *::after { box-sizing: border-box; }
.dw :where(h2, h3, h4, p, ul) { margin: 0; }
.dw :where(ul) { padding: 0; list-style: none; }
.dw button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.dw :focus-visible { outline: 2px solid var(--edge); outline-offset: 3px; }
#tanilama .dw :is(h2, h3, h4) { font-family: var(--fb) !important; letter-spacing: normal; }
#tanilama .dw .dw-disp { font-family: var(--fd) !important; font-weight: var(--dw); letter-spacing: var(--dt); word-spacing: var(--dws); }
.dw-press, .dw :is(.dw-pill, .dw-opt, .dw-restart, .dw-play) { transition: transform 100ms ease-out, background-color .25s ease, border-color .25s ease, color .25s ease, box-shadow .25s ease, opacity .25s ease; }
.dw :is(.dw-pill, .dw-opt, .dw-restart):active:not(:disabled) { transform: scale(.97); }

.dw-bloom { position: absolute; z-index: -1; inset-inline-end: -120px; top: 40px; width: 900px; height: 800px; pointer-events: none; background: radial-gradient(closest-side, rgba(214, 166, 73, .15), rgba(214, 166, 73, 0)); }
.dw-shell { position: relative; scroll-margin-top: 100px; width: min(var(--wrap), calc(100% - 2 * var(--gut))); margin: 0 auto; border-radius: 32px; padding: var(--pad);
  background: linear-gradient(160deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .02) 48%, rgba(255, 255, 255, .04));
  -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), inset 0 -1px 0 rgba(255, 255, 255, .04), 0 40px 100px rgba(0, 0, 0, .55); }
.dw-rim { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.dw-rim::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(145deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .07) 32%, rgba(255, 255, 255, 0) 58%, rgba(230, 186, 90, .45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.dw-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.dw-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.5;
  background: rgba(255, 255, 255, .055); border: 1px solid rgba(255, 255, 255, .11); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16); }
.dw-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px rgba(230, 186, 90, .7); }
.dw-prog { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.dw-prog[hidden] { display: none; }
.dw-bars { display: flex; gap: 6px; }
.dw-bars span { width: var(--segw); height: 4px; border-radius: 4px; background: rgba(248, 246, 242, .13); overflow: hidden; }
.dw-bars i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--grad); transition: width .5s var(--ease); }
.dw-body { position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr); gap: var(--gap); margin-top: var(--bodyTop); align-items: start; }
.dw-body.is-intro { align-items: center; }
.dw-stage { position: relative; }
.dw-pane { transition: opacity .28s ease, transform .38s var(--ease); }
.dw-pane.is-out { opacity: 0; }

.dw-eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: 16px !important; color: var(--gold); font-size: 14px; font-weight: 700; line-height: 1.9; }
.dw-eyebrow::after { content: ""; width: 40px; height: 1px; background: var(--gold); opacity: .55; }
.dw--tr .dw-eyebrow { letter-spacing: .12em; text-transform: uppercase; }
#tanilama .dw .dw-h2 { font-size: var(--h2); line-height: var(--h2lh); color: var(--ink); outline: 0; }
.dw-lead { margin-top: 18px !important; color: var(--muted); font-size: var(--leadS); line-height: var(--lh); max-width: 560px; }
.dw-cta { margin-top: 30px; }
.dw-pill { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 50px; padding: 0 26px; border-radius: 999px; font-family: var(--fb); font-size: 15.5px; font-weight: 700; text-decoration: none; border: 0; }
.dw--tr .dw-pill { font-weight: 600; }
.dw-pill svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dw .dw-gold { border: 1px solid var(--edge); background: var(--grad); color: #171309; box-shadow: inset 0 1px 1px rgba(255, 233, 175, .4), 0 6px 22px rgba(218, 161, 66, .14); }
.dw .dw-gold:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.dw .dw-glassb { border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .055); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16); }
.dw .dw-glassb:hover { border-color: rgba(214, 184, 120, .4); }
.dw .dw-outline { border: 1px solid rgba(230, 186, 90, .55); background: transparent; color: var(--gold); }
.dw .dw-outline:hover { background: rgba(230, 186, 90, .08); }

.dw-qlabel { color: var(--gold); font-size: 13.5px; font-weight: 700; line-height: 1.9; }
.dw--tr .dw-qlabel { letter-spacing: .12em; text-transform: uppercase; }
#tanilama .dw .dw-q { margin-top: 6px; font-size: var(--qS); line-height: 1.45; color: var(--ink); outline: 0; }
#tanilama .dw--tr .dw-q { line-height: 1.2; }
.dw-opts { margin-top: 22px !important; border-top: 1px solid rgba(238, 225, 188, .12); }
.dw-opts li { border-bottom: 1px solid rgba(238, 225, 188, .12); }
.dw .dw-opt { width: 100%; min-height: var(--optH); margin: 4px 0; padding: 10px 12px; display: flex; align-items: center; gap: 14px; border: 0; border-radius: 16px; background: transparent; color: var(--soft);
  font-family: var(--fb); font-size: var(--optS); line-height: 1.6; text-align: start; }
.dw .dw-opt:hover { background: rgba(214, 166, 73, .07); color: var(--ink); }
.dw .dw-opt[aria-checked="true"] { background: linear-gradient(120deg, rgba(214, 166, 73, .17), rgba(180, 129, 39, .07)); color: var(--ink); }
.dw-ring { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid rgba(230, 186, 90, .45); color: transparent;
  transition: background .25s ease, border-color .25s ease, color .25s ease, transform .3s var(--spring); }
.dw-opt[aria-checked="true"] .dw-ring { background: var(--grad); border-color: var(--edge); color: #171309; transform: scale(1.06); }
.dw-ring svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.dw-ctrl { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: var(--ctrlTop); padding-top: 20px; border-top: 1px solid rgba(238, 225, 188, .1); }
.dw-ctrl-btns { display: flex; align-items: center; gap: 10px; }
.dw-helper { color: var(--muted); font-size: 13px; line-height: 1.7; }

/* the live reading: the section's instrument, following the answers */
.dw-inst { position: relative; border-radius: 26px; padding: var(--ipad); background: rgba(0, 0, 0, .2); border: 1px solid rgba(255, 255, 255, .07); }
.dw-field { position: relative; height: var(--fieldH); }
.dw-field svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; }
.dw-field polyline { stroke: rgba(230, 186, 90, .3); stroke-width: 1; stroke-dasharray: 3 5; }
.dw-lens { position: absolute; left: 0; top: 0; width: var(--lens); height: var(--lens); border-radius: 50%; border: 1.5px solid var(--gold);
  box-shadow: 0 0 0 6px rgba(230, 186, 90, .06), 0 0 38px rgba(230, 186, 90, .28); transition: transform .7s var(--spring); }
.dw-orb { position: absolute; width: var(--orb); height: var(--orb); translate: -50% -50%; display: grid; place-items: center; text-align: center; padding: 6px; border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .24), rgba(255, 255, 255, .05) 42%, rgba(0, 0, 0, .18) 100%); border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -10px 18px rgba(0, 0, 0, .25), 0 12px 30px rgba(0, 0, 0, .35);
  font-family: var(--fd); font-weight: var(--dw); letter-spacing: var(--dt); word-spacing: var(--dws); font-size: var(--orbS); line-height: 1.3; color: var(--soft); transition: color .4s ease, box-shadow .5s ease; }
.dw--tr .dw-orb { font-weight: 650; letter-spacing: -.015em; }
.dw-orb.is-on { color: var(--gold); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -10px 18px rgba(0, 0, 0, .25), 0 0 0 1px rgba(230, 186, 90, .55), 0 0 42px rgba(230, 186, 90, .3); }
.dw-orb.is-done { color: var(--ink); }
.dw .dw-play { position: absolute; top: 12px; inset-inline-end: 12px; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05); color: var(--muted); }
.dw .dw-play:hover { color: var(--ink); }
.dw-play svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dw-play .dw-play__play, .dw-play[aria-pressed="true"] .dw-play__pause { display: none; }
.dw-play[aria-pressed="true"] .dw-play__play { display: block; }
.dw-play[hidden] { display: none; }
.dw-read { margin-top: 14px; padding: 16px 18px; border-radius: 18px; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .07); }
.dw-read b { display: block; color: var(--gold); font-size: 17px; line-height: 1.5; }
.dw-read p { margin-top: 4px !important; color: var(--soft); font-size: 14.5px; line-height: 1.8; }
.dw--tr .dw-read p { line-height: 1.55; }
.dw-read[hidden], .dw-inst[hidden], .dw-wa[hidden] { display: none; }

/* the result */
.dw-nodes { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px !important; color: var(--soft); font-size: 13.5px; }
.dw-nodes span { display: inline-flex; align-items: center; gap: 8px; }
.dw-nodes span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--gold); background: rgba(230, 186, 90, .25); }
.dw-nodes em { width: 26px; height: 1px; background: rgba(230, 186, 90, .35); }
.dw-rcard { position: relative; margin-top: 22px; border-radius: 24px; padding: var(--rpad); background: linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02) 50%, rgba(255, 255, 255, .04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 24px 60px rgba(0, 0, 0, .4); }
.dw-kick { color: var(--gold); font-size: 13px; font-weight: 700; line-height: 1.8; }
.dw--tr .dw-kick { letter-spacing: .12em; }
#tanilama .dw .dw-rtitle { margin-top: 4px; font-size: var(--rtS); line-height: 1.3; color: var(--ink); }
.dw--fa .dw-rtitle { unicode-bidi: plaintext; text-align: right; }
.dw-rdesc { margin-top: 8px !important; color: var(--soft); font-size: 15.5px; line-height: var(--lh); }
.dw-rsec { margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(238, 225, 188, .1); }
#tanilama .dw .dw-rsec h4 { color: var(--ink); font-size: 15px; font-weight: 700; line-height: 1.7; }
.dw-rsec p { margin-top: 4px !important; color: var(--muted); font-size: 14.5px; line-height: var(--lh); }
.dw-needs { display: grid; grid-template-columns: repeat(var(--needCols), minmax(0, 1fr)); gap: 8px; margin-top: 10px !important; }
.dw-needs li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); color: var(--soft); font-size: 14px; line-height: 1.5; }
.dw-needs li::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px rgba(230, 186, 90, .6); }
#tanilama .dw .dw-wa h3 { color: var(--ink); font-size: var(--waH); line-height: 1.5; }
.dw-wa > p { margin-top: 6px !important; color: var(--muted); font-size: 14px; line-height: var(--lh); }
.dw-msg { margin-top: 14px; padding: 16px 18px; border-radius: 18px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .08); color: var(--soft); font-size: 14px; line-height: 1.9; white-space: pre-wrap; }
.dw--tr .dw-msg { line-height: 1.6; }
.dw-wa-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.dw-wa-note { margin-top: 16px !important; padding-top: 14px; border-top: 1px solid rgba(238, 225, 188, .1); color: var(--muted); font-size: 13px; line-height: 1.8; }
.dw .dw-restart { display: block; margin: 22px auto 0; padding: 10px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--soft); font-family: var(--fb); font-size: 14.5px; font-weight: 700; }
.dw .dw-restart:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.dw .dw-restart[hidden] { display: none; }

/* ── the 1024 board ── */
@media (max-width: 1199px) {
  .dw { --top: 80px; --bot: 80px; --wrap: 928px; --pad: 30px; --gap: 32px; --bodyTop: 24px; --h2: 38px; --leadS: 17px; --qS: 28px; --optH: 58px; --optS: 15.5px; --ctrlTop: 24px;
    --ipad: 18px; --fieldH: 250px; --lens: 98px; --orb: 84px; --orbS: 13.5px; --rpad: 24px; --rtS: 27px; --needCols: 1; --waH: 20px; --segw: 36px; }
}
/* ── the 768 board: one column; the instrument leads while answering, the message follows the result ── */
@media (max-width: 1023px) {
  .dw { --top: 64px; --bot: 64px; --wrap: 704px; --gut: 32px; --pad: 26px; --gap: 24px; --bodyTop: 22px; --h2: 34px; --leadS: 16.5px; --qS: 26px; --optH: 56px; --ctrlTop: 22px;
    --ipad: 16px; --fieldH: 200px; --lens: 84px; --orb: 70px; --orbS: 12.5px; --rpad: 22px; --rtS: 26px; --needCols: 2; --waH: 20px; --segw: 30px; }
  .dw-body { grid-template-columns: minmax(0, 1fr); }
  .dw-aside { order: -1; }
  .dw-body.is-result .dw-aside { order: 0; }
}
/* ── the 390 board: centred ── */
@media (max-width: 767px) {
  .dw { --top: 40px; --bot: 48px; --wrap: 560px; --gut: 8px; --pad: 16px; --gap: 18px; --bodyTop: 18px; --h2: 26px; --leadS: 15.5px; --qS: 22px; --optH: 54px; --optS: 15px; --ctrlTop: 18px;
    --ipad: 12px; --fieldH: 150px; --lens: 66px; --orb: 54px; --orbS: 11px; --rpad: 18px; --rtS: 23px; --needCols: 1; --waH: 19px; --segw: 22px; }
  .dw-top { flex-wrap: wrap; justify-content: center; }
  .dw-prog { gap: 10px; }
  .dw-ctrl { flex-wrap: wrap; }
  .dw-ctrl .dw-helper { width: 100%; order: 3; text-align: center; }
  .dw-ctrl-btns { width: 100%; }
  .dw-ctrl-btns .dw-pill { flex: 1; }
  .dw-read { margin-top: 10px; padding: 12px 14px; text-align: center; }
  .dw-read p { font-size: 13.5px; }
  .dw-wa-btns .dw-pill { flex: 1 1 100%; }
  #tanilama .dw :is(.dw-h2, .dw-q) { text-align: center; text-wrap: balance; }
  .dw-eyebrow { justify-content: center; }
  .dw-eyebrow::before { content: ""; width: 40px; height: 1px; background: var(--gold); opacity: .55; }
  .dw-qlabel { text-align: center; }
  .dw-lead { text-align: center; margin-inline: auto; }
  .dw-cta { display: flex; justify-content: center; }
  .dw .dw-play { top: 8px; inset-inline-end: 8px; width: 28px; height: 28px; }
}
@media (max-width: 380px) { .dw { --orb: 50px; --orbS: 10.5px; } }

@media (prefers-reduced-motion: reduce) {
  .dw-lens, .dw-pane, .dw-bars i, .dw-ring { transition: none !important; }
  .dw :is(.dw-pill, .dw-opt, .dw-restart):active:not(:disabled) { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .dw .dw-shell { background: #161512; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
