/* shaizik questionnaire. Tokens = Figma variables "Questionnaire / Color" and "Questionnaire / Space" (24.11).
   Square corners, no shadows, no gradients. Raw values live only in :root. */
@font-face { font-family: 'Inconsolata'; font-weight: 400; font-display: swap; src: url(/fonts/inconsolata-latin-400-normal.woff2) format('woff2'); unicode-range: U+0030-0039, U+0041-005A, U+0061-007A; }
@font-face { font-family: 'Inconsolata'; font-weight: 700; font-display: swap; src: url(/fonts/inconsolata-latin-700-normal.woff2) format('woff2'); unicode-range: U+0030-0039, U+0041-005A, U+0061-007A; }
@font-face { font-family: 'Lato'; font-weight: 400; font-display: swap; src: url(/fonts/lato-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans Hebrew'; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-hebrew-hebrew-400-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'IBM Plex Sans Hebrew'; font-weight: 700; font-display: swap; src: url(/fonts/ibm-plex-sans-hebrew-hebrew-700-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Noto Sans Hebrew'; font-weight: 400; font-display: swap; src: url(/fonts/noto-sans-hebrew-hebrew-400-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
/* spaces and punctuation in headings come from Plex (proportional), not from monospace Inconsolata */
@font-face { font-family: 'IBM Plex Sans Hebrew'; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-hebrew-latin-400-normal.woff2) format('woff2'); unicode-range: U+0020-007E, U+00A0; }
@font-face { font-family: 'IBM Plex Sans Hebrew'; font-weight: 700; font-display: swap; src: url(/fonts/ibm-plex-sans-hebrew-latin-700-normal.woff2) format('woff2'); unicode-range: U+0020-007E, U+00A0; }

:root {
  --ink: #000026; --bg: #F9FAFF; --surface: #FFFFFF; --primary: #0B1DFF; --muted: #5B5B7A;
  --line: #D7DAF0; --secondary: #ECEAFE; --highlight: #E4E8FF; --border: #7C8AE6; --error: #B42318;
  --s4: 4px; --s8: 8px; --s12: 12px; --s16: 16px; --s24: 24px; --s32: 32px; --s48: 48px;
  --col: 520px; --btn-h: 56px; --hit: 48px;
  --voice: 'IBM Plex Sans Hebrew', 'Inconsolata', sans-serif; /* Figma uses Plex only, digits included */
  --body: 'Lato', 'Noto Sans Hebrew', sans-serif;
  /* legacy names used by the admin screens (out of scope in this round) */
  --blue: var(--primary); --white: var(--surface); --tint: var(--secondary);
}
* { box-sizing: border-box; border-radius: 0; letter-spacing: 0; box-shadow: none; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 16px; line-height: 22px; font-weight: 400;
}
h1, h2, h3, button, .btn, label.ui, .ui { font-family: var(--voice); font-weight: 700; }
h1 { font-size: 36px; line-height: 42px; margin: 0 0 var(--s16); }                 /* title/l */
h2, .sub-q { font-size: 28px; line-height: 34px; margin: 0 0 var(--s16); }         /* title/m */
h3 { font-size: 16px; line-height: 22px; margin: 0 0 var(--s4); }
@media (min-width: 720px) {
  h1 { font-size: 54px; line-height: 60px; }                                       /* title/xl */
  h2, .sub-q { font-size: 36px; line-height: 42px; }                               /* title/l */
}
h1:focus, h2:focus { outline: none; }
p { margin: 0 0 var(--s12); }
a { color: var(--primary); }
.muted { color: var(--muted); font-size: 14px; line-height: 20px; font-style: normal; }  /* helper */
.ui { font-size: 14px; line-height: 20px; margin: 0 0 var(--s4); display: block; }        /* label/small */
.ltr { direction: ltr; unicode-bidi: plaintext; text-align: start; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }

/* layout: side margin 24, desktop column 608 */
.wrap { max-width: calc(var(--col) + 2 * var(--s24)); margin: 0 auto; padding: var(--s24) var(--s24) 152px; }
.topline { display: flex; justify-content: space-between; align-items: center; gap: var(--s12); margin-bottom: var(--s16); min-height: 20px; }
.progress-label { font-family: var(--voice); font-weight: 700; font-size: 14px; line-height: 20px; }
.save-state { font-size: 14px; line-height: 20px; color: var(--muted); text-align: end; }
.bar { height: 4px; background: var(--line); margin-bottom: var(--s24); direction: rtl; }
.bar > i { display: block; height: 100%; background: var(--primary); width: 0; }
.q-help { margin: calc(-1 * var(--s8)) 0 var(--s16); }
.field { margin-bottom: var(--s16); }
.field .muted { margin: 0 0 var(--s8); }
.sub-q { margin-top: var(--s24); }
.stack { display: grid; gap: var(--s4); }
.points { margin: 0 0 var(--s16); padding-inline-start: var(--s16); }
.points li { margin-bottom: var(--s16); }
.points li::marker { font-size: 12px; }
/* explanation box: highlight background, no outline (outlines are for fields only) */
.note-box { background: var(--highlight); padding: var(--s16); }
.note-box p { margin: 0; }

/* fields: regular = 1px border; typing = 2px primary; error = 2px error */
input[type=text], input[type=url], input[type=password], textarea {
  width: 100%; font: inherit; font-size: 16px; /* 16px prevents iOS zoom */
  color: var(--ink); background: var(--surface); border: 1px solid var(--border);
  padding: var(--s12); min-height: var(--hit); appearance: none; -webkit-appearance: none; display: block;
}
textarea { min-height: 128px; resize: vertical; line-height: 22px; }
@media (min-width: 720px) {
  textarea { min-height: 104px; }
  /* opening screen, desktop: 48 above, 24 between the blocks, 12 between the bullets */
  .wrap.welcome { padding-top: var(--s48); }
  .wrap.welcome > h1, .wrap.welcome > p, .wrap.welcome > .points { margin: 0 0 var(--s24); }
  .wrap.welcome .points li { margin-bottom: var(--s12); }
  .wrap.welcome .points li:last-child { margin-bottom: 0; }
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type=text]:focus, input[type=url]:focus, input[type=password]:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -2px; }
input.invalid, input.invalid:focus { outline: 2px solid var(--error); outline-offset: -2px; }
/* error line: icon + red slanted text. Hebrew has no true italic, the browser slants the regular face. */
.err-msg {
  display: flex; align-items: flex-start; gap: var(--s8); margin: var(--s8) 0 0;
  color: var(--error); font-size: 14px; line-height: 20px; font-style: italic; font-synthesis: style;
}
.err-msg .ico { width: 16px; height: 16px; margin-top: 2px; }

/* icons */
.ico { display: inline-flex; flex: none; width: 24px; height: 24px; }
.ico svg { width: 100%; height: 100%; display: block; }

/* buttons: 56 high, label/button 16 bold */
.btn {
  font-family: var(--voice); font-weight: 700; font-size: 16px; line-height: 22px;
  min-height: var(--btn-h); padding: 0 var(--s16); border: 0; background: var(--surface);
  color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: var(--s8);
  text-decoration: none; text-align: center;
}
.btn.primary { background: var(--primary); color: var(--surface); }
.btn.secondary { background: var(--secondary); color: var(--primary); }
.btn.outline { border: 2px solid var(--ink); }
.btn.quiet { background: transparent; border: 1px solid var(--border); font-size: 14px; }
.btn.small { min-height: var(--hit); font-size: 14px; border-width: 1px; }
.btn.wide { width: 100%; }
.btn[disabled], .btn.dim { opacity: .45; cursor: default; }

/* bottom bar: two equal buttons, gap 8, 16 above and 32 below, aligned to the column */
.nav {
  position: fixed; inset-inline: 0; bottom: 0; background: var(--bg); border-top: 1px solid var(--line);
  padding: var(--s16) var(--s24) calc(var(--s32) + env(safe-area-inset-bottom));
}
.nav-inner { max-width: var(--col); margin: 0 auto; display: flex; gap: var(--s8); }
.nav .btn { flex: 1 1 0; min-width: 0; }

/* options: regular = 1px line on white; chosen = 1px primary + highlight fill */
.choices { display: grid; gap: var(--s8); }
.choice {
  display: flex; align-items: center; gap: var(--s12); min-height: 52px; padding: var(--s12) var(--s16);
  background: var(--surface); border: 1px solid var(--line); cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--primary); background: var(--highlight); }
.choice:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.choice input {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0;
  width: 24px; height: 24px; border: 2px solid var(--ink); background-color: var(--surface); cursor: pointer;
}
.choice input:focus-visible { outline: none; }
.choice input:checked {
  background-color: var(--primary); border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23fff' stroke-width='3'/%3E%3C/svg%3E");
  background-size: 100% 100%;
}
.choice-with-extra { display: grid; gap: var(--s8); }

/* multi-part question (Q9): white surface, no outline, small grey counter */
.part { background: var(--surface); padding: var(--s16); margin-bottom: var(--s16); }
.part-count { color: var(--muted); font-size: 14px; line-height: 20px; margin: 0 0 var(--s4); }
.part .field:last-child { margin-bottom: 0; }

/* voice */
.rec-slot { margin-top: var(--s16); }
.rec { background: var(--highlight); padding: var(--s16); }
.rec-title { font-family: var(--voice); font-weight: 700; font-size: 16px; line-height: 22px; margin: 0 0 var(--s8); }
.rec-title.ok { color: var(--primary); }
.rec .muted { margin: 0 0 var(--s12); }
.rec .muted:last-child { margin: var(--s12) 0 0; }
.rec .err-msg { margin: 0 0 var(--s12); }
.voice-btn { width: 100%; }
.voice-btn.outlined { border: 1px solid var(--border); }
.rec-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s8); margin-top: var(--s12); }
.rec-actions:first-child, .rec .err-msg + .rec-actions { margin-top: 0; }
.rec-row { display: flex; gap: var(--s8); align-items: center; }
.rec-row.center { justify-content: center; margin: var(--s8) 0 var(--s16); }
.rec-timer { font-family: var(--voice); font-weight: 700; font-size: 28px; line-height: 34px; }
.dot { width: 12px; height: 12px; background: var(--primary); display: inline-block; }
.dot.on { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: .15; } }
@media (prefers-reduced-motion: reduce) { .dot.on { animation: none; } }

/* player: no outline at rest; focus outline while she listens; progress fills left to right */
.player { display: flex; align-items: center; gap: var(--s12); background: var(--surface); padding: 6px var(--s12) 6px 6px; min-height: var(--hit); direction: ltr; }
.player.playing { outline: 2px solid var(--primary); outline-offset: -2px; }
.player .pbtn { width: 36px; height: 36px; border: 0; background: var(--primary); color: var(--surface); cursor: pointer; flex: none; padding: 6px; display: inline-flex; }
.player .pbtn .ico { width: 24px; height: 24px; }
.player .track { flex: 1; height: 8px; background: var(--line); position: relative; cursor: pointer; }
.player .track i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--primary); }
.player .time { font-family: var(--voice); font-size: 14px; font-weight: 700; min-width: 40px; text-align: end; }

/* image upload */
.thumb { max-width: 100%; max-height: 220px; display: block; border: 1px solid var(--line); margin-bottom: var(--s8); }
.file-row { display: flex; align-items: center; gap: var(--s12); flex-wrap: wrap; }
.file-row .muted { margin: 0; }
.sr-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.sr-file:focus-visible + .btn { outline: 2px solid var(--primary); outline-offset: 2px; }

/* summary: question, answer under it, arrow at the row end. Answered = primary, unanswered = ink. */
.lead { margin-bottom: var(--s16); }
.rlist { list-style: none; margin: 0 0 var(--s16); padding: 0; }
.rlist li { border-bottom: 1px solid var(--line); position: relative; }
.rlist li.open { background: var(--highlight); border-bottom-color: transparent; padding: 0 var(--s12) var(--s12); margin: 0 calc(-1 * var(--s12)); }
.row-head {
  all: unset; box-sizing: border-box; display: flex; width: 100%; gap: var(--s12); padding: var(--s12) 0;
  cursor: pointer; align-items: flex-start; justify-content: space-between; min-height: var(--hit);
}
.row-head:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.rlist li.open .row-head { padding-inline-end: 40px; padding-bottom: var(--s4); }
.row-text { display: block; min-width: 0; }
.row-q { display: block; font-size: 16px; line-height: 22px; }
.answered .row-q { color: var(--primary); }
.row-answer {
  margin: var(--s4) 0 0; color: var(--muted); font-size: 14px; line-height: 20px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.row-answer .ico { width: 16px; height: 16px; vertical-align: -3px; margin-inline-end: var(--s4); display: inline-block; }
.row-ico { width: 16px; height: 16px; color: var(--muted); margin-top: 3px; }
.row-edit {
  all: unset; box-sizing: border-box; position: absolute; top: 0; inset-inline-end: 0; width: var(--hit); height: var(--hit);
  display: inline-flex; align-items: center; justify-content: center; color: var(--primary); cursor: pointer;
}
.row-edit .ico { width: 20px; height: 20px; }
.row-edit:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.row-full { margin: 0 0 var(--s8); white-space: pre-wrap; overflow-wrap: anywhere; }
.row-full.ltr { text-align: right; }
.row-label { margin-top: var(--s8); }
.row-body > :last-child, .row-body .field:last-child { margin-bottom: 0; }
.row-body .rec { padding: 0; }
.row-body .sub-q { font-size: 16px; line-height: 22px; margin-top: var(--s12); }

/* zero state (personal link not valid, server down): centred like a 404 */
.zero { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding-bottom: var(--s24); }
.zero-ico { width: 32px; height: 32px; color: var(--error); margin-bottom: var(--s12); }
.zero h2 { margin-bottom: var(--s8); }
.zero .muted { font-size: 16px; line-height: 22px; margin-bottom: var(--s16); }

/* admin */
.admin-wrap { max-width: 900px; margin: 0 auto; padding: 24px 16px 64px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > input { flex: 1; min-width: 160px; }
table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 20px; vertical-align: middle; }
th { font-family: var(--voice); font-weight: 700; background: var(--tint); }
.badge { font-family: var(--voice); font-weight: 700; font-size: 14px; padding: 2px 8px; border: 1px solid var(--ink); display: inline-block; }
.badge.submitted { background: var(--blue); border-color: var(--blue); color: var(--white); }
.badge.progress { background: var(--tint); }
.qblock { background: var(--white); border: 1px solid var(--line); padding: 16px; margin-bottom: 12px; }
.qblock h3 { margin-bottom: 10px; }
.ans { margin: 0 0 12px; }
.ans .ui { font-size: 14px; color: var(--muted); display: block; }
.ans .txt { white-space: pre-wrap; unicode-bidi: plaintext; text-align: start; }
.linkbox { background: var(--tint); padding: 10px 12px; word-break: break-all; margin: 8px 0; direction: ltr; text-align: left; }
.toast { position: fixed; top: 12px; inset-inline: 16px; margin: 0 auto; max-width: 400px; background: var(--ink); color: var(--white); padding: 12px 16px; text-align: center; font-family: var(--voice); font-weight: 700; }

.card { background: var(--surface); border: 1px solid var(--line); padding: var(--s16); margin-bottom: var(--s16); }
.field > .ui { margin-bottom: var(--s4); }
.rec-msg { color: var(--muted); font-size: 14px; line-height: 20px; margin: var(--s8) 0 0; }
.rec-msg.err { color: var(--ink); font-weight: 700; }
.admin-wrap .btn:not(.primary) { border: 1px solid var(--ink); }
