/*
 * תרגול מקראות – עיצוב.
 * פריסה: כותרת לבנה ודקה, אזור פתיחה בכחול הדגל עם פסים לבנים כמו בדגל, ומתחתיו
 * כרטיסים מעוגלים על רקע לבן. מראה בהיר אחד, בכוונה (רקע לבן לפי בקשת בעל האתר).
 */

/* האתר כולו מימין לשמאל, גם כשהוא מוטמע במסגרת שאינה מגדירה כיוון */
html { -webkit-text-size-adjust: 100%; direction: rtl; }

:root {
  /* צבע */
  --paper: #ffffff;
  --ink: #0b1533;
  --muted: #4a5878;
  --line: #dce4f2;
  --flag: #0038b8;
  --flag-deep: #002a8c;
  --flag-bright: #2f6bff;
  --tchelet: #eef4ff;
  --tchelet-2: #dbe7ff;
  --on-flag: #ffffff;
  --on-flag-soft: rgba(255, 255, 255, 0.18);
  --on-flag-dim: rgba(255, 255, 255, 0.84);
  --ok: #0f7a3c;
  --ok-bg: #e7f6ed;
  --bad: #b3261e;
  --bad-bg: #fdeceb;
  --warn: #8a5300;
  --warn-bg: #fff4dc;
  --scrim: rgba(11, 21, 51, 0.5);
  --shadow-sm: 0 1px 2px rgba(11, 21, 51, 0.06);
  --shadow: 0 1px 2px rgba(11, 21, 51, 0.05), 0 8px 24px rgba(11, 21, 51, 0.07);
  --shadow-lg: 0 20px 50px rgba(0, 31, 102, 0.22);

  /* טיפוגרפיה */
  --display: "Rubik", "Assistant", "Segoe UI", Arial, sans-serif;
  --body: "Assistant", "Rubik", "Segoe UI", Arial, sans-serif;
  --text-serif: "Frank Ruhl Libre", "David Libre", "Times New Roman", serif;

  /* מידות */
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --mast-h: 68px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--flag); }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-weight: 800; font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.6rem); }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { margin: 0; }
h1:focus { outline: none; }
:focus-visible { outline: 3px solid var(--flag-bright); outline-offset: 2px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.wrap {
  width: 100%; max-width: 1120px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
main.wrap { flex: 1; padding-block: 32px 64px; display: flex; flex-direction: column; gap: 32px; }
main:focus { outline: none; }
main > * { min-width: 0; }

.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

.skip-link {
  position: absolute; inset-inline-start: 8px; top: -60px; z-index: 40;
  background: var(--flag); color: var(--on-flag); padding: 8px 14px; border-radius: 999px; font-weight: 700;
}
.skip-link:focus { top: calc(8px + env(safe-area-inset-top, 0px)); }

/* ---------- כותרת ---------- */

body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10;
  background: var(--paper);
}

.mast {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.mast-in { display: flex; align-items: center; gap: 18px; min-height: var(--mast-h); }

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--flag); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 22px; height: 22px; fill: none; stroke: var(--on-flag); stroke-width: 1.8; stroke-linejoin: round; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 1.35rem; line-height: 1; color: var(--flag); }

.nav { display: flex; gap: 2px; margin-inline-start: 8px; }
.nav a {
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.98rem;
  padding: 8px 14px; border-radius: 999px; white-space: nowrap;
}
.nav a:hover { background: var(--tchelet); color: var(--flag); }
.nav a[aria-current="page"] { background: var(--tchelet); color: var(--flag); }

.auth { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.auth .btn { min-height: 40px; padding: 0 16px; font-size: 0.96rem; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink);
  padding: 4px 6px 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: 0.95rem;
}
.user-chip:hover { border-color: var(--flag); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--flag); color: var(--on-flag); font-family: var(--display); font-weight: 700; font-size: 0.9rem;
}
.tier { font-size: 0.75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--tchelet); color: var(--flag); }
.tier.pro { background: var(--flag); color: var(--on-flag); }

.menu-btn {
  display: none; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); cursor: pointer;
}
.menu-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* כשאין מקום לכל פריטי התפריט בשורה אחת, הם עוברים לתפריט נפתח */
@media (max-width: 1140px) {
  :root { --mast-h: 60px; }
  .mast-in { flex-wrap: wrap; gap: 10px; }
  .menu-btn { display: inline-flex; order: 3; }
  .auth { order: 2; }
  .nav {
    display: none; order: 4; width: 100%; flex-direction: column; gap: 2px; margin: 0 0 12px;
  }
  .mast[data-open] .nav { display: flex; }
  .nav a { padding: 12px 14px; border-radius: 12px; }
  .user-chip .name { display: none; }
}
@media (max-width: 420px) {
  .auth .btn.ghost { display: none; }
}
/* טקסט מוגדל (תפריט הנגישות): פריטי התפריט עוברים לתפריט נפתח בכל רוחב, כדי שלא ייחתכו */
html.a11y-t1 .mast-in, html.a11y-t2 .mast-in { flex-wrap: wrap; gap: 10px; }
html.a11y-t1 .menu-btn, html.a11y-t2 .menu-btn { display: inline-flex; order: 3; }
html.a11y-t1 .auth, html.a11y-t2 .auth { order: 2; }
html.a11y-t1 .nav, html.a11y-t2 .nav { display: none; order: 4; width: 100%; flex-direction: column; gap: 2px; margin: 0 0 12px; }
html.a11y-t1 .mast[data-open] .nav, html.a11y-t2 .mast[data-open] .nav { display: flex; }
html.a11y-t1 .nav a, html.a11y-t2 .nav a { padding: 12px 14px; border-radius: 12px; }

/* ---------- כפתורים ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  border: 1.5px solid var(--flag); background: var(--paper); color: var(--flag);
  font: inherit; font-family: var(--display); font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--tchelet); }
.btn.primary { background: var(--flag); color: var(--on-flag); box-shadow: 0 6px 16px rgba(0, 56, 184, 0.25); }
.btn.primary:hover { background: var(--flag-deep); border-color: var(--flag-deep); }
.btn.ghost { border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--flag); color: var(--flag); background: var(--paper); }
.btn.light { background: var(--paper); border-color: var(--paper); color: var(--flag); }
.btn.light:hover { background: var(--tchelet); }
.btn.outline-light { background: transparent; border-color: var(--on-flag-dim); color: var(--on-flag); }
.btn.outline-light:hover { background: var(--on-flag-soft); }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 0.93rem; }
.btn.block { width: 100%; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn.flag-on { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); }
.btn .ico { width: 20px; height: 20px; }
.link { background: none; border: 0; padding: 0; color: var(--flag); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- מבנה כללי ---------- */

.section { display: flex; flex-direction: column; gap: 16px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.45rem; }
.section-head a { font-weight: 600; text-decoration: none; }
.section-head a:hover { text-decoration: underline; }

.page-head { display: flex; flex-direction: column; gap: 10px; }
.page-head .lead { max-width: 66ch; }
.lead { font-size: 1.12rem; color: var(--muted); }
.eyebrow { font-size: 0.86rem; font-weight: 700; color: var(--flag); letter-spacing: 0.02em; font-family: var(--display); }

.panel { border: 1px solid var(--line); border-radius: var(--r); padding: 22px; background: var(--paper); display: flex; flex-direction: column; gap: 12px; }
.panel.tint { background: var(--tchelet); border-color: var(--tchelet-2); }
.panel > .actions { margin-top: 4px; }
.split { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: stretch; }
.split .panel .actions { margin-top: auto; }

.crumbs { font-size: 0.92rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.crumbs a { text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }

/* ---------- פתיחה (דף הבית) ---------- */

.hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  background: var(--flag); color: var(--on-flag);
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: center;
  padding: 48px clamp(20px, 4vw, 56px);
}
/* שני הפסים של הדגל, בלבן שקוף */
.hero::before, .hero::after {
  content: ""; position: absolute; inset-inline: 0; height: 14px; background: rgba(255, 255, 255, 0.1); pointer-events: none;
}
.hero::before { top: 22px; }
.hero::after { bottom: 22px; }
.hero > * { position: relative; }
.hero-text { display: flex; flex-direction: column; gap: 18px; }
.hero h1 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.2rem); line-height: 1.08; }
.hero .lead { color: var(--on-flag-dim); font-size: 1.18rem; max-width: 46ch; }
.hero .eyebrow { color: var(--on-flag-dim); }
.hero-note { font-size: 0.9rem; color: var(--on-flag-dim); }

.demo-q {
  background: var(--paper); color: var(--ink); border-radius: var(--r); padding: 20px;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 10px;
  transform: rotate(-1.2deg);
}
.demo-q .qtext { font-size: 1.08rem; }
.demo-q .opt { min-height: 44px; padding: 8px 12px; cursor: default; }
.demo-q .feedback { padding: 10px 12px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-block: 36px; }
  .demo-q { transform: none; }
}

.stats-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 18px; border-radius: var(--r); background: var(--tchelet); display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--display); font-size: 1.9rem; font-weight: 800; color: var(--flag); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 0.95rem; }
@media (max-width: 700px) { .stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.entries { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.entry {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 22px; border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink); text-decoration: none; background: var(--paper);
}
.entry .ico-box { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--tchelet); color: var(--flag); margin-bottom: 4px; }
.entry .ico-box .ico { width: 26px; height: 26px; }
.entry strong { font-family: var(--display); font-size: 1.18rem; font-weight: 700; }
.entry span { color: var(--muted); font-size: 0.98rem; }
.entry .lock-badge { position: absolute; top: 18px; inset-inline-end: 18px; }
.entry:hover { border-color: var(--flag); box-shadow: var(--shadow); }

.progress-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 24px;
  padding: 14px 18px; background: var(--tchelet); border-radius: var(--r); font-size: 0.98rem;
}
.progress-line b { font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.progress-line a { font-weight: 700; }
.progress-links { display: inline-flex; flex-wrap: wrap; gap: 6px 18px; margin-inline-start: auto; }

/* ---------- מדריך השערים ---------- */

.dir { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.gate {
  display: grid; grid-template-columns: 56px 1fr; gap: 4px 16px; align-items: start;
  padding: 18px; border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink); text-decoration: none; background: var(--paper);
}
.gate:hover { border-color: var(--flag); box-shadow: var(--shadow); }
.gate:hover .gate-ico { background: var(--flag); color: var(--on-flag); }
.gate-ico {
  grid-row: span 4; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: var(--tchelet); color: var(--flag);
}
.gate-ico .ico { width: 28px; height: 28px; }
.gate-top { display: flex; justify-content: space-between; gap: 8px; font-size: 0.86rem; color: var(--muted); }
.gate-title { font-family: var(--display); font-size: 1.1rem; font-weight: 700; line-height: 1.35; }
.gate-desc { font-size: 0.93rem; color: var(--muted); }
.gate-meta { grid-column: 2; display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--muted); margin-top: 6px; }
.gate-meta .bar { flex: 1; }
.gate.mix .gate-ico { background: var(--paper); border: 1.5px dashed var(--flag); }

.bar { height: 6px; border-radius: 3px; background: var(--tchelet-2); overflow: hidden; min-width: 60px; }
.bar span { display: block; height: 100%; background: var(--flag); border-radius: 3px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; background: var(--tchelet); color: var(--flag); white-space: nowrap;
}
.chip.soft { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.imp { background: var(--paper); color: var(--flag); border: 1px solid var(--flag); }
.chip.lock { background: var(--ink); color: var(--paper); }
.chip .ico { width: 14px; height: 14px; }

/* ---------- נעילה ומנוי ---------- */

.lock-panel { align-items: flex-start; }
.lock-panel .ico-box { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--flag); color: var(--on-flag); }
.lock-panel .ico-box .ico { width: 26px; height: 26px; }
.upsell {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  padding: 14px 18px; border-radius: var(--r); background: var(--tchelet); border: 1px solid var(--tchelet-2);
}
.upsell p { flex: 1; min-width: 220px; }
.upsell .ico { color: var(--flag); }

.plans { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: stretch; }
.plan { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; display: flex; flex-direction: column; gap: 16px; background: var(--paper); }
.plan.featured { border: 2px solid var(--flag); box-shadow: var(--shadow); position: relative; }
.plan .badge { position: absolute; top: -13px; inset-inline-start: 24px; background: var(--flag); color: var(--on-flag); font-family: var(--display); font-weight: 600; font-size: 0.82rem; padding: 4px 12px; border-radius: 999px; }
.plan h3 { font-size: 1.25rem; }
.price { display: flex; align-items: baseline; gap: 6px; }
.price b { font-family: var(--display); font-size: 2.6rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.price span { color: var(--muted); }
.features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.features li { display: flex; gap: 10px; align-items: flex-start; }
.features li .ico { width: 20px; height: 20px; color: var(--ok); margin-top: 3px; }
.features li.no { color: var(--muted); }
.features li.no .ico { color: var(--muted); }
.plan .actions { margin-top: auto; }

.faq { display: flex; flex-direction: column; gap: 8px; }
.faq details { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 18px; }
.faq summary { font-family: var(--display); font-weight: 600; cursor: pointer; }
.faq details p { margin-top: 8px; color: var(--muted); }

/* ---------- טפסים ---------- */

.auth-wrap { display: grid; place-items: start center; }
.auth-card { width: 100%; max-width: 460px; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow); }
.auth-card .page-head { gap: 6px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: 0.95rem; }
.field input {
  font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line);
  border-radius: 12px; min-height: 48px; padding: 0 14px;
}
.field input:focus { border-color: var(--flag); outline: none; box-shadow: 0 0 0 3px var(--tchelet-2); }
.field input[aria-invalid="true"] { border-color: var(--bad); }
.field .hint { font-size: 0.86rem; color: var(--muted); }
.field input[dir="ltr"] { text-align: right; }
.form-error { color: var(--bad); background: var(--bad-bg); border-radius: 12px; padding: 10px 14px; font-weight: 600; }
.form-ok { color: var(--ok); background: var(--ok-bg); border-radius: 12px; padding: 10px 14px; font-weight: 600; }
.auth-alt { text-align: center; color: var(--muted); font-size: 0.96rem; }
.auth-alt a { font-weight: 700; }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* ---------- כותרת שער ---------- */

.gate-head { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center; }
.gate-head .gate-ico { grid-row: span 2; width: 64px; height: 64px; border-radius: 18px; }
.gate-head .gate-ico .ico { width: 32px; height: 32px; }
.gate-head .lead { grid-column: 1 / -1; font-size: 1.02rem; }

/* ---------- תרגול ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--tchelet); border-radius: 999px; align-self: flex-start; max-width: 100%; }
.seg > a, .seg > button, .seg label span {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 999px;
  border: 0; background: none; color: var(--muted); font: inherit; font-family: var(--display); font-size: 0.93rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.seg > a:hover, .seg > button:hover, .seg label:hover span { color: var(--flag); }
.seg > [aria-current="true"], .seg > [aria-selected="true"], .seg input:checked + span { background: var(--paper); color: var(--flag); box-shadow: var(--shadow-sm); }
.seg label { position: relative; display: inline-flex; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg input:focus-visible + span { outline: 3px solid var(--flag-bright); outline-offset: -3px; }

.select { display: inline-flex; align-items: center; gap: 8px; font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.select select {
  font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line);
  border-radius: 999px; min-height: 44px; padding: 0 14px; max-width: 70vw;
}

.counter { color: var(--muted); font-size: 0.95rem; min-height: 1.6em; font-variant-numeric: tabular-nums; }
.qbox { display: flex; flex-direction: column; gap: 10px; }

.qcard {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px; background: var(--paper); display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow);
}
.qmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qnum { font-weight: 700; color: var(--muted); font-size: 0.92rem; margin-inline-end: 4px; font-variant-numeric: tabular-nums; }
.qtext { font-family: var(--display); font-size: 1.3rem; font-weight: 600; line-height: 1.45; }

.options { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: start;
  padding: 13px 14px; min-height: 56px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
  font: inherit; line-height: 1.5; cursor: pointer;
}
.opt:hover:not(:disabled) { border-color: var(--flag); background: var(--tchelet); }
.opt:disabled { cursor: default; opacity: 1; }
.opt-key {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--tchelet); color: var(--flag); font-family: var(--display); font-weight: 700; font-size: 0.92rem;
}
.opt.chosen { border-color: var(--flag); background: var(--tchelet); }
.opt.chosen .opt-key { background: var(--flag); color: var(--on-flag); }
.opt.correct { border-color: var(--ok); background: var(--ok-bg); }
.opt.correct .opt-key { background: var(--ok); color: var(--paper); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.wrong .opt-key { background: var(--bad); color: var(--paper); }
.opt.dim { opacity: 0.6; }

.feedback { padding: 16px 18px; border-radius: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.feedback.ok { background: var(--ok-bg); }
.feedback.bad { background: var(--bad-bg); }
.feedback > strong { font-family: var(--display); font-size: 1.05rem; }
.feedback.ok > strong { color: var(--ok); }
.feedback.bad > strong { color: var(--bad); }
.exp { color: var(--ink); max-width: 72ch; }
.feedback .btn { margin-top: 8px; }

.summary { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.big { font-family: var(--display); font-size: 3.2rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.empty { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }

.kbd-hint { font-size: 0.82rem; color: var(--muted); }
@media (hover: none) { .kbd-hint { display: none; } }

/* ---------- שאלת סידור ושאלה פתוחה ---------- */

.sort-wrap { display: flex; flex-direction: column; gap: 10px; }
.sort-hint { font-size: 0.92rem; color: var(--muted); }
.sortable { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sort-item {
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 10px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper);
  cursor: grab; user-select: none; -webkit-user-select: none; position: relative;
}
.sortable:not(.done) .sort-item:hover { border-color: var(--flag); }
.sort-item.dragging { cursor: grabbing; z-index: 2; border-color: var(--flag); background: var(--tchelet); box-shadow: var(--shadow-lg); }
.grip { flex: none; display: grid; place-items: center; width: 32px; height: 40px; color: var(--muted); touch-action: none; cursor: grab; }
.grip .ico { width: 20px; height: 20px; }
.sort-num {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--tchelet); color: var(--flag); font-family: var(--display); font-weight: 700; font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.sort-text { flex: 1; min-width: 0; line-height: 1.45; }
.sort-moves { flex: none; display: flex; gap: 4px; }
.mv {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--line); background: var(--paper); color: var(--flag); cursor: pointer; padding: 0;
}
.mv:hover:not(:disabled) { background: var(--tchelet); border-color: var(--flag); }
.mv:disabled { color: var(--line); cursor: default; }
.mv .ico { width: 20px; height: 20px; }
.sortable.done .sort-item { cursor: default; }
.sort-item.ok { border-color: var(--ok); background: var(--ok-bg); }
.sort-item.ok .sort-num { background: var(--ok); color: var(--paper); }
.sort-item.bad { border-color: var(--bad); background: var(--bad-bg); }
.sort-item.bad .sort-num { background: var(--bad); color: var(--paper); }
.steps-key { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 4px; }
.rev .sort-wrap { margin-block: 4px; }
.rev .sort-item { min-height: 0; padding: 6px 10px; }

.text-q { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.text-answer {
  flex: 1 1 260px; min-width: 0; font: inherit; font-size: 1.1rem; padding: 12px 14px; min-height: 52px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink);
}
.text-answer:focus { outline: 2px solid var(--flag); outline-offset: 1px; border-color: var(--flag); }
.text-q.ok .text-answer { border-color: var(--ok); background: var(--ok-bg); }
.text-q.bad .text-answer { border-color: var(--bad); background: var(--bad-bg); }
.text-q .muted { flex-basis: 100%; font-size: 0.88rem; }

/* ---------- מבחנים ---------- */

.facts { display: flex; flex-wrap: wrap; gap: 12px; padding: 0; margin: 0; list-style: none; }
.facts li { display: flex; flex-direction: column; padding: 12px 18px; border-radius: var(--r); background: var(--tchelet); min-width: 110px; }
.facts b { font-family: var(--display); font-size: 1.6rem; font-weight: 800; color: var(--flag); font-variant-numeric: tabular-nums; line-height: 1.2; }
.facts span { font-size: 0.88rem; color: var(--muted); }

.samples { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.sample { border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.sample h3 { font-size: 1.2rem; }
.sample .meta { font-size: 0.92rem; color: var(--muted); }
.sample .btn, .sample .chip { align-self: flex-start; }
.sample .btn { margin-top: auto; }
.sample.locked { background: var(--tchelet); border-color: var(--tchelet-2); }
.sample.random { border: 1.5px solid var(--flag); box-shadow: var(--shadow); }
.sample.random.locked { box-shadow: none; }
.sample.random .meta { color: var(--ink); }

.steps { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }

.form { display: flex; flex-direction: column; gap: 20px; }
.form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.form legend { font-family: var(--display); font-weight: 700; padding: 0; margin-bottom: 8px; }
.row-actions { display: flex; gap: 18px; font-size: 0.95rem; }
.checks { display: grid; gap: 4px 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--flag); flex: none; }
.check .ico { width: 20px; height: 20px; color: var(--flag); }
.switch { font-weight: 600; }
.exam-summary { color: var(--muted); font-variant-numeric: tabular-nums; }

.exam-bar {
  position: sticky; top: calc(var(--mast-h) + 8px + env(safe-area-inset-top, 0px)); z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 8px 8px 18px; box-shadow: var(--shadow);
}
.exam-bar .title { font-family: var(--display); font-weight: 700; padding-inline-start: 8px; }
.exam-bar .btn { margin-inline-start: auto; }
.clock-wrap { display: inline-flex; align-items: center; gap: 6px; color: var(--flag); }
.clock { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.15rem; }
.clock.low { color: var(--bad); }

.exam-nav { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; }
.exam-nav .btn { padding: 0 16px; }

.grid-card summary { font-family: var(--display); font-weight: 700; cursor: pointer; }
.grid-card[open] summary { margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.cell {
  height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper);
  color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; position: relative; font-variant-numeric: tabular-nums;
}
.cell.answered { background: var(--tchelet); border-color: var(--flag); color: var(--flag); }
.cell.current { outline: 3px solid var(--flag); outline-offset: 1px; }
.cell.flagged::after {
  content: ""; position: absolute; top: 3px; inset-inline-end: 3px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--warn);
}
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); margin-top: 10px; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; }
.dot.answered { background: var(--tchelet); border: 1.5px solid var(--flag); }
.dot.flagged { background: var(--warn); border-radius: 50%; }

.result { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 28px; border-inline-start-width: 6px; }
.result > div { display: flex; flex-direction: column; gap: 2px; }
.result.ok { border-inline-start-color: var(--ok); }
.result.bad { border-inline-start-color: var(--bad); }
.result.ok .big { color: var(--ok); }
.result.bad .big { color: var(--bad); }
.result .note, .result .fine { flex-basis: 100%; }
.fine { font-size: 0.84rem; color: var(--muted); }
.note { font-size: 0.94rem; color: var(--warn); background: var(--warn-bg); padding: 10px 14px; border-radius: 12px; }

.next-step { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.next-step > .ico { width: 30px; height: 30px; color: var(--flag); }
.next-step div { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; }

.table-wrap { overflow-x: auto; }
.by-gate { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.by-gate th, .by-gate td { text-align: start; padding: 10px 8px; border-top: 1px solid var(--line); }
.by-gate thead th { border-top: 0; color: var(--muted); font-weight: 700; font-size: 0.86rem; }
.by-gate tbody th { font-weight: 600; }
.by-gate tbody th a { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.by-gate tbody th a:hover { text-decoration: underline; }
.by-gate td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.by-gate tr.weak td:last-child { color: var(--bad); font-weight: 800; }
.by-gate .ico { width: 20px; height: 20px; }

.review { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rev {
  border: 1px solid var(--line); border-inline-start: 4px solid var(--line);
  border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px;
}
.rev.ok { border-inline-start-color: var(--ok); }
.rev.bad { border-inline-start-color: var(--bad); }
.rev.skip { border-inline-start-color: var(--warn); }
.rev-q { font-weight: 700; }
.ans.ok { color: var(--ok); }
.ans.bad { color: var(--bad); }
.ans.skip { color: var(--warn); }
.rev .exp { color: var(--muted); font-size: 0.95rem; }

.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.history li:first-child { border-top: 0; }
.score { margin-inline-start: auto; font-weight: 800; padding: 2px 12px; border-radius: 999px; }
.score.ok { color: var(--ok); background: var(--ok-bg); }
.score.bad { color: var(--bad); background: var(--bad-bg); }

.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* ---------- התקווה ---------- */

.anthem-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 760px) { .anthem-grid { grid-template-columns: minmax(0, 1fr); } }
.poem { font-family: var(--text-serif); font-size: 1.55rem; line-height: 1.9; font-weight: 500; }
.poem p { margin: 0; }
.poem .stanza { margin-top: 0.9em; }
.anthem-card { display: flex; flex-direction: column; gap: 14px; }
.facts-list { margin: 0; padding: 0; list-style: none; display: grid; }
.facts-list li { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.facts-list li:first-child { border-top: 0; }
.facts-list .k { color: var(--muted); font-weight: 600; font-size: 0.94rem; }
@media (max-width: 460px) { .facts-list li { grid-template-columns: 1fr; gap: 0; } }

textarea {
  width: 100%; font: inherit; font-family: var(--text-serif); font-size: 1.25rem; line-height: 1.8; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; resize: vertical;
}
textarea:focus { border-color: var(--flag); outline: none; box-shadow: 0 0 0 3px var(--tchelet-2); }

.result-anthem { border-inline-start-width: 6px; }
.result-anthem.ok { border-inline-start-color: var(--ok); }
.result-anthem.bad { border-inline-start-color: var(--bad); }
.tally { margin: 0; padding-inline-start: 20px; color: var(--muted); }
.diff { font-family: var(--text-serif); font-size: 1.25rem; line-height: 2.1; background: var(--tchelet); padding: 12px 14px; border-radius: 12px; }
.tok { border-radius: 4px; padding: 0 3px; }
.tok.miss { background: var(--bad-bg); color: var(--bad); text-decoration: underline dotted; font-weight: 700; }
.tok.extra { color: var(--bad); text-decoration: line-through; outline: 1.5px dashed var(--bad); outline-offset: -1px; }
.tok.extra.punct { text-decoration: none; }
.tok.spell { background: var(--warn-bg); color: var(--warn); }
.tok.punct { padding: 0 5px; font-weight: 800; }

/* ---------- חלון אישור ---------- */

.overlay {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--scrim);
}
.dialog {
  width: 100%; max-width: 440px; background: var(--paper); color: var(--ink);
  border-radius: var(--r-lg); padding: 26px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-lg);
}
.dialog p { font-weight: 600; font-size: 1.05rem; }
.dialog { max-height: 100%; overflow-y: auto; }
.dialog:focus { outline: none; }

/* ---------- מבצע ההשקה ---------- */

.launch-bar { background: var(--tchelet); border-bottom: 1px solid var(--tchelet-2); }
.launch-in { display: flex; align-items: center; gap: 10px; padding-block: 10px; font-size: 0.95rem; }
.launch-in .ico { width: 20px; height: 20px; color: var(--flag); }
.launch-in p { flex: 1; min-width: 0; }
.launch-in strong { color: var(--flag); font-family: var(--display); font-weight: 700; }
.launch-in a { font-weight: 700; white-space: nowrap; }

.launch-pill {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 999px; background: var(--on-flag-soft); color: var(--on-flag);
  font-family: var(--display); font-weight: 600; font-size: 0.9rem;
}
.launch-pill .ico { width: 16px; height: 16px; }
.launch-pill.on-paper { background: var(--tchelet); color: var(--flag); }
.plans-wrap { display: flex; flex-direction: column; gap: 14px; }
.plans .plan { position: relative; }
.plan .badge.soon { background: var(--ink); }

/* ---------- התחברות עם Google ---------- */

.oauth { display: flex; flex-direction: column; gap: 10px; }
.oauth-btn .ico { width: 20px; height: 20px; }
.oauth-btn.google { border-color: var(--line); color: var(--ink); background: var(--paper); }
.oauth-btn.google:hover { border-color: var(--flag); background: var(--paper); }
.oauth .fine { text-align: center; }
.or-line { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.9rem; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.save-dialog { gap: 14px; }
.save-dialog .ico-box { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--tchelet); color: var(--flag); }
.save-dialog h2 { font-size: 1.35rem; }
.save-dialog p { font-weight: 400; font-size: 1rem; color: var(--muted); }
.save-dialog .actions .btn { flex: 1; }
.save-dialog .or-line { font-size: 0.86rem; }

/* ---------- ההתקדמות שלי ---------- */

.note-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; color: var(--muted); font-size: 0.95rem; }
.note-line .ico { width: 20px; height: 20px; color: var(--flag); }
.note-line a { font-weight: 700; }
.empty-stats { align-items: flex-start; }
.empty-stats .ico-box, .reco .ico-box {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: var(--tchelet); color: var(--flag);
}
.empty-stats .ico-box { background: var(--paper); }

.recos { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.reco {
  display: flex; gap: 14px; padding: 20px; border-radius: var(--r); background: var(--paper);
  border: 1px solid var(--line); border-inline-start: 5px solid var(--flag);
}
.reco-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.reco h3 { font-size: 1.08rem; }
.reco p { color: var(--muted); }
.reco .actions { margin-top: 4px; }
.reco.weak { border-inline-start-color: var(--bad); }
.reco.weak .ico-box { background: var(--bad-bg); color: var(--bad); }
.reco.mid { border-inline-start-color: var(--warn); }
.reco.mid .ico-box { background: var(--warn-bg); color: var(--warn); }
.reco.strong { border-inline-start-color: var(--ok); }
.reco.strong .ico-box { background: var(--ok-bg); color: var(--ok); }
.topics { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.topics .chip { text-decoration: none; white-space: normal; }
.topics .chip:hover { border-color: var(--flag); color: var(--flag); }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.88rem; }
.gstats { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.gstat {
  display: grid; align-items: center; gap: 4px 14px; padding: 12px 16px;
  grid-template-columns: auto minmax(0, 1.5fr) minmax(90px, 1fr) 3.4em 7.5em;
  grid-template-areas: "ico name bar pct lv";
  color: var(--ink); text-decoration: none; border-top: 1px solid var(--line);
}
.gstat:first-child { border-top: 0; }
.gstat:hover { background: var(--tchelet); }
.gstat .gate-ico { grid-area: ico; grid-row: auto; width: 42px; height: 42px; border-radius: 12px; }
.gstat .gate-ico .ico { width: 22px; height: 22px; }
.gstat-name { grid-area: name; display: flex; flex-direction: column; min-width: 0; }
.gstat-name strong { font-family: var(--display); font-weight: 600; line-height: 1.3; }
.gstat-name .muted { font-size: 0.85rem; }
.gstat-bar { grid-area: bar; }
.gstat .bar { height: 10px; border-radius: 5px; }
.gstat .bar span { border-radius: 5px; }
.gstat-pct { grid-area: pct; font-family: var(--display); font-weight: 700; font-size: 1.05rem; text-align: end; }
.gstat .chip.lv { grid-area: lv; justify-self: start; }
.chip.lv { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.lv-strong .bar span { background: var(--ok); }
.lv-strong .chip.lv, .chip.lv.lv-strong { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.lv-mid .bar span { background: var(--warn); }
.lv-mid .chip.lv, .chip.lv.lv-mid { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.lv-weak .bar span { background: var(--bad); }
.lv-weak .chip.lv, .chip.lv.lv-weak { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.lv-weak .gstat-pct { color: var(--bad); }
.lv-none .gstat-pct, .lv-few .gstat-pct { color: var(--muted); }
@media (max-width: 640px) {
  .gstat { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ico name pct" "ico bar lv"; padding: 12px; gap: 6px 12px; }
}

.exam-chart {
  --h: 150px; list-style: none; margin: 0; padding: 22px 0 0; position: relative;
  display: flex; align-items: flex-end; gap: 6px; overflow-x: auto;
}
/* קו סף המעבר */
.exam-chart::before {
  content: ""; position: absolute; inset-inline: 0; bottom: calc(28px + var(--h) * var(--pass) / 100);
  border-top: 2px dashed var(--muted); opacity: 0.4; pointer-events: none;
}
.exam-chart li { flex: 1 1 0; min-width: 24px; max-width: 64px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.exam-chart .col { width: 100%; height: var(--h); display: flex; flex-direction: column-reverse; align-items: stretch; gap: 4px; }
.exam-chart .fill { border-radius: 8px 8px 3px 3px; background: var(--ok); }
.exam-chart .bad .fill { background: var(--bad); }
.exam-chart .col b { text-align: center; font-family: var(--display); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.exam-chart .when { height: 22px; font-size: 0.72rem; color: var(--muted); white-space: nowrap; }

/* ---------- טקסט חופשי ---------- */

.prose { display: flex; flex-direction: column; gap: 12px; max-width: 74ch; }
.prose h2 { margin-top: 12px; font-size: 1.2rem; }
.prose ul { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- סרגל התצוגה המקדימה (רק כשאין שרת) ---------- */

.preview-bar {
  position: fixed; z-index: 25; inset-inline: 0; bottom: 0;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--ink); color: var(--paper); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; font-size: 0.92rem;
}
.preview-bar .seg { background: rgba(255, 255, 255, 0.12); align-self: center; }
.preview-bar .seg label span { color: var(--on-flag-dim); }
.preview-bar .seg input:checked + span { background: var(--paper); color: var(--ink); }
body.has-preview { padding-bottom: 64px; }

/* ---------- תחתית ---------- */

.foot { border-top: 1px solid var(--line); padding-block: 26px 32px; font-size: 0.9rem; color: var(--muted); background: var(--paper); }
.foot-in { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; justify-content: space-between; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { color: var(--muted); text-decoration: none; font-weight: 600; }
.foot-links a:hover { color: var(--flag); }
.foot-in p { max-width: 60ch; }
.foot-legal { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.foot-legal p { flex: 1 1 320px; min-width: 0; max-width: none; font-size: 0.86rem; }
.foot-cancel {
  flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 6px 16px; border-radius: 999px;
  border: 1.5px solid var(--ink); color: var(--ink); font-weight: 700; text-decoration: none;
}
.foot-cancel:hover { background: var(--ink); color: var(--paper); }
.cancel-ways { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }
.field textarea { min-height: 110px; }

@media (max-width: 520px) {
  main.wrap { padding-block: 20px 48px; gap: 26px; }
  .qcard { padding: 18px; }
  .qtext { font-size: 1.16rem; }
  .panel { padding: 18px; }
  .auth-card { padding: 22px; }
  .exam-nav { grid-template-columns: 1fr 1fr; }
  .exam-nav .flag-btn { grid-column: 1 / -1; order: 3; }
  .exam-bar { border-radius: var(--r); }
}

@media (prefers-reduced-motion: no-preference) {
  .opt, .btn, .entry, .gate, .gate-ico, .cell, .seg > *, .plan { transition: border-color 0.15s, background-color 0.15s, color 0.15s, box-shadow 0.2s, transform 0.2s; }
  .entry:hover, .gate:hover { transform: translateY(-2px); }
}

/* ---------- תפריט נגישות ---------- */

.a11y {
  position: fixed; z-index: 40; inset-inline-end: max(14px, env(safe-area-inset-left, 0px));
  bottom: calc(14px + env(safe-area-inset-bottom, 0px) + var(--preview-h, 0px));
}
.a11y-btn {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0;
  background: var(--flag); color: var(--on-flag); border: 2px solid var(--paper); box-shadow: var(--shadow-lg);
}
.a11y-btn:hover { background: var(--flag-deep); }
.a11y-btn .ico { width: 30px; height: 30px; }
.a11y-panel {
  position: absolute; bottom: 64px; inset-inline-end: 0; width: min(330px, calc(100vw - 28px));
  max-height: calc(100vh - 140px - var(--preview-h, 0px)); overflow: auto;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg);
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.a11y-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.a11y-head h2 { font-size: 1.15rem; }
.a11y-close { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; padding: 0; }
.a11y-close .ico { width: 20px; height: 20px; }
.a11y-label { font-weight: 700; font-size: 0.92rem; }
.a11y-sizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.a11y-opt, .a11y-size {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px;
  padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer; text-align: start;
}
.a11y-size { justify-content: center; }
.a11y-size { padding-inline: 6px; white-space: nowrap; }
.a11y-size:nth-child(2) { font-size: 1.06em; }
.a11y-size:nth-child(3) { font-size: 1.12em; }
.a11y-opt[aria-pressed="true"], .a11y-size[aria-pressed="true"] { border-color: var(--flag); background: var(--tchelet); color: var(--flag); }
.a11y-opt .mark { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; }
.a11y-opt[aria-pressed="true"] .mark { background: var(--flag); border-color: var(--flag); color: var(--on-flag); }
.a11y-opt .mark .ico { width: 16px; height: 16px; }
.a11y-foot { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; font-size: 0.92rem; }
.a11y-foot a { color: var(--flag); font-weight: 600; }

/* ההתאמות עצמן: מחלקות על <html> */
html.a11y-t1 { font-size: 112.5%; }
html.a11y-t1 body { font-size: 19px; }
html.a11y-t2 { font-size: 125%; }
html.a11y-t2 body { font-size: 21px; }
:root.a11y-contrast {
  --ink: #000000; --muted: #1c1c1c; --line: #4a4a4a; --flag: #00228f; --flag-deep: #00186a; --flag-bright: #00186a;
  --tchelet: #ffffff; --tchelet-2: #c4d2f2; --ok: #005722; --ok-bg: #ffffff; --bad: #8a0d0d; --bad-bg: #ffffff;
  --warn: #5a3600; --warn-bg: #ffffff; --on-flag-dim: #ffffff;
}
:root.a11y-contrast .chip, :root.a11y-contrast .opt, :root.a11y-contrast .sort-item, :root.a11y-contrast .panel, :root.a11y-contrast .sample { border-color: var(--ink); }
:root.a11y-font { --display: Arial, "Helvetica Neue", sans-serif; --body: Arial, "Helvetica Neue", sans-serif; --text-serif: Arial, "Helvetica Neue", sans-serif; }
.a11y-spacing body * { line-height: 1.8 !important; letter-spacing: 0.03em !important; word-spacing: 0.12em !important; }
.a11y-links a:not(.btn):not(.a11y-btn) { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px; font-weight: 700; }
.a11y-links .btn, .a11y-links .foot-cancel { outline: 2px solid var(--ink); outline-offset: 2px; }
.a11y-motion *, .a11y-motion *::before, .a11y-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* זמן המבחן */
.time-pick { display: flex; flex-direction: column; gap: 8px; }
.time-pick legend { font-weight: 700; padding: 0; margin-bottom: 4px; }
.time-pick { border: 0; padding: 0; margin: 0; }

