/* ===== שיטת המצפן · AI Creators ===== */
@font-face { font-family: "Noto Sans Hebrew"; src: url("fonts/NotoSansHebrew-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Sans Hebrew"; src: url("fonts/NotoSansHebrew-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Noto Sans Hebrew"; src: url("fonts/NotoSansHebrew-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Noto Sans Hebrew"; src: url("fonts/NotoSansHebrew-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Noto Sans Hebrew"; src: url("fonts/NotoSansHebrew-Black.ttf") format("truetype"); font-weight: 900; font-display: swap; }

:root {
  --bg: #0b0b0b;
  --bg-2: #111111;
  --card: #151515;
  --card-2: #1b1b1b;
  --line: #262626;
  --line-2: #333;
  --text: #f4efe8;
  --muted: #9a958f;
  --o1: #F29440;
  --o2: #E8822E;
  --o3: #C9641B;
  --grad: linear-gradient(135deg, var(--o1), var(--o2) 45%, var(--o3));
  --ok: #4cc38a;
  --bad: #ef5b4c;
  --r: 18px;
  --shadow: 0 20px 60px -30px rgba(0,0,0,.8);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 16px/1.65 "Noto Sans Hebrew", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  overflow-x: hidden; display: flex; flex-direction: column;
}
a { color: var(--o1); text-decoration: none; }
a:hover { color: #ffb070; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 900; }
h2 { font-size: 24px; font-weight: 800; }
h3 { font-size: 18px; font-weight: 800; }
p { margin: 0 0 1em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: #222; border: 1px solid var(--line-2); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.hl { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { color: var(--o2); font-size: 13px; font-weight: 800; letter-spacing: .06em; margin: 0 0 .4em; }
.lead { font-size: 18px; color: #d7d1ca; }
.inline { display: inline; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.wrap.wide { width: min(1360px, 100% - 32px); }
.main { flex: 1; padding: 34px 0 60px; position: relative; z-index: 1; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ambient glow */
.glow { position: fixed; pointer-events: none; z-index: 0; filter: blur(90px); opacity: .55; border-radius: 50%; }
.glow-a { width: 520px; height: 520px; top: -260px; left: -160px; background: radial-gradient(circle, rgba(232,130,46,.45), transparent 65%); }
.glow-b { width: 460px; height: 460px; bottom: -240px; right: -180px; background: radial-gradient(circle, rgba(201,100,27,.35), transparent 65%); }

/* compass mark */
.mark { width: 36px; height: 36px; color: var(--text); flex: none; }
.mark .needle { transform-origin: 32px 32px; transform: rotate(32deg); animation: swing 2.4s cubic-bezier(.3,1.6,.4,1) both; }
@keyframes swing { 0% { transform: rotate(-70deg); } 60% { transform: rotate(48deg); } 100% { transform: rotate(32deg); } }
.brand:hover .mark .needle { transform: rotate(0deg); transition: transform .6s cubic-bezier(.3,1.6,.4,1); }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(11,11,11,.78); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 19px; font-weight: 900; }
.brand-by { height: 20px; width: auto; opacity: .95; margin-top: 5px; align-self: flex-start; }
.nav { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.nav a, .link-btn { color: #cfc9c2; padding: 8px 12px; border-radius: 10px; font-size: 15px; font-weight: 500; }
.nav a:hover, .nav a.on, .link-btn:hover { color: var(--text); background: #1c1c1c; }
.nav-admin { border: 1px solid rgba(232,130,46,.4); color: var(--o1) !important; }
.link-btn { background: none; border: 0; font: inherit; cursor: pointer; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #111; font-weight: 900; }
.nav-user { padding: 4px !important; }
.admin-badge { background: var(--grad); color: #111; font-weight: 900; font-size: 12px; padding: 3px 10px; border-radius: 99px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--text);
  font: 700 15px/1 "Noto Sans Hebrew", system-ui, sans-serif; padding: 13px 20px; border-radius: 12px; cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s, border-color .2s; text-align: center; }
.btn:hover { color: var(--text); border-color: #4a4a4a; transform: translateY(-1px); }
.btn-primary { background: var(--grad); border-color: transparent; color: #121212; box-shadow: 0 10px 30px -12px rgba(232,130,46,.75); }
.btn-primary:hover { color: #121212; box-shadow: 0 14px 38px -10px rgba(232,130,46,.95); }
.btn-ghost { background: transparent; }
.btn-done { background: rgba(76,195,138,.12); border-color: rgba(76,195,138,.5); color: #8fe0b7; }
.btn-danger { background: transparent; border-color: rgba(239,91,76,.45); color: #ff8b7e; }
.btn-danger:hover { background: rgba(239,91,76,.12); color: #ffb1a8; }
.btn-xs { padding: 8px 12px; font-size: 13.5px; border-radius: 9px; }
.btn-wide { width: 100%; }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(-4px); }
.icon-btn { background: none; border: 1px solid transparent; color: var(--muted); cursor: pointer; font-size: 12px; padding: 4px 7px; border-radius: 7px; }
.icon-btn:hover { border-color: var(--line-2); color: var(--text); }
.icon-btn.danger:hover { color: var(--bad); border-color: rgba(239,91,76,.4); }

/* forms */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; color: #d9d3cc; }
.hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
input, select, textarea {
  width: 100%; background: #0f0f0f; border: 1px solid var(--line-2); color: var(--text); border-radius: 12px;
  padding: 12px 14px; font: 400 15.5px/1.5 "Noto Sans Hebrew", system-ui, sans-serif; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--o2); box-shadow: 0 0 0 4px rgba(232,130,46,.16); }
input[disabled] { opacity: .6; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--o2); }
input[type=file] { padding: 9px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; line-height: 1.6; }
.check-label { display: flex !important; align-items: center; gap: 10px; font-weight: 500 !important; }
.pw { position: relative; display: block; }
.pw input { padding-left: 64px; }
.pw-toggle { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); background: #222; border: 0; color: var(--muted); font: 600 12.5px "Noto Sans Hebrew", sans-serif; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.form-inline { grid-template-columns: 1.4fr 1.2fr auto auto auto; align-items: center; }
.grid-form { grid-template-columns: 1fr 1fr; align-items: end; }
.grid-form .span-2 { grid-column: span 2; }
.search { display: flex; gap: 8px; }
.search input { padding: 8px 12px; min-width: 240px; }

/* flash */
.flash { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 15px; border: 1px solid; }
.flash-ok { background: rgba(76,195,138,.09); border-color: rgba(76,195,138,.4); color: #a9ecc9; }
.flash-err { background: rgba(239,91,76,.09); border-color: rgba(239,91,76,.45); color: #ffb1a8; }

/* auth */
body.auth { display: block; }
.auth-grid { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; position: relative; z-index: 1; }
.auth-side { position: relative; display: flex; align-items: center; padding: 60px; overflow: hidden;
  background: radial-gradient(120% 80% at 100% 0%, rgba(232,130,46,.18), transparent 55%), linear-gradient(180deg, #121212, #0b0b0b); border-left: 1px solid var(--line); }
.auth-side::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, #000, transparent 85%); pointer-events: none; }
.auth-side-in { position: relative; z-index: 1; max-width: 520px; }
.auth-side h1 { font-size: clamp(42px, 5.4vw, 72px); margin-bottom: 16px; }
.big-compass { margin-bottom: 26px; }
.auth-logo { display: block; height: 52px; width: auto; margin: 0 0 18px; }
.big-compass .mark { width: 120px; height: 120px; filter: drop-shadow(0 0 40px rgba(232,130,46,.35)); }
.ticks { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-right: 32px; color: #d7d1ca; }
.ticks li::before { content: ""; position: absolute; right: 0; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--grad); -webkit-mask: radial-gradient(circle, transparent 3px, #000 3.5px); mask: radial-gradient(circle, transparent 3px, #000 3.5px); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 22px; }
.auth-card { width: min(440px, 100%); }
.auth-brand { display: none; margin-bottom: 28px; }
.auth-card h2 { font-size: 30px; font-weight: 900; }
.auth-card .btn-primary { width: 100%; margin-top: 4px; padding: 15px; font-size: 16px; }
.btn-google { width: 100%; background: #fff; color: #1f1f1f; border-color: #fff; padding: 14px; }
.btn-google:hover { color: #1f1f1f; background: #f1f1f1; }
.btn-google svg { width: 20px; height: 20px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 20px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.switch { text-align: center; color: var(--muted); margin-top: 22px; }
.row-between .small { font-weight: 500; }

/* dashboard */
.hello { margin-bottom: 26px; }
.hello h1 { margin: 0; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 18px; background: linear-gradient(135deg, rgba(232,130,46,.14), rgba(232,130,46,.04)); border: 1px solid rgba(232,130,46,.45); border-radius: var(--r); padding: 20px 24px; }
.notice p { margin: 4px 0 0; color: #d7d1ca; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 22px; }
.course-card { position: relative; background: linear-gradient(180deg, var(--card), #121212); border: 1px solid var(--line); border-radius: 22px; padding: 26px; box-shadow: var(--shadow); overflow: hidden; }
.course-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--grad); }
.course-card h2 a { color: var(--text); }
.course-card-top { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.meta-row { display: flex; gap: 16px; color: var(--muted); font-size: 14px; margin: 14px 0 10px; flex-wrap: wrap; }
.meta-row span::before { content: "•"; color: var(--o2); margin-left: 6px; }
.bar { height: 8px; background: #222; border-radius: 99px; overflow: hidden; margin-bottom: 18px; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: inherit; box-shadow: 0 0 18px rgba(232,130,46,.7); transition: width .6s ease; }
.next-up { margin: 12px 0 0; font-size: 14px; color: var(--muted); text-align: center; }

/* progress ring */
.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring-bg { stroke: #262626; }
.ring-fg { stroke: var(--o2); stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(232,130,46,.6)); transition: stroke-dashoffset .8s ease; }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 18px; }

/* empty */
.empty { text-align: center; max-width: 560px; margin: 40px auto; padding: 40px 28px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; }
.empty-mark .mark { width: 84px; height: 84px; margin-bottom: 12px; }

/* course page */
.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--o1); }
.course-hero { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; background: radial-gradient(90% 120% at 0% 0%, rgba(232,130,46,.16), transparent 60%), var(--card); border: 1px solid var(--line); border-radius: 26px; padding: 34px; margin-bottom: 28px; box-shadow: var(--shadow); }
.hero-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 18px; }
.course-hero-ring { display: grid; justify-items: center; gap: 8px; }
.course-hero-ring .ring { width: 130px; height: 130px; }
.course-hero-ring .ring span { font-size: 26px; }
.ring-label { color: var(--muted); font-size: 13px; }
.curriculum { display: grid; gap: 14px; }
.section { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.section[open] { border-color: #333; }
.section summary { list-style: none; display: flex; align-items: center; gap: 16px; padding: 18px 22px; cursor: pointer; }
.section summary::-webkit-details-marker { display: none; }
.sec-num { font-weight: 900; font-size: 15px; color: var(--o2); background: rgba(232,130,46,.1); border: 1px solid rgba(232,130,46,.3); border-radius: 10px; padding: 6px 9px; min-width: 40px; text-align: center; }
.sec-title { flex: 1; display: grid; }
.sec-title strong { font-size: 17.5px; }
.sec-title small { color: var(--muted); font-size: 14px; }
.sec-count { color: var(--muted); font-size: 14px; font-weight: 700; }
.sec-count.full { color: var(--ok); }
.chev { width: 10px; height: 10px; border-left: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .2s; }
.section[open] .chev { transform: rotate(135deg); }
.sec-body { padding: 0 22px 16px; border-top: 1px solid var(--line); }
.topic { margin: 16px 0 4px; color: var(--o1); font-size: 13px; font-weight: 800; }
.lesson-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.lesson-list a { display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 12px; color: var(--text); }
.lesson-list a:hover { background: #1c1c1c; }
.lesson-list li.next a { background: rgba(232,130,46,.08); box-shadow: inset 0 0 0 1px rgba(232,130,46,.35); }
.l-title { flex: 1; display: grid; }
.l-title small { color: var(--muted); font-size: 13.5px; }
.dur { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #3a3a3a; flex: none; display: grid; place-items: center; }
.done .check { background: var(--grad); border-color: transparent; }
.done .check::after { content: ""; width: 5px; height: 10px; border: solid #111; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }

/* lesson page */
.lesson-page { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.lesson-head h1 { font-size: clamp(26px, 3.2vw, 38px); }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 30px 80px -40px rgba(232,130,46,.45); margin: 8px 0 18px; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.small-player { margin: 0 0 6px; border-radius: 12px; }
.lesson-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.pager { display: flex; gap: 10px; }
.lesson-side { position: sticky; top: 88px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; overflow: hidden; }
.side-head { padding: 18px 18px 12px; border-bottom: 1px solid var(--line); }
.side-head .bar { margin: 10px 0 6px; }
.side-title { color: var(--text); font-weight: 800; }
.side-list { overflow-y: auto; padding: 8px 10px 14px; }
.side-sec { margin: 14px 8px 6px; color: var(--muted); font-size: 12.5px; font-weight: 800; }
.side-list a { display: flex; gap: 10px; align-items: center; padding: 8px 8px; border-radius: 10px; color: #d7d1ca; font-size: 14.5px; }
.side-list a:hover { background: #1c1c1c; color: var(--text); }
.side-list a.cur { background: rgba(232,130,46,.12); color: var(--text); box-shadow: inset -3px 0 0 var(--o2); }
.side-list .check { width: 18px; height: 18px; }
.side-list .done .check::after { width: 4px; height: 8px; }

/* rich text */
.rich { font-size: 17px; line-height: 1.85; color: #e4ded7; }
.rich h3 { font-size: 22px; margin-top: 1.4em; }
.rich h4 { font-size: 18px; margin-top: 1.2em; color: var(--o1); }
.rich ul, .rich ol { padding-right: 22px; margin: 0 0 1em; }
.rich li { margin-bottom: .35em; }
.rich li::marker { color: var(--o2); }
.rich mark { background: linear-gradient(180deg, transparent 52%, rgba(232,130,46,.55) 52%); color: inherit; padding: 0 2px; }
.lesson-body { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px 30px; }
.tip { background: rgba(232,130,46,.08); border-right: 3px solid var(--o2); border-radius: 12px; padding: 14px 18px; margin: 0 0 1em; }
.prompt { background: #0e0e0e; border: 1px solid var(--line-2); border-radius: 14px; margin: 0 0 1.2em; overflow: hidden; }
.prompt-head { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; background: #171717; border-bottom: 1px solid var(--line-2); font-size: 13px; color: var(--o1); font-weight: 800; }
.prompt pre { margin: 0; padding: 16px 18px; white-space: pre-wrap; word-break: break-word; direction: ltr; text-align: left; unicode-bidi: plaintext; font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; color: #e9e2da; }
.copy-btn { background: var(--grad); color: #111; border: 0; font: 800 12.5px "Noto Sans Hebrew", sans-serif; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.copy-btn.copied { background: var(--ok); }
.resources { margin-top: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px 24px; }
.resources ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.resources a { display: inline-flex; gap: 8px; }

/* panels & admin */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; margin-bottom: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; padding: 28px 0 60px; position: relative; z-index: 1; flex: 1; }
.admin-nav { display: grid; gap: 4px; align-content: start; position: sticky; top: 90px; }
.admin-nav a { color: #cfc9c2; padding: 11px 14px; border-radius: 12px; font-weight: 600; }
.admin-nav a:hover { background: #181818; color: var(--text); }
.admin-nav a.on { background: rgba(232,130,46,.12); color: var(--o1); box-shadow: inset -3px 0 0 var(--o2); }
.admin-main h1 { font-size: 32px; }
.admin-main h2 { font-size: 20px; margin-top: 26px; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 26px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 2px; }
.stat b { font-size: 32px; font-weight: 900; }
.stat span { color: var(--muted); font-size: 13.5px; }
.stat.hot { background: linear-gradient(135deg, rgba(232,130,46,.2), rgba(232,130,46,.04)); border-color: rgba(232,130,46,.45); }
.stat.hot b { color: var(--o1); }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 22px; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: right; color: var(--muted); font-weight: 700; font-size: 12.5px; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid #1f1f1f; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.off { opacity: .55; }
.table .actions { white-space: nowrap; }
.table .actions .btn { margin: 2px; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; border: 1px solid; white-space: nowrap; }
.pill-on { color: #8fe0b7; border-color: rgba(76,195,138,.45); background: rgba(76,195,138,.08); }
.pill-off { color: #ff9d92; border-color: rgba(239,91,76,.45); background: rgba(239,91,76,.08); }
.pill-wait { color: #ffc48f; border-color: rgba(232,130,46,.45); background: rgba(232,130,46,.08); }
.mini-bar { width: 110px; height: 6px; background: #262626; border-radius: 99px; overflow: hidden; margin-bottom: 4px; }
.mini-bar i { display: block; height: 100%; background: var(--grad); }
.feed { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 14.5px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 24px; }
.course-tile { display: grid; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; color: var(--text); transition: border-color .2s, transform .2s; position: relative; overflow: hidden; }
.course-tile::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--grad); opacity: .7; }
.course-tile:hover { border-color: rgba(232,130,46,.5); transform: translateY(-2px); color: var(--text); }
.course-tile strong { font-size: 18px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ed-section { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; background: #121212; }
.ed-sec-head { display: flex; align-items: flex-start; gap: 12px; }
.ed-sec-edit { flex: 1; }
.ed-sec-edit summary { cursor: pointer; list-style: none; padding-top: 4px; }
.ed-sec-edit summary::-webkit-details-marker { display: none; }
.ed-sec-edit[open] .form { margin: 12px 0; }
.ed-lessons { list-style: none; padding: 0; margin: 12px 0 6px; display: grid; gap: 4px; }
.ed-lessons li { display: flex; align-items: center; gap: 4px; }
.ed-lesson { flex: 1; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--text); }
.ed-lesson:hover { border-color: rgba(232,130,46,.5); color: var(--text); }
.ed-lesson span:nth-child(2), .ed-lesson > span:first-child:not(.tag) { flex: 1; }
.tag { font-size: 11.5px; font-weight: 700; color: var(--o1); background: rgba(232,130,46,.1); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.mover { display: inline-flex; }
.add-lesson, .add-section { margin-top: 6px; }
.add-lesson summary, .add-section summary { cursor: pointer; color: var(--o1); font-weight: 700; font-size: 14px; padding: 8px 4px; list-style: none; }
.add-lesson summary::-webkit-details-marker, .add-section summary::-webkit-details-marker { display: none; }
.add-section { border: 1px dashed var(--line-2); border-radius: 14px; padding: 8px 14px; }
.add-section[open] .form, .add-lesson[open] .form { padding: 10px 0 6px; }
.access-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.access-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; background: #121212; border: 1px solid var(--line); border-radius: 12px; }
.access-list li > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.access-list li.off { opacity: .55; }
.danger-zone { border-color: rgba(239,91,76,.3); }
.help { margin-top: 8px; }
.help summary { cursor: pointer; color: var(--o1); font-size: 14px; font-weight: 700; }
.json { background: #0e0e0e; border: 1px solid var(--line-2); border-radius: 12px; padding: 16px; overflow-x: auto; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: #e9e2da; direction: ltr; text-align: left; white-space: pre; margin: 0; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checks li { display: flex; align-items: center; gap: 12px; }
.checks .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.checks .warn .dot { background: var(--o2); box-shadow: 0 0 10px var(--o2); }
.checks b { min-width: 200px; }
.steps li { margin-bottom: 6px; }

/* footer */
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 22px 0 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; position: relative; z-index: 1; }
.foot a { color: var(--muted); }

/* responsive */
@media (max-width: 980px) {
  .lesson-page, .editor-grid, .admin-grid { grid-template-columns: 1fr; }
  .lesson-side { position: static; max-height: none; }
  .admin-nav { position: static; display: flex; overflow-x: auto; gap: 6px; }
  .admin-nav a { white-space: nowrap; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-inline { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .auth-grid { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-brand { display: block; }
  .course-hero { grid-template-columns: 1fr; padding: 24px; }
  .course-hero-ring { justify-items: start; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 28px); }
  .cards { grid-template-columns: 1fr; }
  .brand-by { display: none; }
  .nav a:not(.nav-user):not(.nav-admin) { display: none; }
  .grid-form { grid-template-columns: 1fr; }
  .grid-form .span-2 { grid-column: auto; }
  .lesson-body { padding: 20px; }
  .rich { font-size: 16px; }
  .section summary { padding: 16px; gap: 12px; }
  .sec-body { padding: 0 12px 12px; }
  .lesson-actions { flex-direction: column; align-items: stretch; }
  .lesson-actions .btn { width: 100%; }
  .pager { justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
