/* =========================================================================
   The WICK Protocol · application (shown inside the VSL page popup)
   Typeform-style flow, then the DQ page or the booking calendar. System B tokens.
   ========================================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100svh; background: var(--bg); color: var(--ink); font-family: var(--sans); overflow-x: hidden; display: flex; flex-direction: column; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background: radial-gradient(80% 50% at 50% -10%, color-mix(in srgb, var(--funnel-gold) 16%, transparent), transparent 70%), linear-gradient(180deg, var(--bg), var(--bg-2));
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

/* --------------------------------- Chrome ------------------------------- */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 18px clamp(18px, 4vw, 32px); }
.top__brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 500; font-size: 0.92rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); text-decoration: none; opacity: 0.9; }
.top__brand .dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink); }
.top__step { font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: rgba(245, 241, 240, 0.08); z-index: 25; }
.progress__bar { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.5s var(--ease); }

/* --------------------------------- Stage -------------------------------- */
.app { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 96px clamp(20px, 5vw, 40px) 120px; }
.screen { width: 100%; max-width: 660px; }
.screen--wide { max-width: 960px; }
.screen-enter { animation: screenIn 0.55s var(--ease) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* --------------------------------- Intro -------------------------------- */
.intro { text-align: center; }
.intro__title { font-family: var(--display); font-weight: 600; font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.08; letter-spacing: -0.02em; color: var(--ink); }
.intro__sub { margin: 22px auto 0; max-width: 520px; font-size: 1.08rem; line-height: 1.55; color: var(--muted); }
.intro__start { margin-top: 36px; }

/* -------------------------------- Question ------------------------------ */
.q__num { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 600; color: var(--muted); margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.q__num .arr { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); display: inline-block; }
.q__title { font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 3.4vw, 2.15rem); line-height: 1.18; letter-spacing: -0.015em; color: var(--ink); }
.q__help { margin-top: 12px; font-size: 1rem; line-height: 1.5; color: var(--muted); }
.q__input { margin-top: 30px; }

/* text-style inputs */
.field { width: 100%; background: transparent; border: 0; border-bottom: 2px solid rgba(245, 241, 240, 0.18);
  color: var(--ink); font-family: var(--sans); font-size: clamp(1.3rem, 3vw, 1.7rem); padding: 8px 2px; transition: border-color 0.25s var(--ease); }
.field::placeholder { color: rgba(245, 241, 240, 0.28); }
.field:focus { outline: none; border-bottom-color: var(--ink); }
textarea.field { resize: none; min-height: 56px; line-height: 1.5; overflow: hidden; font-size: clamp(1.05rem, 2.1vw, 1.35rem); }

/* phone with country-code picker */
.phone { position: relative; display: flex; align-items: center; gap: 12px; }
.phone__cc { display: flex; align-items: center; gap: 8px; flex: none; cursor: pointer;
  background: rgba(245, 241, 240, 0.05); border: 1px solid var(--hair); border-radius: 11px; padding: 12px 14px;
  color: var(--ink); font-family: var(--sans); font-size: 1.05rem; transition: border-color 0.2s var(--ease); }
.phone__cc:hover { border-color: rgba(245, 241, 240, 0.4); }
.phone__flag { font-size: 1.3rem; line-height: 1; }
.phone__dial { font-weight: 600; font-variant-numeric: tabular-nums; }
.phone__caret { width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-top: -3px; }
.phone__num { flex: 1 1 auto; min-width: 0; }
.phone__menu { position: absolute; top: calc(100% + 10px); left: 0; width: min(340px, 100%); z-index: 30; overflow: hidden;
  background: var(--surface); border: 1px solid var(--hair); border-radius: 12px; box-shadow: 0 30px 70px rgba(0,0,0,0.5); }
.phone__menu[hidden] { display: none; }
.phone__search { width: 100%; padding: 13px 15px; border: 0; border-bottom: 1px solid var(--hair);
  background: rgba(245, 241, 240, 0.04); color: var(--ink); font-family: var(--sans); font-size: 0.95rem; }
.phone__search::placeholder { color: var(--muted); }
.phone__search:focus { outline: none; }
.phone__list { list-style: none; margin: 0; padding: 6px; max-height: 264px; overflow-y: auto; }
.phone__item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); font-size: 0.95rem; }
.phone__item:hover, .phone__item.active { background: rgba(245, 241, 240, 0.08); }
.phone__item .flag { font-size: 1.15rem; line-height: 1; }
.phone__item .name { flex: 1 1 auto; }
.phone__item .dial { color: var(--muted); font-variant-numeric: tabular-nums; }

/* choice options */
.options { display: flex; flex-direction: column; gap: 12px; }
.option { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  background: rgba(245, 241, 240, 0.03); border: 1.5px solid var(--hair); border-radius: 12px; padding: 16px 18px;
  color: var(--ink); font-family: var(--sans); font-size: 1.02rem; line-height: 1.35;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease); }
.option:hover { border-color: rgba(245, 241, 240, 0.4); background: rgba(245, 241, 240, 0.06); }
.option.sel { border-color: var(--accent); background: var(--accent-soft); }
.option__key { flex: none; width: 26px; height: 26px; border-radius: 7px; border: 1.5px solid var(--hair); display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 700; color: var(--muted); transition: inherit; }
.option:hover .option__key, .option.sel .option__key { border-color: var(--ink); color: var(--ink); }
.option.sel .option__key { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.q__actions { margin-top: 28px; display: flex; align-items: center; gap: 16px; }
.q__hint { font-size: 0.85rem; color: var(--muted); }
.q__hint b { color: var(--ink); font-weight: 600; }
.q__err { margin-top: 12px; font-size: 0.88rem; color: #ff8f8f; min-height: 1em; }

/* --------------------------------- Buttons ------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer; border: 0;
  font-family: var(--sans); font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; padding: 14px 30px; border-radius: 12px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), opacity 0.2s var(--ease); }
.btn--primary { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); color: var(--accent-ink); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px color-mix(in srgb, var(--funnel-gold) 35%, transparent); }
.btn--primary:active { transform: scale(0.98); }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--hair); }
.btn--ghost:hover { border-color: rgba(245, 241, 240, 0.4); }
.btn .arr { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); display: inline-block; }

/* Up/down nav */
.nav { position: fixed; right: clamp(16px, 4vw, 32px); bottom: clamp(16px, 4vw, 28px); display: flex; gap: 2px; z-index: 20; }
.nav__btn { width: 44px; height: 40px; display: grid; place-items: center; cursor: pointer; background: var(--surface); border: 1px solid var(--hair); color: var(--ink); }
.nav__btn:first-child { border-radius: 10px 0 0 10px; }
.nav__btn:last-child { border-radius: 0 10px 10px 0; border-left: 0; }
.nav__btn:hover:not(:disabled) { background: var(--surface-2); }
.nav__btn:disabled { opacity: 0.35; cursor: default; }
.nav__btn .chev { width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.nav__btn.up .chev { transform: rotate(-135deg); margin-top: 3px; }
.nav__btn.down .chev { transform: rotate(45deg); margin-bottom: 3px; }

/* ----------------------------------- DQ --------------------------------- */
.dq { text-align: center; max-width: 620px; margin-inline: auto; }
.dq__mark { width: 54px; height: 54px; margin: 0 auto 26px; border-radius: 50%; border: 1.5px solid var(--hair); display: grid; place-items: center; color: var(--muted); }
.dq__mark span { width: 16px; height: 2px; background: currentColor; display: block; }
.dq__title { font-family: var(--display); font-weight: 600; font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.14; letter-spacing: -0.02em; color: var(--ink); }
.dq__body { margin-top: 20px; font-size: 1.04rem; line-height: 1.62; color: var(--muted); text-align: left; }
.dq__body p { margin-bottom: 16px; }
.dq__note { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--hair); font-size: 0.92rem; color: var(--muted); }

/* -------------------------------- Booking ------------------------------- */
.qualified { text-align: center; }
.qualified__title { font-family: var(--display); font-weight: 600; font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.12; letter-spacing: -0.02em; }
.qualified__sub { margin: 20px auto 34px; max-width: 560px; font-size: 1.05rem; line-height: 1.55; color: var(--muted); }
.qualified .btn { margin-top: 60px; }

.booking { display: grid; grid-template-columns: 300px 1fr; background: var(--surface); border: 1px solid var(--hair); border-radius: 18px; overflow: hidden; box-shadow: 0 40px 100px rgba(0,0,0,0.5); }
.booking__info { padding: 30px; border-right: 1px solid var(--hair); }
.booking__host { display: inline-flex; align-items: center; gap: 9px; font-size: 0.86rem; color: var(--muted); margin-bottom: 18px; }
.booking__host .dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--muted); }
.booking__event { font-family: var(--display); font-weight: 600; font-size: 1.35rem; line-height: 1.2; color: var(--ink); }
.booking__meta { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 0.95rem; }
.booking__meta .clock { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid currentColor; position: relative; }
.booking__meta .clock::before { content: ""; position: absolute; top: 2px; left: 50%; width: 1.5px; height: 5px; background: currentColor; transform-origin: bottom; }
.booking__note { margin-top: 22px; font-size: 0.9rem; line-height: 1.55; color: var(--muted); }
.booking__main { padding: 30px; min-width: 0; }
.booking__prompt { font-weight: 700; color: var(--ink); margin-bottom: 20px; font-size: 1.05rem; }

/* calendar */
.cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal__month { font-weight: 700; color: var(--ink); font-size: 1rem; }
.cal__nav { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--hair); background: transparent; color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.cal__nav:hover:not(:disabled) { background: rgba(245, 241, 240, 0.06); }
.cal__nav:disabled { opacity: 0.3; cursor: default; }
.cal__nav .chev { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.cal__nav.prev .chev { transform: rotate(135deg); }
.cal__nav.next .chev { transform: rotate(-45deg); }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal__dow { margin-bottom: 8px; }
.cal__dow span { text-align: center; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 4px 0; }
.cal__day { aspect-ratio: 1; border-radius: 10px; border: 0; background: transparent; color: var(--ink); font-family: var(--sans); font-size: 0.95rem; font-weight: 600; cursor: pointer;
  font-variant-numeric: tabular-nums; transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease); }
.cal__day.avail { background: rgba(245, 241, 240, 0.06); }
.cal__day.avail:hover { background: rgba(245, 241, 240, 0.16); transform: translateY(-1px); }
.cal__day.sel { background: var(--accent); color: var(--accent-ink); }
.cal__day.off { color: rgba(245, 241, 240, 0.22); cursor: default; }

/* slots */
.slots__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.slots__back { background: transparent; border: 1px solid var(--hair); color: var(--ink); border-radius: 8px; padding: 6px 12px; cursor: pointer; font-family: var(--sans); font-size: 0.85rem; }
.slots__date { font-weight: 700; color: var(--ink); }
.slots__list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-height: 300px; overflow-y: auto; padding-right: 4px; }
.slot { padding: 13px; border-radius: 10px; border: 1.5px solid var(--hair); background: transparent; color: var(--ink); font-family: var(--sans); font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: border-color 0.2s var(--ease), background 0.2s var(--ease); }
.slot:hover { border-color: var(--ink); background: rgba(245, 241, 240, 0.06); }

/* confirm */
.confirm__when { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px; background: rgba(245, 241, 240, 0.05); border: 1px solid var(--hair); margin-bottom: 20px; font-weight: 600; color: var(--ink); }
.cfield { margin-bottom: 14px; text-align: left; }
.cfield label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; letter-spacing: 0.04em; text-transform: uppercase; }
.cfield input { width: 100%; padding: 13px 15px; border-radius: 10px; background: rgba(245, 241, 240, 0.04); border: 1px solid var(--hair); color: var(--ink); font-family: var(--sans); font-size: 1rem; }
.cfield input:focus { outline: none; border-color: var(--ink); }
.confirm__actions { display: flex; gap: 12px; margin-top: 8px; }

/* confirmed */
.confirmed { text-align: center; max-width: 560px; margin-inline: auto; }
.confirmed__check { width: 66px; height: 66px; margin: 0 auto 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 1.8rem; font-weight: 700; }
.confirmed__title { font-family: var(--display); font-weight: 600; font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1.14; letter-spacing: -0.02em; }
.confirmed__when { margin: 20px auto; display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 12px; background: rgba(245, 241, 240, 0.05); border: 1px solid var(--hair); font-weight: 600; color: var(--ink); }
.confirmed__body { font-size: 1.02rem; line-height: 1.6; color: var(--muted); }
.confirmed__note { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--hair); font-size: 0.9rem; color: var(--muted); }

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 720px) {
  .booking { grid-template-columns: 1fr; }
  .booking__info { border-right: 0; border-bottom: 1px solid var(--hair); }
  .slots__list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .app { padding: 84px 20px 110px; }
  .nav { bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .screen-enter { animation: none; }
  .progress__bar { transition: none; }
}

/* ---- mobile hardening (references/mobile.md) ---- */
img, svg, video, canvas, iframe { max-width: 100%; height: auto; }
p, li, td, th, blockquote, figcaption,
h1, h2, h3, h4, h5, h6 { overflow-wrap: anywhere; }
table, pre { display: block; max-width: 100%; overflow-x: auto; }
@media (max-width: 700px) {
  .tag, [class*="badge"], [class*="pill"] { margin-left: 0; }
}
@media (max-width: 420px) {
  .tok-merge, .tok-link, code { white-space: normal; }
}

/* ---- mobile hardening (references/mobile.md) ---- */
img, svg, video, canvas, iframe { max-width: 100%; height: auto; }
p, li, td, th, blockquote, figcaption, h1, h2, h3, h4, h5, h6 { overflow-wrap: anywhere; }
@media (max-width: 700px) { .tag, [class*="badge"], [class*="pill"] { margin-left: 0; } }
.top { padding-right: 76px; }
/* inside the popup the frame is short: start content higher so the nav arrows never sit on an answer */
@media (max-height: 820px) { .app { align-items: flex-start; padding-top: 104px; padding-bottom: 96px; } .nav { bottom: 14px; } }
.q { padding-bottom: 68px; }
.sample-note { position: fixed; left: 0; right: 0; bottom: 14px; margin: 0; text-align: center; font-size: 0.78rem; color: var(--muted); pointer-events: none; }
html.inline .top { padding-right: 24px; }
