/* First-visit questionnaire. Tokens copied from messinis.ch (rebuild-2026-11, css/style.css v2). */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('fonts/inter-latin-wght-normal.v1.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('fonts/lora-latin-wght-normal.v1.woff2') format('woff2'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/space-mono-latin-400-normal.v1.woff2') format('woff2'); }

:root {
  --ink: #13272c;
  --text: #1F2933;
  --muted: #5f6b76;
  --accent: #2E6F73;
  --accent-hover: #255A5D;
  --teal-deep: #1f5457;
  --signal: #3fa3a0;
  --tint: #eef4f3;
  --tint-2: #dfeceb;
  --line: #dde6e5;
  --bg: #F6F9F9;
  --white: #fff;
  --radius-lg: 20px;
  --shadow-1: 0 1px 2px rgba(19,39,44,.06), 0 8px 24px rgba(19,39,44,.06);
  --gutter: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.55 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh; min-height: 100dvh;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 10; background: rgba(246,249,249,.92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.top-in { max-width: 720px; margin: 0 auto; height: 58px; padding: 0 var(--gutter); display: flex; align-items: center; gap: 10px; }
.back { width: 40px; height: 40px; margin-left: -8px; border: 0; background: none; border-radius: 10px; display: grid; place-items: center; color: var(--ink); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-family: 'Lora', Georgia, serif; font-size: 16.5px; font-weight: 500; }
.brand img { display: block; width: 34px; height: auto; }
.progress { height: 3px; background: var(--line); }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--signal)); border-radius: 0 3px 3px 0; transition: width .45s cubic-bezier(.2,.7,.2,1); }

/* ---------- stage and card ---------- */
.stage { max-width: 720px; margin: 0 auto; padding: 24px var(--gutter) 64px; outline: none; }
.card { opacity: 0; transform: translateY(14px); transition: opacity .32s ease, transform .38s cubic-bezier(.2,.7,.2,1); }
.card.from-left { transform: translateY(-10px); }
.card.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .card, .progress span { transition: none; } }

.eyebrow { font-family: 'Space Mono', ui-monospace, monospace; font-size: .8125rem; letter-spacing: .02em; color: var(--accent); margin: 0 0 14px; }
.stem { color: var(--muted); font-size: 15.5px; margin: 0 0 8px; }
.q, .hello { font-weight: 650; letter-spacing: -0.02em; color: var(--ink); line-height: 1.2; margin: 0 0 12px; font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2rem); text-wrap: balance; }
.hello { font-size: clamp(1.6rem, 1.25rem + 1.8vw, 2.2rem); margin-bottom: 14px; }
.help { color: var(--muted); margin: 0 0 18px; }
.help.small, .small { font-size: 14.5px; }
.lead { font-size: 18px; margin: 0 0 12px; color: var(--text); }
.muted { color: var(--muted); margin: 0 0 18px; }
.q2 { font-weight: 600; color: var(--ink); margin: 18px 0 4px; }
.note { margin-top: 22px; padding: 14px 16px; background: var(--tint); border-radius: 14px; color: var(--teal-deep); }

/* ---------- welcome ---------- */
.t-welcome { padding-top: 6px; }
.hero { background: linear-gradient(160deg, #fff 0%, #fff 55%, var(--tint) 100%); border: 1px solid var(--line); border-radius: 28px; padding: 26px 20px 20px; box-shadow: var(--shadow-1); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 18px; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px 7px 11px; font-size: 15px; color: var(--ink); }
.chip svg { color: var(--accent); flex: none; }
.privacy { display: flex; gap: 14px; align-items: flex-start; background: var(--tint-2); border-radius: 16px; padding: 16px 18px; }
.privacy p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--teal-deep); }
.privacy-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; background: #fff; display: grid; place-items: center; color: var(--accent); }
.start { margin-top: 22px; }
.agree { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 15.5px; color: var(--text); padding: 4px 2px; }
.agree input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.agree .tick { flex: none; width: 24px; height: 24px; margin-top: 1px; border: 1.6px solid #9fb3b2; border-radius: 7px; background: #fff; display: grid; place-items: center; color: transparent; transition: background .15s, border-color .15s; }
.agree input:checked + .tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.agree input:focus-visible + .tick { outline: 3px solid rgba(46,111,115,.3); outline-offset: 2px; }
.agree a { font-weight: 600; text-underline-offset: 2px; }
.agree.shake { animation: shake .4s; }
.agree.shake .tick { border-color: #b4553d; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.hint { color: #9a432f; font-size: 14.5px; margin: 6px 0 0 36px; }
.start .btn.big { margin-top: 16px; }

/* ---------- options ---------- */
.opts { display: grid; gap: 10px; margin: 6px 0 4px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opts.grid { grid-template-columns: 1fr 1fr; }
.opt {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 44px 12px 14px;
  box-shadow: 0 1px 1px rgba(19,39,44,.03); transition: border-color .15s, background .15s, box-shadow .15s, transform .1s;
}
.opt:active { transform: scale(.99); }
.opt:focus-visible { outline: 3px solid rgba(46,111,115,.3); outline-offset: 2px; }
.opt .key { flex: none; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); display: grid; place-items: center; font: 400 12px 'Space Mono', monospace; color: var(--muted); background: var(--bg); }
.opt .ol { flex: 1; color: var(--ink); line-height: 1.35; }
.opt .ok { position: absolute; right: 14px; top: 50%; transform: translateY(-50%) scale(.6); opacity: 0; color: var(--accent); transition: opacity .15s, transform .2s; }
.opt.on { border-color: var(--accent); background: var(--tint); box-shadow: inset 0 0 0 1px var(--accent); }
.opt.on .key { background: var(--accent); border-color: var(--accent); color: #fff; }
.opt.on .ok { opacity: 1; transform: translateY(-50%) scale(1); }
.opt.suggest { border-style: dashed; }
.opts.grid .opt { padding-right: 36px; min-height: 52px; }
@media (hover: none) { .opt .key { display: none; } .opt { padding-left: 16px; } }
.more { margin: 2px 0 6px; }

/* ---------- fields ---------- */
.field {
  width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px;
  font-size: 17px; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
.field::placeholder { color: #98a4ad; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46,111,115,.16); }
textarea.field { resize: none; min-height: 120px; line-height: 1.5; }
.opts + textarea.field { margin-top: 14px; min-height: 64px; }
.field.num { max-width: 140px; }
.unit-row { display: flex; align-items: center; gap: 10px; }
.unit { color: var(--muted); }
.form { display: grid; gap: 14px; margin: 6px 0 4px; }
.form label, .pair label, .solo { display: grid; gap: 6px; font-size: 14.5px; color: var(--muted); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 6px 0 14px; }
.solo { margin-bottom: 4px; }

/* ---------- scale 0-10 ---------- */
.scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 6px; margin: 10px 0 8px; }
.sc { height: 52px; border: 1px solid var(--line); background: #fff; border-radius: 12px; font-weight: 600; color: var(--ink); transition: background .15s, border-color .15s; }
.sc.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.scale-ends { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--muted); }
@media (max-width: 520px) {
  .scale { grid-template-columns: repeat(6, 1fr); }
  .sc { height: 50px; }
}

/* ---------- confirm card ---------- */
.confirm { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 6px 18px; margin: 4px 0 4px; box-shadow: var(--shadow-1); display: grid; grid-template-columns: max-content 1fr; column-gap: 18px; }
.confirm dt, .confirm dd { padding: 13px 0; border-bottom: 1px solid var(--line); margin: 0; }
.confirm dt { color: var(--muted); font-size: 14.5px; }
.confirm dd { color: var(--ink); font-weight: 550; overflow-wrap: anywhere; }
.confirm dt:nth-last-of-type(1), .confirm dd:last-of-type { border-bottom: 0; }
.confirm .field { padding: 9px 11px; font-weight: 400; }
@media (max-width: 420px) { .confirm { grid-template-columns: 1fr; } .confirm dt { border: 0; padding: 12px 0 2px; } .confirm dd { padding: 0 0 12px; } }

/* ---------- address ---------- */
.suggest-list { display: grid; gap: 6px; margin: 8px 0 10px; }
.sug { display: flex; gap: 10px; align-items: center; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); }
.sug:focus-visible { border-color: var(--accent); background: var(--tint); outline: none; }
.sug strong { color: var(--ink); font-weight: 600; display: block; }
.sug-ic { flex: none; color: var(--accent); display: grid; }
.addr-pick { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--accent); border-radius: 16px; padding: 16px; box-shadow: var(--shadow-1); color: var(--text); }
.addr-pick strong { color: var(--ink); }

/* ---------- medication, habits, files ---------- */
.meds { display: grid; gap: 12px; margin: 14px 0 0; }
.med-row { display: grid; gap: 8px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.med-sub { display: flex; gap: 8px; }
.med-sub .field { flex: 1; min-width: 0; }
.med-row .link { justify-self: start; }
.habits { display: grid; gap: 18px; margin: 4px 0 6px; }
.habit-l { margin: 0 0 8px; color: var(--ink); font-weight: 550; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 16px; color: var(--ink); min-height: 42px; transition: background .15s, border-color .15s; }
.pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.drop { display: flex; align-items: center; justify-content: center; gap: 10px; border: 1.5px dashed #a9c3c1; background: #fff; border-radius: 16px; padding: 22px; color: var(--accent); font-weight: 600; cursor: pointer; margin: 4px 0 8px; }
.drop-ic { display: grid; }
.files { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.files li { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.f-ic { color: var(--accent); display: grid; }
.f-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-n small { display: block; font-size: 13px; color: var(--muted); }
.files li.st-err .f-n small, .files li.st-big .f-n small { color: #9a432f; }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 24px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 16.5px; text-decoration: none; transition: background .15s, border-color .15s, opacity .15s; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:disabled { opacity: .38; cursor: default; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.big { min-height: 56px; font-size: 17.5px; padding: 0 30px; }
.link { background: none; border: 0; padding: 6px 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
@media (max-width: 560px) {
  .actions .btn, .start .btn { width: 100%; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .link { align-self: center; }
}

/* ---------- review ---------- */
.rv-h { font-size: 15px; font-family: 'Space Mono', monospace; font-weight: 400; color: var(--accent); margin: 28px 0 8px; }
.rv { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 2px 16px; }
.rv-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rv-row:last-child { border-bottom: 0; }
.rv-q { grid-column: 1; font-size: 14px; color: var(--muted); }
.rv-a { grid-column: 1; color: var(--ink); overflow-wrap: anywhere; }
.rv-a.none { color: #98a4ad; font-style: italic; }
.rv-row .link { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

/* ---------- done ---------- */
.done-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; margin: 8px 0 18px; }
.done-ic svg { width: 28px; height: 28px; }
.appt { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-1); margin-top: 18px; }
.appt-row { display: flex; gap: 10px; align-items: center; color: var(--ink); font-weight: 550; padding: 4px 0; }
.appt-row svg { color: var(--accent); flex: none; }
.appt-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.appt-links .btn { min-height: 42px; font-size: 15px; padding: 0 14px; }

/* ---------- terms sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(19,39,44,.38); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet-in { background: #fff; width: 100%; max-width: 760px; max-height: 88vh; max-height: 88dvh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: up .28s cubic-bezier(.2,.7,.2,1); }
.sheet-top { display: flex; justify-content: flex-end; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sheet-top .btn { min-height: 40px; font-size: 15px; }
.terms { overflow: auto; padding: 8px 22px 40px; font-size: 15.5px; -webkit-overflow-scrolling: touch; }
.terms h2 { font-size: 1.5rem; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); margin: 18px 0 6px; }
.terms h3 { font-size: 1.05rem; font-weight: 650; color: var(--ink); margin: 22px 0 6px; }
.terms p, .terms li { color: var(--text); }
@media (min-width: 761px) { .sheet { align-items: center; } .sheet-in { border-radius: 22px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

@media (min-width: 700px) {
  .stage { padding-top: 56px; }
  .hero { padding: 40px 40px 32px; }
  .opts:not(.grid):not(.two) { max-width: 560px; }
  .field:not(.num) { max-width: 560px; }
  .confirm, .addr-pick, .med-row, .suggest-list, .drop, .files { max-width: 560px; }
}
@media (hover: hover) { .back:hover { background: var(--tint); } }
@media (hover: hover) { .opt:hover { border-color: #b9cfcd; } }
@media (hover: hover) { .sc:hover { border-color: #b9cfcd; } }
@media (hover: hover) { .pill:hover { border-color: #b9cfcd; } }
@media (hover: hover) { .drop:hover { background: var(--tint); } }
@media (hover: hover) { .btn.primary:hover { background: var(--accent-hover); } }
@media (hover: hover) { .btn.ghost:hover { border-color: var(--accent); } }
@media (hover: hover) { .sug:hover { border-color: var(--accent); background: var(--tint); } }
.confirm.updated { animation: updated 1.2s ease-out; }
@keyframes updated { from { box-shadow: 0 0 0 3px rgba(46,111,115,.35), var(--shadow-1); } to { box-shadow: var(--shadow-1); } }
