/* تەختەی ڕێزمان — whiteboard lessons for the grade-10 Kurdish grammar book.
   The board is a fixed 1600×900 canvas that is scaled to fit the screen,
   so every size below is in board pixels. */

:root {
  --ink: #1d2433;
  --ink-2: #4a5263;
  --ink-3: #8a91a0;
  --blue: #1f56d6;
  --red: #d42a3e;
  --green: #12865a;
  --orange: #e2700c;
  --purple: #7740c4;
  --yellow: #ffe24a;
  --hl: rgba(255, 222, 0, .5);

  --board: #fdfdfb;
  --wall: #e8e6e0;
  --wall-2: #dcd9d1;
  --wall-ink: #1d2433;
  --wall-muted: #636a78;
  --card: #f7f6f2;
  --line: rgba(29, 36, 51, .12);
  --frame-a: #eef0f3;
  --frame-b: #aab1ba;

  --ui: rgba(28, 28, 30, .9);
  --ui-hi: rgba(255, 255, 255, .1);
  --ui-fg: #f2f2f4;
  --ui-dim: #a1a1aa;
  --accent: #f08a24;
  --btn: #1d2433;
  --btn-fg: #ffffff;
  --btn-hover: #2c3550;

  --f-hand: 'Marhey', 'Vazirmatn', 'Noto Sans Arabic', Tahoma, sans-serif;
  --f-text: 'Vazirmatn', 'Noto Sans Arabic', Tahoma, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wall: #17191d;
    --wall-2: #202329;
    --wall-ink: #eceef2;
    --wall-muted: #9aa1ad;
    --card: #1f2228;
    --line: rgba(255, 255, 255, .1);
    --frame-a: #5b616b;
    --frame-b: #2c3036;
    --btn: #eceef2;
    --btn-fg: #15171b;
    --btn-hover: #ffffff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --wall: #17191d;
  --wall-2: #202329;
  --wall-ink: #eceef2;
  --wall-muted: #9aa1ad;
  --card: #1f2228;
  --line: rgba(255, 255, 255, .1);
  --frame-a: #5b616b;
  --frame-b: #2c3036;
  --btn: #eceef2;
  --btn-fg: #15171b;
  --btn-hover: #ffffff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--wall);
  color: var(--wall-ink);
  font-family: var(--f-text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ───────────────────────── Library ───────────────────────── */

.lib { max-width: 1240px; margin: 0 auto; padding-block: 40px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.lib-head {
  position: relative;
  background: var(--board);
  color: var(--ink);
  border-radius: 18px;
  padding: 44px 48px 40px;
  box-shadow: 0 0 0 10px var(--frame-a), 0 0 0 11px var(--frame-b), 0 18px 40px rgba(0, 0, 0, .14);
  margin: 12px 12px 56px;
  overflow: hidden;
}
.lib-head::after { /* marker smudge */
  content: ""; position: absolute; inset: auto -60px -80px auto; width: 380px; height: 220px;
  background: radial-gradient(closest-side, rgba(31, 86, 214, .07), transparent);
  pointer-events: none;
}
.lib-kicker { font-family: var(--f-hand); color: var(--red); font-size: 22px; margin: 0 0 6px; }
.lib-title {
  font-family: var(--f-hand); font-weight: 700; font-size: clamp(44px, 7vw, 76px);
  line-height: 1.25; margin: 0; color: var(--ink); display: inline-block; position: relative;
}
.lib-title .u-line { color: var(--blue); }
.lib-sub { font-size: 19px; color: var(--ink-2); margin: 18px 0 26px; line-height: 1.8; max-width: 760px; }
.lib-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line); background: transparent;
  text-decoration: none; font-size: 16px; font-weight: 600; cursor: pointer;
  transition: background .15s ease-out, transform .15s ease-out;
}
.btn:hover { background: rgba(127, 127, 127, .1); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--btn); color: var(--btn-fg); border-color: var(--btn); }
.btn.primary:hover { background: var(--btn-hover); }
.lib-head .btn { color: var(--ink); border-color: rgba(29, 36, 51, .16); }
.lib-head .btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }

.season { margin: 0 12px 48px; }
.season-h { display: flex; align-items: baseline; gap: 14px; margin: 0 0 20px; }
.season-h h2 { font-family: var(--f-hand); font-weight: 700; font-size: 32px; margin: 0; }
.season-h span { color: var(--wall-muted); font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 26px; }

.lcard {
  background: var(--card); border-radius: 16px; padding: 12px 12px 16px;
  border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px;
  transition: transform .2s ease-out, box-shadow .2s ease-out;
}
.lcard:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0, 0, 0, .12); }
.thumb {
  position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden;
  background: var(--board); box-shadow: 0 0 0 4px var(--frame-a), 0 0 0 5px var(--frame-b);
  margin: 5px;
}
.mini { position: absolute; top: 0; left: 0; width: 1600px; height: 900px; transform-origin: 0 0; pointer-events: none; }
.lcard-meta { padding: 0 6px; }
.lcard-n { font-family: var(--f-hand); color: var(--red); font-size: 16px; }
.lcard-t { font-family: var(--f-hand); font-weight: 700; font-size: 23px; margin: 2px 0 4px; line-height: 1.5; }
.lcard-d { color: var(--wall-muted); font-size: 14px; margin: 0; }
.lcard-row { display: flex; gap: 8px; padding: 0 6px; margin-top: auto; }
.lcard-row .btn { height: 40px; font-size: 15px; flex: 1; justify-content: center; }
.lcard-row .btn.pdf { flex: 0 0 auto; }

.howto { margin: 8px 12px 0; padding: 26px 28px; border-radius: 16px; border: 1px dashed var(--line); }
.howto h2 { font-family: var(--f-hand); font-size: 26px; margin: 0 0 14px; }
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px 26px; margin: 0; padding: 0; list-style: none; font-size: 15px; color: var(--wall-muted); }
.keys li { display: flex; gap: 10px; align-items: center; }
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; direction: ltr;
  min-width: 26px; height: 26px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 7px; color: var(--wall-ink);
}
.lib-foot { text-align: center; color: var(--wall-muted); font-size: 13px; margin-top: 40px; }

/* ───────────────────────── Presenter ───────────────────────── */

.stage { position: fixed; inset: 0; overflow: hidden; background: var(--wall); }
.frame {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%);
  border-radius: 20px; padding: 12px;
  background: linear-gradient(160deg, var(--frame-a), var(--frame-b));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 22px 50px rgba(0, 0, 0, .22);
}
.stage.fs .frame { padding: 4px; border-radius: 10px; top: 8px; }
.board {
  position: absolute; top: 12px; left: 12px; width: 1600px; height: 900px;
  transform-origin: 0 0; background: var(--board); border-radius: 10px; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.stage.fs .board { top: 4px; left: 4px; border-radius: 6px; }
.board::before { /* soft board sheen */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(1100px 520px at 72% -10%, rgba(255, 255, 255, .9), transparent 70%),
              linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, .025));
}
.progress { position: absolute; left: 0; bottom: 0; height: 5px; background: var(--accent); border-radius: 0 3px 3px 0; transition: width .3s ease-out; z-index: 3; opacity: .85; }
canvas.ink, canvas.laser { position: absolute; inset: 0; width: 1600px; height: 900px; z-index: 5; pointer-events: none; }
canvas.ink { mix-blend-mode: multiply; }
.board.drawing canvas.ink { pointer-events: auto; touch-action: none; }
.board.t-pen canvas.ink, .board.t-hl canvas.ink { cursor: crosshair; }
.board.t-eraser canvas.ink { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Ccircle cx='14' cy='14' r='12' fill='white' fill-opacity='.6' stroke='%231d2433' stroke-width='1.5'/%3E%3C/svg%3E") 14 14, cell; }
.board.t-laser canvas.ink { cursor: none; }

.blank-tag {
  position: absolute; top: 26px; right: 34px; z-index: 4; font-family: var(--f-hand); font-size: 24px;
  color: var(--ink-3); display: none;
}
.board.blank .blank-tag { display: block; }
.board.blank .slide { visibility: hidden; }

/* Toolbar: same family as the Forma canvas toolbar — 36px controls, 18px icons, 1.5px strokes. */
.toolbar {
  position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: 999px;
  background: var(--ui); color: var(--ui-fg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .28);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  z-index: 20; user-select: none; max-width: calc(100vw - 16px);
}
.tb-btn {
  position: relative; width: 36px; height: 36px; border: 0; border-radius: 999px; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ui-fg);
  transition: background .15s ease-out, color .15s ease-out; flex: none;
}
.tb-btn svg { width: 18px; height: 18px; }
.tb-btn:hover { background: var(--ui-hi); }
.tb-btn.on { background: rgba(255, 255, 255, .2); }
.tb-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn:focus-visible, .opt:focus-visible, .ov-item:focus-visible, .thumb:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tb-btn[disabled] { opacity: .35; cursor: default; }
.tb-sep { width: 1px; height: 20px; background: rgba(255, 255, 255, .16); margin: 0 6px; flex: none; }
.tb-count { font-size: 14px; font-variant-numeric: tabular-nums; min-width: 64px; text-align: center; color: var(--ui-dim); flex: none; }
.tb-count b { color: var(--ui-fg); font-weight: 600; }
.swatches { display: inline-flex; gap: 2px; margin: 0 2px; }
.sw { width: 28px; height: 36px; border: 0; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; }
.sw i { width: 16px; height: 16px; border-radius: 50%; display: block; box-shadow: 0 0 0 2px rgba(255, 255, 255, .15); transition: transform .15s ease-out, box-shadow .15s ease-out; }
.sw.on i { transform: scale(1.18); box-shadow: 0 0 0 2px var(--ui-fg); }
.tb-tip {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translate(-50%, 4px);
  white-space: nowrap; background: var(--ui); color: var(--ui-fg); font-size: 13px; padding: 5px 9px;
  border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .15s ease-out, transform .15s ease-out;
}
.tb-tip kbd { color: var(--ui-dim); border-color: rgba(255, 255, 255, .2); height: 20px; min-width: 20px; font-size: 11px; margin-inline-start: 6px; }
.tb-btn:hover .tb-tip { opacity: 1; transform: translate(-50%, 0); }

.overlay {
  position: absolute; inset: 0; z-index: 30; background: rgba(15, 17, 21, .78);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); overflow: auto; padding: 40px 32px 90px;
}
.ov-head { display: flex; justify-content: space-between; align-items: center; color: #fff; max-width: 1300px; margin: 0 auto 22px; }
.ov-head h2 { font-family: var(--f-hand); font-size: 28px; margin: 0; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; max-width: 1300px; margin: 0 auto; }
.ov-item { background: none; border: 0; padding: 0; cursor: pointer; text-align: start; color: #d7d9de; font-size: 14px; }
.ov-item .thumb { margin: 0 0 10px; box-shadow: 0 0 0 3px rgba(255, 255, 255, .14); transition: box-shadow .15s ease-out; }
.ov-item:hover .thumb, .ov-item.cur .thumb { box-shadow: 0 0 0 3px var(--accent); }
.help-card { max-width: 760px; margin: 6vh auto 0; background: #fff; color: var(--ink); border-radius: 18px; padding: 30px 34px; }
.help-card h2 { font-family: var(--f-hand); margin: 0 0 16px; font-size: 28px; }
.help-card .keys { color: var(--ink-2); }
.help-card kbd { color: var(--ink); border-color: rgba(0, 0, 0, .15); }

/* ───────────────────────── Slide ───────────────────────── */

.slide {
  position: absolute; inset: 0; z-index: 1; direction: rtl; color: var(--ink);
  font-family: var(--f-text); font-size: 38px; line-height: 1.75;
  padding: 44px 80px 40px; display: flex; flex-direction: column;
}
.s-head { display: flex; align-items: flex-start; justify-content: space-between; height: 64px; flex: none; }
.s-label { font-family: var(--f-hand); font-weight: 700; font-size: 34px; line-height: 1.3; position: relative; display: inline-block; padding-bottom: 6px; }
.s-label .u-line { height: 12px; bottom: -6px; }
.s-lesson { font-size: 20px; color: var(--ink-3); line-height: 1.6; padding-top: 6px; }
.s-lesson b { font-weight: 600; color: var(--ink-2); }
.s-title { font-family: var(--f-hand); font-weight: 700; font-size: 52px; line-height: 1.45; text-align: center; margin: 0 0 8px; flex: none; }
.s-intro { text-align: center; font-size: 30px; color: var(--ink-2); margin: -4px 0 6px; line-height: 1.7; flex: none; }
.s-body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; position: relative; }
.s-foot { display: flex; justify-content: space-between; align-items: center; height: 34px; font-size: 19px; color: var(--ink-3); flex: none; }
.s-foot .s-src { display: inline-flex; align-items: center; gap: 8px; }
.s-foot svg { width: 20px; height: 20px; }
svg.links { position: absolute; inset: 0; width: 1600px; height: 900px; pointer-events: none; z-index: 0; overflow: visible; }
svg.links path { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }

/* ink colours */
.i-r { color: var(--red); } .i-b { color: var(--blue); } .i-g { color: var(--green); }
.i-o { color: var(--orange); } .i-p { color: var(--purple); } .i-k { color: var(--ink); font-weight: 700; }
.hand { font-family: var(--f-hand); }
mark.mk-h { background: linear-gradient(100deg, transparent 0 2%, var(--hl) 4% 95%, transparent 98%); color: inherit; padding: 0 .12em; border-radius: .2em; }
.mk-u, .mk-c { position: relative; display: inline-block; }
.u-line { position: absolute; left: -2%; width: 104%; height: 14px; bottom: -4px; overflow: visible; pointer-events: none; }
.u-line path { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; }
.mk-u .u-line { color: var(--red); bottom: 2px; }
.mk-c .circ { position: absolute; inset: -14% -14%; width: 128%; height: 128%; color: var(--red); overflow: visible; pointer-events: none; }
.circ path { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; }
.mk-s { position: relative; color: var(--ink-3); }
.mk-s::after { content: ""; position: absolute; left: -2%; right: -2%; top: 52%; height: 4px; background: var(--red); border-radius: 2px; transform: rotate(-2deg); }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.05; font-size: .82em; margin: 0 .15em; font-family: var(--f-text); font-weight: 700; }
.frac span:first-child { border-bottom: 3px solid currentColor; padding: 0 .2em .06em; }
.frac span:last-child { padding-top: .06em; }
.num { font-family: var(--f-hand); }

/* reveal: anything with data-s waits for its step */
.slide [data-s] { transition: opacity .45s ease-out, transform .45s ease-out, clip-path .7s ease-out; }
.slide [data-s]:not(.on) { opacity: 0; transform: translateY(8px); pointer-events: none; }
.slide .write[data-s] { clip-path: inset(-20% 0 -20% 0); }
.slide .write[data-s]:not(.on) { clip-path: inset(-20% 0 -20% 100%); transform: none; opacity: 1; }
svg.links path[data-s] { transition: stroke-dashoffset .8s ease-out, opacity .2s; transform: none !important; }
svg.links path[data-s]:not(.on) { opacity: 0; }
.slide.all [data-s], .slide.static [data-s] { opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important; stroke-dashoffset: 0 !important; }
@media (prefers-reduced-motion: reduce) {
  .slide [data-s] { transition: opacity .2s linear !important; transform: none !important; clip-path: none !important; }
}

/* ── title ── */
.k-title .s-body { justify-content: center; align-items: center; padding-bottom: 30px; }
.tt-n { font-family: var(--f-hand); font-weight: 700; font-size: 40px; color: var(--red); margin-bottom: 14px; }
.tt-box {
  font-family: var(--f-hand); font-weight: 700; font-size: 84px; line-height: 1.35; padding: 22px 64px 30px;
  background: var(--yellow); border: 5px solid #2f9e4f; border-radius: 26px 30px 24px 32px / 30px 24px 32px 26px;
  box-shadow: 6px 8px 0 rgba(29, 36, 51, .08); position: relative; z-index: 1; text-align: center; max-width: 1300px;
}
.tt-meta { margin-top: 16px; font-size: 24px; color: var(--ink-3); }
.tt-goals { display: flex; gap: 40px; justify-content: center; margin-top: 96px; width: 100%; position: relative; z-index: 1; }
.tt-g { flex: 1; max-width: 440px; text-align: center; font-size: 32px; line-height: 1.65; padding: 18px 22px; border-radius: 18px; background: #fff; border: 3px solid currentColor; box-shadow: 4px 6px 0 rgba(29, 36, 51, .06); }
.tt-g b { display: block; font-family: var(--f-hand); font-size: 26px; margin-bottom: 4px; }
.tt-g span { color: var(--ink); }

/* ── define ── */
.def { max-width: 1340px; margin: 0 auto; width: 100%; }
.def-term { font-family: var(--f-hand); font-weight: 700; font-size: 62px; line-height: 1.4; display: inline-block; position: relative; margin-bottom: 18px; }
.def-term .u-line { bottom: -8px; height: 16px; }
.def-text { font-size: 44px; line-height: 1.85; margin: 0; }
.def-points { list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 16px; }
.def-points li { font-size: 34px; line-height: 1.7; padding-inline-start: 46px; position: relative; }
.def-points li::before { content: ""; position: absolute; right: 6px; top: .62em; width: 18px; height: 18px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 5px rgba(31, 86, 214, .14); }
.def-ex { margin-top: 30px; font-size: 32px; color: var(--ink-2); }
.def-ex .lead { font-family: var(--f-hand); color: var(--green); margin-inline-end: 12px; }

/* ── tree ── */
.k-tree .s-body { justify-content: center; padding-bottom: 20px; }
.tree { display: flex; flex-direction: column; align-items: center; position: relative; width: 100%; }
.t-root {
  font-family: var(--f-hand); font-weight: 700; font-size: 46px; line-height: 1.35; padding: 12px 40px 18px;
  background: var(--yellow); border: 4px solid #2f9e4f; border-radius: 18px 22px 16px 24px / 22px 16px 24px 18px;
  position: relative; z-index: 1;
}
.t-row { display: flex; justify-content: space-around; width: 100%; margin-top: 78px; gap: 24px; position: relative; z-index: 1; }
.t-col { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 0; }
.t-node { font-family: var(--f-hand); font-weight: 700; text-align: center; line-height: 1.4; position: relative; z-index: 1; }
.t-node.lv1 { font-size: 44px; padding: 4px 18px; }
.t-node.lv1.boxed { border: 3.5px solid currentColor; border-radius: 16px 20px 14px 22px / 20px 14px 22px 16px; padding: 8px 26px 12px; background: #fff; }
.t-row:has(> .t-col:nth-child(4)) .t-node.lv1 { font-size: 34px; padding: 6px 16px 10px; }
.t-kids { display: flex; justify-content: center; gap: 36px; margin-top: 60px; width: 100%; }
.t-col2 { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.t-node.lv2 { font-size: 36px; padding: 2px 10px; }
.t-ex { margin-top: 14px; text-align: center; font-size: 30px; line-height: 1.8; color: var(--green); font-weight: 600; }
.t-ex.ink { color: var(--ink-2); font-weight: 500; }
.t-note { text-align: center; font-size: 28px; color: var(--ink-2); margin-top: 26px; }

/* ── cards ── */
.cards { display: grid; gap: 26px 30px; width: 100%; }
.cards.c1 { grid-template-columns: 1fr; max-width: 1200px; margin: 0 auto; }
.cards.c2 { grid-template-columns: 1fr 1fr; }
.cards.c3 { grid-template-columns: 1fr 1fr 1fr; }
.cards.c4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.card {
  --c: var(--blue);
  border: 3.5px solid var(--c); border-radius: 18px 24px 16px 22px / 22px 16px 24px 18px;
  background: color-mix(in srgb, var(--c) 5%, #fff); padding: 20px 26px 22px;
  display: flex; gap: 22px; align-items: flex-start; position: relative;
}
.card.cr { --c: var(--red); } .card.cg { --c: var(--green); } .card.co { --c: var(--orange); } .card.cp { --c: var(--purple); }
.card-ic {
  flex: none; width: 92px; height: 92px; border-radius: 50%; border: 3.5px solid var(--c); color: var(--c);
  display: flex; align-items: center; justify-content: center; font-family: var(--f-text); font-weight: 800;
  font-size: 50px; line-height: 1; background: #fff; direction: ltr;
}
.card-ic.sm { font-size: 34px; }
.card-b { min-width: 0; flex: 1; }
.card-t { font-family: var(--f-hand); font-weight: 700; font-size: 36px; line-height: 1.4; color: var(--c); margin-bottom: 4px; }
.card-d { font-size: 28px; line-height: 1.7; }
.card-x { font-size: 28px; line-height: 1.7; margin-top: 8px; color: var(--ink-2); }
.card-x .lead, .lead { font-family: var(--f-hand); color: var(--green); margin-inline-end: 8px; }
.cards.dense .card { padding: 14px 22px 16px; }
.cards.dense .card-d, .cards.dense .card-x { font-size: 26px; }
.cards.dense .card-t { font-size: 32px; }

/* ── chips ── */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 20px; max-width: 1360px; margin: 0 auto; }
.chip {
  font-family: var(--f-hand); font-weight: 700; font-size: 44px; line-height: 1.3; padding: 10px 28px 14px;
  border: 3.5px solid currentColor; border-radius: 999px; background: #fff;
}
.chips.sm .chip { font-size: 34px; padding: 6px 22px 10px; }
.chips .chip:nth-child(4n+1) { color: var(--blue); } .chips .chip:nth-child(4n+2) { color: var(--red); }
.chips .chip:nth-child(4n+3) { color: var(--green); } .chips .chip:nth-child(4n+4) { color: var(--purple); }
.chips.mono .chip { color: var(--blue); }
.chips-group.on .chip { animation: pop .45s both; }
.slide.static .chip, .print-page .chip { animation: none !important; }
@keyframes pop { from { opacity: 0; transform: scale(.7) rotate(-4deg); } to { opacity: 1; transform: none; } }
.chips-note { text-align: center; font-size: 32px; margin-top: 34px; line-height: 1.75; }
.chips-cap { text-align: center; font-family: var(--f-hand); font-size: 34px; color: var(--ink-2); margin: 0 0 20px; }
.chips-group + .chips-group { margin-top: 34px; }

/* ── formula ── */
.fx { display: flex; flex-direction: column; gap: 22px; align-items: center; width: 100%; }
.fx-grid { display: grid; gap: 14px 14px; align-items: center; justify-content: center; }
.fx-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 60px; width: 100%; }
.fx-row { display: contents; }
.fx-line { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fx-parts { display: flex; align-items: center; gap: 14px; justify-content: center; flex-wrap: wrap; }
.fx-p {
  --c: var(--blue);
  font-family: var(--f-hand); font-weight: 700; font-size: 40px; line-height: 1.3; padding: 6px 22px 10px;
  border: 3.5px solid var(--c); color: var(--c); border-radius: 14px 18px 12px 20px / 18px 12px 20px 14px;
  background: #fff; text-align: center; white-space: nowrap;
}
.fx-p.c1 { --c: var(--red); } .fx-p.c2 { --c: var(--purple); } .fx-p.c3 { --c: var(--orange); }
.fx-p.res { --c: var(--green); background: color-mix(in srgb, var(--yellow) 55%, #fff); }
.fx-p.soft { border-style: dashed; }
.fx-op { font-family: var(--f-hand); font-weight: 700; font-size: 46px; color: var(--ink-3); line-height: 1; text-align: center; }
.fx-ex { font-size: 30px; color: var(--ink-2); text-align: center; line-height: 1.7; }
.fx.compact .fx-p { font-size: 34px; padding: 3px 18px 7px; }
.fx.compact .fx-op { font-size: 38px; }
.fx.compact .fx-grid { gap: 10px 12px; }
.fx-note { font-size: 30px; text-align: center; color: var(--ink-2); line-height: 1.7; margin-top: 6px; }
.fx-head { font-family: var(--f-hand); font-size: 34px; color: var(--ink-2); text-align: center; }

/* ── examples ── */
.exs { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 18px; width: 100%; max-width: 1400px; counter-reset: ex; }
.exs li { display: grid; grid-template-columns: 60px 1fr auto; align-items: baseline; gap: 18px; font-size: 40px; line-height: 1.75; counter-increment: ex; }
.exs li::before {
  content: counter(ex, arabic-indic); font-family: var(--f-hand); font-weight: 700; color: var(--blue);
  width: 52px; height: 52px; border: 3px solid var(--blue); border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 28px; line-height: 1; align-self: center;
}
.exs.nonum li { grid-template-columns: 1fr auto; } .exs.nonum li::before { display: none; }
.exs .ex-n { font-size: 26px; color: var(--green); font-family: var(--f-hand); white-space: nowrap; }
.exs.sm li { font-size: 34px; gap: 14px; }
.ex-lead { text-align: center; font-size: 32px; color: var(--ink-2); margin-bottom: 18px; }
.ex-foot { text-align: center; font-size: 30px; margin-top: 26px; line-height: 1.7; }

/* ── parse (labelled brackets under words) ── */
.parse { display: flex; flex-direction: column; gap: 22px; width: 100%; align-items: center; }
.pz { font-size: 42px; line-height: 1.5; text-align: center; position: relative; }
.parse.sm { gap: 14px; } .parse.sm .pz { font-size: 36px; } .parse.sm .seg-l { font-size: 24px; }
.pz-note { font-size: 28px; color: var(--ink-2); text-align: center; margin-top: 6px; }
.seg { display: inline-flex; flex-direction: column; align-items: center; vertical-align: top; position: relative; margin: 0 4px; }
.seg-t { position: relative; color: var(--c, var(--red)); font-weight: 700; padding: 0 4px; }
.seg-t::after {
  content: ""; position: absolute; left: 3px; right: 3px; bottom: -6px; height: 14px;
  border: 3.5px solid currentColor; border-top: 0; border-radius: 0 0 10px 10px;
}
.seg-pu { position: absolute; left: -.38em; top: 0; color: var(--ink); font-weight: 400; }
.seg-l { margin-top: 12px; white-space: nowrap; font-family: var(--f-hand); font-weight: 700; font-size: 27px; color: var(--c, var(--red)); line-height: 1.3; }
/* a word split into two coloured parts keeps its letters joined: labels float and stagger */
.seg.tight { margin: 0; padding-bottom: 60px; }
.seg.tight .seg-l { position: absolute; top: calc(100% - 42px); margin: 0; }
.seg.tight.j { padding-bottom: 98px; } .seg.tight.j .seg-l { transform: translateY(38px); }
.pg { display: inline-flex; flex-direction: column; align-items: center; vertical-align: top; position: relative; padding-bottom: 66px; }
.pg-in { position: relative; padding: 0 6px; }
.pg-in::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 16px; border: 3.5px solid var(--c, var(--ink)); border-top: 0; border-radius: 0 0 14px 14px; opacity: .85; }
.pg-l { position: absolute; bottom: 8px; white-space: nowrap; font-family: var(--f-hand); font-weight: 700; font-size: 27px; color: var(--c, var(--ink)); }
.pz .seg.c-r, .pz .pg.c-r { --c: var(--red); } .pz .c-b { --c: var(--blue); } .pz .c-g { --c: var(--green); }
.pz .c-o { --c: var(--orange); } .pz .c-p { --c: var(--purple); } .pz .c-k { --c: var(--ink); }
/* practice mode: sentence visible, marks appear on the step */
.slide .rv[data-s]:not(.on) { opacity: 1; transform: none; }
.rv:not(.on) .seg-t, .rv:not(.on) .pg-in { color: var(--ink); font-weight: 400; }
.rv:not(.on) .seg-t::after, .rv:not(.on) .pg-in::after, .rv:not(.on) .seg-l, .rv:not(.on) .pg-l { opacity: 0; }
.rv .seg-t::after, .rv .pg-in::after, .rv .seg-l, .rv .pg-l, .rv .seg-t { transition: opacity .4s ease-out, color .4s ease-out; }
.rv:not(.on) .pz-note { opacity: 0; }

/* ── table ── */
.tbw { width: 100%; display: flex; justify-content: center; }
table.tb { border-collapse: collapse; font-size: 32px; line-height: 1.55; min-width: 70%; }
table.tb th { font-family: var(--f-hand); font-weight: 700; font-size: 32px; color: var(--blue); padding: 6px 26px 12px; border-bottom: 4px solid var(--blue); text-align: start; }
table.tb td { padding: 9px 26px; border-bottom: 2px solid rgba(29, 36, 51, .1); vertical-align: middle; }
table.tb td:first-child { font-family: var(--f-hand); font-weight: 700; color: var(--red); white-space: nowrap; }
table.tb.plain td:first-child { font-family: var(--f-text); font-weight: 600; color: var(--ink); }
table.tb.sm { font-size: 28px; } table.tb.sm th { font-size: 28px; padding-bottom: 8px; } table.tb.sm td { padding: 6px 22px; }
table.tb tr[data-s] { transform: none; }
.tb-note { text-align: center; font-size: 28px; color: var(--ink-2); margin-top: 20px; }

/* ── notes (sticky notes) ── */
.notes { display: grid; gap: 36px 40px; width: 100%; align-items: start; }
.notes.n1 { grid-template-columns: 1fr; max-width: 1100px; margin: 0 auto; }
.notes.n2 { grid-template-columns: 1fr 1fr; }
.notes.n3 { grid-template-columns: 1fr 1fr 1fr; }
.note {
  --bg: #fff3a6; background: var(--bg); padding: 34px 30px 26px; position: relative; font-size: 29px; line-height: 1.7;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .04), 4px 12px 22px rgba(29, 36, 51, .12); border-radius: 3px 3px 18px 3px;
}
.note::before { /* tape */
  content: ""; position: absolute; top: -14px; left: 50%; width: 120px; height: 30px; transform: translateX(-50%) rotate(-3deg);
  background: rgba(255, 255, 255, .55); box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.note:nth-child(4n+1) { --bg: #fff1a1; rotate: -1.2deg; } .note:nth-child(4n+2) { --bg: #ffdbe5; rotate: .9deg; }
.note:nth-child(4n+3) { --bg: #d9ecff; rotate: -.6deg; } .note:nth-child(4n+4) { --bg: #dcf5df; rotate: 1.1deg; }
.note-t { font-family: var(--f-hand); font-weight: 700; font-size: 31px; color: var(--ink); margin-bottom: 6px; display: flex; gap: 10px; align-items: center; }
.note-t .num { width: 40px; height: 40px; border-radius: 50%; background: rgba(29, 36, 51, .85); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.note-x { margin-top: 10px; color: var(--blue); font-size: 28px; }
.notes.n1 .note { font-size: 34px; padding: 40px 44px 34px; } .notes.n1 .note-t { font-size: 38px; } .notes.n1 .note-x { font-size: 32px; }
.notes.dense .note { font-size: 26px; padding: 28px 26px 20px; } .notes.dense .note-x { font-size: 25px; }

/* ── compare ── */
.cmp { display: grid; grid-template-columns: 1fr 70px 1fr; width: 100%; align-items: stretch; }
.cmp-p { padding: 6px 10px; }
.cmp-t { font-family: var(--f-hand); font-weight: 700; font-size: 46px; text-align: center; line-height: 1.4; margin-bottom: 6px; }
.cmp-d { font-size: 30px; text-align: center; line-height: 1.7; color: var(--ink-2); margin-bottom: 14px; }
.cmp-l { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cmp-l li { font-size: 31px; line-height: 1.7; padding-inline-start: 40px; position: relative; }
.cmp-l li::before { content: ""; position: absolute; right: 4px; top: .7em; width: 16px; height: 16px; border-radius: 50%; background: currentColor; opacity: .9; }
.cmp-p.a { color: var(--red); } .cmp-p.b { color: var(--blue); }
.cmp-l li > span { color: var(--ink); }
.cmp-mid { display: flex; flex-direction: column; align-items: center; }
.cmp-mid::before { content: ""; flex: 1; width: 4px; border-radius: 4px; background: repeating-linear-gradient(180deg, var(--ink-3) 0 18px, transparent 18px 28px); opacity: .5; }
.cmp-vs { font-family: var(--f-hand); font-weight: 700; font-size: 26px; color: var(--ink-3); width: 58px; height: 58px; border: 3px solid var(--ink-3); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 14px 0; background: var(--board); }
.cmp-mid::after { content: ""; flex: 1; width: 4px; border-radius: 4px; background: repeating-linear-gradient(180deg, var(--ink-3) 0 18px, transparent 18px 28px); opacity: .5; }
.cmp-foot { text-align: center; font-size: 29px; margin-top: 22px; color: var(--ink-2); line-height: 1.7; }

/* ── quiz ── */
.quiz { display: flex; flex-direction: column; gap: 34px; width: 100%; max-width: 1420px; margin: 0 auto; }
.q-t { display: flex; gap: 18px; align-items: baseline; font-size: 36px; line-height: 1.65; margin-bottom: 14px; }
.q-t .num { flex: none; width: 54px; height: 54px; border-radius: 50%; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 28px; align-self: center; }
.q-o { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-inline-start: 72px; }
.q-o.two { grid-template-columns: 1fr 1fr; }
.opt {
  position: relative; display: flex; align-items: center; gap: 14px; text-align: start; cursor: pointer;
  font-family: var(--f-text); font-size: 30px; line-height: 1.5; padding: 10px 16px; min-height: 66px;
  border: 3px solid rgba(29, 36, 51, .18); border-radius: 16px; background: #fff; color: var(--ink);
  transition: border-color .2s ease-out, background .2s ease-out, transform .2s ease-out;
}
.opt:hover { border-color: rgba(29, 36, 51, .4); }
.opt .ol { flex: none; width: 44px; height: 44px; border-radius: 50%; background: rgba(29, 36, 51, .08); display: inline-flex; align-items: center; justify-content: center; font-family: var(--f-hand); font-weight: 700; font-size: 24px; }
.opt.right { border-color: var(--green); background: #e8f7ef; }
.opt.right .ol { background: var(--green); color: #fff; }
.opt.wrong { border-color: var(--red); background: #fdecee; animation: shake .4s; }
.opt.wrong .ol { background: var(--red); color: #fff; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }
.opt .circ { position: absolute; inset: -12px -10px; width: calc(100% + 20px); height: calc(100% + 24px); color: var(--green); }
.opt .tick { position: absolute; top: -26px; left: -12px; width: 56px; height: 56px; color: var(--green); }
.tick path { fill: none; stroke: currentColor; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.q-why {
  margin: 12px 0 0; margin-inline-start: 72px; padding: 6px 18px 8px; border-radius: 12px;
  background: #e8f7ef; border-inline-start: 5px solid var(--green); font-size: 26px; line-height: 1.6; color: var(--ink);
}
.q-why .lead { margin-inline-end: 10px; }
.quiz.dense .q-why { font-size: 23px; margin-top: 8px; padding: 3px 16px 5px; }
.quiz.dense { gap: 22px; } .quiz.dense .q-t { font-size: 32px; margin-bottom: 8px; } .quiz.dense .opt { font-size: 27px; min-height: 58px; padding: 6px 14px; }

/* ── fill (blanks) ── */
.fill { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 22px; width: 100%; max-width: 1400px; counter-reset: fl; }
.fill li { display: grid; grid-template-columns: 60px 1fr; gap: 18px; align-items: baseline; font-size: 38px; line-height: 1.9; counter-increment: fl; }
.fill li::before { content: counter(fl, arabic-indic); font-family: var(--f-hand); font-weight: 700; color: var(--orange); width: 50px; height: 50px; border: 3px solid var(--orange); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; line-height: 1; align-self: center; }
.blank { display: inline-block; min-width: 150px; border-bottom: 4px dotted var(--ink-3); text-align: center; padding: 0 12px; margin: 0 6px; line-height: 1.4; vertical-align: baseline; }
.blank .ans { font-family: var(--f-hand); font-weight: 700; color: var(--green); }
.fill.sm li { font-size: 34px; gap: 14px; }

/* ── fix / convert ── */
.fix { display: grid; gap: 24px; width: 100%; max-width: 1440px; margin: 0 auto; }
.fx-item { display: grid; grid-template-columns: 1fr 70px 1fr; gap: 10px; align-items: center; }
.fx-bad, .fx-good { font-size: 32px; line-height: 1.6; padding: 12px 20px; border-radius: 16px; }
.fx-bad { background: #fff; border: 3px dashed rgba(212, 42, 62, .45); position: relative; }
.fx-good { background: #ecf8f1; border: 3px solid var(--green); color: var(--ink); }
.fx-arrow { color: var(--ink-3); display: flex; justify-content: center; }
.fx-arrow svg { width: 56px; height: 34px; }
.fx-arrow path { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.fx-why { grid-column: 1 / -1; font-size: 25px; color: var(--ink-2); padding-inline-start: 24px; margin-top: -6px; }
.fx-bad .xmark { position: absolute; top: -18px; left: -14px; width: 40px; height: 40px; color: var(--red); }
.fix.convert .fx-bad { border-color: rgba(31, 86, 214, .4); }
.fix.convert .fx-arrow { color: var(--blue); }

/* ── merge ── */
.merge { display: grid; grid-template-columns: auto 120px 1fr; align-items: center; gap: 10px; width: 100%; max-width: 1440px; margin: 0 auto; }
.mg-from { display: grid; gap: 14px; }
.mg-from div { font-size: 33px; line-height: 1.6; padding: 8px 22px; border-radius: 14px; background: #f1f4fb; border: 2px solid rgba(31, 86, 214, .25); }
.mg-brace { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--blue); }
.mg-brace svg { width: 110px; height: 100%; overflow: visible; }
.mg-brace path { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.mg-to { font-size: 38px; line-height: 1.7; padding: 22px 30px; border-radius: 20px; background: color-mix(in srgb, var(--yellow) 45%, #fff); border: 4px solid var(--green); }
.mg-note { grid-column: 1 / -1; text-align: center; font-size: 29px; color: var(--ink-2); margin-top: 20px; line-height: 1.7; }

/* ── summary ── */
.sum { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 16px; max-width: 1300px; width: 100%; }
.sum li { font-size: 34px; line-height: 1.7; display: flex; gap: 20px; align-items: baseline; }
.sum li .tick { width: 46px; height: 46px; flex: none; color: var(--green); align-self: center; }
.sum-hw {
  margin: 30px auto 0; display: flex; align-items: center; gap: 14px; justify-content: center; width: fit-content;
  font-size: 28px; color: var(--ink-2); padding: 12px 26px; border: 3px dashed var(--orange); border-radius: 16px;
}
.sum-hw svg { width: 36px; height: 36px; flex: none; color: var(--orange); }
.sum-hw b { font-family: var(--f-hand); color: var(--orange); font-weight: 700; }

/* ── cover (all-lessons PDF) ── */
.k-cover { align-items: center; justify-content: center; padding: 70px 120px; }
.cv-kick { font-family: var(--f-hand); color: var(--red); font-size: 30px; }
.cv-title { font-family: var(--f-hand); font-weight: 700; font-size: 104px; line-height: 1.3; margin: 6px 0 46px; position: relative; display: inline-block; }
.cv-title .u-line { color: var(--blue); height: 18px; bottom: -6px; }
.cv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 90px; width: 100%; }
.cv-cols h3 { font-family: var(--f-hand); font-size: 34px; margin: 0 0 12px; color: var(--blue); }
.cv-cols ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cv-cols li { display: flex; align-items: center; gap: 16px; font-size: 28px; line-height: 1.6; border-bottom: 2px dotted rgba(29, 36, 51, .15); padding-bottom: 4px; }
.cv-n { font-family: var(--f-hand); font-weight: 700; color: #fff; background: var(--ink); width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.cv-p { margin-inline-start: auto; color: var(--ink-3); font-size: 22px; }

/* ───────────────────────── Print / PDF ───────────────────────── */

.print-root { display: none; }
@page { size: 1600px 900px; margin: 0; }
@media print {
  html, body { background: #fff !important; width: 1600px; }
  body > *:not(.print-root) { display: none !important; }
  .print-root { display: block !important; }
}
body.printing { background: #fff; width: 1600px; }
body.printing > *:not(.print-root) { display: none !important; }
body.printing .print-root { display: block; }
.print-page { position: relative; width: 1600px; height: 900px; overflow: hidden; background: #fff; break-after: page; page-break-after: always; }
.print-page:last-child { break-after: auto; page-break-after: auto; }
.print-page .slide [data-s] { opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important; }
.print-page .rv .seg-t, .print-page .rv .pg-in { color: var(--c, var(--red)); font-weight: 700; }
.print-page .rv .seg-t::after, .print-page .rv .pg-in::after, .print-page .rv .seg-l, .print-page .rv .pg-l, .print-page .rv .pz-note { opacity: 1 !important; }
.print-cover .slide { padding-top: 60px; }

/* ───────────────────────── Small screens ───────────────────────── */
@media (max-width: 760px) {
  .lib { padding-block: 22px 48px; }
  .lib-head { padding: 30px 24px 28px; margin: 8px 8px 40px; }
  .season { margin: 0 4px 40px; }
  .howto { margin: 0 4px; }
  .toolbar .opt-wide { display: none; }
  .tb-count { min-width: 50px; }
}
