/* NISYAS ACADEMY, v2 (2026-11-03 d): rebuilt to Yassine's Learnix reference.
   One rounded geometric sans (Lexend; IBM Plex Sans Arabic for Arabic), warm brown cards, pills, one orange accent.
   Every colour, size and radius below resolves to a token declared in UI-SPEC.md. */
:root {
  --ground: #17130f;
  --panel: #1d1813;
  --card: #241e19;
  --raise: #2d261f;
  --cell: #3a3029;
  --on-accent: #1a120b;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ink: #f3eee8;
  --muted: #a39a92;
  --dim: #6f655d;
  --accent: #e0954f;
  --mark: #f29949;
  --cream: #f0d3a8;
  --mint: #9ad8c0;
  --blue: #8fb4e8;
  --scrim: rgba(23, 19, 15, 0.92);
  --fade: rgba(224, 149, 79, 0.16);

  --sans: "Lexend", "IBM Plex Sans Arabic", sans-serif;
  --num: "Lexend", "IBM Plex Sans Arabic", sans-serif;

  --t12: 12px; --t13: 13px; --t15: 15px; --t17: 17px; --t20: 20px;
  --t26: 26px; --t34: 34px; --t44: 44px; --t64: 64px;

  --r-card: 24px; --r-cell: 12px; --r-pill: 999px;
}
html[lang="ar"] { --sans: "IBM Plex Sans Arabic", "Lexend", sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--sans); font-size: var(--t15); font-weight: 400; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; font-size: var(--t15); }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
small { font-size: var(--t13); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
html[dir="rtl"] .flip { transform: scaleX(-1); }
svg.i { width: 18px; height: 18px; flex: none; }

/* ---------------- top bar (both pages) ---------------- */
.top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  max-width: 1536px; margin-inline: auto; padding: 22px 40px 10px;
}
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--mark); font-size: var(--t20); font-weight: 500; letter-spacing: -0.01em; }
.logo svg { width: 22px; height: 22px; fill: currentColor; }
.tabs { display: flex; gap: 4px; padding: 5px; background: var(--raise); border-radius: var(--r-pill); }
.tab {
  display: inline-flex; align-items: center; padding: 10px 22px; border: 0; border-radius: var(--r-pill);
  background: none; color: var(--muted); font-size: var(--t15); white-space: nowrap;
  transition: background-color 200ms ease, color 200ms ease;
}
.tab[aria-pressed="true"], .tab[aria-current] { background: var(--accent); color: var(--on-accent); font-weight: 500; }
.top-end { justify-self: end; display: flex; align-items: center; gap: 10px; }
.round {
  position: relative; display: grid; place-items: center; width: 46px; height: 46px; border: 0;
  border-radius: var(--r-pill); background: var(--raise); color: var(--ink); flex: none;
}
.round .dot { position: absolute; top: 11px; inset-inline-end: 12px; width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--accent); }
.me { background: var(--cell); font-size: var(--t17); font-weight: 500; }
.lang { display: flex; padding: 4px; gap: 2px; background: var(--raise); border-radius: var(--r-pill); }
.lang button { border: 0; background: none; padding: 8px 14px; border-radius: var(--r-pill); color: var(--muted); font-size: var(--t13); }
.lang button[aria-pressed="true"] { background: var(--cell); color: var(--ink); }

/* ---------------- pills ---------------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--r-pill);
  background: var(--raise); color: var(--ink); font-size: var(--t13); white-space: nowrap; border: 0;
}
.chip.sample { color: var(--muted); }
.chip svg { width: 14px; height: 14px; }
.cta, .ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 24px; border: 0;
  border-radius: var(--r-pill); font-size: var(--t15); font-weight: 500; white-space: nowrap;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}
.cta { background: var(--accent); color: var(--on-accent); }
.ghost { background: var(--raise); color: var(--ink); }
.ghost[aria-disabled="true"] { color: var(--muted); cursor: default; }
.go {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-pill);
  background: var(--raise); color: var(--accent); flex: none;
}
.go svg { width: 16px; height: 16px; }

/* ---------------- cards ---------------- */
.card {
  position: relative; display: flex; flex-direction: column; gap: 16px; min-width: 0;
  padding: 22px 24px; background: var(--card); border-radius: var(--r-card);
}
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-t { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-t .ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-pill); background: var(--raise); color: var(--muted); flex: none; }
.card-t .ico svg { width: 16px; height: 16px; }
.card h2, .card h3.ttl { font-size: var(--t20); font-weight: 500; }
.sub { color: var(--muted); font-size: var(--t13); }
.big { font-family: var(--num); font-variant-numeric: tabular-nums; font-size: var(--t34); font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.big small { font-size: var(--t13); color: var(--muted); font-weight: 400; letter-spacing: 0; margin-inline-start: 4px; }
.is-hidden { display: none !important; }

/* legend dots */
.legend { display: grid; gap: 6px; font-size: var(--t13); color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 7px; height: 7px; border-radius: var(--r-pill); background: var(--accent); flex: none; }
.legend i.k-cream { background: var(--cream); }
.legend i.k-mint { background: var(--mint); }
.legend i.k-blue { background: var(--blue); }
.legend b { color: var(--ink); font-weight: 500; }

/* donut */
.donut-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 1; }
.donut { position: relative; width: 112px; height: 112px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 12; stroke-linecap: round; }
.donut .s1 { stroke: var(--cream); } .donut .s2 { stroke: var(--mint); } .donut .s3 { stroke: var(--blue); }
.donut .n { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--t20); font-weight: 500; }

/* svg chart paints */
.g-a0 { stop-color: var(--accent); stop-opacity: 1; }
.g-a1 { stop-color: var(--accent); stop-opacity: 0.35; }
.g-a2 { stop-color: var(--accent); stop-opacity: 0.5; }
.g-a3 { stop-color: var(--accent); stop-opacity: 0; }
.chart { direction: ltr; }
.track { fill: var(--cell); }
.stroke-track { stroke: var(--cell); }
.stroke-accent { stroke: var(--accent); }
.fill-bar { fill: url(#g-bar); }
.fill-area { fill: url(#g-area); }
.fill-chunk { fill: url(#g-chunk); }
.fill-fade { fill: url(#g-fade); }
.line-accent { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; }

/* bars */
.stat-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex: 1; }
.bars { width: 168px; flex: none; }
.bars svg { width: 100%; height: 96px; display: block; }
.wd { display: grid; grid-template-columns: repeat(7, 1fr); margin-top: 6px; font-size: var(--t12); color: var(--dim); text-align: center; }

/* area */
.area svg { width: 100%; height: 92px; display: block; }
.area-wrap { display: flex; align-items: flex-end; gap: 14px; flex: 1; }
.area-wrap .area { flex: 1; min-width: 0; }

/* ring */
.ring { position: relative; width: 80px; height: 80px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.ring .n { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--t17); font-weight: 500; }

/* segmented gauge */
.gauge { position: relative; width: 100%; max-width: 340px; margin-inline: auto; }
.gauge svg { width: 100%; display: block; }
.gauge path.seg { fill: none; stroke-width: 16; stroke-linecap: round; }
.gauge .n { position: absolute; inset-inline: 0; bottom: 0; text-align: center; font-size: var(--t44); font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
.gauge .n small { font-size: var(--t20); color: var(--muted); }
.gauge-sub { text-align: center; color: var(--muted); font-size: var(--t13); }

/* leaderboard pills */
.lb { display: grid; gap: 12px; }
.lb li { display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 12px; }
.lb .pill { position: relative; display: flex; align-items: center; height: 44px; padding-inline: 6px; border-radius: var(--r-pill); overflow: hidden; }
.lb .pill svg.bg { position: absolute; inset: 0; width: 100%; height: 100%; }
html[dir="rtl"] .lb .pill svg.bg { transform: scaleX(-1); }
.lb .av { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-pill); background: var(--cream); color: var(--ground); font-size: var(--t13); font-weight: 600; }
.lb .av + .av { margin-inline-start: -8px; }
.lb .who { font-size: var(--t15); }
.lb .val { font-size: var(--t15); color: var(--ink); font-weight: 500; }
.lb .val.dim { color: var(--muted); }

/* prizes */
.prizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prizes > div { display: grid; gap: 2px; padding: 12px 14px; background: var(--raise); border-radius: var(--r-cell); }
.prizes span { font-size: var(--t13); color: var(--muted); }
.prizes strong { font-size: var(--t20); font-weight: 500; white-space: nowrap; }
.dash .prizes strong { font-size: var(--t17); }

/* calendar */
.cal-wrap { display: grid; grid-template-columns: 1fr 240px; gap: 20px; align-items: start; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { padding-block: 4px; text-align: center; font-size: var(--t12); color: var(--dim); }
.cal .d {
  position: relative; display: grid; place-items: center; height: 46px; border-radius: var(--r-cell);
  background: var(--cell); font-size: var(--t15); font-family: var(--num); font-variant-numeric: tabular-nums;
}
.cal .d.k-live::after, .cal .d.k-sess::after { content: ""; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; border-radius: var(--r-pill); background: var(--accent); }
.cal .d.k-sess::after { background: var(--cream); }
.cal .d.today { color: var(--accent); font-weight: 600; }
.cal-title { font-size: var(--t26); font-weight: 500; letter-spacing: -0.01em; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--t13); color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 8px; }
.cal-legend i { width: 7px; height: 7px; border-radius: var(--r-pill); background: var(--accent); }
.cal-legend i.k-sess { background: var(--cream); }
.upcoming { display: grid; gap: 8px; }
.upcoming li { display: grid; gap: 2px; padding: 12px 14px; background: var(--raise); border-radius: var(--r-cell); font-size: var(--t13); color: var(--muted); }
.upcoming li span:first-child { color: var(--ink); font-size: var(--t15); }

/* live countdown */
.teacher { display: flex; align-items: center; gap: 14px; }
.avatar { width: 56px; height: 56px; border-radius: var(--r-pill); object-fit: cover; background: var(--cell); }
.avatar.lg { width: 84px; height: 84px; }
.teacher h3, .teacher .t-title { font-size: var(--t17); font-weight: 500; }
.count { display: flex; gap: 22px; }
.count > div { display: grid; justify-items: center; }
.count .n { font-family: var(--num); font-variant-numeric: tabular-nums; font-size: var(--t34); font-weight: 500; color: var(--accent); line-height: 1.05; letter-spacing: -0.02em; }
.count .u { font-size: var(--t12); color: var(--muted); }
.count.xl .n { font-size: var(--t44); }
.live-go { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.note { font-size: var(--t13); color: var(--muted); }

/* lessons */
.lessons { display: grid; gap: 8px; }
.lessons li { display: grid; grid-template-columns: 34px 30px 1fr 120px auto; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; background: var(--raise); border-radius: var(--r-pill); }
.lessons .st { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-pill); background: var(--cell); color: var(--muted); }
.lessons .st svg { width: 16px; height: 16px; }
.lessons .st.ok, .lessons .st.now { color: var(--accent); }
.lessons .nb { color: var(--muted); font-size: var(--t13); }
.lessons .lbar { height: 6px; border-radius: var(--r-pill); background: var(--cell); overflow: hidden; }
.lessons .lbar b { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); }
.lessons .state { font-size: var(--t13); color: var(--muted); white-space: nowrap; }
.lessons li.locked .t { color: var(--muted); }
.lessons .cta { padding: 8px 16px; font-size: var(--t13); }
.lessons.simple li { grid-template-columns: 34px 1fr auto; }

/* image card */
.img-card { padding: 0; overflow: hidden; min-height: 240px; justify-content: flex-end; }
.img-card picture, .img-card img.cover { position: absolute; inset: 0; width: 100%; height: 100%; }
.img-card img.cover { object-fit: cover; object-position: 50% 12%; }
.img-card .scrim { position: absolute; inset: 0; background-image: linear-gradient(to top, var(--scrim) 18%, transparent 72%); }
.img-card .inner { position: relative; display: grid; gap: 4px; padding: 22px 24px; }

/* ask */
.ask { display: flex; gap: 8px; }
.ask input { flex: 1; min-width: 0; padding: 13px 20px; border: 0; border-radius: var(--r-pill); background: var(--raise); color: var(--ink); }
.ask input::placeholder { color: var(--dim); }

/* notification chip */
.notif svg { color: var(--accent); }
.notif b { font-weight: 500; }
.notif .np { color: var(--muted); }

/* ---------------- dashboard page ---------------- */
.main { max-width: 1536px; margin-inline: auto; padding: 10px 40px 48px; }
.dhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-block: 18px 22px; flex-wrap: wrap; }
.hi { color: var(--muted); font-size: var(--t17); }
.name { font-size: var(--t34); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.dhead-end { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.dash {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
  grid-template-areas:
    "donut bars area active"
    "live gauge cal cal"
    "lead quiz lessons lessons"
    "new new ai access";
}
.a-donut { grid-area: donut; } .a-bars { grid-area: bars; } .a-area { grid-area: area; } .a-active { grid-area: active; }
.a-live { grid-area: live; } .a-gauge { grid-area: gauge; } .a-cal { grid-area: cal; } .a-lead { grid-area: lead; }
.a-quiz { grid-area: quiz; } .a-new { grid-area: new; } .a-lessons { grid-area: lessons; } .a-ai { grid-area: ai; } .a-access { grid-area: access; }
.dash.filtered { grid-template-areas: none; grid-auto-flow: row dense; }
.dash.filtered > * { grid-area: auto; }
.dash.filtered > .a-cal, .dash.filtered > .a-lessons { grid-column: span 2; }
.dfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.dfoot a { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--t13); }

/* ---------------- public page ---------------- */
.wrap { max-width: 1536px; margin-inline: auto; padding-inline: 40px; }
.hero { display: grid; grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr); gap: 48px; align-items: center; padding-block: 36px 40px; }
.hero h1 { font-size: var(--t64); font-weight: 500; letter-spacing: -0.03em; line-height: 1.02; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { margin-top: 22px; font-size: var(--t17); color: var(--muted); max-width: 46ch; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.hero-note { margin-top: 16px; font-size: var(--t13); color: var(--muted); }
.screen { padding: 18px; background: var(--panel); border-radius: var(--r-card); display: grid; gap: 14px; }
.screen-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 6px 0; }
.screen-h .hi { font-size: var(--t13); }
.screen-h .name { font-size: var(--t26); }
.mini {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  grid-template-areas: "donut bars area" "live live gauge";
}
.mini .card { padding: 18px 20px; gap: 12px; }
.mini .donut { width: 96px; height: 96px; }
.mini .bars { width: 128px; }

.section { padding-top: 112px; }
.sec-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 28px; flex-wrap: wrap; }
.sec-h h2 { font-size: var(--t44); font-weight: 500; letter-spacing: -0.02em; }
.sec-h p { max-width: 52ch; color: var(--muted); font-size: var(--t17); }

.prog { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 16px; }
.facts-list { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 28px; }
.facts-list li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.facts-list .ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-pill); background: var(--raise); color: var(--accent); }
.facts-list .ico svg { width: 18px; height: 18px; }
.facts-list h3 { font-size: var(--t17); font-weight: 500; margin-bottom: 4px; }
.facts-list p { color: var(--muted); font-size: var(--t15); }
.quiz { display: grid; gap: 8px; }
.quiz p { font-size: var(--t15); font-weight: 500; margin-bottom: 4px; }
.quiz label { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--raise); border-radius: var(--r-pill); cursor: pointer; font-size: var(--t15); }
.quiz input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }

.lives { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.live-big { gap: 22px; }
.sess { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 18px; background: var(--raise); border-radius: var(--r-cell); }
.sess .count .n { font-size: var(--t26); color: var(--ink); }

.prof { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); padding: 0; overflow: hidden; gap: 0; }
.prof-photo { position: relative; min-height: 560px; }
.prof-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.prof-text { display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: 48px 56px; }
.prof-text .sub { font-size: var(--t17); }
.prof-name { font-size: var(--t64); font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.prof-lines { display: grid; gap: 10px; }
.prof-lines li { display: flex; gap: 12px; align-items: baseline; font-size: var(--t17); color: var(--muted); }
.prof-lines li::before { content: ""; width: 7px; height: 7px; border-radius: var(--r-pill); background: var(--accent); flex: none; transform: translateY(-2px); }

.chal { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; }
.chal-side { display: grid; gap: 16px; }
.equity svg { width: 100%; height: auto; display: block; }
.equity .peak { stroke: var(--dim); }
.equity .cut { stroke: var(--cream); }
.equity-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 10px; font-size: var(--t13); color: var(--muted); }
.equity-keys { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.equity-keys > span { display: inline-flex; align-items: center; gap: 8px; }
.equity-keys i { width: 16px; height: 2px; background: var(--dim); }
.equity-keys i.k-cut { background: var(--cream); }

.access { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 16px; }
.plans { display: grid; gap: 14px; }
.plan { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 16px; }
.plan strong { font-size: var(--t17); font-weight: 500; }
.plan .bar { height: 14px; border-radius: var(--r-pill); background: var(--cell); overflow: hidden; }
.plan .bar b { display: block; height: 100%; border-radius: var(--r-pill); background: var(--accent); }
.plan-ends { display: flex; justify-content: space-between; margin-inline-start: 106px; font-size: var(--t13); color: var(--muted); }
.notes { display: grid; gap: 10px; }
.notes li { display: flex; gap: 12px; align-items: baseline; color: var(--muted); }
.notes li::before { content: ""; width: 7px; height: 7px; border-radius: var(--r-pill); background: var(--accent); flex: none; transform: translateY(-2px); }
.login { gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: var(--t13); color: var(--muted); }
.field input { padding: 14px 20px; border: 0; border-radius: var(--r-pill); background: var(--raise); color: var(--ink); }
.later { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 16px; }
.later h2 { font-size: var(--t20); }

.foot { margin-top: 112px; padding-block: 40px 48px; background: var(--panel); }
.foot-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot-legal { display: grid; gap: 8px; margin-top: 24px; font-size: var(--t13); color: var(--muted); max-width: 80ch; }

/* ---------------- responsive ---------------- */
@media (max-width: 1240px) {
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "donut bars" "area active" "live gauge" "cal cal" "lead quiz" "lessons lessons" "new new" "ai access"; }
  .hero { grid-template-columns: 1fr; }
  .hero h1 { max-width: 14ch; }
}
@media (max-width: 860px) {
  .top { grid-template-columns: 1fr auto; padding-inline: 20px; }
  .tabs-wrap { grid-column: 1 / -1; grid-row: 2; }
  .main, .wrap { padding-inline: 16px; }
  .prog, .lives, .chal, .access, .prof { grid-template-columns: 1fr; }
  .prof-photo { min-height: 420px; }
  .prof-text { padding: 28px 24px 32px; }
  .facts-list { grid-template-columns: 1fr; }
  .cal-wrap { grid-template-columns: 1fr; }
  .mini { grid-template-columns: 1fr 1fr; grid-template-areas: "donut bars" "live live" "gauge area"; }
}
@media (max-width: 640px) {
  .dash { grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "live" "gauge" "donut" "bars" "area" "active" "cal" "lead" "quiz" "new" "lessons" "ai" "access"; }
  .dash.filtered > .a-cal, .dash.filtered > .a-lessons { grid-column: auto; }
  .mini { grid-template-columns: minmax(0, 1fr); grid-template-areas: "live" "gauge" "donut" "bars"; }
  .mini .a-area { display: none; }
  .hero h1 { font-size: var(--t44); }
  .prof-name { font-size: var(--t44); }
  .sec-h h2 { font-size: var(--t34); }
  .name { font-size: var(--t26); }
  .section { padding-top: 80px; }
  .tabs-wrap { overflow-x: auto; scrollbar-width: none; margin-inline: -20px; padding-inline: 20px;
    -webkit-mask-image: linear-gradient(to right, transparent 0, var(--ground) 20px, var(--ground) calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, var(--ground) 20px, var(--ground) calc(100% - 28px), transparent 100%); }
  .tabs-wrap::-webkit-scrollbar { display: none; }
  .tabs { width: max-content; }
  .top-end .lang, .top-end .hide-sm { display: none; }
  .lessons li { grid-template-columns: 34px 24px 1fr; row-gap: 6px; border-radius: var(--r-card); padding: 10px 14px 10px 8px; }
  .lessons .lbar { grid-column: 2 / -1; }
  .lessons .state, .lessons .cta { grid-column: 2 / -1; justify-self: start; }
  .lessons.simple li { grid-template-columns: 34px 1fr; }
  .lessons.simple .state { grid-column: 2; }
  .lb li { grid-template-columns: 96px 1fr auto; }
  .count { gap: 16px; }
  .count.xl .n { font-size: var(--t34); }
  .prizes strong { font-size: var(--t17); }
  .plan-ends { margin-inline-start: 0; }
  .plan { grid-template-columns: 70px 1fr; }
  .card { padding: 20px; }
  .dhead { padding-block: 12px 16px; }
  .notif { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.cal-side { display: grid; gap: 14px; align-content: start; }
.sprite { position: absolute; }
.ttl { font-size: var(--t20); font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; }
.mini .ttl { font-size: var(--t17); }
.screen .card-h .chip { padding: 7px 12px; font-size: var(--t12); }
.a-lead > .sub:last-child, .a-live .sess, .a-quiz .quiz { margin-top: auto; }
.a-live .sess { padding: 14px 16px; }
.a-live .sess .count { gap: 14px; }
.a-live .sess .count .n { font-size: var(--t20); }
.a-gauge .gauge { margin-block: auto; }
.lb .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-new picture { inset: 0 0 0 auto; width: 58%; }
html[dir="rtl"] .a-new picture { inset: 0 auto 0 0; }
.a-new img.cover { object-position: 50% 22%; }
.a-new .scrim { background-image: linear-gradient(to right, var(--card) 42%, transparent 75%); }
html[dir="rtl"] .a-new .scrim { background-image: linear-gradient(to left, var(--card) 42%, transparent 75%); }
.quiz input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border-radius: var(--r-pill); border: 2px solid var(--dim); flex: none; }
.quiz input:checked { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--raise); }
@media (max-width: 640px) {
  .a-new picture { width: 100%; }
  .a-new .scrim { background-image: linear-gradient(to top, var(--scrim) 18%, transparent 72%); }
  html[dir="rtl"] .a-new .scrim { background-image: linear-gradient(to top, var(--scrim) 18%, transparent 72%); }
  .a-new { min-height: 360px; }
}
.show-sm { display: none; }
@media (max-width: 640px) {
  .dfoot .show-sm { display: flex; }
  .notif .np { display: none; }
  .dhead-end { justify-content: flex-start; }
}

/* ---------------- motion (Emil Kowalski rules: transform/opacity only, strong ease-out, under 300ms for UI) ---------------- */
.round, .go, .lang button { transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease; }
.cta:active, .ghost:active, .round:active, .go:active, .lang button:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .tab:hover { color: var(--ink); }
  .cta:hover { background: var(--mark); }
  .ghost:hover, .round:hover, .go:hover { background: var(--cell); }
}

/* sliding active tab: a clipped copy of the row in the active colours (js builds it; without js the plain pill stays) */
.tabs { position: relative; }
.tabs-ov { position: absolute; inset: 0; display: flex; gap: 4px; padding: 5px; border-radius: var(--r-pill); background: var(--accent);
  pointer-events: none; user-select: none; clip-path: inset(50%); }
.tabs-live .tabs-ov { transition: clip-path 320ms var(--ease-out); }
.tabs-ov .tab { color: var(--on-accent); background: none; }
.tabs-ov .tab.on { font-weight: 500; }
.tabs.has-ov > .tab[aria-pressed="true"], .tabs.has-ov > .tab[aria-current] { background: none; }
/* the public page keeps its tabs in reach while reading; sections land below the bar */
@media (min-width: 901px) {
  .top { position: sticky; top: 0; z-index: 30; background: var(--ground); box-shadow: 0 0 0 100vmax var(--ground); clip-path: inset(0 -100vmax); }
  main > section[id] { scroll-margin-top: 96px; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
