:root {
  --bg: #f4f1ea;
  --card: #fffdf8;
  --ink: #1d2433;
  --muted: #5d6576;
  --line: #e2ddd1;
  --brand: #1f3a68;
  --brand-ink: #ffffff;
  --brand-soft: #e6ecf6;
  --green: #1f7a4a; --green-bg: #e3f3ea;
  --orange: #b85d00; --orange-bg: #fdeedd;
  --red: #b42b2b; --red-bg: #fbe4e2;
  --slate: #2c4a7a; --slate-bg: #e6ecf6;
  --gray: #5f6470; --gray-bg: #eceae5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 25, 40, .06), 0 4px 14px rgba(20, 25, 40, .05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171d; --card: #1d212a; --ink: #eef0f4; --muted: #a2a9b7; --line: #2f3542;
    --brand: #8fb0ea; --brand-ink: #0f1626; --brand-soft: #24314a;
    --green: #6fd29a; --green-bg: #183126;
    --orange: #f4a65a; --orange-bg: #3a2814;
    --red: #f08a84; --red-bg: #3c1d1c;
    --slate: #a7c0ec; --slate-bg: #24314a;
    --gray: #b4b8c2; --gray-bg: #2a2e37;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Assistant', 'Segoe UI', Arial, sans-serif; font-size: 17px; line-height: 1.55;
}
button, select, input, textarea { font: inherit; color: inherit; }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px 120px; }
header.top { padding: 28px 0 8px; }
h1 { font-size: 1.65rem; line-height: 1.25; margin: 0 0 6px; font-weight: 800; letter-spacing: -.01em; }
.lead { font-size: 1.12rem; margin: 10px 0 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px; margin: 14px 0; }
.callout { border: 2px solid var(--brand); background: var(--brand-soft); border-radius: var(--radius); padding: 16px; margin: 16px 0; font-weight: 600; }
.callout p { margin: 0; }
h2 { font-size: 1.15rem; margin: 0 0 10px; font-weight: 800; }
.legend { display: grid; gap: 10px; }
.lg { border-radius: 12px; padding: 10px 12px; border-inline-start: 6px solid; }
.lg b { display: block; }
.lg span { color: var(--muted); font-size: .95rem; }
.tone-green { --t: var(--green); --tb: var(--green-bg); }
.tone-orange { --t: var(--orange); --tb: var(--orange-bg); }
.tone-red { --t: var(--red); --tb: var(--red-bg); }
.tone-slate { --t: var(--slate); --tb: var(--slate-bg); }
.tone-gray { --t: var(--gray); --tb: var(--gray-bg); }
.lg.tone-green, .lg.tone-orange, .lg.tone-red { background: var(--tb); border-color: var(--t); }
.lg.tone-green b, .lg.tone-orange b, .lg.tone-red b { color: var(--t); }
.past { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.past li { padding: 8px 12px; background: var(--bg); border-radius: 10px; }
.past b { color: var(--brand); }
.fine { color: var(--muted); font-size: .97rem; margin: 12px 0 0; }

/* פרטים */
.field { margin: 12px 0; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .97rem; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--card); font-size: 16px;
}
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* התקדמות */
.progress { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 0 10px; margin: 0 -16px; padding-inline: 16px; border-bottom: 1px solid var(--line); }
.progress .txt { display: flex; justify-content: space-between; font-weight: 700; font-size: .98rem; margin-bottom: 6px; }
.progress .saved { color: var(--muted); font-weight: 400; font-size: .88rem; }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 99px; transition: width .3s ease; }

/* שאלה */
.q { padding: 0; overflow: hidden; }
.q-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 16px; background: none; border: 0; text-align: start; cursor: pointer; }
.q-num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.q.done .q-num { background: var(--brand); color: var(--brand-ink); }
.q-title { flex: 1; min-width: 0; }
.q-title strong { display: block; font-size: 1.4rem; line-height: 1.2; font-weight: 800; }
.q-title small { display: inline-block; margin-top: 4px; color: var(--muted); font-size: .95rem; font-weight: 600; }
.chev { flex: none; width: 22px; height: 22px; transition: transform .2s; color: var(--muted); }
.q.open .chev { transform: rotate(180deg); }
.q-body { display: none; padding: 0 12px 14px; }
.q.open .q-body { display: block; }
.q-note { background: var(--bg); border-radius: 10px; padding: 10px 12px; margin: 0 4px 12px; font-weight: 600; }

/* שורה */
.row { border-radius: 12px; border: 1.5px solid var(--line); margin: 10px 0; padding: 12px; background: var(--card); border-inline-start: 6px solid var(--t); }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; flex-direction: column; background: var(--tb); color: var(--t); border-radius: 10px; padding: 4px 10px; font-weight: 800; line-height: 1.3; }
.chip small { font-weight: 600; font-size: .85rem; opacity: .9; }
.copy-prev { border: 1.5px dashed var(--line); background: none; border-radius: 99px; padding: 6px 12px; font-size: .9rem; font-weight: 700; color: var(--brand); cursor: pointer; min-height: 38px; }
.copy-prev:active { background: var(--brand-soft); }
.lbl { font-weight: 700; font-size: .93rem; margin: 10px 0 6px; color: var(--muted); }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg.two { grid-template-columns: 1fr 1fr; }
.seg button { min-height: 46px; padding: 6px 4px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); font-weight: 700; font-size: .95rem; line-height: 1.2; cursor: pointer; }
.seg button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.amt { margin-top: 8px; }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toggles .lbl { margin-top: 12px; }
.clear-row { background: none; border: 0; color: var(--muted); font-size: .85rem; text-decoration: underline; padding: 8px 0 0; cursor: pointer; }

/* סיום */
.btn { display: block; width: 100%; min-height: 54px; border-radius: 12px; border: 0; font-weight: 800; font-size: 1.1rem; cursor: pointer; margin: 10px 0; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.secondary { background: none; border: 1.5px solid var(--brand); color: var(--brand); font-size: 1rem; }
.btn:disabled { opacity: .6; }
.msg { text-align: center; font-weight: 700; margin: 8px 0; min-height: 1.5em; }
.msg.err { color: var(--red); }
.thanks { text-align: center; padding: 40px 16px; }
.thanks .big { font-size: 1.8rem; font-weight: 800; margin-bottom: 8px; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
