/* ==========================================================================
   مراجعتي ثالثة إعدادي — design system
   Sections: 1 tokens · 2 reset · 3 layout · 4 appbar · 5 hero · 6 cards
             7 subject grid · 8 rows/lists · 9 subject page · 10 study blocks
             11 questions · 12 states · 13 footer · 14 utilities · 15 media
   ========================================================================== */

/* 1. tokens --------------------------------------------------------------- */
:root {
  color-scheme: light;

  --bg: #f1f5fb;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --surface-3: #eef2fa;

  --ink: #0e1a2f;
  --ink-2: #44516b;
  --ink-3: #6a7690;

  --line: #e3e9f4;
  --line-2: #d3dcee;

  --primary: #1b3a8f;
  --primary-700: #142c6e;
  --primary-900: #0d1d4b;
  --primary-050: #edf1fd;
  --primary-100: #dfe6fb;

  --gold-ink: #8a5c10;
  --gold-bg: #fdf3e0;
  --gold-line: #f1ddb6;

  --ok-ink: #0b6b48;
  --ok-bg: #e7f7ef;
  --ok-line: #b9e6d1;

  --err-ink: #a3251a;
  --err-bg: #fdeceb;
  --err-line: #f6cdc8;

  --radius-xs: 8px;
  --radius-sm: 11px;
  --radius: 15px;
  --radius-lg: 22px;

  --shadow-1: 0 1px 2px rgba(14, 26, 47, .05), 0 1px 3px rgba(14, 26, 47, .04);
  --shadow-2: 0 10px 30px -18px rgba(14, 26, 47, .45);

  --font: "SF Arabic", "Geeza Pro", "Noto Sans Arabic", "Segoe UI", Tahoma,
    system-ui, sans-serif;
  --font-lat: ui-sans-serif, "Segoe UI", Roboto, Arial, sans-serif;

  --gutter: 16px;
  --maxw: 720px;
  --tap: 44px;
}

/* 2. reset ---------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 116px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
[hidden] { display: none !important; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--primary); text-decoration: none; }
b, strong { font-weight: 700; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  inset-inline-start: -999px;
  top: 8px;
  background: var(--surface);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  z-index: 50;
}
.skip:focus { inset-inline-start: 8px; }

/* 3. layout --------------------------------------------------------------- */
.appbar,
.main,
.foot {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
}

.main {
  padding: 14px var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* 4. appbar --------------------------------------------------------------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px var(--gutter);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
}

.brand__mark {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--primary) 0%, var(--primary-900) 100%);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 4px 12px -6px rgba(27, 58, 143, .8);
}

.brand__text { min-width: 0; }
.brand__title {
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand__sub {
  font-size: .72rem;
  color: var(--ink-3);
  line-height: 1.3;
}

.backbtn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 10px 0 6px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: .82rem;
  font-weight: 600;
}
.backbtn svg { width: 16px; height: 16px; }
.backbtn:active { background: var(--surface-3); }

/* 5. hero ----------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 20px 18px 18px;
  color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, #2f56b8 0%, rgba(47, 86, 184, 0) 55%),
    linear-gradient(160deg, #1e3f96 0%, #14296a 100%);
  box-shadow: 0 18px 34px -24px rgba(13, 29, 75, .9);
}

.hero::after {
  content: "";
  position: absolute;
  inset-inline-start: -40px;
  bottom: -70px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .18);
  font-size: .72rem;
  font-weight: 600;
  color: #eaf0ff;
}

.hero h1 {
  margin-top: 12px;
  font-size: 1.42rem;
  line-height: 1.35;
  font-weight: 700;
  text-wrap: balance;
}

.hero__sub {
  margin-top: 6px;
  font-size: .88rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, .82);
  max-width: 42ch;
  text-wrap: pretty;
}

.hero__stats {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .16);
}

.ring {
  position: relative;
  flex: none;
  width: 62px;
  height: 62px;
}
.ring svg { transform: rotate(-90deg); }
.ring__track { stroke: rgba(255, 255, 255, .2); }
.ring__fill {
  stroke: #ffd47a;
  stroke-linecap: round;
  transition: stroke-dashoffset .5s ease;
}
.ring__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
}

.hero__stat-text { min-width: 0; }
.hero__stat-title { font-size: .86rem; font-weight: 600; color: #fff; }
.hero__stat-line { font-size: .78rem; color: rgba(255, 255, 255, .78); }

/* 6. cards ---------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

.card--pad { padding: 16px; }

.section { display: flex; flex-direction: column; gap: 10px; }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-inline: 2px;
}
.section__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section__title::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 3px;
  background: var(--primary);
}
.section__meta { font-size: .76rem; color: var(--ink-3); }

/* 7. subject grid --------------------------------------------------------- */
.grid-subjects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.subj {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  color: inherit;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.subj:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.subj:active { transform: scale(.985); }

.subj__icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--primary-050);
  color: var(--primary);
}
.subj__icon svg { width: 23px; height: 23px; }

.subj__body { min-width: 0; }
.subj__name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.45;
}
.subj__sub {
  margin-top: 2px;
  font-size: .78rem;
  line-height: 1.6;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.subj__foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.bar {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.bar__fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f56b8, var(--primary));
  transition: width .4s ease;
}
.bar__label {
  font-size: .72rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* per-subject tint */
.subj--ar .subj__icon { background: #eef2fd; color: #1b3a8f; }
.subj--en .subj__icon { background: #eaf6f3; color: #0f6f5c; }
.subj--ma .subj__icon { background: #f2eefd; color: #5b34a8; }
.subj--sc .subj__icon { background: #e9f5ee; color: #14764b; }
.subj--so .subj__icon { background: #fdf1e6; color: #a15a12; }
.subj--de .subj__icon { background: #eef7f2; color: #1d6b4e; }
.subj--tc .subj__icon { background: #eef3fb; color: #1f4f9e; }

/* 8. rows / lists --------------------------------------------------------- */
.rows { display: flex; flex-direction: column; }

.row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: inherit;
  border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.row:hover { background: var(--surface-2); }
.row__n {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--primary-050);
  color: var(--primary);
  font-size: .82rem;
  font-weight: 700;
}
.row__title { font-size: .88rem; font-weight: 600; line-height: 1.5; display: block; }
.row__sub { font-size: .74rem; color: var(--ink-3); line-height: 1.5; display: block; }
.row__go { color: var(--ink-3); display: grid; place-items: center; }
.row__go svg { width: 16px; height: 16px; }

.bullets { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.bullets li {
  position: relative;
  padding-inline-start: 18px;
  font-size: .84rem;
  line-height: 1.7;
  color: var(--ink-2);
}
.bullets li::before {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-100);
  box-shadow: inset 0 0 0 1.5px var(--primary);
}

.note {
  display: flex;
  gap: 10px;
  padding: 13px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: .82rem;
  line-height: 1.75;
  color: var(--ink-2);
}
.note svg { flex: none; width: 18px; height: 18px; margin-top: 3px; color: var(--primary); }
.note--gold { background: var(--gold-bg); border-color: var(--gold-line); color: #6d4a0e; }
.note--gold svg { color: var(--gold-ink); }

/* unit / lesson outline (math curriculum) */
.unit { overflow: hidden; }
.unit__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.unit__n {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-size: .92rem;
  font-weight: 700;
}
.unit__title { flex: 1; font-size: .95rem; font-weight: 700; }
.unit__meta { font-size: .72rem; color: var(--ink-3); white-space: nowrap; }

.lesson {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  align-items: center;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
}
.lesson:first-child { border-top: 0; }
.lesson__no {
  padding: 2px 0;
  border-radius: 7px;
  background: var(--primary-050);
  color: var(--primary);
  font-size: .72rem;
  font-weight: 700;
  text-align: center;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}
.lesson__name { font-size: .85rem; line-height: 1.6; }
.lesson--part { padding-inline-start: 30px; background: var(--surface-2); }
.lesson--part .lesson__no {
  background: transparent;
  border: 1px dashed var(--line-2);
  color: var(--ink-3);
  font-size: .66rem;
}

.unit__desc {
  padding: 13px 14px;
  font-size: .84rem;
  line-height: 1.8;
  color: var(--ink-2);
}

.extra { padding: 12px 14px; border-top: 1px solid var(--line); }
.extra:first-child { border-top: 0; }
.extra__name {
  display: block;
  font-size: .87rem;
  font-weight: 600;
  line-height: 1.5;
}
.extra__desc {
  display: block;
  margin-top: 2px;
  font-size: .8rem;
  line-height: 1.7;
  color: var(--ink-2);
}

/* 9. subject page --------------------------------------------------------- */
.pagehead {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 4px 2px 0;
}
.pagehead__icon {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--primary-050);
  color: var(--primary);
}
.pagehead__icon svg { width: 27px; height: 27px; }
.pagehead h1 {
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pagehead__sub { font-size: .78rem; color: var(--ink-3); margin-top: 2px; }

.intro { font-size: .87rem; line-height: 1.8; color: var(--ink-2); padding: 14px 16px; }

.chipnav {
  position: sticky;
  top: 60px;
  z-index: 20;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 10px 2px;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  background: linear-gradient(var(--bg) 72%, rgba(241, 245, 251, 0));
  -webkit-overflow-scrolling: touch;
}
.chipnav::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}
.chip[aria-current="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* 10. study blocks -------------------------------------------------------- */
.block { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 118px; }

.block__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline: 2px;
  flex-wrap: wrap;
}
.block__title { font-size: .98rem; font-weight: 700; }
.block__count {
  margin-inline-start: auto;
  font-size: .74rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.9;
  white-space: nowrap;
}
.badge--train { background: var(--gold-bg); color: var(--gold-ink); border: 1px solid var(--gold-line); }
.badge--own { background: var(--primary-050); color: var(--primary); border: 1px solid var(--primary-100); }
.badge--review { background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line-2); }
.badge--unverified { background: #fdf0e3; color: #8a4a10; border: 1px solid #f2d8bb; }

/* Q&A accordion */
.qa-list { overflow: hidden; }

.qa { border-top: 1px solid var(--line); }
.qa:first-child { border-top: 0; }

.qa__q {
  display: grid;
  grid-template-columns: 26px 1fr 18px;
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 13px 14px;
  background: none;
  border: 0;
  text-align: start;
  cursor: pointer;
  list-style: none;
}
.qa__q::-webkit-details-marker { display: none; }
.qa__q:hover { background: var(--surface-2); }

.qa__n {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: .72rem;
  font-weight: 700;
  margin-top: 2px;
}
.qa__text { font-size: .87rem; font-weight: 600; line-height: 1.7; color: var(--ink); }
.qa__caret { color: var(--ink-3); margin-top: 4px; transition: transform .2s ease; }
.qa__caret svg { width: 16px; height: 16px; display: block; }
.qa[open] .qa__caret { transform: rotate(180deg); }
.qa[open] .qa__n { background: var(--primary-050); color: var(--primary); }

.qa__a {
  padding-inline: 50px 14px;
  padding-bottom: 14px;
  font-size: .84rem;
  line-height: 1.85;
  color: var(--ink-2);
}
.qa__a::before {
  content: "";
  display: block;
  height: 1px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, var(--line) 0%, rgba(227, 233, 244, 0) 85%);
}

/* 11. questions ----------------------------------------------------------- */
.q { padding: 14px; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; }

.q__head { display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.q__n {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--primary-050);
  color: var(--primary);
  font-size: .72rem;
  font-weight: 700;
  margin-top: 2px;
}
.q__text { font-size: .88rem; font-weight: 600; line-height: 1.75; }

.opts {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 11px;
}

.opt {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: var(--tap);
  padding: 8px 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: start;
  font-size: .85rem;
  line-height: 1.6;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.opt:hover { border-color: var(--primary-100); background: var(--surface-2); }
.opt__key {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  color: var(--ink-3);
  font-size: .68rem;
  font-weight: 700;
}
.opt__text { min-width: 0; }

.q.is-done .opt { cursor: default; }
.q.is-done .opt:hover { background: var(--surface); border-color: var(--line-2); }

.opt.is-right { background: var(--ok-bg); border-color: var(--ok-line); color: #0a5539; }
.opt.is-right .opt__key { background: var(--ok-ink); border-color: var(--ok-ink); color: #fff; }
.opt.is-right:hover { background: var(--ok-bg); border-color: var(--ok-line); }

.opt.is-wrong { background: var(--err-bg); border-color: var(--err-line); color: #7d1b12; }
.opt.is-wrong .opt__key { background: var(--err-ink); border-color: var(--err-ink); color: #fff; }
.opt.is-wrong:hover { background: var(--err-bg); border-color: var(--err-line); }

.q__why {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px dashed var(--line-2);
  font-size: .8rem;
  line-height: 1.75;
  color: var(--ink-2);
}
.q.is-done .q__why { display: block; }
.q__why b { color: var(--ink); }

/* model result */
.result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius) var(--radius);
}
.result__score {
  flex: none;
  font-size: .95rem;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.result__msg { flex: 1; font-size: .8rem; color: var(--ink-2); line-height: 1.6; }
.result__reset {
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
}
.result__reset:hover { border-color: var(--primary-100); color: var(--primary); }

/* 12. states -------------------------------------------------------------- */
.placeholder {
  padding: 24px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.placeholder__icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--gold-bg);
  color: var(--gold-ink);
  border: 1px solid var(--gold-line);
}
.placeholder__icon svg { width: 22px; height: 22px; }
.placeholder__title { font-size: .98rem; font-weight: 700; }
.placeholder__text {
  font-size: .84rem;
  line-height: 1.8;
  color: var(--ink-2);
  max-width: 46ch;
}

/* 13. footer -------------------------------------------------------------- */
.foot {
  padding: 0 var(--gutter) 34px;
  font-size: .76rem;
  line-height: 1.8;
  color: var(--ink-3);
  text-align: center;
}
.foot a { font-weight: 600; }

.install { display: flex; flex-direction: column; gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px -12px rgba(27, 58, 143, .9);
}
.btn:hover { background: var(--primary-700); }
.btn svg { width: 18px; height: 18px; }
.btn[hidden] { display: none; }

/* 14. utilities ----------------------------------------------------------- */
.lat {
  font-family: var(--font-lat);
  unicode-bidi: isolate;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.muted { color: var(--ink-3); }

/* 14b. exam ------------------------------------------------------------- */
.exam-cta {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  color: inherit;
  background: linear-gradient(135deg, #eef2fd 0%, #ffffff 70%);
  border-color: var(--primary-100);
}
.exam-cta__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--primary-100);
  color: var(--primary);
}
.exam-cta__icon svg { width: 20px; height: 20px; }
.exam-cta__title { display: block; font-size: .92rem; font-weight: 700; }
.exam-cta__sub { display: block; font-size: .76rem; color: var(--ink-3); line-height: 1.5; }
.exam-cta__go {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
}
.exam-start { padding: 20px 18px; display: flex; flex-direction: column; gap: 12px; }
.exam-start__badge {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--gold-bg);
  color: var(--gold-ink);
  border: 1px solid var(--gold-line);
  font-size: .7rem;
  font-weight: 700;
}
.exam-start__title { font-size: 1.2rem; font-weight: 700; line-height: 1.4; }
.exam-start__sub { font-size: .8rem; color: var(--ink-3); }
.exam-start__facts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: .82rem;
  color: var(--ink-2);
}
.exam-start__facts li { position: relative; padding-inline-start: 16px; }
.exam-start__facts li::before {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: .55;
}

.exam-top { display: flex; flex-direction: column; gap: 8px; }
.exam-top .bar { flex: none; height: 6px; }
.exam-top__row { display: flex; justify-content: space-between; align-items: baseline; }
.exam-top__count { font-size: .82rem; font-weight: 700; color: var(--ink); }
.exam-top__meta { font-size: .74rem; color: var(--ink-3); }

.q-card { padding: 16px; }
.q-card__text { font-size: .95rem; font-weight: 600; line-height: 1.8; }

.opt.is-picked {
  border-color: var(--primary);
  background: var(--primary-050);
  color: var(--primary-900);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.opt.is-picked .opt__key { background: var(--primary); border-color: var(--primary); color: #fff; }

.exam-nav { display: flex; gap: 10px; }
.exam-nav .btn { flex: 1; }
.btn--ghost {
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  box-shadow: none;
}
.btn--ghost:hover { background: var(--surface-2); color: var(--primary); }
.btn[disabled] { opacity: .45; cursor: default; }
.exam-hint { font-size: .76rem; color: var(--ink-3); text-align: center; }

.score { padding: 22px 18px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.score__label { font-size: .82rem; color: var(--ink-3); }
.score__mark { display: flex; align-items: baseline; gap: 6px; color: var(--primary); }
.score__mark b { font-size: 2.6rem; line-height: 1.1; font-weight: 700; }
.score__mark span { font-size: .95rem; color: var(--ink-3); }
.score__bar {
  width: 100%;
  max-width: 260px;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 6px;
}
.score__bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f56b8, var(--primary));
}
.score__pct { font-size: .9rem; font-weight: 700; color: var(--ink); }
.score__verdict { font-size: .87rem; line-height: 1.7; color: var(--ink-2); max-width: 40ch; }
.score__meta { font-size: .76rem; color: var(--ink-3); }

.review { display: flex; flex-direction: column; gap: 10px; }
.review__title { font-size: .95rem; font-weight: 700; padding-inline: 2px; }
.review__item { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.review__q { display: grid; grid-template-columns: 24px 1fr; gap: 8px; font-size: .87rem; font-weight: 600; line-height: 1.7; }
.review__n {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: .7rem;
  font-weight: 700;
}
.review__line { font-size: .82rem; line-height: 1.6; padding: 7px 10px; border-radius: var(--radius-xs); }
.review__line--bad { background: var(--err-bg); color: #7d1b12; }
.review__line--ok { background: var(--ok-bg); color: #0a5539; }
.review__why { font-size: .8rem; line-height: 1.7; color: var(--ink-2); padding-inline: 2px; }

/* 15. media --------------------------------------------------------------- */
@media (min-width: 560px) {
  body { font-size: 16px; }
  .grid-subjects { grid-template-columns: 1fr 1fr; }
  .hero { padding: 26px 24px 22px; }
  .hero h1 { font-size: 1.6rem; }
  .main { padding-top: 18px; gap: 26px; }
  .qa__a { padding-inline: 60px 18px; }
}

@media (min-width: 860px) {
  :root { --maxw: 780px; }
  .hero { padding: 30px 28px 26px; }
  .hero h1 { font-size: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

@media print {
  .appbar, .chipnav, .install, .result__reset { display: none; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* ==========================================================================
   16. English by Field — field grid, vocabulary, sentences, dialogue, quiz CTA
   ========================================================================== */

.ehero {
  position: relative;
  overflow: hidden;
  padding: 22px 18px 20px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 100% 0%, #2a4fae 0%, transparent 55%),
    linear-gradient(160deg, var(--primary) 0%, var(--primary-900) 100%);
  color: #fff;
  box-shadow: var(--shadow-2);
}
.ehero__kicker {
  margin: 0 0 6px;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
  font-family: var(--font-lat);
}
.ehero__title {
  margin: 0;
  font-family: var(--font-lat);
  font-size: 1.72rem;
  line-height: 1.15;
  letter-spacing: -.01em;
  direction: ltr;
  text-align: right;
}
.ehero__sub {
  margin: 8px 0 0;
  font-size: .9rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, .88);
}

.fgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 560px) {
  .fgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.fcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  color: inherit;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.fcard:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.fcard:active { transform: scale(.985); }
.fcard--lead { border-color: var(--primary-100); background: linear-gradient(180deg, var(--primary-050), var(--surface) 55%); }

.fcard__art {
  display: block;
  border-radius: 12px;
  background: var(--surface-3);
  padding: 8px;
}
.fcard__art svg { display: block; width: 100%; height: auto; }

.fcard__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fcard__name { font-size: .9rem; font-weight: 700; line-height: 1.4; }
.fcard__en {
  font-family: var(--font-lat);
  font-size: .7rem;
  color: var(--ink-3);
  line-height: 1.4;
}
.fcard__meta { font-size: .68rem; color: var(--ink-3); margin-top: 2px; }

.fhero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.fhero__art { flex: none; width: 84px; }
.fhero__art svg { display: block; width: 100%; height: auto; }
.fhero__text { min-width: 0; }
.fhero__title { margin: 0; font-size: 1.16rem; line-height: 1.35; }
.fhero__en {
  margin: 2px 0 0;
  font-family: var(--font-lat);
  font-size: .78rem;
  color: var(--ink-3);
  direction: ltr;
  text-align: right;
}
.fhero__sub { margin: 4px 0 0; font-size: .78rem; color: var(--ink-2); line-height: 1.6; }

.lead { margin: 0; font-size: .88rem; color: var(--ink-2); line-height: 1.8; }

.vocab, .snts, .qalist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.voc {
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-1);
}
.voc__term {
  margin: 0;
  font-family: var(--font-lat);
  font-size: .98rem;
  font-weight: 700;
  color: var(--primary);
  text-align: left;
  line-height: 1.4;
}
.voc__ar { margin: 3px 0 0; font-size: .9rem; font-weight: 600; }
.voc__use { margin: 4px 0 0; font-size: .8rem; color: var(--ink-3); line-height: 1.65; }

.snt {
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-1);
}
.snt__en {
  margin: 0;
  font-family: var(--font-lat);
  font-size: .92rem;
  line-height: 1.55;
  text-align: left;
  color: var(--ink);
}
.snt__ar { margin: 4px 0 0; font-size: .82rem; color: var(--ink-2); line-height: 1.7; }

.dlg { padding: 14px; }
.dlg__title { margin: 0 0 10px; font-size: .95rem; font-weight: 700; }
.dlg__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dlg__line {
  max-width: 92%;
  padding: 9px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.dlg__line--a { align-self: flex-start; border-start-start-radius: 5px; }
.dlg__line--b { align-self: flex-end; background: var(--primary-050); border-color: var(--primary-100); border-start-end-radius: 5px; }
.dlg__who { display: block; font-size: .68rem; font-weight: 700; color: var(--ink-3); margin-bottom: 2px; }
.dlg__en { margin: 0; font-family: var(--font-lat); font-size: .9rem; line-height: 1.55; text-align: left; }
.dlg__ar { margin: 3px 0 0; font-size: .78rem; color: var(--ink-3); line-height: 1.65; }

.qa { padding: 14px; }
.qa__q {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  font-family: var(--font-lat);
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: left;
  direction: ltr;
}
.qa__n {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-050);
  color: var(--primary);
  font-family: var(--font);
  font-size: .72rem;
  font-weight: 700;
  margin-top: 2px;
}
.qa__tr { margin: 5px 0 0; font-size: .82rem; color: var(--ink-2); }
.qa__answer {
  margin-top: 9px;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  background: var(--ok-bg);
  border: 1px solid var(--ok-line);
}
.qa__label { margin: 0 0 4px; font-size: .68rem; font-weight: 700; color: var(--ok-ink); letter-spacing: .02em; }
.qa__en { margin: 0; font-family: var(--font-lat); font-size: .9rem; line-height: 1.6; text-align: left; color: var(--ink); }
.qa__ar { margin: 5px 0 0; font-size: .78rem; color: var(--ink-2); line-height: 1.65; }
.qa__tip { margin: 8px 0 0; font-size: .76rem; color: var(--ink-3); line-height: 1.65; }

.mail { padding: 14px; }
.mail__title { display: flex; gap: 8px; align-items: center; margin: 0; font-size: .92rem; font-weight: 700; }
.mail__when { margin: 4px 0 0; font-size: .78rem; color: var(--ink-3); }
.mail__body {
  margin-top: 9px;
  padding: 11px 12px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mail__line { margin: 0; font-family: var(--font-lat); font-size: .84rem; line-height: 1.6; text-align: left; }
.mail__ar { margin: 8px 0 0; font-size: .78rem; color: var(--ink-3); line-height: 1.65; }

.quizcta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border-radius: var(--radius);
  background: linear-gradient(150deg, var(--primary) 0%, var(--primary-900) 100%);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-2);
}
.quizcta__ico {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, .16);
  font-size: 1.1rem;
  font-weight: 700;
}
.quizcta__body { min-width: 0; display: flex; flex-direction: column; }
.quizcta__title { font-size: .95rem; font-weight: 700; }
.quizcta__sub { font-size: .76rem; color: rgba(255, 255, 255, .82); line-height: 1.6; }
.quizcta__go { margin-inline-start: auto; font-size: 1.3rem; opacity: .8; }

.en { font-family: var(--font-lat); }
.art { display: block; width: 100%; height: auto; }
