/* Guided questions (wizard.js). Uses the app's colour tokens; the website can map them to its own:
   --paper, --ink, --ink-2, --muted, --red, --pen, --line, --card. Fallbacks keep it usable standalone. */
.wz { position: fixed; inset: 0; z-index: 9000; display: flex; flex-direction: column; background: var(--paper, #fff1e5); color: var(--ink, #33302e);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) calc(env(safe-area-inset-right, 0px) + 18px) calc(env(safe-area-inset-bottom, 0px) + 14px) calc(env(safe-area-inset-left, 0px) + 18px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.wz > * { width: 100%; max-width: 560px; margin-left: auto; margin-right: auto; }
.wz-top { display: flex; align-items: center; gap: 12px; }
.wz-back, .wz-x { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(51,48,46,.07); color: var(--ink, #33302e); font-size: 26px; line-height: 1; cursor: pointer; }
.wz-x { font-size: 24px; }
.wz-prog { flex: 1; font: 600 13px/1.2 -apple-system, system-ui, sans-serif; color: var(--muted, #66605c); letter-spacing: .02em; }
.wz-bar { height: 6px; border-radius: 3px; background: rgba(51,48,46,.12); margin-top: 6px; overflow: hidden; }
.wz-bar i { display: block; height: 100%; background: var(--red, #990f3d); border-radius: 3px; transition: width .45s cubic-bezier(.2,.8,.2,1); }

.wz-score { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 14px; border-radius: 14px; background: var(--ink, #33302e); color: #fff;
  font: 600 12px/1 -apple-system, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.wz-score b { font: 700 24px/1 'Playfair Display', Georgia, serif; letter-spacing: 0; margin-left: auto; font-variant-numeric: tabular-nums; }
.wz-score i { font-style: normal; font-size: 13px; letter-spacing: 0; }
.wz-score.up i { color: #6fd39e; } .wz-score.down i { color: #ff8a80; }
.wz-score em { font-style: normal; font-size: 10px; padding: 4px 8px; border-radius: 999px; }
.wz-score.pending b { opacity: .5; }
.wz-score.up { animation: wzpulse .6s; } .wz-score.down { animation: wzshake .45s; }
@keyframes wzpulse { 40% { transform: scale(1.03); } }
@keyframes wzshake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.wz-card { flex: 1; margin-top: 22px; }
.wz-card.in { animation: wzin .35s cubic-bezier(.2,.8,.2,1) both; } .wz-card.back { animation: wzback .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes wzin { from { opacity: 0; transform: translateX(28px); } }
@keyframes wzback { from { opacity: 0; transform: translateX(-28px); } }
.wz-card h2 { font: 900 clamp(24px, 6.6vw, 32px)/1.15 'Playfair Display', Georgia, serif; margin: 0 0 12px; }
.wz-plain { font: 400 18px/1.45 Georgia, 'Times New Roman', serif; margin: 0 0 10px; }
.wz-ex { font: 400 15px/1.45 -apple-system, system-ui, sans-serif; color: var(--muted, #66605c); margin: 0 0 18px; padding-left: 12px; border-left: 3px solid rgba(51,48,46,.15); }
.wz-ex b { color: var(--ink-2, #4a4541); font-weight: 600; }

.wz-big { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 12px; }
.wz-big.two { grid-template-columns: 1fr 1fr; }
.wz-opt { min-height: 56px; padding: 12px 14px; border-radius: 16px; border: 1.5px solid rgba(51,48,46,.18); background: var(--card, #fffaf5); color: var(--ink, #33302e);
  font: 600 17px/1.2 -apple-system, system-ui, sans-serif; cursor: pointer; text-align: center; transition: transform .12s, background .2s, border-color .2s; }
.wz-opt:active { transform: scale(.97); }
.wz-opt.on { background: var(--red, #990f3d); border-color: var(--red, #990f3d); color: #fff; }
.wz-big .wz-opt:only-child, .wz-big.one .wz-opt { grid-column: 1 / -1; }
.wz-freewrap { display: flex; align-items: center; gap: 8px; border-bottom: 2px solid var(--ink, #33302e); padding: 4px 2px; }
.wz-score small { font-size: 11px; letter-spacing: .02em; text-transform: none; opacity: .75; font-weight: 500; }
.wz-free { -webkit-appearance: none; appearance: none; box-shadow: none !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; height: auto !important; flex: 1; min-width: 0; border: 0; background: transparent; font: 600 22px/1.3 ui-monospace, Menlo, monospace; color: var(--ink, #33302e); padding: 6px 0; outline: none; }
.wz-unit { font: 500 14px/1 -apple-system, system-ui, sans-serif; color: var(--muted, #66605c); }

.wz-slider { margin: 10px 0 8px; }
.wz-slider output { display: block; text-align: center; font: 700 44px/1 'Playfair Display', Georgia, serif; color: var(--red, #990f3d); margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.wz-slider output small { font: 500 16px/1 -apple-system, system-ui, sans-serif; color: var(--muted, #66605c); }
.wz-slider input { width: 100%; height: 36px; accent-color: var(--red, #990f3d); }
.wz-ends { display: flex; justify-content: space-between; font: 500 13px/1.2 -apple-system, system-ui, sans-serif; color: var(--muted, #66605c); }

.wz-flags { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.wz-flag { padding: 10px 14px; border-radius: 999px; border: 1.5px solid rgba(51,48,46,.18); background: var(--card, #fffaf5); color: var(--ink, #33302e);
  font: 500 15px/1.25 -apple-system, system-ui, sans-serif; cursor: pointer; text-align: left; }
.wz-flag.on { background: #b3261e; border-color: #b3261e; color: #fff; }

.wz-pen span { display: block; margin-top: 14px; padding: 2px 0 2px 12px; border-left: 2px solid var(--pen, #d0202e); color: var(--pen, #d0202e);
  font: 600 20px/1.3 'Caveat', 'Segoe Print', cursive; animation: wzwrite .6s ease both; }
@keyframes wzwrite { from { opacity: 0; transform: translateY(4px); } }

.wz-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 10px; }
.wz-skip { border: 0; background: none; color: var(--muted, #66605c); font: 500 15px/1.2 -apple-system, system-ui, sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 10px 4px; }
.wz-next { min-width: 140px; min-height: 52px; padding: 0 24px; border-radius: 26px; border: 0; background: var(--red, #990f3d); color: #fff; font: 700 17px/1 -apple-system, system-ui, sans-serif; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .wz-card.in, .wz-card.back, .wz-score.up, .wz-score.down, .wz-pen span { animation: none; } }
/* reading time after a red-pen note: thin bar that runs out, tap anywhere to skip */
.wz-wait { height: 3px; margin: 10px 0 0 12px; border-radius: 2px; background: rgba(208,32,46,.15); overflow: hidden; }
.wz-wait i { display: block; height: 100%; width: 100%; background: var(--pen, #d0202e); transform-origin: left; animation: wzread linear forwards; }
@keyframes wzread { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.wz-tap { display: block; margin: 6px 0 0 12px; font: 500 12px/1.2 -apple-system, system-ui, sans-serif; color: var(--muted, #66605c); }
.wz.waiting .wz-card { cursor: pointer; }
/* Intro screen before the onboarding questions: what we ask about you and why */
.wz-kick { font: 700 12px/1 -apple-system, system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--red, #990f3d); margin: 0 0 10px; }
.wz-points { list-style: none; margin: 16px 0 0; padding: 0; font: 400 15px/1.45 -apple-system, system-ui, sans-serif; color: var(--ink-2, #4a4541); }
.wz-points li { padding: 6px 0 6px 22px; position: relative; border-top: 1px solid rgba(51,48,46,.1); }
.wz-points li::before { content: ''; position: absolute; left: 4px; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--red, #990f3d); }
.wz-sp { flex: 1; }
/* Date entry: an empty date input is invisible on iOS, so it gets a fixed height and a hint next to it */
.wz-date { min-height: 48px; font-size: 18px; }
.wz-date::-webkit-date-and-time-value { text-align: left; }
.wz-datehint { font: 400 14px/1.3 -apple-system, system-ui, sans-serif; color: var(--muted, #66605c); white-space: nowrap; }
