/* ==========================================================================
   בחינון — Design System · "לוח ומחברת"
   קלף/דיו · אמרלד מלומד · זהב מדוד · Frank Ruhl Libre + Assistant · RTL
   ========================================================================== */

:root {
    /* — קנבס ומשטחים (קלף) — */
    --canvas:        #F5F0E4;
    --canvas-2:      #EFE8D8;
    --surface:       #FEFCF6;
    --surface-2:     #FBF7EE;

    /* — דיו (טקסט/כותרות) — */
    --ink:           #1E2A44;
    --ink-2:         #3C4763;
    --ink-soft:      #5C6479;
    --muted:         #8B8471;

    /* — קווים וגבולות (שורות מחברת) — */
    --line:          #E5DDC9;
    --line-strong:   #D8CDB2;
    --rule:          rgba(30, 42, 68, 0.05);

    /* — אקצנטים — */
    --emerald:       #2E6E4E;
    --emerald-700:   #255C41;
    --emerald-tint:  #E7EFE9;
    --gold:          #A9813B;
    --gold-tint:     #F1E9D6;
    --danger:        #A6462F;
    --danger-tint:   #F3E2DB;

    /* — טיפוגרפיה — */
    --font-display:  "Frank Ruhl Libre", "Times New Roman", serif;
    --font-ui:       "Assistant", system-ui, "Segoe UI", sans-serif;

    /* — צללים חמים — */
    --shadow-sm:  0 1px 2px rgba(30, 42, 68, 0.06);
    --shadow-md:  0 4px 16px rgba(30, 42, 68, 0.08);
    --shadow-lg:  0 18px 48px rgba(30, 42, 68, 0.14);

    --radius:     14px;
    --radius-sm:  9px;
    --sidebar-w:  252px;
    --ring:       0 0 0 3px rgba(46, 110, 78, 0.28);
}

@media (prefers-color-scheme: dark) {
    :root {
        --canvas:      #12161D;
        --canvas-2:    #171C25;
        --surface:     #1B212C;
        --surface-2:   #202836;
        --ink:         #ECE4D2;
        --ink-2:       #C6CBD6;
        --ink-soft:    #9BA3B4;
        --muted:       #7E8698;
        --line:        #2A3342;
        --line-strong: #384253;
        --rule:        rgba(236, 228, 210, 0.05);
        --emerald:     #5FB487;
        --emerald-700: #74C199;
        --emerald-tint: #1C2E27;
        --gold:        #CDA96A;
        --gold-tint:   #2B2617;
        --danger:      #E08a72;
        --danger-tint: #33211C;
        --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md:  0 4px 16px rgba(0, 0, 0, 0.36);
        --shadow-lg:  0 18px 48px rgba(0, 0, 0, 0.5);
        --ring:       0 0 0 3px rgba(95, 180, 135, 0.35);
    }
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }

.brand-mark { object-fit: contain; display: block; flex: none; }
/* על רקע כהה (sidebars/footer) — שבב לבן עדין כדי שהלוגו יישאר קריא */
.sidebar .brand-mark, .site-footer .brand-mark { background: #fff; border-radius: 9px; padding: 4px; }

html {
    font-size: 17px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: clip;
}
body { overflow-x: clip; }

body {
    margin: 0;
    font-family: var(--font-ui);
    font-weight: 500;
    line-height: 1.55;
    color: var(--ink);
    background-color: var(--canvas);
    /* מרקם שורות-מחברת עדין ביותר */
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 37px,
        var(--rule) 37px,
        var(--rule) 38px
    );
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--ink);
    line-height: 1.2;
    margin: 0 0 .4em;
    font-weight: 700;
}

a { color: var(--emerald-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* — נגישות: focus ברור לכל אלמנט אינטראקטיבי — */
:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: 6px;
}

/* ==========================================================================
   Shell מחובר — לוח (sidebar) + תוכן
   ========================================================================== */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

/* — לוח / sidebar (דיו כהה) — בעמודה 1 = inline-start = ימין ב-RTL — */
.sidebar {
    grid-column: 1;
    grid-row: 1;
    background: linear-gradient(180deg, #202D49 0%, #1A2540 100%);
    color: #D9DEEA;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: sticky;
    top: 0;
    height: 100vh;
    border-inline-start: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 6px 8px 20px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar__mark {
    width: 40px; height: 40px;
    border-radius: 11px;
    background: var(--emerald);
    color: #fff;
    display: grid; place-items: center;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 22px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.sidebar__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.35rem;
    color: #fff;
    letter-spacing: .2px;
}
.sidebar__tag { font-size: .72rem; color: #97A0B7; margin-top: -2px; }

.nav__label {
    font-size: .7rem;
    letter-spacing: .12em;
    color: #7E88A2;
    padding: 14px 10px 6px;
    text-transform: none;
}
.nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: #CDD3E1;
    font-weight: 600;
    min-height: 44px;
    transition: background .15s ease, color .15s ease;
    border-inline-start: 3px solid transparent;
}
.nav__item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; text-decoration: none; }
.nav__item.is-active {
    background: rgba(46, 110, 78, 0.22);
    color: #fff;
    border-inline-start-color: var(--emerald);
}
.nav__item svg { width: 20px; height: 20px; flex: none; opacity: .9; }
.nav__spacer { flex: 1; }

.sidebar__user {
    display: flex; align-items: center; gap: 11px;
    padding: 12px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 8px;
}
.sidebar__avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--gold); color: #2A2410;
    display: grid; place-items: center;
    font-weight: 700; font-family: var(--font-display);
}
.sidebar__user-name { font-weight: 600; color: #fff; font-size: .92rem; }
.sidebar__user-role { font-size: .74rem; color: #97A0B7; }

/* — אזור התוכן — בעמודה 2 = inline-end = שמאל ב-RTL, באותה שורה כמו הלוח — */
.main {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 34px;
    background: color-mix(in srgb, var(--canvas) 82%, transparent);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
}
.topbar__title { font-size: 1.5rem; margin: 0; }
.topbar__crumb { font-size: .8rem; color: var(--muted); }
.topbar__actions { display: flex; align-items: center; gap: 10px; }

.content { padding: 30px 34px 56px; max-width: 1180px; width: 100%; }

/* — שורת מבחן בדשבורד — */
.dash-exam {
    display: flex; align-items: center; gap: 14px;
    padding: 13px 2px;
    border-bottom: 1px solid var(--line);
}
.dash-exam:last-child { border-bottom: none; padding-bottom: 2px; }
.dash-exam a.cell-strong:hover { color: var(--emerald-700); text-decoration: none; }

/* — חלון צף (modal) — נסגר רק בכפתור/X (לא ב-Esc/רקע) — */
dialog.modal {
    border: none; border-radius: var(--radius); padding: 0;
    width: min(580px, 94vw); max-height: 90vh; overflow: hidden;
    background: var(--surface); color: var(--ink);
    box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(15, 20, 30, .55); backdrop-filter: blur(2px); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.modal__head h2 { margin: 0; font-size: 1.3rem; }
.modal__close { width: 36px; height: 36px; border: none; background: transparent; cursor: pointer; color: var(--muted); border-radius: 8px; display: grid; place-items: center; }
.modal__close:hover { background: var(--canvas-2); color: var(--ink); }
.modal__body { padding: 20px 22px; overflow-y: auto; max-height: calc(90vh - 132px); }
.modal__foot { display: flex; gap: 10px; justify-content: flex-end; padding: 15px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }

/* — בחירת-קובץ יפה — */
.filepick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filepick > input[type="file"] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.filepick__btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 20px; border-radius: var(--radius-sm);
    background: linear-gradient(180deg, var(--emerald) 0%, var(--emerald-700) 100%);
    color: #fff; font-weight: 600; font-family: var(--font-ui); cursor: pointer;
    border: 1px solid rgba(0,0,0,.08); box-shadow: var(--shadow-sm); transition: filter .15s ease;
}
.filepick__btn:hover { filter: brightness(1.06); }
.filepick__btn svg { width: 18px; height: 18px; }
.filepick__name { color: var(--muted); font-size: .9rem; }
.filepick input:focus-visible + .filepick__btn { box-shadow: var(--ring); }

.menu-btn {
    display: none;
    width: 44px; height: 44px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    border-radius: var(--radius-sm);
    color: var(--ink);
    cursor: pointer;
}

/* ==========================================================================
   רכיבים
   ========================================================================== */

/* — כרטיס = דף מחברת עם שוליים צבעוניים — */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    position: relative;
    overflow: hidden;
}
.card--ruled::before {
    content: "";
    position: absolute; inset: 0;
    background-image: repeating-linear-gradient(
        to bottom, transparent 0, transparent 33px, var(--rule) 33px, var(--rule) 34px);
    pointer-events: none; opacity: .6;
}
.card__accent { border-inline-start: 4px solid var(--emerald); }
.card__accent--gold { border-inline-start: 4px solid var(--gold); }

/* — שורת סטטיסטיקה — */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    display: flex; align-items: center; gap: 16px;
    position: relative;
}
.stat__icon {
    width: 46px; height: 46px; border-radius: 12px;
    display: grid; place-items: center; flex: none;
    background: var(--emerald-tint); color: var(--emerald-700);
}
.stat__icon svg { width: 24px; height: 24px; }
.stat__icon--gold { background: var(--gold-tint); color: var(--gold); }
.stat__num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1; color: var(--ink); }
.stat__label { font-size: .88rem; color: var(--ink-soft); margin-top: 3px; }

/* — כותרת סעיף — */
.section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px; margin: 6px 0 16px;
}
.section-head h2 { font-size: 1.35rem; margin: 0; }
.section-head::after { /* קו-דיו דקורטיבי */
    content: ""; flex: 1; height: 1px;
    background: linear-gradient(to left, transparent, var(--line-strong));
    align-self: center;
}

/* — כפתורים — */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font-ui); font-weight: 700; font-size: 1rem;
    min-height: 46px; padding: 0 22px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 19px; height: 19px; }
.btn--primary { background: var(--emerald); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--emerald-700); text-decoration: none; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface-2); text-decoration: none; }
.btn--block { width: 100%; }
.btn--lg { min-height: 52px; font-size: 1.06rem; }

/* — טפסים — */
.field { margin-bottom: 18px; }
.label { display: block; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; font-size: .95rem; }
.input {
    width: 100%;
    font-family: var(--font-ui); font-size: 1.05rem; font-weight: 500;
    color: var(--ink);
    background: var(--surface);
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 13px 15px;
    min-height: 50px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--emerald); box-shadow: var(--ring); }

/* — Badges — */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .78rem; font-weight: 700;
    padding: 4px 11px; border-radius: 999px;
}
.badge--trial { background: var(--gold-tint); color: var(--gold); }
.badge--live  { background: var(--emerald-tint); color: var(--emerald-700); }

/* — Flash — */
.flash {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 16px; border-radius: var(--radius-sm);
    margin-bottom: 18px; font-weight: 600;
    border: 1px solid transparent;
}
.flash svg { width: 20px; height: 20px; flex: none; }
.flash--error   { background: var(--danger-tint); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.flash--success { background: var(--emerald-tint); color: var(--emerald-700); border-color: color-mix(in srgb, var(--emerald) 26%, transparent); }

/* — Empty state — */
.empty {
    text-align: center; padding: 46px 24px; color: var(--ink-soft);
}
.empty__icon {
    width: 64px; height: 64px; margin: 0 auto 16px;
    border-radius: 18px; background: var(--emerald-tint); color: var(--emerald-700);
    display: grid; place-items: center;
}
.empty__icon svg { width: 32px; height: 32px; }
.empty h3 { font-size: 1.3rem; }
.empty p { max-width: 42ch; margin: 0 auto 20px; }

/* ==========================================================================
   מסך התחברות (auth)
   ========================================================================== */
.auth {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: 24px;
    background:
        radial-gradient(1100px 620px at 88% -8%, color-mix(in srgb, var(--emerald) 12%, transparent), transparent 60%),
        var(--canvas);
}
.auth__sheet {
    width: 100%; max-width: 428px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 40px 38px;
    position: relative;
    overflow: hidden;
}
.auth__sheet::before { /* שוליי-מחברת בצד ההתחלה */
    content: ""; position: absolute; inset-block: 0; inset-inline-start: 0;
    width: 5px; background: linear-gradient(var(--emerald), var(--gold));
}
.auth__brand { text-align: center; margin-bottom: 26px; }
.auth__mark {
    width: 60px; height: 60px; margin: 0 auto 14px;
    border-radius: 16px; background: var(--emerald); color: #fff;
    display: grid; place-items: center;
    font-family: var(--font-display); font-weight: 900; font-size: 32px;
    box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(255,255,255,.2);
}
.auth__title { font-size: 2rem; margin: 0; }
.auth__tag { color: var(--muted); font-size: .95rem; margin-top: 2px; }
.auth__foot { text-align: center; margin-top: 22px; font-size: .82rem; color: var(--muted); }

/* ==========================================================================
   אנימציית טעינה מדודה
   ========================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
.rise-1 { animation-delay: .04s; } .rise-2 { animation-delay: .1s; }
.rise-3 { animation-delay: .16s; } .rise-4 { animation-delay: .22s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
    /* לא לסמוך על סיום האנימציה — תמיד לוודא נראוּת מלאה (delay+fill עלול להשאיר opacity:0) */
    .rise { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* ==========================================================================
   רספונסיביות
   ========================================================================== */
/* ==========================================================================
   רספונסיביות — מחשב גדול · לפטופ · טאבלט · סמארטפון
   ========================================================================== */

/* מסכים גדולים מאוד — תוכן רחב ונוח יותר */
@media (min-width: 1600px) {
    .content { max-width: 1320px; }
    html { font-size: 17.5px; }
}

/* טאבלט ולפטופ קטן — ה-sidebar הופך למגירה נשלפת + backdrop */
@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    /* התוכן תופס את העמודה היחידה (הלוח הופך למגירה fixed) — בלי עמודת-רפאים ריקה */
    .main { grid-column: 1; }
    .sidebar {
        position: fixed; inset-block: 0; inset-inline-start: 0;
        transform: translateX(100%); transition: transform .22s ease;
        z-index: 60; width: min(86vw, 300px);
    }
    :root[data-nav="open"] .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    :root[data-nav="open"] body::after {
        content: ""; position: fixed; inset: 0; background: rgba(15, 20, 30, .45); z-index: 55;
    }
    .menu-btn { display: grid; place-items: center; }
    .content { padding: 24px 20px 48px; }
    .topbar { padding: 15px 20px; }
}

/* סמארטפון */
@media (max-width: 640px) {
    html { font-size: 16px; }
    .content { padding: 18px 14px 40px; }
    .topbar { padding: 13px 14px; gap: 10px; }
    .topbar__title { font-size: 1.2rem; }
    .card { padding: 18px 16px; }
    .form-grid { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat { padding: 15px 16px; gap: 12px; }
    .stat__icon { width: 40px; height: 40px; }
    .stat__num { font-size: 1.6rem; }
    /* יעדי-מגע גדולים יותר */
    .btn { min-height: 48px; }
    .icon-btn { width: 42px; height: 42px; }
    .input, .select { min-height: 48px; }
    table.data thead th, table.data tbody td { padding: 11px 12px; }
    .toolbar { gap: 12px; }
    .search input { min-width: 0; width: 100%; }
    .search { flex: 1; }
    .form-actions { flex-wrap: wrap; }
    .form-actions .btn { flex: 1; min-width: 130px; }
    /* אתר תדמית */
    .hero__cta { flex-direction: column; align-items: stretch; }
    .hero__cta .btn { width: 100%; }
    .site-nav { padding: 12px 16px; }
    .site-nav__brand b { font-size: 1.2rem; }
}

/* סמארטפון קטן */
@media (max-width: 400px) {
    .stat-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.85rem; }
    .auth__sheet { padding: 30px 22px; }
    .site-nav__cta .btn { padding: 0 14px; }
}

.util-muted { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.util-mt { margin-top: 22px; }
.util-mb { margin-bottom: 18px; }

/* ==========================================================================
   Toolbar · טבלאות · טפסים (CRUD)
   ========================================================================== */
.toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap; margin-bottom: 20px;
}
.toolbar__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.search {
    position: relative; display: inline-flex; align-items: center;
}
.search input {
    font-family: var(--font-ui); font-size: 1rem; color: var(--ink);
    background: var(--surface); border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-sm); padding: 10px 14px; min-height: 44px; min-width: 240px;
}
.search input:focus { outline: none; border-color: var(--emerald); box-shadow: var(--ring); }

.btn--sm { min-height: 38px; padding: 0 15px; font-size: .92rem; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(.94); text-decoration: none; }

.table-wrap {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
table.data { width: 100%; border-collapse: collapse; font-size: .98rem; }
table.data thead th {
    text-align: start; font-family: var(--font-ui); font-weight: 700;
    color: var(--ink-soft); font-size: .82rem; letter-spacing: .01em;
    padding: 14px 18px; border-bottom: 2px solid var(--line-strong);
    white-space: nowrap; background: var(--surface-2);
}
table.data tbody td { padding: 13px 18px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: color-mix(in srgb, var(--emerald) 5%, transparent); }
table.data .num { font-variant-numeric: tabular-nums; }
.cell-strong { color: var(--ink); font-weight: 600; }

.row-actions { display: inline-flex; gap: 4px; }
.icon-btn {
    width: 38px; height: 38px; border-radius: 9px;
    border: 1px solid var(--line); background: var(--surface);
    color: var(--ink-soft); display: inline-grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { border-color: var(--emerald); color: var(--emerald-700); text-decoration: none; }
.icon-btn--danger:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn svg { width: 18px; height: 18px; }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.chip--active { background: var(--emerald-tint); color: var(--emerald-700); }
.chip--archived { background: var(--canvas-2); color: var(--muted); }
.chip--scheduled { background: var(--gold-tint); color: var(--gold); }
.chip--neutral { background: var(--canvas-2); color: var(--ink-soft); }
.chip--danger { background: var(--danger-tint); color: var(--danger); }

/* טפסים */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 22px; }
.form-grid .field--full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.select {
    width: 100%; font-family: var(--font-ui); font-size: 1.05rem; color: var(--ink);
    background: var(--surface); border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-sm); padding: 13px 15px; min-height: 50px; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235C6479' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: left 14px center;
}
.select:focus { outline: none; border-color: var(--emerald); box-shadow: var(--ring); }
.field-error { color: var(--danger); font-size: .85rem; margin-top: 5px; font-weight: 600; }
.input.has-error, .select.has-error { border-color: var(--danger); }

.hint { color: var(--muted); font-size: .86rem; margin-top: 5px; }
.field__err { color: var(--danger); font-size: .84rem; margin-top: 5px; }

/* — הרחבת מספרי-טלפון נוספים בטבלת התלמידים — */
.phones-toggle { transition: background .15s ease, color .15s ease; }
.phones-toggle.is-open { background: var(--emerald-tint); color: var(--emerald-700); }
.phones-list { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.phones-list span { font-size: .82rem; color: var(--ink-2); }

/* — בונה-שאלות קומפקטי — */
.ans-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ans-row:last-child { border-bottom: none; }
.ans-row__correct { flex: none; width: 46px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; font-size: .68rem; color: var(--muted); padding-top: 8px; }
.ans-row__correct input { width: 18px; height: 18px; accent-color: var(--emerald); }
.ans-row__main { flex: 1; min-width: 0; }
.audio-bar { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.audio-bar--sm { margin-top: 6px; }
.filepick__btn--sm { padding: 7px 13px; font-size: .84rem; box-shadow: none; }
.filepick__btn--sm svg { width: 15px; height: 15px; }
.audio-rec.is-recording { color: #fff; background: var(--danger); border-color: var(--danger); animation: recpulse 1s ease-in-out infinite; }
@keyframes recpulse { 50% { opacity: .55; } }
.form-actions { display: flex; gap: 10px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }

.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.check input { width: 20px; height: 20px; accent-color: var(--emerald); }

/* ==========================================================================
   אתר תדמית (Marketing)
   ========================================================================== */
.site-nav {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px clamp(18px, 5vw, 60px);
    background: color-mix(in srgb, var(--canvas) 86%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.site-nav__brand { display: flex; align-items: center; gap: 11px; }
.site-nav__brand .sidebar__mark { width: 38px; height: 38px; font-size: 21px; border-radius: 10px; }
.site-nav__brand b { font-family: var(--font-display); font-size: 1.4rem; color: var(--ink); }
.site-nav__cta { display: flex; align-items: center; gap: 10px; }

.hero {
    text-align: center;
    padding: clamp(50px, 9vw, 110px) clamp(18px, 5vw, 40px) clamp(40px, 7vw, 80px);
    background:
        radial-gradient(900px 460px at 50% -10%, color-mix(in srgb, var(--emerald) 13%, transparent), transparent 62%),
        repeating-linear-gradient(to bottom, transparent 0, transparent 37px, var(--rule) 37px, var(--rule) 38px);
}
.hero__badge {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--surface); border: 1px solid var(--line-strong);
    padding: 6px 14px; border-radius: 999px; font-size: .82rem; font-weight: 600; color: var(--emerald-700);
    margin-bottom: 22px;
}
.hero h1 {
    font-size: clamp(2.1rem, 5.5vw, 3.6rem); line-height: 1.12; margin: 0 auto .3em;
    max-width: 16ch; letter-spacing: -.5px;
}
.hero p.lead { font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: var(--ink-soft); max-width: 52ch; margin: 0 auto 30px; }
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero__note { margin-top: 16px; font-size: .85rem; color: var(--muted); }

.section { max-width: 1100px; margin: 0 auto; padding: clamp(46px, 8vw, 84px) clamp(18px, 5vw, 40px); }
.section--tint { background: var(--surface); border-block: 1px solid var(--line); max-width: none; }
.section__head { text-align: center; margin-bottom: clamp(30px, 5vw, 52px); }
.section__head h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); margin: 0 0 .3em; }
.section__head p { color: var(--ink-soft); max-width: 46ch; margin: 0 auto; font-size: 1.05rem; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.feature {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 28px 24px; box-shadow: var(--shadow-sm); border-inline-start: 4px solid var(--emerald);
}
.feature__icon { width: 50px; height: 50px; border-radius: 13px; background: var(--emerald-tint); color: var(--emerald-700); display: grid; place-items: center; margin-bottom: 16px; }
.feature__icon svg { width: 26px; height: 26px; }
.feature h3 { font-size: 1.25rem; margin: 0 0 .35em; }
.feature p { color: var(--ink-soft); margin: 0; font-size: .96rem; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 26px; counter-reset: step; }
.step { text-align: center; }
.step__num {
    width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%;
    background: var(--ink); color: var(--canvas); display: grid; place-items: center;
    font-family: var(--font-display); font-weight: 700; font-size: 1.5rem;
}
.step h3 { font-size: 1.2rem; margin: 0 0 .3em; }
.step p { color: var(--ink-soft); margin: 0; font-size: .95rem; }

.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; align-items: stretch; }
.price-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 28px 24px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
}
.price-card--featured { border: 2px solid var(--emerald); box-shadow: var(--shadow-md); position: relative; }
.price-card--featured::before {
    content: "הכי פופולרי"; position: absolute; top: -12px; inset-inline-start: 50%; transform: translateX(50%);
    background: var(--emerald); color: #fff; font-size: .74rem; font-weight: 700; padding: 4px 14px; border-radius: 999px;
}
.price-card h3 { font-size: 1.35rem; margin: 0 0 6px; }
.price-card .price { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; color: var(--ink); }
.price-card .price small { font-size: .95rem; color: var(--muted); font-family: var(--font-ui); font-weight: 500; }
.price-card ul { list-style: none; margin: 18px 0; padding: 0; flex: 1; }
.price-card li { padding: 7px 0; color: var(--ink-2); display: flex; align-items: flex-start; gap: 9px; font-size: .94rem; }
.price-card li svg { width: 18px; height: 18px; color: var(--emerald); flex: none; margin-top: 2px; }

.site-footer { background: var(--ink); color: #B7BECE; text-align: center; padding: 40px 20px; }
.site-footer .sidebar__mark { margin: 0 auto 14px; }
.site-footer a { color: #D9DEEA; }

/* רשימת יכולות מפורטת */
.caps { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 22px; }
.cap {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow-sm); border-inline-start: 4px solid var(--emerald);
}
.cap h3 { font-size: 1.2rem; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.cap h3 .cap__ic { width: 38px; height: 38px; border-radius: 10px; background: var(--emerald-tint); color: var(--emerald-700); display: grid; place-items: center; flex: none; }
.cap h3 .cap__ic svg { width: 21px; height: 21px; }
.cap ul { list-style: none; margin: 0; padding: 0; }
.cap li { display: flex; gap: 9px; padding: 6px 0; color: var(--ink-2); font-size: .95rem; align-items: flex-start; }
.cap li svg { width: 17px; height: 17px; color: var(--emerald); flex: none; margin-top: 3px; }

/* ==========================================================================
   ספינר טעינה (כפתורים) + מצב-הצלחה של רשימת-המתנה
   ========================================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .6s linear infinite; vertical-align: -.15em; margin-inline-end: .4em; }
.btn.is-loading { pointer-events: none; opacity: .92; }

.nav__badge { margin-inline-start: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: #241E10; font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }

.wl-done { text-align: center; padding: 8px 0 4px; }
.wl-done__mark { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--emerald-tint); color: var(--emerald-700); }
.wl-done__mark svg { width: 30px; height: 30px; }
.wl-done__title { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; color: var(--ink); margin: 0 0 6px; line-height: 1.5; }

/* ==========================================================================
   דף נחיתה — צילומי-מסך של המוצר (מסגרת דפדפן + גלריה)
   ========================================================================== */
.hero-shot { max-width: 1040px; margin: 6px auto 0; padding: 0 20px; }
.hero-frame { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line-strong); background: #fff; }
.hero-frame > img { display: block; width: 100%; height: auto; }

.showcase { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.shot { margin: 0; text-align: center; }
.shot__frame { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); border: 1px solid var(--line-strong); background: #fff; aspect-ratio: 4 / 3; }
.shot__frame img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.shot figcaption { margin-top: 13px; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--ink); }
@media (max-width: 820px) { .showcase { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; } }

/* ==========================================================================
   דף בקשת-הצטרפות (רשימת המתנה) — טופס-מסננת רחב יותר
   ========================================================================== */
.auth__sheet:has(.wl-split) { max-width: 1000px; padding: 34px 36px; }
.auth__sheet:has(.wl-thanks) { max-width: 460px; }
.wl-split { display: grid; grid-template-columns: 1.05fr 0.9fr; gap: 34px; align-items: start; }

.wl-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.wl-brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; color: var(--ink); }
.wl-pitch h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.5rem, 2.6vw, 1.95rem); line-height: 1.18; color: var(--ink); margin: 0 0 12px; }
.wl-pitch .lead { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.6; margin: 0 0 20px; }

.wl-side { background: var(--emerald-tint); border: 1px solid var(--line-strong); border-radius: 16px; padding: 26px 24px; }
.wl-side__head h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.28rem; color: var(--ink); margin: 0 0 3px; }
.wl-side__head p { font-size: .85rem; margin: 0 0 18px; }
.wl-side .auth__foot { margin-top: 14px; }

.req { color: var(--danger); font-weight: 700; }
.wl-values { list-style: none; margin: 2px 0 20px; padding: 0; display: grid; gap: 10px; }
.wl-values li { display: flex; align-items: flex-start; gap: 10px; font-size: .95rem; color: var(--ink-soft); }
.wl-values svg { width: 18px; height: 18px; color: var(--emerald); flex: none; margin-top: 2px; }
.wl-note { background: var(--gold-tint); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 13px 16px; margin: 20px 0 0; font-size: .88rem; line-height: 1.65; color: var(--ink-soft); }
.wl-note b { color: var(--ink); }
.wl-reassure { margin-top: 14px; text-align: center; font-size: .77rem; color: var(--muted); }
.wl-shot { margin: 0; }
.wl-shot img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); box-shadow: var(--shadow-md); }
.wl-shot figcaption { margin-top: 9px; text-align: center; font-size: .78rem; color: var(--muted); }

@media (max-width: 880px) {
    .auth__sheet:has(.wl-split) { max-width: 480px; padding: 30px 24px; }
    .wl-split { grid-template-columns: 1fr; gap: 24px; }
    .wl-pitch h1 { font-size: 1.5rem; }
}

/* ==========================================================================
   מרכז תובנות (דוח מבחן)
   ========================================================================== */
.insights { margin-bottom: 24px; }
.insights__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.insights__head h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; margin: 0; color: var(--ink); }
.insights__head span { font-size: .85rem; }
.ins-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.ins-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px 14px; text-align: center; box-shadow: var(--shadow-sm); }
.ins-kpi__num { font-family: var(--font-display); font-weight: 800; font-size: 1.75rem; color: var(--ink); line-height: 1; }
.ins-kpi__sub { font-size: 1rem; color: var(--muted); font-weight: 600; }
.ins-kpi__lbl { font-size: .78rem; color: var(--ink-soft); margin-top: 7px; }
.ins-good { color: var(--emerald) !important; }
.ins-warn { color: var(--gold) !important; }
.ins-charts { display: grid; grid-template-columns: 1.1fr 1fr .8fr; gap: 16px; margin-bottom: 16px; align-items: start; }
.ins-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.ins-card figcaption, .ins-concl figcaption { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--ink); margin: 0 0 12px; }
.ins-dist { width: 100%; height: auto; }
.ins-dist__val { font-size: 11px; font-weight: 700; fill: var(--ink); }
.ins-dist__lbl { font-size: 9.5px; fill: var(--muted); direction: ltr; }
.ins-axis { stroke: var(--line-strong); stroke-width: 1; }
.ins-perq { display: grid; gap: 7px; }
.ins-perq__row { display: flex; align-items: center; gap: 8px; }
.ins-perq__lbl { width: 34px; flex: none; font-size: .8rem; color: var(--ink-soft); }
.ins-perq__track { flex: 1; height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.ins-perq__fill { display: block; height: 100%; border-radius: 5px; }
.ins-perq__val { width: 40px; flex: none; text-align: end; font-size: .8rem; font-weight: 700; color: var(--ink); }
.ins-card--donut { display: flex; flex-direction: column; align-items: center; }
.ins-donut { width: 128px; height: 128px; }
.ins-donut__pct { font-family: var(--font-display); font-weight: 800; font-size: 20px; fill: var(--ink); }
.ins-donut__sub { font-size: 10px; fill: var(--muted); }
.ins-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ins-list li { background: var(--bg); border-inline-start: 3px solid var(--ac); border-radius: 8px; padding: 10px 14px; font-size: .9rem; color: var(--ink); line-height: 1.5; }
.ins-more { margin-top: 10px; }
.ins-more summary { cursor: pointer; color: var(--emerald-700); font-size: .86rem; font-weight: 600; list-style: none; }
.ins-more summary::-webkit-details-marker { display: none; }
.ins-more summary::before { content: "▸ "; }
.ins-more[open] summary::before { content: "▾ "; }
.ins-more .ins-list { margin-top: 10px; }
@media (max-width: 820px) { .ins-kpis { grid-template-columns: repeat(2, 1fr); } .ins-charts { grid-template-columns: 1fr; } }

/* ==========================================================================
   מבחנים סרוקים
   ========================================================================== */
.scan-pick { position: relative; display: flex; align-items: center; gap: 12px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 18px 20px; cursor: pointer; color: var(--ink-soft); transition: border-color .15s, background .15s; }
.scan-pick > input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.scan-pick:hover { border-color: var(--emerald); background: var(--emerald-tint); }
.scan-pick svg { width: 24px; height: 24px; color: var(--emerald); flex: none; }
.scan-pick--has { border-style: solid; border-color: var(--emerald); background: var(--emerald-tint); color: var(--ink); }
.scan-pick--err { border-style: solid; border-color: var(--danger); background: var(--danger-tint); color: var(--danger); }
.ppx { display: flex; gap: 10px; flex-wrap: wrap; }
.ppx__opt { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 15px; cursor: pointer; font-size: .9rem; color: var(--ink); }
.ppx__opt:has(input:checked) { border-color: var(--emerald); background: var(--emerald-tint); box-shadow: var(--ring); }
.ppx__opt input { accent-color: var(--emerald); }
.scan-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.scan-doc { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: visible; box-shadow: var(--shadow-sm); }
.scan-doc--done { border-color: var(--emerald); }
.scan-doc__pages { display: flex; gap: 6px; overflow-x: auto; background: #EEE8DA; padding: 8px; border-radius: var(--radius) var(--radius) 0 0; }

/* בורר חיפוש-מהיר (type-ahead) — למשל בחירת תלמיד */
.ss { position: relative; }
.ss > select { display: none; }
.ss__panel { position: absolute; z-index: 40; inset-inline: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-height: 264px; overflow-y: auto; padding: 4px; }
.ss__opt { padding: 8px 12px; border-radius: 7px; cursor: pointer; font-size: .92rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss__opt:hover, .ss__opt.is-active { background: var(--emerald-tint); }
.ss__opt.is-sel { font-weight: 700; color: var(--emerald-700); }
.ss__empty { padding: 10px 12px; color: var(--muted); font-size: .88rem; }
.scan-doc__pages img { height: 300px; width: auto; border-radius: 6px; border: 1px solid var(--line-strong); background: #fff; display: block; }
.scan-doc__form { padding: 14px 16px; }
.scan-doc__title { font-family: var(--font-display); font-weight: 700; margin-bottom: 10px; color: var(--ink); }

/* ── סריקה: מסך העיבוד ברקע ── */
.scanprog { text-align: center; padding: 8px 0 4px; }
.scanprog__pct { font-family: var(--font-display); font-size: 3.2rem; line-height: 1; font-weight: 700; color: var(--emerald-700); font-variant-numeric: tabular-nums; }
.scanprog__track { height: 10px; margin: 20px 0 12px; border-radius: 999px; background: var(--canvas-2); border: 1px solid var(--line); overflow: hidden; }
.scanprog__fill { height: 100%; background: var(--emerald); border-radius: 999px; transition: width .6s cubic-bezier(.2,.7,.2,1); }
/* ממתין לתור — אין עדיין ספירת-עמודים, ולכן פס בלתי-מוגדר במקום 0% מטעה */
.scanprog__fill--wait { width: 34%; background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: scanwait 1.5s ease-in-out infinite; }
@keyframes scanwait { 0% { margin-inline-start: -34%; } 100% { margin-inline-start: 100%; } }
.scanprog__note { color: var(--ink-soft); font-size: .92rem; margin: 0; }
.scanprog__sub { color: var(--muted); font-size: .82rem; margin: 6px 0 0; }
@media (prefers-reduced-motion: reduce) {
    .scanprog__fill { transition: none; }
    .scanprog__fill--wait { animation: none; margin-inline-start: 0; width: 100%; opacity: .5; }
}

/* בורר-הקובץ: שורת גודל + פס העלאה אמיתי */
.scan-pick__size { margin-inline-start: auto; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.uprog { margin-top: 14px; }
.uprog__track { height: 8px; border-radius: 999px; background: var(--canvas-2); border: 1px solid var(--line); overflow: hidden; }
.uprog__fill { height: 100%; width: 0; background: var(--emerald); border-radius: 999px; transition: width .2s linear; }
.uprog__label { display: block; margin-top: 8px; font-size: .84rem; color: var(--ink-soft); text-align: center; font-variant-numeric: tabular-nums; }

/* ── חתימת המפתח ────────────────────────────────────────────────────────────
   שורה שקטה בתחתית המסך המחובר. רוחב וריפוד תואמים ל-.content כדי שתתיישר
   עם התוכן, וקו-שיער קצר במקום פס רוחב-מלא — חתימה, לא באנר. */
.dev-credit {
    max-width: 1180px;
    width: 100%;
    padding: 0 34px 34px;
    font-family: var(--font-ui);
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--muted);
    text-align: center;
}
.dev-credit::before {
    content: "";
    display: block;
    inline-size: 42px;
    block-size: 1px;
    margin-inline: auto;
    margin-block-end: 14px;
    background: var(--line-strong);
}
.dev-credit a {
    color: var(--ink-soft);
    text-decoration: none;
    padding-block-end: 1px;
    border-block-end: 1px solid transparent;
    transition: color .18s ease, border-color .18s ease;
}
.dev-credit a:hover { color: var(--gold); border-block-end-color: var(--gold-tint); }
.dev-credit a:focus-visible { outline: 2px solid var(--emerald); outline-offset: 3px; border-radius: 3px; }
@media (min-width: 1600px) { .dev-credit { max-width: 1320px; } }
@media (max-width: 900px)  { .dev-credit { padding: 0 20px 30px; } }
@media (max-width: 640px)  { .dev-credit { padding: 0 14px 26px; } }
@media (prefers-reduced-motion: reduce) { .dev-credit a { transition: none; } }

/* חתימת המפתח בפוטר הכהה של דף הנחיתה — מתחת לשורת הזכויות, במשקל נמוך ממנה */
.site-footer__credit { margin-top: 12px; font-size: .8rem; color: #8E97AB; }
.site-footer__credit a {
    color: #B7BECE; text-decoration: none; padding-block-end: 1px;
    border-block-end: 1px solid transparent;
    transition: color .18s ease, border-color .18s ease;
}
.site-footer__credit a:hover { color: var(--gold); border-block-end-color: rgba(169, 129, 59, .45); }
.site-footer__credit a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { .site-footer__credit a { transition: none; } }

/* ==========================================================================
   מפתח-תשובות (מבחן סרוק)
   העיגולים כאן הם אותם עיגולים שעל דף-התשובות המודפס — המורה מסמנת את המפתח
   באותה תנועה שהתלמידה תסמן בה את תשובתה. עקביות-מטאפורה, לא קישוט.
   ========================================================================== */
.keybar { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; }
.keybar__grp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.keybar__lbl { font-family: var(--font-display); font-weight: 700; color: var(--ink); font-size: .96rem; }
.keybar__num { width: 74px; text-align: center; font-variant-numeric: tabular-nums; }
.keybar__sel { width: 68px; }
.keybar__paste { width: 210px; font-variant-numeric: tabular-nums; letter-spacing: .06em; }

/* טבלת-המפתח. אותה תבנית-עמודות לכותרת ולשורות — אחרת הן לא מתיישרות. */
.key-head, .key-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 104px 190px 62px 80px 34px;
    gap: 10px;
    align-items: center;
}
.key-head {
    padding: 11px 18px;
    background: var(--canvas-2);
    border-bottom: 1px solid var(--line-strong);
    font-size: .78rem; font-weight: 700; color: var(--ink-soft);
    letter-spacing: .01em;
}
.key-head i { font-style: normal; font-weight: 400; font-size: .92em; }
.key-row { padding: 9px 18px; border-bottom: 1px solid var(--line); }
.key-row:last-child { border-bottom: none; }
.key-row:hover { background: var(--surface-2); }
.key-row__n {
    font-family: var(--font-display); font-weight: 700; color: var(--muted);
    font-variant-numeric: tabular-nums; text-align: center; font-size: .98rem;
}
.key-row__prompt, .key-row__kind, .key-row__opts, .key-row__score { padding: 8px 11px; font-size: .9rem; }
.key-row__score { text-align: center; font-variant-numeric: tabular-nums; }
.key-row__del { justify-self: center; }

/* העיגולים */
.key-bub { display: flex; gap: 6px; justify-content: flex-start; }
.key-bub__o { position: relative; cursor: pointer; }
.key-bub__o input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.key-bub__o span {
    display: grid; place-items: center;
    width: 28px; height: 28px; border-radius: 50%;
    border: 1.5px solid var(--line-strong); background: var(--surface);
    font-size: .84rem; font-weight: 600; color: var(--muted);
    font-variant-numeric: tabular-nums;
    transition: background .12s, border-color .12s, color .12s;
}
.key-bub__o:hover span { border-color: var(--emerald); color: var(--emerald-700); }
.key-bub__o input:checked + span {
    background: var(--emerald); border-color: var(--emerald-700); color: #fff;
}
.key-bub__o input:focus-visible + span { box-shadow: var(--ring); }
/* אפשרות מעבר למספר שהוגדר: נשארת בתזרים כדי שהעמודות יישארו מיושרות בין
   שורות עם מספר אפשרויות שונה, אבל אינה נראית ואינה לחיצה. */
.key-bub__o.is-off { visibility: hidden; pointer-events: none; }

/* שאלה פתוחה/קצרה — שורת-טקסט שנפתחת מתחת, ברוחב מלא */
.key-row__text { grid-column: 1 / -1; display: none; padding: 2px 0 8px; }
.key-row.is-text .key-row__text { display: block; }
.key-row.is-text .key-bub,
.key-row.is-text .key-row__opts { visibility: hidden; }
.key-row__text-lbl { display: block; margin-bottom: 5px; font-size: .8rem; color: var(--gold); font-weight: 600; }
.key-row__text textarea { width: 100%; font-size: .88rem; resize: vertical; }

.key-empty { padding: 34px 24px; text-align: center; }

/* תא עם תווית. התווית מוסתרת בדסקטופ (יש שורת-כותרת) ומוצגת בנייד (אין).
   בלעדיה "4" ו-"20" הם מספרים חסרי משמעות על מסך צר. */
.key-cell { display: block; min-width: 0; }
.key-cell > span { display: none; }
.key-cell .select, .key-cell .input { width: 100%; }

@media (max-width: 980px) {
    .key-head { display: none; }
    /* פריסת-נייד מפורשת באזורים. הגרסה הקודמת מיקמה את כפתור-המחיקה
       ב-position:absolute בלי עוגן, והוא נחת באמצע השורה מעל בורר-הסוג. */
    .key-row {
        grid-template-columns: 38px minmax(0, 1fr) minmax(0, 1fr) 38px;
        /* ⚠️ אסור לשבץ שדה-קלט בעמודת ה-38px של כפתור-המחיקה — הוא נמעך לאפס
           והערך נעלם. שורה נפרדת ל«אפשרויות»+«ניקוד», חצי-חצי. */
        grid-template-areas:
            "num  prompt prompt del"
            "kind kind   kind   kind"
            "opts opts   score  score"
            "bub  bub    bub    bub"
            "text text   text   text";
        gap: 10px 8px;
        padding: 14px 16px;
        background: var(--surface);
        border-bottom: 8px solid var(--canvas);
    }
    .key-row__n      { grid-area: num; align-self: center; }
    .key-row__prompt { grid-area: prompt; }
    .key-row__del    { grid-area: del; position: static; justify-self: end; align-self: center; }
    .key-row__kind   { grid-area: kind; }
    .key-cell--opts  { grid-area: opts; }
    .key-cell--score { grid-area: score; }
    .key-bub         { grid-area: bub; }
    .key-row__text   { grid-area: text; }

    .key-cell { display: flex; align-items: center; gap: 7px; }
    .key-cell > span { display: inline; font-size: .76rem; color: var(--muted); white-space: nowrap; }

    /* יעדי-מגע 44px בנייד — התקן לנגישות, ובקהל שלנו זה קריטי בפועל. */
    .key-bub__o span { width: 44px; height: 44px; font-size: .95rem; }
    .key-bub { gap: 10px; flex-wrap: wrap; }

    /* בשאלה פתוחה/קצרה הבורר והעיגולים אינם רלוונטיים — בנייד מקום הוא משאב,
       ולכן הם נגרעים מהתזרים במקום להישאר שקופים כמו בדסקטופ. */
    .key-row.is-text .key-bub,
    .key-row.is-text .key-cell--opts { display: none; }
    .key-row.is-text { grid-template-areas:
            "num   prompt prompt del"
            "kind  kind   kind   kind"
            "score score  score  score"
            "text  text   text   text"; }
}

/* ==========================================================================
   מסך אישור סריקה — רשת תלמידות × שאלות
   הצבע כאן אינו קישוט: ירוק/אדום = המערכת הכריעה · צהוב = היא **לא** הכריעה
   ומחכה לך. תא צהוב הוא היחיד שחוסם ניקוד.
   ========================================================================== */
.rv-legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; font-size: .85rem; color: var(--ink-2); }
.rv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rv-dot { width: 13px; height: 13px; border-radius: 4px; display: inline-block; border: 1px solid transparent; }
.rv-dot--ok   { background: var(--emerald-tint); border-color: var(--emerald); }
.rv-dot--no   { background: var(--danger-tint);  border-color: var(--danger); }
.rv-dot--none { background: var(--canvas-2);     border-color: var(--line-strong); }
.rv-dot--ask  { background: var(--gold-tint);    border-color: var(--gold); }

.rv-grid { border-collapse: separate; border-spacing: 0; }
.rv-grid th, .rv-grid td { padding: 6px 5px; text-align: center; vertical-align: middle; }
.rv-q { min-width: 44px; font-variant-numeric: tabular-nums; }
.rv-open { display: block; font-style: normal; font-size: .62rem; font-weight: 500; color: var(--gold); }

/* עמודת-השם ננעצת: ברשת של 30 שאלות אי-אפשר לגלול ולזכור על מי מסתכלים. */
.rv-name {
    position: sticky; inset-inline-start: 0; z-index: 2;
    background: var(--surface); text-align: start !important;
    min-width: 172px; box-shadow: 1px 0 0 var(--line);
}
thead .rv-name { background: var(--canvas-2); z-index: 3; }
.rv-name__in { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.rv-peek { font-size: .74rem; color: var(--emerald-700); text-decoration: underline; white-space: nowrap; }
.rv-note { font-size: .72rem; color: var(--gold); margin-top: 3px; line-height: 1.35; }
.rv-total { min-width: 66px; font-variant-numeric: tabular-nums; }

.rv-v {
    display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px;
    border-radius: 8px; font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums;
    border: 1px solid transparent; cursor: default;
}
.rv-v--ok   { background: var(--emerald-tint); border-color: var(--emerald); color: var(--emerald-700); }
.rv-v--no   { background: var(--danger-tint);  border-color: var(--danger);  color: var(--danger); }
.rv-v--none { background: var(--canvas-2);     border-color: var(--line-strong); color: var(--muted); }
/* סימון דק שהערך הזה נקבע בידי אדם ולא במכונה — שקיפות על מקור הנתון. */
.rv-v--manual { box-shadow: inset 0 -3px 0 var(--gold); }

.rv-pick, .rv-score { width: 100%; min-width: 56px; padding: 5px 6px; font-size: .86rem; text-align: center; }
.rv-pick {
    background: var(--gold-tint); border-color: var(--gold); color: var(--ink);
    font-weight: 700; background-position: left 6px center;
}
.rv-score { font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
    .rv-name { min-width: 128px; font-size: .84rem; }
    .rv-name__in { flex-direction: column; align-items: flex-start; gap: 2px; }
    .rv-v { min-width: 26px; height: 26px; font-size: .82rem; }
}
