/* כיתות חושבות – אתר המערכים. Brand: navy board, marker teal, marker coral. */
@font-face { font-family: 'Rubik'; src: url('../fonts/Rubik-VariableFont_wght.ttf') format('truetype'); font-weight: 300 900; font-display: swap; }
@font-face { font-family: 'Assistant'; src: url('../fonts/Assistant-VariableFont_wght.ttf') format('truetype'); font-weight: 200 800; font-display: swap; }

:root {
  --navy: #1f3a5f; --navy-2: #2c4d78; --teal: #2a9d8f; --teal-dark: #1f7a6f; --coral: #e76f51;
  --ink: #16202b; --ink-2: #4a5866; --ink-3: #6b7785;
  --line: #d8dfe5; --ground: #f3f6f8; --card: #ffffff; --tint: #eaf3f4; --coral-tint: #fdf0ec;
  --ok: #2f8a4f; --warn: #b7791f; --bad: #b4413c;
  --f-display: 'Rubik', 'Segoe UI', Arial, sans-serif;
  --f-body: 'Assistant', 'Segoe UI', Arial, sans-serif;
  --r: 10px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--f-body); font-size: 17px; line-height: 1.55; color: var(--ink); background: var(--ground); direction: rtl; }
a { color: var(--navy); }
a:hover { color: var(--teal-dark); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); color: var(--navy); line-height: 1.25; margin: 0; text-wrap: balance; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 21px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- header ---------- */
.site-head { background: var(--card); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 32px; text-decoration: none; }
.brand img { height: 56px; width: auto; display: block; }
.brand .words { display: flex; flex-direction: column; gap: 4px; }
.brand .title { font-family: var(--f-display); font-weight: 700; font-size: 26px; color: var(--navy); line-height: 1.05; width: max-content; padding-bottom: 4px; border-bottom: 3px solid var(--navy); }
.brand .sub { font-family: var(--f-display); font-weight: 500; font-size: 13px; color: var(--ink-2); }
.user-box { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--ink-2); }
.nav { background: var(--navy); }
.nav .wrap { display: flex; gap: 4px; flex-wrap: wrap; padding-block: 0; }
.nav a { color: #fff; text-decoration: none; font-family: var(--f-display); font-weight: 500; font-size: 15px; padding: 11px 14px; border-bottom: 3px solid transparent; opacity: .85; }
.nav a:hover { opacity: 1; color: #fff; }
.nav a.on { opacity: 1; border-bottom-color: var(--coral); }
.wrap { max-width: 1240px; 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 { padding-block: 28px 56px; }

/* ---------- building blocks ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.muted { color: var(--ink-3); font-size: 15px; }
.lead { color: var(--ink-2); max-width: 65ch; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 8px; border: 1.5px solid var(--navy); background: var(--navy); color: #fff; font: 600 16px var(--f-display); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--navy-2); color: #fff; }
.btn.alt { background: transparent; color: var(--navy); }
.btn.alt:hover { background: var(--tint); }
.btn.teal { background: var(--teal); border-color: var(--teal); }
.btn.teal:hover { background: var(--teal-dark); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.link { background: none; border: none; color: var(--navy); padding: 0 4px; text-decoration: underline; min-height: 34px; font-weight: 500; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
label { font-weight: 600; font-size: 15px; display: block; margin-bottom: 6px; color: var(--ink); }
.hint-text { font-weight: 400; color: var(--ink-3); font-size: 14px; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; font: 16px var(--f-body); color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(42,157,143,.18); }
.field { min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; font: 600 13px var(--f-display); padding: 3px 10px; border-radius: 999px; background: var(--tint); color: var(--teal-dark); white-space: nowrap; }
.chip.draft { background: #eef1f5; color: var(--ink-2); }
.chip.wait { background: var(--coral-tint); color: #a8472e; }
.chip.ok { background: #e7f4eb; color: var(--ok); }
.chip.pending { background: #fff4df; color: var(--warn); }
.chip.bad { background: #f8e8e7; color: var(--bad); }
.notice { border-radius: var(--r); padding: 14px 18px; background: var(--tint); color: var(--ink); display: flex; gap: 12px; align-items: flex-start; }
.notice.coral { background: var(--coral-tint); }
.notice b { font-family: var(--f-display); color: var(--navy); }
.quota { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.quota .boards { display: flex; gap: 5px; }
.quota .boards span { width: 14px; height: 22px; border: 2px solid var(--navy); border-radius: 3px; }
.quota .boards span.used { background: var(--navy); }
.toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 8px; font-weight: 600; z-index: 50; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.demo-bar { background: #fff7e6; border-bottom: 1px solid #f0dcae; font-size: 14px; color: #6b5316; }
.demo-bar .wrap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-block: 6px; }

/* ---------- auth pages ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.auth .pitch { padding-top: 12px; }
.auth .pitch img { width: 240px; max-width: 100%; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 14px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.google { background: #fff; color: var(--ink); border-color: var(--line); }
.google:hover { background: var(--ground); color: var(--ink); }
.rules { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- lessons list ---------- */
table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
table.list th, table.list td { text-align: right; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 15px; vertical-align: middle; }
table.list th { font: 600 13px var(--f-display); color: var(--ink-3); background: #fafbfc; letter-spacing: .02em; }
table.list tr:last-child td { border-bottom: none; }
th .sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
th .sort::after { content: '↕'; font-size: 11px; opacity: .45; }
th[aria-sort=ascending] .sort::after { content: '↑'; opacity: 1; }
th[aria-sort=descending] .sort::after { content: '↓'; opacity: 1; }
th .sort:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.scroll-x { overflow-x: auto; border-radius: var(--r); }
.empty { text-align: center; padding: 40px 16px; color: var(--ink-3); }

/* ---------- lesson workspace ---------- */
.ws-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.ws { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.ws .chat { flex: 1 1 340px; max-width: 420px; min-width: 0; position: sticky; top: 12px; display: flex; flex-direction: column; gap: 12px; }
.ws .doc { flex: 999 1 560px; min-width: 0; }
.msgs { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow-y: auto; padding: 4px; }
.msg { padding: 10px 14px; border-radius: 12px; font-size: 15px; max-width: 92%; }
.msg.bot { background: var(--tint); align-self: flex-start; border-start-start-radius: 4px; }
.msg.me { background: var(--navy); color: #fff; align-self: flex-end; border-start-end-radius: 4px; }
.composer textarea { min-height: 80px; }
.revs { font-size: 14px; color: var(--ink-2); }
.preview { width: 100%; border: 1px solid var(--line); border-radius: var(--r); background: #e9edf0; display: block; min-height: 600px; }
.outline-card ol { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }
.outline-card .finish { border-inline-start: 4px solid var(--coral); padding: 6px 12px; background: var(--coral-tint); border-radius: 0 8px 8px 0; }
.versions { display: flex; gap: 6px; flex-wrap: wrap; }
.versions button { min-height: 32px; padding: 0 10px; border-radius: 6px; border: 1.5px solid var(--line); background: #fff; font: 600 13px var(--f-display); color: var(--ink-2); cursor: pointer; }
.versions button.on { border-color: var(--navy); color: var(--navy); background: var(--tint); }
.confirm { border: 2px solid var(--coral); }

/* ---------- feedback ---------- */
.q { padding: 18px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.q:last-child { border-bottom: none; }
.q .qt { font-family: var(--f-display); font-weight: 600; color: var(--navy); font-size: 16px; }
.opts { display: flex; gap: 8px; flex-wrap: wrap; }
.opts label { margin: 0; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; background: #fff; min-height: 44px; }
.opts input { accent-color: var(--teal); width: 18px; height: 18px; }
.opts label:has(input:checked) { border-color: var(--teal); background: var(--tint); }
.taskq { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: #fcfdfd; }
.taskq .tn { font-weight: 700; color: var(--navy); }

/* ---------- prefs ---------- */
.pref { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pref:last-child { border-bottom: none; }
.pref .tx { flex: 1; min-width: 0; }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { background: none; border: none; font: 600 15px var(--f-display); color: var(--ink-2); padding: 10px 14px; border-bottom: 3px solid transparent; margin-bottom: -2px; cursor: pointer; min-height: 44px; }
.tabs button.on { color: var(--navy); border-bottom-color: var(--coral); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v { font: 700 28px var(--f-display); color: var(--navy); font-variant-numeric: tabular-nums; }
.stat .l { font-size: 14px; color: var(--ink-3); }
.qinput { width: 70px !important; min-height: 34px !important; padding: 4px 8px !important; }
.bar { height: 10px; background: var(--ground); border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.bar > span { display: block; height: 100%; background: var(--teal); }

/* admin feedback */
.fb-full summary { cursor: pointer; }
.fb-tasks { display: flex; flex-direction: column; gap: 8px; }
.fb-task { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fcfdfd; }
.fb-task .tn { font-weight: 700; color: var(--navy); min-width: 64px; }
.fb-change { color: var(--ink-2); flex-basis: 100%; }
.fb-free { margin: 0; border-inline-start: 4px solid var(--teal); background: var(--tint); padding: 10px 14px; border-radius: 0 8px 8px 0; white-space: pre-wrap; }

/* help */
.help { max-width: 980px; margin-inline: auto; }
.help-toc { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 15px; }
.help ul, .help ol { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }
.help .steps li::marker { font-weight: 700; color: var(--teal-dark); }
.sample { border: 1px dashed var(--line); border-radius: var(--r); padding: 16px 18px; background: #fcfdfd; }
.sheet-like { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.sample .tag { font: 600 13px var(--f-display); color: var(--teal-dark); }
.abc { list-style-type: hebrew; }
.hint-box { border-inline-start: 4px solid var(--teal); background: var(--tint); padding: 6px 12px; border-radius: 0 8px 8px 0; }
.help details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.help details:last-child { border-bottom: none; }
.help summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.help details p { margin-top: 6px; }
.help-btn span { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; }
.contact-msg.done { opacity: .6; }

/* ---------- footer + legal pages ---------- */
body { min-height: 100vh; display: flex; flex-direction: column; }
main.wrap { flex: 1 0 auto; width: 100%; }
.site-foot { border-top: 1px solid var(--line); background: var(--card); color: var(--ink-3); font-size: 14px; }
.site-foot .wrap { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; padding-block: 16px; }
.site-foot img { height: 24px; width: auto; display: block; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-inline-start: auto; }
.site-foot a { color: var(--ink-2); }
.legal { max-width: 820px; margin-inline: auto; display: flex; flex-direction: column; gap: 12px; }
.legal h2 { margin-top: 14px; }
.legal ul { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }
.draft-note { background: var(--coral-tint); color: #8a3a26; border-radius: 8px; padding: 8px 12px; font-weight: 600; font-size: 15px; align-self: flex-start; }

.mob-only { display: none !important; }
.sortbar { align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.sortbar label { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.sortbar select { width: auto; min-height: 34px; padding: 4px 8px; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .auth, .grid2 { grid-template-columns: minmax(0, 1fr); }
  .brand { gap: 16px; }
  .brand img { height: 40px; }
  .brand .title { font-size: 20px; }
  .brand .sub { display: flex; flex-direction: column; gap: 0; font-size: 11.5px; line-height: 1.3; }
  .brand .sub .dot { display: none; }
  .site-head .wrap { padding-block: 10px; }
  .nav .wrap { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 0; }
  .nav a { padding: 11px 10px; font-size: 14.5px; white-space: nowrap; flex: none; }
  .ws .chat { position: static; max-width: none; }
  h1 { font-size: 24px; }
  .card { padding: 18px; }
  /* tables become stacked cards */
  table.list:not(.as-table) thead { display: none; }
  table.list:not(.as-table), table.list:not(.as-table) tbody, table.list:not(.as-table) tr, table.list:not(.as-table) td { display: block; width: 100%; }
  table.list:not(.as-table) tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  table.list:not(.as-table) tr:last-child { border-bottom: none; }
  table.list:not(.as-table) td { border: none; padding: 3px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; }
  table.list:not(.as-table) td::before { content: attr(data-label); font: 600 13px var(--f-display); color: var(--ink-3); text-align: right; }
  table.list:not(.as-table) td:first-child { font-weight: 700; font-size: 16px; text-align: right; padding-bottom: 6px; }
  table.list:not(.as-table) td:first-child::before { content: none; }
  table.list:not(.as-table) td:empty { display: none; }
  .mob-only { display: inline-flex !important; }
  .sortbar.mob-only { display: flex !important; }
  table.list.as-table { min-width: 640px; }
}
@media (max-width: 420px) {
  .user-box > span { display: none; }
  .help-btn { padding: 0 8px; }
  .brand { gap: 12px; }
  .brand img { height: 36px; }
}
@media print { .site-head, .nav, .demo-bar, .site-foot { display: none; } }
