/* Medli. The site was "lecture notes and highlighters"; it now wears the B2 binder look (see the layer at the end). */

@font-face { font-family: "Plex"; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex"; font-weight: 500 600; font-display: swap; src: url("/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex"; font-weight: 700 800; font-display: swap; src: url("/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex"; font-weight: 400 500; font-display: swap; src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex"; font-weight: 600 800; font-display: swap; src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Readex"; font-weight: 160 700; font-display: swap; src: url("/fonts/readex-pro-arabic-wght-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Readex"; font-weight: 160 700; font-display: swap; src: url("/fonts/readex-pro-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Medli (B2): Alexandria for headings and big numbers, Readex Pro for reading, Baloo Bhaijaan 2 only for the wordmark. */
@font-face { font-family: "Alexandria"; font-weight: 500 800; font-display: swap; src: url("/fonts/alexandria-arabic-wght.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Alexandria"; font-weight: 500 800; font-display: swap; src: url("/fonts/alexandria-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Baloo Bhaijaan 2"; font-weight: 800; font-display: swap; src: url("/fonts/baloo-bhaijaan2-arabic-800.woff2") format("woff2"); }
@font-face { font-family: "DM Mono"; font-weight: 500; font-display: swap; src: url("/fonts/dm-mono-latin-500.woff2") format("woff2"); }

:root {
  /* Medli B2: a binder on a warm desk. White sheets, deep ink, and one jewel colour per body system. */
  --paper: #E9E6E1;
  /* Sheets are a warm off-white: testers found pure white tiring to read on. */
  --card: #FBF9F5;
  --sunk: #F1EDE6;
  --ink: #1A1A24;
  --ink-soft: #4A4960;
  --ink-faint: #615F75;
  --line: #E2DFD9;
  --field: #B9B6C4;
  --pen: #1A1A24;
  --pen-hover: #34334A;
  --on-pen: #ffffff;
  --on-ink: #ffffff;
  --focus: #1A1A24;
  /* The old highlighter names now carry quiet tints. */
  --hl-yellow: #F6E9C8;
  --hl-green: #DDEFE3;
  --hl-pink: #F6E0E6;
  --hl-orange: #F6E3D3;
  --hl-blue: #E2E8F5;
  --verified: #1C7A45;
  --verified-bg: #E3F2E8;
  --wrong: #A3262B;
  --wrong-bg: #F6E7E5;
  --disputed: #8A5A00;
  --disputed-bg: #F8EBD2;
  --unknown: #4A4960;
  --unknown-bg: #EFECF2;
  --late: #F2D58A;

  /* The current divider. Pages inside a system set sys-<key> on <body>. */
  --sys: #1A1A24;
  --sys-deep: #000000;
  --sys-tint: #EFECF2;

  --ui: "Readex", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --display: "Alexandria", "Readex", system-ui, sans-serif;
  --clinical: "Readex", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, Consolas, monospace;

  --radius: 16px;
  --radius-sm: 12px;
  --tabbar: 66px;
  color-scheme: light;
}


/* Night: the same binder in the dark. Ink becomes the light colour, sheets go charcoal,
   and each divider keeps its colour with a lighter shade for text. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121118;
    --card: #1C1B24;
    --sunk: #25242E;
    --ink: #ECEAF3;
    --ink-soft: #B9B7C9;
    --ink-faint: #9A98AC;
    --line: #312F3C;
    --field: #4A4858;
    --pen: #ECEAF3;
    --pen-hover: #FFFFFF;
    --on-pen: #121118;
    --on-ink: #121118;
    --focus: #ECEAF3;
    --hl-yellow: #3A3220; --hl-green: #1C3326; --hl-pink: #3A2229; --hl-orange: #3A2A1E; --hl-blue: #222C40;
    --verified: #6FD39A; --verified-bg: #15301F;
    --wrong: #FF8A8F; --wrong-bg: #3A1B1E;
    --disputed: #F3B562; --disputed-bg: #33260F;
    --unknown: #B9B7C9; --unknown-bg: #25242E;
    --late: #7A5A10;
    --sys: #4A4860; --sys-deep: #ECEAF3; --sys-tint: #2A2935;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .sys-cardio { --sys-deep: #F2A4A7; --sys-tint: #3A1E21; }
  :root:not([data-theme="light"]) .sys-pulmo { --sys-deep: #A9C1F2; --sys-tint: #1E2740; }
  :root:not([data-theme="light"]) .sys-endo { --sys-deep: #EDC97E; --sys-tint: #362A12; }
  :root:not([data-theme="light"]) .sys-id { --sys-deep: #8FD6B6; --sys-tint: #17302A; }
  :root:not([data-theme="light"]) .sys-neuro { --sys-deep: #C9B6F0; --sys-tint: #2A2240; }
  :root:not([data-theme="light"]) .sys-gi { --sys-deep: #F0B490; --sys-tint: #38251B; }
  :root:not([data-theme="light"]) .sys-hema { --sys-deep: #EFA2C2; --sys-tint: #381C2A; }
  :root:not([data-theme="light"]) .sys-nephro { --sys-deep: #8ED6D6; --sys-tint: #163232; }
  :root:not([data-theme="light"]) body[class*="sys-"] { --on-pen: #ffffff; }
  :root:not([data-theme="light"]) .orow__n, :root:not([data-theme="light"]) .orow__done, :root:not([data-theme="light"]) .cards-system, :root:not([data-theme="light"]) .readiness__score b, :root:not([data-theme="light"]) .countdown__days { color: var(--sys-deep); }
  :root:not([data-theme="light"]) .question__image img, :root:not([data-theme="light"]) img.question__image { background: #fff; }
}
/* The same night colours when the reader picks dark themselves. */
:root[data-theme="dark"] {
    --paper: #121118;
    --card: #1C1B24;
    --sunk: #25242E;
    --ink: #ECEAF3;
    --ink-soft: #B9B7C9;
    --ink-faint: #9A98AC;
    --line: #312F3C;
    --field: #4A4858;
    --pen: #ECEAF3;
    --pen-hover: #FFFFFF;
    --on-pen: #121118;
    --on-ink: #121118;
    --focus: #ECEAF3;
    --hl-yellow: #3A3220; --hl-green: #1C3326; --hl-pink: #3A2229; --hl-orange: #3A2A1E; --hl-blue: #222C40;
    --verified: #6FD39A; --verified-bg: #15301F;
    --wrong: #FF8A8F; --wrong-bg: #3A1B1E;
    --disputed: #F3B562; --disputed-bg: #33260F;
    --unknown: #B9B7C9; --unknown-bg: #25242E;
    --late: #7A5A10;
    --sys: #4A4860; --sys-deep: #ECEAF3; --sys-tint: #2A2935;
    color-scheme: dark;
  }
  :root[data-theme="dark"] .sys-cardio { --sys-deep: #F2A4A7; --sys-tint: #3A1E21; }
  :root[data-theme="dark"] .sys-pulmo { --sys-deep: #A9C1F2; --sys-tint: #1E2740; }
  :root[data-theme="dark"] .sys-endo { --sys-deep: #EDC97E; --sys-tint: #362A12; }
  :root[data-theme="dark"] .sys-id { --sys-deep: #8FD6B6; --sys-tint: #17302A; }
  :root[data-theme="dark"] .sys-neuro { --sys-deep: #C9B6F0; --sys-tint: #2A2240; }
  :root[data-theme="dark"] .sys-gi { --sys-deep: #F0B490; --sys-tint: #38251B; }
  :root[data-theme="dark"] .sys-hema { --sys-deep: #EFA2C2; --sys-tint: #381C2A; }
  :root[data-theme="dark"] .sys-nephro { --sys-deep: #8ED6D6; --sys-tint: #163232; }
  :root[data-theme="dark"] body[class*="sys-"] { --on-pen: #ffffff; }
  :root[data-theme="dark"] .orow__n, :root[data-theme="dark"] .orow__done, :root[data-theme="dark"] .cards-system, :root[data-theme="dark"] .readiness__score b, :root[data-theme="dark"] .countdown__days { color: var(--sys-deep); }
  :root[data-theme="dark"] .question__image img, :root[data-theme="dark"] img.question__image { background: #fff; }


/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.65 var(--ui);
  -webkit-font-smoothing: antialiased;
}
main { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }
.has-tabs main { padding-bottom: calc(var(--tabbar) + 40px + env(safe-area-inset-bottom)); }
.is-review main { max-width: 1200px; }
a { color: inherit; text-underline-offset: 3px; }
code { font-family: var(--mono); font-size: 0.82em; letter-spacing: 0.01em; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 0.5em; font-family: var(--display); font-weight: 600; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.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; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 30; padding: 8px 14px; border-radius: 8px; background: var(--pen); color: var(--on-pen); }
.skip:focus { top: 8px; }
[lang="en"] { font-family: var(--clinical); }
/* English names inside Arabic lists line up with the Arabic around them; long English text (stems) stays left-aligned. */
.page-title[lang="en"], .tile__name, .lrow__name, .search-result__title, .systems__name { text-align: right; }
.icon { width: 22px; height: 22px; flex: none; }
.icon--sm { width: 18px; height: 18px; }
.icon--xs { width: 13px; height: 13px; }

/* The signature: a highlighter stroke behind the words that matter. */
.hl, .point__text strong, .search mark, mark {
  background-color: transparent;
  background-image: linear-gradient(100deg, transparent 0.18em, var(--hl, var(--hl-yellow)) 0.18em, var(--hl, var(--hl-yellow)) calc(100% - 0.12em), transparent calc(100% - 0.12em));
  background-repeat: no-repeat;
  background-size: 100% 0.68em;
  background-position: 0 86%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding-inline: 0.12em;
  color: inherit;
  font-weight: 600;
}

/* ---------- Header and the five tabs ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding-inline: 16px 8px;
  /* No backdrop-filter here: it would trap the fixed tab bar inside the header. */
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 700 17px var(--display);
  text-decoration: none;
  white-space: nowrap;
}
/* A short yellow highlighter swipe as the logo. */
.brand__mark {
  width: 22px;
  height: 12px;
  border-radius: 3px 6px 4px 7px;
  background: var(--hl-yellow);
  transform: rotate(-8deg) skewX(-12deg);
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.06);
}
.iconbtn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-inline-start: auto;
  border-radius: 12px;
  color: var(--ink-soft);
}
.iconbtn:hover { background: var(--sunk); color: var(--ink); }
.topbar__user { display: flex; gap: 12px; align-items: center; font-size: 14px; flex-wrap: wrap; margin-inline-start: auto; }

.tabs-nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ink-faint);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 500;
}
.tab__icon { width: 24px; height: 24px; position: relative; z-index: 1; }
.tab[aria-current="page"] { color: var(--ink); font-weight: 700; }
/* The current tab: a highlighter swipe behind its icon. */
.tab[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 9px;
  width: 38px;
  height: 18px;
  border-radius: 4px 8px 5px 9px;
  background: var(--hl-yellow);
  transform: rotate(-6deg);
  translate: 0 12px;
}
.tab .badge { position: absolute; top: 6px; inset-inline-end: calc(50% - 22px); }
.is-focus .tabs-nav { display: none; }

@media (min-width: 900px) {
  .topbar { height: 64px; padding-inline: 24px; }
  .tabs-nav {
    position: static;
    display: flex;
    gap: 4px;
    height: auto;
    padding: 0;
    margin-inline-start: 24px;
    background: none;
    border: 0;
  }
  .is-focus .tabs-nav { display: flex; }
  .tab { flex-direction: row; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px; font-size: 15px; }
  .tab:hover { background: var(--sunk); color: var(--ink); }
  .tab__icon { width: 20px; height: 20px; }
  .tab[aria-current="page"]::before { top: auto; bottom: 7px; width: auto; inset-inline: 10px; height: 9px; translate: 0 0; transform: rotate(-1deg); }
  .tab__label { position: relative; z-index: 1; }
  .tab .badge { position: static; }
  .has-tabs main { padding-bottom: 64px; }
  main { padding-top: 28px; }
}

/* ---------- Shared pieces ---------- */
.page-title { font: 600 clamp(24px, 6vw, 30px)/1.25 var(--display); margin: 4px 0 12px; }
.page-title[lang="en"] { font-family: var(--display); }
.eyebrow { font-size: 13px; color: var(--ink-soft); margin: 0 0 6px; }
.muted { color: var(--ink-soft); font-size: 14px; }
.hint { font-weight: 400; font-size: 13px; color: var(--ink-soft); }
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--ink-soft); }
.crumbs a { text-decoration: none; display: inline-block; padding-block: 8px; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs a[lang="en"] { max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.is-wrong { color: var(--wrong); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1.5px solid var(--pen);
  border-radius: 12px;
  background: var(--pen);
  color: var(--on-pen);
  font: 600 15.5px var(--ui);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms, border-color 120ms;
}
.button:hover { background: var(--pen-hover); border-color: var(--pen-hover); }
.button--ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.button--ghost:hover { background: var(--sunk); border-color: var(--field); }
.button--small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
@media (pointer: coarse) { .button--small { min-height: 44px; } }
.button--danger { background: var(--wrong); border-color: var(--wrong); color: #fff; }
.button[disabled] { opacity: 0.5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--pen); text-decoration: underline; cursor: pointer; }
.actions, .dispute__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.actions--end { margin-top: 20px; }

.chip, .tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
}
.tag { background: var(--sunk); color: var(--ink-soft); }
.tag--warn { background: var(--disputed-bg); color: var(--disputed); }
.tag--exam { background: var(--hl-yellow); color: var(--ink); }
.tag--saved { background: var(--hl-blue); color: var(--ink); }
.chip--verified { background: var(--verified-bg); color: var(--verified); }
.chip--disputed { background: var(--disputed-bg); color: var(--disputed); }
.chip--unknown { background: var(--unknown-bg); color: var(--unknown); }
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--wrong);
  color: #fff;
  font: 700 11px var(--ui);
}

.panel, .empty {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 16px 0;
}
.panel h2, .empty h2 { font-size: 18px; }
.panel h3 { font-size: 15px; margin-top: 18px; }
.panel--narrow { max-width: 440px; margin-inline: auto; }
.empty { text-align: center; color: var(--ink-soft); padding: 28px 18px; }
.empty h1, .empty h2 { color: var(--ink); }
.alert { background: var(--wrong-bg); color: var(--wrong); border-radius: var(--radius-sm); padding: 10px 14px; }
.alert ul { margin: 4px 0 0; padding-inline-start: 20px; }
.notice { background: var(--verified-bg); color: var(--verified); border-radius: var(--radius-sm); padding: 10px 14px; font-weight: 600; }

/* The two-colour progress bar (right, then wrong). */
.meter { display: block; width: 100%; height: 6px; border-radius: 3px; overflow: hidden; }
.meter__track { fill: var(--sunk); }
.meter__right { fill: var(--verified); }
.meter__wrong { fill: var(--wrong); }
progress { appearance: none; width: 100%; height: 6px; border: 0; border-radius: 3px; background: var(--sunk); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--sunk); }
progress::-webkit-progress-value { background: var(--verified); }
progress::-moz-progress-bar { background: var(--verified); }

/* A sheet: one card, rows separated by hairlines, like a page of notes. */
.sheet, .qrows, .lrows, .menu, .points, .search-results {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.qrows > li + li, .lrows > li + li, .menu > li + li, .points > li + li, .search-results > li + li { border-top: 1px solid var(--line); }

/* ---------- Library ---------- */
.intro { padding: 8px 0 4px; }
.intro h1 { font: 600 clamp(26px, 7.4vw, 38px)/1.25 var(--display); margin: 0 0 10px; max-width: 18em; }
.intro p { color: var(--ink-soft); margin: 0; max-width: 34em; }

.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 8px;
  padding: 0 14px;
  min-height: 50px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-faint);
}
.searchbar:focus-within { border-color: var(--pen); }
.searchbar input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: 16px var(--ui); padding: 12px 0; outline: none; }

.module { margin-top: 28px; }
.module__title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 19px; margin-bottom: 10px; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.tile {
  display: grid;
  gap: 6px;
  align-content: start;
  height: 100%;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 120ms, transform 120ms;
}
.tile:hover { border-color: var(--field); }
.tile:active { transform: scale(0.99); }
.tile__name { font-weight: 600; font-size: 16.5px; line-height: 1.35; overflow-wrap: anywhere; }
.tile__meta, .tile__mine { font-size: 13px; color: var(--ink-soft); }
.tile .meter { margin-top: 4px; }

.lrow, .qrow, .menu a {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  text-decoration: none;
}
.lrow:hover, .qrow:hover, .menu a:hover { background: var(--sunk); }
.lrow__name { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.lrow__meta { font-size: 13px; color: var(--ink-soft); }
.lrow .meter { margin-top: 6px; }

/* ---------- Lecture page ---------- */
.lecture-head { margin-bottom: 4px; }
.lecture-head .page-title { margin-bottom: 6px; }
.lecture-head__mine { display: grid; gap: 6px; margin: 0 0 10px; font-size: 14px; color: var(--ink-soft); max-width: 420px; }
.lecture-head__mine p { margin: 0; }
.lecture-head__mine b { color: var(--ink); }

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 14px 0 16px;
  padding: 4px;
  background: var(--sunk);
  border-radius: 12px;
}
.seg a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-weight: 600;
  text-decoration: none;
}
.seg a[aria-current="page"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
.seg__n { font-size: 12px; font-weight: 600; color: var(--ink-faint); }

/* Levels (and today's time choice): chips; the current one wears its highlighter colour. */
.levels { display: flex; gap: 6px; overflow-x: auto; margin: 10px -16px 6px; padding: 2px 16px 4px; scrollbar-width: none; }
.levels::-webkit-scrollbar { display: none; }
.levels a {
  --hl: var(--hl-yellow);
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
}
.level--important { --hl: var(--hl-green); }
.level--full { --hl: var(--hl-blue); }
.level--traps { --hl: var(--hl-orange); }
.levels a[aria-current="page"] { background: var(--hl); border-color: transparent; color: var(--ink); }
.level__done { font-size: 13px; color: var(--verified); }
.levels a[aria-current="page"] .level__done { color: var(--ink); }
.levels__hint { margin: 2px 0 12px; color: var(--ink-soft); font-size: 14px; }

.point { padding: 14px 16px; }
.point__text { margin: 0; font-size: 16.5px; line-height: 1.7; overflow-wrap: anywhere; }
.point__src { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ink-faint); overflow-wrap: anywhere; }
.point__alt { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--disputed-bg); }
.point__alt .point__text { margin-top: 6px; font-size: 15.5px; }
.point__q { margin: 8px 0 0; font-size: 13px; color: var(--ink-soft); }
.point__q a { margin-inline-end: 4px; color: var(--pen); }
.point-section h2 { font-size: 17px; margin: 22px 0 0; }
.read-mark { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 0; }
.read-mark p { margin: 0; font-weight: 600; color: var(--verified); }
.lecture-gaps { margin: 14px 0; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.lecture-gaps summary { cursor: pointer; font-weight: 600; }
.lecture-gaps ul { margin: 8px 0 0; padding-inline-start: 18px; font-size: 14.5px; }

/* Question rows: a mark for where you stand, the stem, and small tags. */
.qrow { grid-template-columns: 26px minmax(0, 1fr); gap: 12px; align-items: start; }
.qrow__mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1.5px dashed var(--field);
  font-size: 13px;
  font-weight: 700;
}
.qrow__mark--right { border: 0; background: var(--hl-green); color: var(--verified); }
.qrow__mark--wrong { border: 0; background: var(--hl-pink); color: var(--wrong); }
.qrow__mark--done { border: 0; background: var(--sunk); color: var(--ink-soft); }
.qrow__body { display: grid; gap: 6px; min-width: 0; }
.qrow__stem { font-size: 15px; line-height: 1.55; text-align: left; overflow-wrap: anywhere; }
.qrow__meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--ink-faint); }
.qrow__where { font-size: 12.5px; }

/* ---------- Question ---------- */
.qhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.qhead__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.qhead__back:hover { color: var(--ink); }
.qhead__lecture { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qhead__pos { flex: none; font-size: 13px; color: var(--ink-faint); font-weight: 600; }
.question__tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 4px 0 0; }
.qid { color: var(--ink-faint); }

.stem { font-size: 17.5px; line-height: 1.7; text-align: left; margin: 14px 0 18px; }
.stem p { margin: 0 0 0.6em; }
.question__image { margin: 0 0 16px; }
.question__image img, img.question__image { display: block; max-width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; }

.options { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.option {
  --hl: transparent;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  min-height: 54px;
  padding: 13px 14px;
  background: var(--card) linear-gradient(var(--hl), var(--hl)) no-repeat 0 0 / 0% 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font: 16px/1.5 var(--clinical);
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms, background-size 520ms cubic-bezier(0.3, 0.7, 0.2, 1);
}
.option:hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--field); }
.option:disabled, .option[aria-disabled="true"] { cursor: default; }
.option__key {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--sunk);
  color: var(--ink-soft);
  font: 700 13px var(--ui);
}
.option__text { padding-top: 2px; }
/* Answering sweeps the highlighter across: green for the right one, pink for your mistake. */
.option.is-correct { --hl: var(--hl-green); border-color: transparent; background-size: 100% 100%; }
.option.is-chosen { --hl: var(--hl-pink); border-color: transparent; background-size: 100% 100%; }
.option.is-alt { --hl: var(--hl-orange); border-color: transparent; background-size: 100% 100%; }
.option.is-correct .option__key { background: var(--verified); color: var(--card); }
.option.is-chosen .option__key { background: var(--wrong); color: var(--card); }
.option.is-alt .option__key { background: var(--disputed); color: var(--card); }
.option.is-picked { border-color: var(--pen); }
.option.is-picked .option__key { background: var(--pen); color: var(--on-pen); }
.question[data-answered] .option:not(.is-correct):not(.is-chosen):not(.is-alt) { opacity: 0.6; }

.reveal { margin-top: 16px; overflow-x: clip; padding-inline: 4px; margin-inline: -4px; }
.reveal summary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1.5px dashed var(--field);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.reveal summary::-webkit-details-marker { display: none; }
.reveal[open] summary { display: none; }
.reveal__result:empty { display: none; }
.reveal__result { font: 600 18px var(--display); margin: 16px 0 0; }
.reveal__result.is-right { color: var(--verified); }
.reveal__result.is-wrong { color: var(--wrong); }

.verdict { border-radius: var(--radius); padding: 12px 14px; margin: 0 0 14px; }
.verdict p { margin: 0; }
.verdict ul { margin: 6px 0 0; padding-inline-start: 20px; }
.verdict--verified { background: var(--verified-bg); }
.verdict--disputed { background: var(--disputed-bg); }
.verdict--unknown { background: var(--unknown-bg); }
.explanation { font-size: 16px; line-height: 1.75; }
.explanation p, .explanation ul { margin: 0 0 0.8em; }
.explanation [dir="auto"] { unicode-bidi: plaintext; }

/* The source stamp: file and page, like a checked box on a lab sheet. */
.stamp {
  --tone: var(--verified);
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 12px;
  align-items: baseline;
  max-width: 100%;
  margin: 4px 0 16px;
  padding: 8px 12px;
  border: 1.5px solid var(--tone);
  border-radius: var(--radius-sm);
  color: var(--tone);
  font-size: 14px;
}
.stamp--disputed { --tone: var(--disputed); }
.stamp--unknown { --tone: var(--unknown); }
.stamp__mark { font-weight: 700; }
.stamp__who { font-weight: 600; overflow-wrap: anywhere; }
.stamp__date { grid-column: 1 / -1; font-size: 12px; opacity: 0.8; }

.sources { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 12px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.sources dt { font-weight: 600; }
.sources dd { margin: 0; text-align: left; overflow-wrap: anywhere; }
.credit { font-size: 14px; color: var(--verified); font-weight: 600; margin: 12px 0 0; }
.dispute-link { display: inline-block; margin-top: 8px; padding-block: 10px; font-size: 14px; color: var(--ink-soft); }
.save-hint { font-size: 14px; color: var(--ink-soft); margin: 0 0 12px; }
.free-strip { margin: 12px 0 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--sunk); font-size: 14px; color: var(--ink-soft); }
.free-strip a { color: var(--pen); font-weight: 600; }

.locked-wrap { margin-top: 18px; }
.locked { border-color: var(--pen); }
.locked h2 { font-size: 18px; }
.locked-note { background: var(--card); border: 1px solid var(--pen); border-radius: var(--radius); padding: 12px 14px; margin: 16px 0 0; }

.qtools { display: flex; gap: 8px; margin-top: 18px; }
.qtools form { margin: 0; }
.qtool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink-soft);
  font: 600 14px var(--ui);
  cursor: pointer;
}
.qtool:hover { color: var(--ink); border-color: var(--field); }
.qtool.is-on { background: var(--hl-blue); border-color: transparent; color: var(--ink); }
.qtool.is-on svg { fill: currentColor; }

.question__nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
}
.question__nav .button { flex: 1; max-width: 220px; }
.question__nav > span:empty { flex: 1; max-width: 220px; }
/* After answering, "التالي" stays under the thumb. */
.reveal[open] ~ .question__nav {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-inline: -16px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}

/* ---------- Today ---------- */
.readiness {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin: 8px 0 14px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.readiness p { margin: 0 0 4px; }
.readiness__score { margin: 0; }
.readiness__score b {
  font: 600 44px/1 var(--display);
  background: linear-gradient(var(--hl-yellow), var(--hl-yellow)) no-repeat 0 92% / 100% 0.42em;
  padding-inline: 0.06em;
}
.exam-link { margin: 0 0 8px; }
.steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.step__n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--sunk); font-weight: 700; font-size: 14px; }
.step .muted { display: block; font-size: 13px; }
.weak { margin: 0; padding-inline-start: 18px; }

/* ---------- Me ---------- */
.countdown { padding: 8px 0 4px; }
.countdown h1 { font: 600 clamp(28px, 8vw, 38px)/1.2 var(--display); margin: 0; }
.countdown__days { background: linear-gradient(var(--hl-yellow), var(--hl-yellow)) no-repeat 0 90% / 100% 0.45em; padding-inline: 0.08em; }
.countdown .muted { margin: 4px 0 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.stats div { display: grid; gap: 2px; padding: 12px 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-align: center; }
.stats b { font: 600 24px var(--display); }
.stats span { font-size: 12.5px; color: var(--ink-soft); }
.stats--five { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.menu a { grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; font-weight: 600; }
.menu a::after { content: "‹"; color: var(--ink-faint); font-size: 20px; line-height: 1; }
.menu__n { min-width: 26px; padding: 0 8px; border-radius: 999px; background: var(--sunk); color: var(--ink-soft); font-size: 13px; text-align: center; }
.lecture { margin: 24px 0; }
.lecture h2 { font-size: 18px; }
.bysystem { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.bysystem li { padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.bysystem a { display: flex; justify-content: space-between; gap: 12px; text-decoration: none; margin-bottom: 8px; }
.bysystem small { color: var(--ink-faint); }
.bysystem__nums { font-size: 13.5px; color: var(--ink-soft); white-space: nowrap; }
.bysystem li.is-weak { border-color: var(--wrong); }
.bysystem li.is-weak b { color: var(--wrong); }
.account form { margin: 8px 0; }
.danger summary { cursor: pointer; color: var(--wrong); font-size: 14px; margin-top: 12px; padding-block: 10px; }
.notices ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.notices li { padding-inline-start: 10px; border-inline-start: 3px solid var(--line); }
.notices li.is-new { border-color: var(--wrong); }
.notices a { text-decoration: none; font-weight: 600; }
.notices__reply { margin: 4px 0; font-size: 14px; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 14.5px; }
.form input, .form textarea, .form select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1.5px solid var(--field);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font: 16px/1.5 var(--ui);
}
.form input:focus, .form textarea:focus, .form select:focus { border-color: var(--pen); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--pen) 22%, transparent); }
.form .field { display: grid; gap: 6px; }
.form .field label { font-weight: 600; font-size: 14.5px; }
.form [aria-invalid="true"] { border-color: var(--wrong); }
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0; display: grid; gap: 8px; }
.form legend { font-weight: 700; padding: 0 6px; }
.code-input { font: 600 26px var(--mono) !important; letter-spacing: 0.4em; text-align: center; }
.resend { margin-top: 12px; font-size: 14px; color: var(--ink-soft); }
.confirm { display: flex !important; gap: 8px; align-items: flex-start; font-weight: 500 !important; }
.confirm input { width: auto; min-height: 0; margin-top: 5px; }
.choice { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; }
.choice input { width: auto; min-height: 0; margin-top: 6px; }
.stem--small { font-size: 16px; margin: 0 0 8px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--pen); width: 18px; height: 18px; }

/* ---------- Practice ---------- */
.practice-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.practice-error { background: var(--disputed-bg); color: var(--disputed); border-radius: var(--radius-sm); padding: 10px 14px; font-weight: 600; }
.practice-form { display: grid; gap: 14px; }
.practice-form fieldset { margin: 0; padding: 14px 16px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.practice-form > fieldset > legend { float: inline-start; width: 100%; padding: 0; margin-bottom: 8px; font: 600 16px var(--display); }
.practice-form fieldset fieldset { padding: 10px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.practice-module legend { padding: 0; }
.practice-module-all { display: flex; align-items: center; gap: 10px; min-height: 40px; font-weight: 600; cursor: pointer; }
.practice-systems { list-style: none; margin: 0 0 6px; padding: 0 28px 0 0; display: grid; gap: 2px; }
.practice-system label { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; font-size: 15px; }
.practice-count { color: var(--ink-faint); font-size: 13px; }
.practice-hint { color: var(--ink-soft); font-size: 13px; margin: 0 0 6px; }
.practice-hint a { color: var(--pen); }
.practice-filter, .practice-size, .practice-order { display: grid; gap: 4px; }
.practice-size { grid-template-columns: repeat(3, 1fr); }
.practice-size > legend, .practice-order > legend { grid-column: 1 / -1; }
.practice-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
}
.practice-option:has(input:checked) { border-color: var(--pen); background: color-mix(in srgb, var(--pen) 8%, var(--card)); }
.practice-option--off { opacity: 0.5; cursor: not-allowed; }
.practice-option .practice-hint { margin: 0; }
.practice-note { font-size: 13.5px; color: var(--ink-soft); margin: 6px 0 0; }
.practice-note a { color: var(--pen); }
.practice-submit { position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding: 12px 0; background: linear-gradient(transparent, var(--paper) 35%); }
.practice-submit .button { width: 100%; min-height: 52px; font-size: 17px; }
@media (min-width: 900px) { .practice-submit { bottom: 0; } }

/* ---------- Search ---------- */
.search-form { display: flex; gap: 8px; margin: 8px 0 16px; }
.search-form__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.search-form__input { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); font: 16px var(--ui); }
.search-form__input:focus { border-color: var(--pen); outline: none; }
.search-summary { color: var(--ink-soft); font-size: 14px; }
.search-group { margin: 22px 0; }
.search-group__title { font-size: 17px; margin-bottom: 0; }
.search-group__count { color: var(--ink-faint); font-weight: 500; font-size: 14px; }
.search-group__note { font-size: 14px; color: var(--ink-soft); }
.search-group__note a { color: var(--pen); }
.search-result__link { display: grid; gap: 4px; padding: 12px 16px; text-decoration: none; }
.search-result__link:hover { background: var(--sunk); }
.search-result__title { font-weight: 600; }
.search-result__snippet { font-size: 15px; line-height: 1.6; text-align: left; overflow-wrap: anywhere; }
.search-result__meta, .search-result__extra { font-size: 12.5px; color: var(--ink-faint); }
.search-hint, .search-none { color: var(--ink-soft); }
.search-examples { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 12px 0; }
.search-examples__link { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: 14.5px; }

/* ---------- Practice exam ---------- */
.exam-sizes { display: grid; gap: 10px; margin: 16px 0; }
@media (min-width: 560px) { .exam-sizes { grid-template-columns: 1fr 1fr; } }
.mode-card, .osce-mode {
  display: grid;
  gap: 4px;
  justify-items: start;
  padding: 16px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
.mode-card:hover, .osce-mode:hover { border-color: var(--pen); }
.mode-card b, .osce-mode b { font: 600 17px var(--display); }
.mode-card span, .osce-mode span { font-size: 14px; color: var(--ink-soft); }
.exam { display: grid; gap: 14px; margin-top: 12px; }
.exam-q { margin: 0; padding: 14px; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.exam-q legend { float: inline-start; width: 100%; padding: 0; margin-bottom: 10px; line-height: 1.65; overflow-wrap: anywhere; }
.exam-q__n { display: inline-grid; place-items: center; min-width: 26px; height: 26px; margin-inline-end: 6px; border-radius: 8px; background: var(--sunk); font: 700 13px var(--ui); }
.exam-q__options { display: grid; gap: 6px; clear: both; }
.exam-option { display: flex; gap: 10px; align-items: flex-start; min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; overflow-wrap: anywhere; }
.exam-option input { margin-top: 4px; }
.exam-option:has(input:checked) { border-color: var(--pen); background: color-mix(in srgb, var(--pen) 8%, var(--card)); }
.exam-submit { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--paper) 35%); }
.exam-submit .button { width: 100%; min-height: 52px; }
.exam-breakdown { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.exam-breakdown li { display: flex; justify-content: space-between; gap: 10px; }

/* ---------- Subscription and admin ---------- */
.hero { padding: 12px 0 8px; }
.hero h1 { font: 600 clamp(26px, 7vw, 36px)/1.25 var(--display); }
.hero__lede { color: var(--ink-soft); max-width: 36em; margin: 0 0 16px; }
.perks { margin: 0; padding-inline-start: 20px; display: grid; gap: 8px; }
.bank { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0; }
.bank dt { font-weight: 600; }
.bank dd { margin: 0; }
.invite__link code { word-break: break-all; }
.price { margin: 0 0 12px; font-size: 16px; color: var(--ink-soft); }
.price b { font: 600 42px/1 var(--display); color: var(--ink); margin-inline-end: 4px; }
.admin-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.admin-search input { min-height: 40px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); min-width: 240px; font: inherit; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); font-size: 14px; }
.admin-table th, .admin-table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.admin-actions { display: grid; gap: 4px; justify-items: start; }
.admin-actions form { margin: 0; }
.credentials { font-size: 15px; }

/* ---------- Reviewer ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }
.tabs a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); text-decoration: none; font-size: 14px; }
.tabs a.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tabs a.tabs__warn { border-color: var(--disputed); color: var(--disputed); }
.qlist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.qlist a { display: grid; gap: 6px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.qlist a:hover { border-color: var(--field); }
.qlist__meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.qlist__stem { font-size: 15px; color: var(--ink-soft); text-align: left; overflow-wrap: anywhere; }
.review-grid { display: grid; gap: 16px; }
@media (min-width: 1000px) {
  .review-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .review-grid > .panel:last-child { position: sticky; top: 76px; }
}
.notes { margin: 0; padding-inline-start: 20px; font-size: 14px; }
.copy { border-top: 1px solid var(--line); padding: 8px 0; font-size: 14px; }
.copy summary { cursor: pointer; }
.copy__options { padding-left: 0; list-style: none; }
.copy__options .is-key { color: var(--verified); font-weight: 600; }
.draft { white-space: pre-wrap; font: 13.5px/1.55 var(--mono); background: var(--paper); border: 1px dashed var(--disputed); border-radius: var(--radius-sm); padding: 12px; max-height: 420px; overflow: auto; }
.statuses { grid-template-columns: repeat(3, 1fr); }
.statuses--two { grid-template-columns: 1fr 1fr; }
.status-option { display: flex !important; align-items: center; gap: 6px; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; }
.status-option input { width: auto; min-height: 0; }
.status-option--verified { background: var(--verified-bg); color: var(--verified); }
.status-option--disputed { background: var(--disputed-bg); color: var(--disputed); }
.status-option--unknown { background: var(--unknown-bg); color: var(--unknown); }
.option-input { grid-template-columns: 28px 1fr; align-items: center; }
.option-input span { font-family: var(--mono); }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.keys [hidden] { display: none; }
.panel--disputes { border-color: var(--disputed); }
.dispute { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.dispute p { margin: 0 0 6px; }
.dispute__reason { white-space: pre-wrap; background: var(--paper); border-radius: var(--radius-sm); padding: 8px 10px; }

/* ---------- OSCE ---------- */
.module h2 { font-size: 19px; }
.systems { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.systems a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.systems a:hover { border-color: var(--field); }
.systems__name { font-weight: 600; overflow-wrap: anywhere; }
.systems__count { font-size: 13.5px; color: var(--ink-soft); }
.systems--osce a { flex-wrap: wrap; row-gap: 2px; }
.systems--osce .systems__name { flex: 1 1 100%; }
.systems--osce .systems__count { flex-basis: 100%; }
.hero--osce h1 { font-size: clamp(24px, 6.5vw, 32px); }
.sudden h2 { font-size: 17px; }
.sudden__list { margin: 0 0 12px; padding-inline-start: 22px; display: grid; gap: 6px; }
.sudden__list a { font-weight: 600; }
.sudden__list .muted { display: block; font-size: 13px; }
.sudden__form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.sudden__form label { display: grid; gap: 4px; flex: 1 1 200px; min-width: 0; font-size: 14px; font-weight: 600; }
.sudden__form select { width: 100%; min-width: 0; max-width: 100%; min-height: 46px; padding: 8px 10px; border: 1.5px solid var(--field); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); font: 15px var(--clinical); }
.osce-modes { display: grid; gap: 10px; margin: 16px 0; }
@media (min-width: 560px) { .osce-modes { grid-template-columns: 1fr 1fr; } }
.osce-mode b::after { content: " ←"; }
.osce-read summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.osce-key { display: inline-block; padding: 0 7px; border-radius: 6px; background: var(--disputed-bg); color: var(--disputed); font: 600 11.5px var(--ui); vertical-align: middle; }
.osce-critical { color: var(--wrong); font-weight: 600; }
.checklist { display: grid; gap: 12px; margin: 12px 0; }
.checklist__group { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist__group legend { font: 700 13px var(--ui); letter-spacing: 0.04em; color: var(--ink-soft); padding: 0 0 4px; }
.checklist__step { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 12px 14px; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); font: 16px/1.5 var(--clinical); text-align: left; }
label.checklist__step { cursor: pointer; }
.checklist__step input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--verified); scroll-margin-block: 76px 100px; }
.checklist__step.is-critical { border-inline-start: 4px solid var(--disputed); }
label.checklist__step:has(input:checked) { border-color: transparent; background: var(--hl-green); }
.is-runner main { padding-top: 0; }
.runner__bar {
  position: sticky;
  top: 56px;
  z-index: 9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 -16px 12px;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
}
@media (min-width: 900px) { .runner__bar { top: 64px; border-radius: 0 0 var(--radius) var(--radius); } }
.runner__title { margin: 0; line-height: 1.3; min-width: 0; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runner__time { display: flex; align-items: center; gap: 10px; flex: none; }
.runner__clock { font: 600 26px var(--display); font-variant-numeric: tabular-nums; }
.runner__tally { font: 600 14px var(--ui); opacity: 0.85; }
.runner__start { min-height: 40px; padding: 0 12px; border: 1.5px solid currentColor; border-radius: 10px; background: transparent; color: inherit; font: 600 14px var(--ui); cursor: pointer; }
.runner__bar.is-late .runner__clock { color: var(--late); }
.runner__bar.is-over { background: var(--wrong); }
.runner__hint { margin: 0 0 8px; }
.runner__submit { position: sticky; bottom: 0; padding: 12px 0 16px; background: linear-gradient(transparent, var(--paper) 30%); }
.runner__submit .button { width: 100%; }
.solo-gate > summary { list-style: none; width: 100%; margin: 8px 0; }
.solo-gate > summary::-webkit-details-marker { display: none; }
.solo-gate[open] > summary { display: none; }
.result h1 { font: 600 clamp(26px, 7vw, 34px) var(--display); margin-bottom: 4px; }
.result__score { color: var(--verified); }
.osce-missed h2 { font-size: 17px; }
.osce-missed h3 { font: 700 13px var(--ui); color: var(--ink-soft); margin: 12px 0 4px; }
.osce-missed ul { margin: 0; padding-left: 20px; font-family: var(--clinical); }
.osce-missed li.is-critical { color: var(--wrong); font-weight: 600; }
.osce-missed--critical { border-color: var(--wrong); background: var(--wrong-bg); }
.osce-missed--critical h2 { color: var(--wrong); }
.scenario h2 { margin-top: 0; }
.scenario p { margin: 0 0 0.5em; overflow-wrap: anywhere; }
.runner__bar + .scenario { margin-top: 12px; }
.case-parts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.case-parts a, .case-parts__current { padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); font-size: 0.9em; text-decoration: none; }
.case-parts__current { background: var(--ink); color: var(--card); border-color: var(--ink); }
.next-part { display: grid; gap: 10px; }
.next-part p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Later refinements ---------- */
.section-title { font-size: 17px; margin: 22px 0 4px; }
.step__body { display: grid; gap: 1px; min-width: 0; }
.step__lecture { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.eyebrow[lang="en"], p[lang="en"].eyebrow { text-align: right; }
.explanation strong { background-image: linear-gradient(var(--hl-yellow), var(--hl-yellow)); background-repeat: no-repeat; background-size: 100% 0.62em; background-position: 0 88%; -webkit-box-decoration-break: clone; box-decoration-break: clone; padding-inline: 0.1em; }
.practice-module > legend { float: inline-start; width: 100%; }
.practice-form fieldset fieldset { margin-top: 6px; }
a.mode-card { margin: 18px 0; }

/* ---------- Exam recall ---------- */
.mode-card--hl { border-color: transparent; background: var(--hl-yellow); }
.mode-card--hl span { color: var(--ink); }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.field__label { font-weight: 600; font-size: 14.5px; }
.tag--ok { background: var(--verified-bg); color: var(--verified); }
.recall-mine { display: grid; gap: 6px; padding: 12px 16px; }
.recall-mine p { margin: 0; }
.recall__stem { font-size: 16px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; }
.recall__options { margin: 0 0 8px; padding-left: 0; list-style: none; font-size: 15px; }
.recall__options .is-key { color: var(--verified); font-weight: 600; }
.recall__similar { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.recall__similar li { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--sunk); }
.recall__simstem { margin: 4px 0 8px; font-size: 14px; }
.recall__accept { margin: 12px 0; }
.recall__accept summary { cursor: pointer; font-weight: 600; color: var(--pen); padding: 6px 0; }
.recall__inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 8px 0; }
.recall__inline label { display: grid; gap: 4px; flex: 1 1 220px; font-size: 14px; font-weight: 600; }
.recall__inline input { min-height: 38px; padding: 6px 10px; border: 1.5px solid var(--field); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); font: inherit; }
.recalled { margin: 8px 0 0; font-size: 13.5px; color: var(--verified); font-weight: 600; }
.form .practice-option { display: flex; font-weight: 500; }
.form .field > label { display: block; }
.form .option-input { display: grid; grid-template-columns: 28px 1fr; align-items: center; }

/* ---------- Official lecture list (system page) ---------- */
.orow { display: grid; grid-template-columns: 2.6em 1fr; align-items: start; position: relative; }
.orow__n {
  padding: 15px 14px 0 0;
  font: 600 13px/1.4 "Plex", system-ui, sans-serif;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.orow > .lrow, .orow__group { grid-column: 2; }
.orow__done {
  position: absolute; inset-inline-end: 14px; top: 13px;
  color: var(--verified); font-weight: 700;
}
.orow__group { display: grid; padding: 14px 16px 6px 16px; padding-inline-start: 0; gap: 2px; }
.orow__links { list-style: none; margin: 0; padding: 0; }
.orow__links .lrow { padding: 8px 12px; border-inline-start: 2px solid var(--hl-blue); margin-block: 4px; }
.orow__links .lrow__name { font-size: 14.5px; font-weight: 500; }
.orow > .lrow { padding-inline-start: 0; }
.orow.is-missing .lrow__name { color: var(--ink-faint); font-weight: 500; }
.orow.is-missing .lrow:hover { background: none; }

/* ---------- OSCE skills map ---------- */
.jump { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.jump a {
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  font-weight: 600; font-size: 14px; color: var(--ink); text-decoration: none;
}
.jump a:hover { border-color: var(--pen); }
.osce-map__week { font-size: 15px; margin: 22px 0 4px; color: var(--ink-soft); }
.osce-map .orow__group > .lrow__meta { margin-top: 2px; }
.seen { color: var(--pen); font-weight: 600; }

/* ==========================================================================
   Medli B2 · binder dividers
   Every body system is a coloured divider (sys-<key>). Pages inside a system
   take its colour; everything else is ink on white sheets over a warm desk.
   ========================================================================== */
.sys-cardio { --sys: #A3262B; --sys-deep: #7C1A1F; --sys-tint: #F6E7E5; }
.sys-pulmo  { --sys: #2A4F9A; --sys-deep: #1D3870; --sys-tint: #E4EAF6; }
.sys-endo   { --sys: #A87210; --sys-deep: #7A520A; --sys-tint: #F8EED8; }
.sys-id     { --sys: #1E6B4E; --sys-deep: #144C37; --sys-tint: #E1F0E9; }
.sys-neuro  { --sys: #5A3B93; --sys-deep: #412A6C; --sys-tint: #ECE6F5; }
.sys-gi     { --sys: #B85A2A; --sys-deep: #87411D; --sys-tint: #F7E8DF; }
.sys-hema   { --sys: #8E2450; --sys-deep: #681A3A; --sys-tint: #F5E3EA; }
.sys-nephro { --sys: #16666A; --sys-deep: #0F4A4D; --sys-tint: #DFF0F0; }
body[class*="sys-"] { --pen: var(--sys); --pen-hover: var(--sys-deep); }

body { font-family: var(--ui); }
h1, h2, h3, .page-title { font-family: var(--display); font-weight: 700; letter-spacing: -0.005em; }
.page-title { font-weight: 800; font-size: clamp(26px, 6.4vw, 36px); line-height: 1.15; }
:focus-visible { outline-color: var(--ink); }

/* No more highlighter strokes: weight and ink carry emphasis. */
.hl, .point__text strong, mark {
  background-image: none;
  padding-inline: 0;
  font-weight: 600;
  color: var(--ink);
}
.search mark, .search-result mark { background: var(--sys-tint); border-radius: 4px; padding-inline: 2px; }

/* ---------- Header: the sticker wordmark ---------- */
.topbar { background: var(--paper); border-bottom: 0; height: 68px; padding-inline: 14px 8px; }
.brand {
  gap: 0; padding: 4px 5px 5px; background: #fff; border-radius: 14px;
  display: inline-flex; flex-direction: column; transform: rotate(-4deg);
  box-shadow: 0 1px 0 rgb(26 26 36 / 0.06), 0 8px 16px -8px rgb(26 26 36 / 0.45);
}
.brand__tabs { display: flex; align-items: flex-end; gap: 2px; height: 7px; padding-inline: 7px; }
.brand__tabs i { flex: 1; height: 100%; border-radius: 3px 3px 0 0; }
.brand__tabs i:nth-child(even) { height: 65%; }
.brand__tabs i:nth-child(1) { background: #A3262B; }
.brand__tabs i:nth-child(2) { background: #2A4F9A; }
.brand__tabs i:nth-child(3) { background: #C98A16; }
.brand__tabs i:nth-child(4) { background: #1E6B4E; }
.brand__tabs i:nth-child(5) { background: #5A3B93; }
.brand__tabs i:nth-child(6) { background: #B85A2A; }
.brand__tabs i:nth-child(7) { background: #8E2450; }
.brand__tabs i:nth-child(8) { background: #16666A; }
.brand__word {
  display: block; background: #1A1A24; color: #fff;
  font: 800 22px/1.25 "Baloo Bhaijaan 2", var(--display);
  padding: 4px 13px 1px; border-radius: 10px;
}
.iconbtn { width: 44px; height: 44px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink); color: var(--ink); }
.iconbtn:hover { background: var(--sunk); }

/* Phone tab bar */
.tabs-nav { background: var(--card); border-top: 2px solid var(--ink); }
.tab { font-family: var(--display); font-weight: 600; color: var(--ink-faint); }
.tab[aria-current="page"] { color: var(--sys-deep); font-weight: 700; }
.tab[aria-current="page"]::before {
  background: var(--sys-tint); transform: none; border-radius: 12px;
  width: 52px; height: 30px; top: 6px; translate: 0 0;
}

@media (min-width: 900px) {
  .topbar { height: 84px; padding-inline: 28px; }
  .tabs-nav { background: none; border: 0; }
  .brand__word { font-size: 28px; padding: 5px 16px 2px; }
  .brand__tabs { height: 9px; padding-inline: 9px; gap: 3px; }
  .tab { height: 44px; padding: 0 16px; border-radius: 999px; font-size: 16px; color: var(--ink-soft); }
  .tab:hover { background: var(--card); color: var(--ink); }
  .tab[aria-current="page"] { background: var(--ink); color: var(--on-ink); }
  .tab[aria-current="page"]::before { display: none; }
}

/* ---------- Sheets, cards, buttons ---------- */
.panel, .empty, .sheet, .qrows, .lrows, .menu, .points, .search-results, .tile, .mode-card, .osce-mode, .step, .readiness {
  border-color: transparent;
  border-radius: 18px;
  box-shadow: 0 1px 0 rgb(26 26 36 / 0.05);
}
.button {
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--pen);
  color: var(--on-pen);
  font-family: var(--display);
  font-weight: 700;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.button:hover { background: var(--pen-hover); }
.button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.button--ghost { background: var(--card); color: var(--ink); }
.button--ghost:hover { background: var(--sys-tint); }
.button--danger { background: #A3262B; }
.chip, .tag { border-radius: 8px; font-weight: 600; }

/* ---------- Library: the eight dividers ---------- */
.intro h1 { font-weight: 800; }
.searchbar { border: 2px solid var(--ink); border-radius: 999px; background: var(--card); min-height: 52px; }
.searchbar:focus-within { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink); border-color: var(--ink); }
.module__title { font: 800 22px/1.2 var(--display); }
.tile[class*="sys-"] {
  background: var(--sys); color: #fff; border-radius: 18px;
  box-shadow: inset 0 -6px 0 rgb(0 0 0 / 0.14); padding: 16px 18px 20px;
}
.tile[class*="sys-"] .tile__name { font: 800 20px/1.2 var(--display); }
.tile[class*="sys-"] .tile__meta, .tile[class*="sys-"] .tile__mine { color: rgb(255 255 255 / 0.9); }
.tile[class*="sys-"]:hover { transform: translateY(-3px); border-color: transparent; }

/* ---------- Inside a system: the page wears its divider ---------- */
body[class*="sys-"] main::before {
  content: ""; display: block; height: 12px; margin: 0 0 14px;
  border-radius: 0 0 12px 12px; background: var(--sys);
}
body[class*="sys-"] .crumbs a[lang="en"] { color: var(--sys-deep); font-weight: 600; }
.orow { grid-template-columns: 3.2em 1fr; column-gap: 6px; }
.orow__n { font: 800 26px/1 var(--display); color: var(--sys); padding: 15px 14px 0 0; letter-spacing: -0.02em; text-align: start; }
.orow__done { color: var(--sys); }

/* Lecture page */
.seg { display: flex; gap: 22px; background: transparent; border-bottom: 2px solid var(--line); border-radius: 0; padding: 0; }
.seg a { position: relative; min-height: 48px; border-radius: 0; padding-inline: 2px; font: 700 18px var(--display); color: var(--ink-faint); }
.seg a[aria-current="page"] { background: transparent; box-shadow: none; color: var(--ink); }
.seg a[aria-current="page"]::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -2px; height: 4px; border-radius: 4px; background: var(--sys);
}
.seg__n { font: 500 12px/1 var(--mono); background: var(--ink); color: var(--on-ink); padding: 5px 7px; border-radius: 7px; }
.levels a { border: 2px solid var(--line); background: var(--card); border-radius: 999px; font: 700 15px var(--display); color: var(--ink-soft); }
.levels a:hover { border-color: var(--ink); }
.levels a[aria-current="page"] { background: var(--sys); border-color: var(--sys); color: #fff; }
.levels a[aria-current="page"] .level__done { color: #fff; }
.point__text { font-size: 16.5px; line-height: 1.75; }
.point__alt { border: 2px solid var(--ink); border-radius: 14px; background: #F8F5F1; }

/* Today / me: big numbers */
.readiness__score b, .countdown__days { font-family: var(--display); font-weight: 800; color: var(--sys); }
.step__n, .menu__n { font-family: var(--display); font-weight: 800; }

/* OSCE */
.hero h1 { font-weight: 800; }
.seen { color: var(--ink); }
.osce-map__week { font: 800 16px/1.2 var(--display); color: var(--ink); }
.jump a { border: 2px solid var(--ink); background: var(--card); font-family: var(--display); }
.jump a:hover { background: var(--ink); color: var(--on-ink); }

/* ---------- Wider screens: use the width ---------- */
@media (min-width: 900px) {
  main { max-width: 1040px; padding-inline: 28px; }
  .point__text { max-width: 70ch; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
}
@media (min-width: 1300px) {
  main { max-width: 1180px; }
  body[class*="sys-"] .orows { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile[class*="sys-"]:hover, .button:active { transform: none; }
}
@media (max-width: 899px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile[class*="sys-"] { padding: 14px 14px 18px; }
  .tile[class*="sys-"] .tile__name { font-size: 16.5px; }
}

/* ---------- OSCE: each week is its own divider; station choices look like buttons ---------- */
.osce-week { margin-top: 30px; }
.osce-map__week {
  display: inline-block; margin: 0; padding: 9px 16px 6px;
  background: var(--ink); color: var(--on-ink); border-radius: 12px 12px 0 0;
  font: 800 16px/1.2 var(--display);
}
.osce-map__week .muted { color: rgb(255 255 255 / 0.75); font-size: 13px; }
.osce-week > .lrows { border-start-start-radius: 0; border-top: 3px solid var(--ink); }
.osce-week--past > .muted { margin: 8px 0; }
.osce-week--past > .lrows { border-top-color: var(--ink); }
.orow__pick { margin-top: 8px; font: 700 13.5px var(--display); color: var(--ink); }
.osce-map .orow__links { display: grid; gap: 8px; margin-top: 8px; }
.osce-map .orow__links .lrow {
  position: relative; padding: 12px 44px 12px 14px; padding-inline: 14px 44px; margin: 0;
  border: 2px solid var(--line); border-inline-start: 2px solid var(--line); border-radius: 12px; background: var(--card);
}
.osce-map .orow__links .lrow:hover { border-color: var(--ink); background: var(--sunk); }
.osce-map a.lrow::after {
  content: "←"; position: absolute; inset-inline-end: 14px; top: 50%; translate: 0 -50%;
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink); color: var(--on-ink); font: 700 14px/1 var(--ui);
}
.osce-map .orow > a.lrow { padding-inline-end: 48px; }
.osce-map .orow > a.lrow:hover { background: var(--sunk); }

/* ---------- Questions and the practice exam ---------- */
.runner__bar { top: 68px; background: var(--ink); color: var(--on-ink); }
@media (min-width: 900px) { .runner__bar { top: 84px; border-radius: 0 0 16px 16px; } }
.runner__clock { font-family: var(--display); font-weight: 800; }
.option { border: 2px solid var(--line); border-radius: 14px; }
.option:hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--ink); }
.option.is-picked { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.option.is-picked .option__key { background: var(--ink); color: var(--on-ink); }
.exam-q { border: 0; border-radius: 18px; padding: 18px; box-shadow: 0 1px 0 rgb(26 26 36 / 0.05); }
.exam-q__n { background: var(--ink); color: var(--on-ink); font: 800 13px var(--display); }
.exam-option { border: 2px solid var(--line); border-radius: 12px; background: var(--card); }
.exam-option:hover { border-color: var(--ink); }
.exam-option:has(input:checked) { border-color: var(--ink); background: var(--sunk); box-shadow: 3px 3px 0 var(--ink); }
.exam-option input { accent-color: var(--ink); }
.exam-sizes .mode-card, .exam-sizes a, .exam-sizes button { border: 2px solid var(--ink); }
.mode-card, .osce-mode { border: 2px solid var(--ink); }
.mode-card:hover, .osce-mode:hover { background: var(--sunk); }
.exam-q legend { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.exam-q__stem { text-align: left; }
.exam-q__n { margin: 2px 0 0; }

/* A way out of the timed exam (the tab bar is hidden there). */
.runner__exit { flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 2px solid currentColor; border-radius: 10px; color: inherit; font: 700 14px var(--display); text-decoration: none; }
.runner__exit:hover { background: var(--on-ink); color: var(--ink); }
.runner__title { flex: 1; }
.exam-leave { margin: 0 0 4px; }

/* OSCE map: one column (rows differ a lot in height); the arrow sits beside the title, not in empty space. */
.osce-map .osce-week { max-width: 880px; }
.osce-map .orow > a.lrow::after { top: 16px; translate: 0 0; }
.osce-map .orow__links a.lrow::after { width: 24px; height: 24px; font-size: 13px; }

/* The explained level reads like notes: paragraphs, not a list. */
.point-section--explained .points { counter-reset: none; }
.point-section--explained .point { padding-block: 16px; }
.point-section--explained .point__text { font-size: 17px; line-height: 1.85; max-width: 70ch; }
.point-section--explained .point__text strong { color: var(--sys-deep); }
.point-section--explained > h2 { font: 800 21px/1.25 var(--display); margin-top: 26px; padding-inline-start: 12px; border-inline-start: 5px solid var(--sys); }
.level--explained:not([aria-current]) { border-color: var(--sys); color: var(--sys-deep); }

/* Why each option is right or wrong; the student’s own pick stands out. */
.optnotes { margin-top: 18px; }
.optnotes h3 { font: 800 16px var(--display); margin: 0 0 8px; }
.optnotes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.optnote { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); }
.optnote p { grid-column: 1 / -1; margin: 2px 0 0; text-align: left; line-height: 1.6; }
.optnote__key { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--sunk); font: 800 13px var(--display); }
.optnote__verdict { align-self: center; font: 700 13px var(--display); }
.optnote--right { border-color: var(--verified); }
.optnote--right .optnote__key { background: var(--verified); color: var(--card); }
.optnote--right .optnote__verdict { color: var(--verified); }
.optnote--wrong .optnote__verdict { color: var(--wrong); }
.optnote__src { grid-column: 1 / -1; font-size: 12.5px; color: var(--verified); }
.question[data-chosen="A"] .optnote[data-key="A"], .question[data-chosen="B"] .optnote[data-key="B"], .question[data-chosen="C"] .optnote[data-key="C"], .question[data-chosen="D"] .optnote[data-key="D"], .question[data-chosen="E"] .optnote[data-key="E"], .question[data-chosen="F"] .optnote[data-key="F"] { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); order: -1; }

/* ---------- Flashcards ---------- */
.cards-system { margin: 22px 0 8px; font: 800 18px var(--display); color: var(--sys); }
.cards-left { margin: 6px 0 10px; font: 700 14px var(--display); color: var(--ink-soft); }
.flashcard { background: var(--card); border: 2px solid var(--ink); border-radius: 20px; box-shadow: 5px 5px 0 var(--sys); padding: 22px 20px; max-width: 720px; }
.flashcard__front { margin: 0; font-size: 19px; line-height: 1.75; text-align: left; }
.flashcard__reveal { margin-top: 18px; }
.flashcard__reveal > summary { list-style: none; cursor: pointer; width: 100%; }
.flashcard__reveal > summary::-webkit-details-marker { display: none; }
.flashcard__reveal[open] > summary { display: none; }
.flashcard__back { margin: 0; padding-top: 14px; border-top: 2px dashed var(--line); font-size: 18px; line-height: 1.75; text-align: left; }
.flashcard__back strong { color: var(--sys-deep); background: var(--sys-tint); border-radius: 4px; padding-inline: 3px; }
.flashcard__src { margin: 8px 0 0; font-size: 12.5px; color: var(--verified); text-align: left; }
.flashcard__grade { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }

/* Practice: the three ways in, as big cards. */
.practice-modes { display: grid; gap: 10px; margin: 6px 0 14px; }
@media (min-width: 700px) { .practice-modes { grid-template-columns: repeat(3, 1fr); } }
.practice-mode { display: grid; gap: 6px; padding: 18px; border: 2px solid var(--ink); border-radius: 18px; background: var(--card); box-shadow: 4px 4px 0 var(--ink); text-decoration: none; color: var(--ink); }
.practice-mode:hover { background: var(--sunk); }
.practice-mode:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.practice-mode b { font: 800 22px var(--display); }
.practice-mode span { font-size: 14px; color: var(--ink-soft); }
.practice-mistakes { margin: 0 0 12px; }
.practice-heading { margin-top: 26px; font: 800 20px var(--display); scroll-margin-top: 96px; }

/* ---------- Plan ---------- */
.plan-summary { padding: 18px; border-radius: 18px; background: var(--card); display: grid; gap: 8px; }
.plan-summary p { margin: 0; }
.plan-big { font: 800 34px/1 var(--display); }
.plan-heading { margin: 26px 0 10px; font: 800 20px var(--display); }
.plan-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 900px) { .plan-days { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }
.plan-day { padding: 14px 16px; border-radius: 16px; background: var(--card); border: 2px solid transparent; }
.plan-day.is-today { border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.plan-day h3 { margin: 0 0 8px; font: 800 16px var(--display); }
.plan-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plan-item { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.plan-item__name { display: flex; gap: 8px; align-items: baseline; text-decoration: none; color: var(--ink); font-weight: 600; min-width: 0; }
.plan-item__name:hover { text-decoration: underline; }
.plan-item__n { font: 800 15px var(--display); color: var(--sys); flex: none; }
.plan-item.is-done .plan-item__name { color: var(--ink-faint); text-decoration: line-through; }
.plan-sys { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--sys); color: #fff; font: 700 11.5px var(--display); }
.plan-check { width: 34px; height: 34px; flex: none; border-radius: 10px; border: 2px solid var(--ink); background: var(--card); color: var(--on-pen); font: 800 16px var(--display); cursor: pointer; }
.plan-check[aria-pressed="true"] { background: var(--verified); border-color: var(--verified); color: #fff; }
.plan-system { margin-top: 8px; padding: 12px 16px; border-radius: 16px; background: var(--card); border-inline-start: 6px solid var(--sys); }
.plan-system summary { cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font: 800 16px var(--display); }
.plan-system .plan-items { margin-top: 10px; }

/* Picture flashcards */
.flashcard__pic { margin: 0; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.flashcard__pic img { display: block; width: 100%; height: auto; }
.flashcard__ask { margin: 12px 0 0; font: 800 20px var(--display); }
.flashcard__features { margin: 8px 0 0; padding-inline-start: 20px; text-align: left; line-height: 1.6; }
.cards-deck--pics { background: var(--ink); color: var(--on-ink); }
.cards-deck--pics .tile__meta { color: inherit; opacity: 0.85; }
.flashcard__pic figcaption { padding: 6px 10px; font-size: 13px; background: var(--card); text-align: start; }
.flashcard__pic figcaption a { color: var(--ink-soft); }
.iconbtn--theme { margin-inline-start: 6px; font-size: 20px; line-height: 1; cursor: pointer; }
.iconbtn + .iconbtn--theme { margin-inline-start: 6px; }

/* OSCE v2: weeks open and close; a sticky bar to jump between modules and back to the top; a filter box. */
.jump--sticky { position: sticky; top: 68px; z-index: 5; padding: 8px 0; background: var(--paper); }
@media (min-width: 900px) { .jump--sticky { top: 84px; } }
.osce-map, #sudden { scroll-margin-top: 140px; }
details.osce-week { margin-top: 18px; }
details.osce-week > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; }
details.osce-week > summary::-webkit-details-marker { display: none; }
details.osce-week > summary::after { content: "▾"; margin-inline-start: auto; font-size: 14px; }
details.osce-week:not([open]) > summary { border-radius: 12px; }
details.osce-week:not([open]) > summary::after { content: "◂"; }
.osce-week__count { font: 600 13px var(--ui); opacity: 0.8; }
details.osce-week > .lrows { border-start-start-radius: 0; border-top: 3px solid var(--ink); margin-top: 0; }
.osce-map__week { display: flex; width: 100%; box-sizing: border-box; }
.osce-search { display: block; margin: 6px 0 10px; }
.osce-search input { width: 100%; min-height: 48px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 999px; background: var(--card); color: var(--ink); font: 15px var(--ui); }
details.sudden { margin-top: 26px; }
details.sudden > summary { cursor: pointer; line-height: 1.6; }
details.sudden[open] > summary { margin-bottom: 8px; }
.osce-map .orow[hidden] { display: none; }

/* Picture cards: four choices, then right/wrong with the diagnosis. */
.flashcard__choices { display: grid; gap: 8px; margin-top: 12px; }
@media (min-width: 700px) { .flashcard__choices { grid-template-columns: 1fr 1fr; } }
.flashcard__choice { min-height: 50px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font: 600 15px var(--ui); text-align: left; cursor: pointer; }
.flashcard__choice:hover { border-color: var(--ink); background: var(--sunk); }
.flashcard-feedback { margin: 0 0 14px; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); max-width: 720px; }
.flashcard-feedback p { margin: 0; }
.flashcard-feedback__head { font: 800 18px var(--display); margin-bottom: 4px !important; }
.flashcard-feedback.is-right { border-color: var(--verified); }
.flashcard-feedback.is-right .flashcard-feedback__head { color: var(--verified); }
.flashcard-feedback.is-wrong { border-color: var(--wrong); }
.flashcard-feedback.is-wrong .flashcard-feedback__head { color: var(--wrong); }
.tile[class*="sys-"] .tile__name { overflow-wrap: break-word; word-break: normal; hyphens: auto; }
