/* ============================================================================
   Dr. M. Omar Reels — Project Management System
   Design: Apple-style light. White grounds, system typography, generous radii,
   colour used only where it carries meaning.
   ========================================================================== */

/* Cairo is the brand's Arabic face — the only webfont here.
   Everything else is the native system stack. */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&display=swap');

/* ---------------------------------------------------------------- tokens -- */
:root {
  /* ground */
  --ground:   #FFFFFF;
  --ground-2: #F5F5F7;   /* wells, table header rows */
  --panel:    #FFFFFF;   /* cards */

  /* hairlines + surface washes */
  --line:   rgba(0, 0, 0, 0.08);
  --line-2: rgba(0, 0, 0, 0.14);
  --tint:   rgba(0, 0, 0, 0.03);
  --tint-2: rgba(0, 0, 0, 0.055);

  /* ink */
  --ink:   #1D1D1F;   /* 15.8:1 */
  --ink-2: #4E4E52;   /*  7.9:1  body + secondary text */
  --ink-3: #6E6E73;   /*  5.3:1  small labels, still AA */
  --ink-4: #8E8E93;   /*  3.4:1  DECORATIVE ONLY — large numerals, markers */

  /* accents */
  --accent:      #0071E3;   /* links, nav active, focus */
  --accent-ink:  #0058B0;   /* blue TEXT sitting on a blue tint */
  --accent-dim:  rgba(0, 113, 227, 0.10);
  --gold:        #B0862B;   /* brand mark (decorative) */
  --gold-ink:    #7D5F1B;   /* gold TEXT — the mark colour fails AA at small sizes */
  --gold-dim:    rgba(176, 134, 43, 0.12);

  /* status — vivid fills for bars, darkened twins for pill text */
  --st-published:  #0071E3;
  --st-approved:   #34C759;
  --st-revisions:  #FF9500;
  --st-review:     #FFB700;
  --st-notstarted: #D2D2D7;

  --st-approved-ink:  #16682F;   /* dark enough on the recessed version-row tint */
  --st-revisions-ink: #9A4E00;
  --st-review-ink:    #8A5A00;

  /* elevation */
  --shadow:    0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.04), 0 14px 40px rgba(0,0,0,.08);

  /* geometry — Apple runs generous */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 980px;

  --pad:    clamp(1.25rem, 3.2vw, 2rem);
  --gutter: clamp(1.1rem, 4vw, 3.25rem);
  --maxw:   1280px;

  /* type — native system stack */
  --f-ui: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Segoe UI Variable Display", "Segoe UI", system-ui, Roboto, sans-serif;
  --f-display: var(--f-ui);
  --f-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --f-ar: 'Cairo', 'Segoe UI', Tahoma, sans-serif;

  --ease: cubic-bezier(0.22, 0.68, 0.36, 1);
}

/* ------------------------------------------------------------------ base -- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* one very soft wash at the top — the only atmosphere on white */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 60vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(70vw 40vh at 15% -10%, rgba(0, 113, 227, 0.045), transparent 65%),
    radial-gradient(60vw 36vh at 92% -6%, rgba(176, 134, 43, 0.04), transparent 62%);
}

#page { position: relative; z-index: 1; }

a { color: inherit; }

::selection { background: rgba(0, 113, 227, 0.16); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Grid and flex items default to min-width:auto, which lets a wide child
   (a table, a long token) push its container past the viewport. Every direct
   item of a grid here is allowed to shrink instead. */
.dash > *, .dash__side > *, .miniset > *, .serieslist > *,
.rules > *, .figs > *, .swatches > *, .updates > * { min-width: 0; }
.rule__body, .series__names, .update__list { min-width: 0; }

/* visually hidden, still read by screen readers and still focusable */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Arabic text — always RTL, always Cairo, never breaks the LTR layout */
.ar {
  font-family: var(--f-ar);
  direction: rtl;
  unicode-bidi: isolate;
  text-align: right;
  line-height: 1.85;
}

/* Inline Arabic sitting inside an English sentence. `isolate` is what keeps
   the visual order matching the source order — without it, adjacent Arabic
   runs either side of an English word swap places. */
.ar-i {
  font-family: var(--f-ar);
  direction: rtl;
  unicode-bidi: isolate;
  font-weight: 600;
}

.mono {
  font-family: var(--f-mono);
  font-feature-settings: "tnum" 1;
}

/* section label */
.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 1.25rem;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* the compact line that replaced the hero meta */
.metaline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.4rem;
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-3);
}
.metaline b { color: var(--ink-2); font-weight: 600; }
.metaline .num { font-family: var(--f-mono); font-size: 0.78rem; color: var(--ink-2); }

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--st-approved);
  margin-right: 0.15rem;
  flex: none;
}

/* ============================================================== masthead == */
.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.masthead__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 56px;
  padding-block: 0.6rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  min-width: 0;
}

/* the eye mark */
.brand__mark {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  display: grid;
  place-items: center;
  background: var(--gold-dim);
}
.brand__mark i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  display: block;
}

.brand__txt { min-width: 0; }
.brand__name {
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--ink);
}
.brand__sub {
  font-size: 0.68rem;
  letter-spacing: 0.01em;
  color: var(--ink-3);
  white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: 0.3rem; }

.nav a {
  font-size: 0.83rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink-2);
  padding: 0.45rem 0.9rem;
  border-radius: var(--r-pill);
  transition: color 0.22s var(--ease), background 0.22s var(--ease);
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--tint); }
.nav a[aria-current="page"] {
  color: #fff;
  background: var(--accent);
  font-weight: 600;
}

/* On narrow screens the brand strapline and the two nav links collide.
   Drop the strapline first, then tighten the nav. */
@media (max-width: 560px) {
  .masthead__in { gap: 0.75rem; }
  .brand__sub { display: none; }
  .brand__name { font-size: 0.92rem; }
  .nav a { padding: 0.4rem 0.7rem; font-size: 0.78rem; }
}
@media (max-width: 380px) {
  .brand__name { font-size: 0.85rem; }
  .nav a { padding: 0.38rem 0.55rem; font-size: 0.72rem; }
}

/* ============================================================== sections == */
.section { padding-block: clamp(2rem, 4.5vw, 3.25rem); }
.section--tight { padding-block: clamp(1.4rem, 3vw, 2rem) 0; }
.section--first { padding-top: clamp(1.75rem, 4vw, 2.75rem); }

/* ============================================================= dashboard == */
.dash {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) { .dash { grid-template-columns: 1fr; } }

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--pad);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* --- overall card --- */
.overall { display: flex; flex-direction: column; gap: clamp(1.75rem, 4vw, 2.5rem); }

.overall__glow {
  position: absolute;
  top: -55%; right: -18%;
  width: 62%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.07), transparent 68%);
  pointer-events: none;
}

.overall__num {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.92;
}
.overall__num .big {
  font-size: clamp(4rem, 14vw, 8.25rem);
  color: var(--ink);
}
.overall__num .of {
  font-size: clamp(1.4rem, 4vw, 2.3rem);
  color: var(--ink-4);
  font-weight: 500;
}

.overall__pct {
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--accent);
  margin-top: 0.35rem;
}

/* --- right column stack --- */
.dash__side { display: grid; gap: 1rem; grid-template-rows: auto 1fr; }

.kpi { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.kpi__num {
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.04em;
}
.kpi__lbl {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-3);
  text-align: right;
  max-width: 16ch;
  line-height: 1.4;
}
.kpi__lbl .dot { display: inline-block; background: var(--st-review); margin-right: 0.4rem; }

/* --- per-series mini cards --- */
.miniset { display: grid; gap: 0.6rem; align-content: start; }

.mini {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.4rem 1rem;
  padding: 0.85rem 1rem 0.85rem 1.15rem;
  background: var(--ground-2);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  text-decoration: none;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.mini:hover {
  background: #fff;
  box-shadow: var(--shadow);
  border-color: var(--line);
  transform: translateY(-1px);
}
.mini::before {
  content: "";
  position: absolute;
  left: 0; top: 14%; bottom: 14%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-series, var(--accent));
}
.mini__name {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.mini__name span {
  font-family: var(--f-mono);
  font-size: 0.66rem;
  color: var(--ink-4);
  margin-right: 0.55rem;
}
.mini__count {
  font-family: var(--f-mono);
  font-size: 0.8rem;
  color: var(--ink-3);
  white-space: nowrap;
}
.mini__count b { color: var(--accent-series, var(--ink)); font-weight: 600; }
.mini__bar { grid-column: 1 / -1; }

/* --- segmented progress bar --- */
.bar {
  display: flex;
  width: 100%;
  height: 6px;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: #E8E8ED;
  gap: 1.5px;
}
.bar--lg { height: 10px; gap: 2px; }

.bar span {
  display: block;
  height: 100%;
  width: 0;
  transition: width 1.1s var(--ease);
}
.bar span:first-child { border-radius: var(--r-pill) 0 0 var(--r-pill); }
.bar span:last-child  { border-radius: 0 var(--r-pill) var(--r-pill) 0; }

.seg-published   { background: var(--st-published); }
.seg-approved    { background: var(--st-approved); }
.seg-revisions   { background: var(--st-revisions); }
.seg-in-review   { background: var(--st-review); }
.seg-not-started { background: var(--st-notstarted); }

/* legend */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.25rem;
  margin-top: 1.15rem;
  font-size: 0.76rem;
  color: var(--ink-3);
}
.legend i {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 3px;
  margin-right: 0.45rem;
  vertical-align: 0;
}

/* ================================================================ updates = */
.updates { display: grid; gap: 0.7rem; }

.update {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0 1.75rem;
  padding: 1.15rem 1.35rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
}
.update--latest {
  border-color: rgba(176, 134, 43, 0.32);
  background: linear-gradient(180deg, rgba(176, 134, 43, 0.05), transparent 70%), #fff;
}

.update__date {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  color: var(--ink-3);
  padding-top: 0.1rem;
}
.update--latest .update__date { color: var(--gold-ink); }

.update__tag {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: var(--f-ui);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.14rem 0.55rem;
  border: 1px solid rgba(176, 134, 43, 0.4);
  border-radius: var(--r-pill);
  color: var(--gold-ink);
}

.update__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.75rem; }
.update__item { display: flex; gap: 0.75rem; align-items: baseline; }
.update__owner {
  flex: none;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--ink);
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-pill);
}
.update__text { color: var(--ink); font-size: 0.95rem; }

@media (max-width: 620px) {
  .update { grid-template-columns: 1fr; gap: 0.9rem; }
  .update__tag { margin-top: 0; margin-left: 0.6rem; }
}

/* =============================================================== accordion */
.serieslist { display: grid; gap: 0.8rem; }

.series {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
}
.series::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent-series);
  z-index: 1;
}

.series__head {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.3rem 1.35rem;
  padding: 1.3rem clamp(1rem, 3vw, 1.75rem);
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.25s var(--ease);
}
.series__head:hover { background: var(--tint); }

.series__no {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  color: var(--accent-series);
  background: var(--accent-soft, var(--ground-2));
  border-radius: var(--r-pill);
  padding: 0.3rem 0.75rem;
  white-space: nowrap;
  font-weight: 500;
}

.series__names { min-width: 0; }
.series__name {
  font-weight: 600;
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  letter-spacing: -0.028em;
  line-height: 1.2;
  color: var(--ink);
}
.series__namear {
  font-family: var(--f-ar);
  direction: rtl;
  unicode-bidi: isolate;
  font-size: 0.82rem;
  color: var(--ink-3);
  line-height: 1.7;
  display: block;
}

.series__stat { text-align: right; white-space: nowrap; }
.series__count {
  font-family: var(--f-mono);
  font-size: 1rem;
  color: var(--ink);
}
.series__count b { color: var(--accent-series); font-weight: 600; }
.series__of { color: var(--ink-4); }
.series__statlbl {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--ink-3);
  display: block;
  letter-spacing: 0.01em;
}

.series__chev {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--ground-2);
  color: var(--ink-2);
  transition: transform 0.32s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease);
}
.series__head[aria-expanded="true"] .series__chev {
  transform: rotate(180deg);
  background: var(--accent-series);
  color: #fff;
}
.series__chev svg { width: 13px; height: 13px; }

.series__barwrap { grid-column: 1 / -1; padding-top: 0.4rem; }

/* TBD colour flag */
.tbd {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--st-revisions-ink);
  background: rgba(255, 149, 0, 0.12);
  border-radius: var(--r-pill);
  padding: 0.14rem 0.5rem;
  margin-left: 0.6rem;
  vertical-align: 3px;
}

/* --- panel body --- */
.series__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.42s var(--ease);
}
.series__body[data-open="true"] { grid-template-rows: 1fr; }
.series__bodyin { overflow: hidden; }

/* ================================================================== table = */
.tbl { width: 100%; border-collapse: collapse; }

.tbl thead th {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
  padding: 0.7rem clamp(0.5rem, 1.5vw, 0.9rem);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ground-2);
  white-space: nowrap;
}
.tbl thead th:first-child { padding-left: clamp(1rem, 3vw, 1.75rem); }
.tbl thead th:last-child  { padding-right: clamp(1rem, 3vw, 1.75rem); text-align: right; }
/* the Episode column holds right-aligned Arabic — its header follows it */
.tbl thead th:nth-child(2) { text-align: right; }

.tbl tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background 0.2s var(--ease);
}
.tbl tbody tr:last-child { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--tint); }
.tbl tbody tr.is-linked { cursor: pointer; }

.tbl td {
  padding: 0.85rem clamp(0.5rem, 1.5vw, 0.9rem);
  vertical-align: middle;
}
.tbl td:first-child { padding-left: clamp(1rem, 3vw, 1.75rem); }
.tbl td:last-child  { padding-right: clamp(1rem, 3vw, 1.75rem); text-align: right; }

/* episode number */
.ep {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  color: var(--ink-3);
  white-space: nowrap;
}
.ep--intro {
  color: var(--accent-series);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

/* title cell */
.tcell { display: flex; align-items: center; gap: 0.7rem; justify-content: flex-end; }
.ttl {
  font-family: var(--f-ar);
  direction: rtl;
  unicode-bidi: isolate;
  text-align: right;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}

.linkchip {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--ground-2);
  color: var(--ink-2);
  text-decoration: none;
  transition: all 0.22s var(--ease);
}
.linkchip:hover {
  color: #fff;
  background: var(--accent);
  transform: translateY(-1px);
}
.linkchip svg { width: 11px; height: 11px; }

/* status pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  padding: 0.3rem 0.72rem;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

.pill--published   { color: #FFFFFF;                 background: var(--st-published); }
.pill--approved    { color: var(--st-approved-ink);  background: rgba(52, 199, 89, 0.14); }
.pill--revisions   { color: var(--st-revisions-ink); background: rgba(255, 149, 0, 0.14); }
.pill--in-review   { color: var(--st-review-ink);    background: rgba(255, 183, 0, 0.18); }
.pill--not-started { color: var(--ink-3);            background: var(--ground-2); }

/* ------------------------------------------------- version rows + verdicts */

/* A version row is a sub-row of the episode above it: recessed, not clickable,
   and deliberately quieter than its parent. */
.vrow { background: var(--tint); }
.vrow:hover { background: var(--tint); }   /* no hover affordance — not clickable */
.vrow td { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.vrow td[data-c="ep"] { padding-left: calc(clamp(1rem, 3vw, 1.75rem) + 0.9rem) !important; }

/* the └ connector tying the badge back to its episode number */
.vbadge {
  position: relative;
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--accent-series, var(--ink-2));
  background: var(--accent-soft, var(--ground-2));
  border-radius: var(--r-pill);
  padding: 0.16rem 0.6rem;
  white-space: nowrap;
}
.vbadge::before {
  content: "";
  position: absolute;
  left: -0.72rem;
  top: 50%;
  width: 0.42rem;
  height: 1px;
  background: var(--line-2);
}

/* the verdict chips — last column, hugs the right edge */
.checks { display: flex; flex-wrap: wrap; gap: 0.4rem 0.5rem; align-items: center; justify-content: flex-end; }

.vd {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.73rem;
  padding: 0.24rem 0.62rem;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.vd b { font-weight: 600; }
.vd__ic { display: inline-grid; place-items: center; flex: none; }
.vd__ic svg { width: 11px; height: 11px; display: block; }

.vd--approved  { color: var(--st-approved-ink);  background: rgba(52, 199, 89, 0.14); }
.vd--revisions { color: var(--st-revisions-ink); background: rgba(255, 149, 0, 0.14); }
.vd--pending   { color: var(--ink-3);            background: var(--ground-2); }

/* the band that covers the checkboxes once approved / published */
.band {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.42rem 0.9rem;
  border-radius: var(--r-sm);
  white-space: nowrap;
}
.band--ready {
  color: var(--st-approved-ink);
  background: rgba(52, 199, 89, 0.14);
}
.band--published {
  color: var(--accent-ink);
  background: var(--accent-dim);
}
.band svg { width: 11px; height: 11px; flex: none; }

/* ---- table -> cards under 880px ---- */
@media (max-width: 880px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody { display: block; width: 100%; }

  .tbl tbody tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "ep     status"
      "title  title"
      "rev    rev";
    align-items: center;
    gap: 0.7rem 1rem;
    padding: 1.1rem clamp(1rem, 4vw, 1.5rem);
    border-bottom: 1px solid var(--line);
  }

  .tbl td { display: block; padding: 0 !important; }
  .tbl td[data-c="ep"]      { grid-area: ep; }
  .tbl td[data-c="status"]  { grid-area: status; justify-self: end; }
  .tbl td[data-c="title"]   { grid-area: title; }
  .tbl td[data-c="reviews"] { grid-area: rev; text-align: left !important; }

  /* left-aligned inside the card, where there is no right edge to hug */
  .checks { justify-content: flex-start; }
  .band { justify-content: flex-start; }

  /* A version row becomes its own compact block, indented under the episode
     card. Badge on top, verdict chips stacked beneath it. */
  .tbl tbody tr.vrow {
    grid-template-areas:
      "ep  ep"
      "rev rev";
    gap: 0.5rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    padding-left: calc(clamp(1rem, 4vw, 1.5rem) + 0.9rem);
  }
  .vrow td[data-c="ep"] { padding-left: 0 !important; }
  .vrow td[data-c="title"], .vrow td[data-c="status"] { display: none; }
  .vd { font-size: 0.72rem; }
}

/* ============================================================ guidelines == */
.rules { display: grid; gap: 0.8rem; }

.rule {
  position: relative;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 0 1.5rem;
  padding: clamp(1.4rem, 3vw, 2.1rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  scroll-margin-top: 84px;
}

.rule__no {
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--ink-4);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.rule__title {
  font-weight: 600;
  font-size: clamp(1.18rem, 2.6vw, 1.45rem);
  letter-spacing: -0.028em;
  line-height: 1.25;
  margin: 0 0 0.7rem;
  color: var(--ink);
}

.rule__body { color: var(--ink-2); font-size: 0.95rem; }
.rule__body > *:first-child { margin-top: 0; }
.rule__body > *:last-child  { margin-bottom: 0; }
.rule__body p { margin: 0 0 0.85rem; }
.rule__body strong { color: var(--ink); font-weight: 600; }
.rule__body a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.rule__body a:hover { text-decoration: underline; }

.rule__body ul { margin: 0 0 0.9rem; padding-left: 1.15rem; }
.rule__body li { margin-bottom: 0.4rem; }
.rule__body li::marker { color: var(--ink-4); }

@media (max-width: 620px) {
  .rule { grid-template-columns: 1fr; gap: 0.4rem; }
  .rule__no { font-size: 1.25rem; }
}

/* callouts */
.callout {
  display: flex;
  gap: 0.85rem;
  padding: 0.95rem 1.15rem;
  border-radius: var(--r-md);
  margin: 0 0 1rem;
  font-size: 0.91rem;
  line-height: 1.6;
}
.callout__ic { flex: none; font-size: 0.9rem; line-height: 1.6; }
.callout--danger { color: #8C2A10; background: rgba(255, 59, 48, 0.08); }
.callout--danger .callout__ic { color: #D6301F; }
.callout--warn   { color: var(--st-revisions-ink); background: rgba(255, 149, 0, 0.10); }
.callout--warn .callout__ic { color: #C96A00; }
.callout--info   { color: var(--ink-2); background: var(--ground-2); }
.callout--info .callout__ic { color: var(--ink-3); }
.callout strong { color: inherit; font-weight: 700; }

/* spec table */
.spec { width: 100%; border-collapse: collapse; margin: 0 0 1rem; font-size: 0.87rem; }
.spec th, .spec td {
  text-align: left;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--line);
}
.spec th {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.spec td:first-child { color: var(--ink); font-weight: 500; }
.spec td { color: var(--ink-2); }
.spec tr:last-child td { border-bottom: 0; }
.spec .num { font-family: var(--f-mono); color: var(--accent); white-space: nowrap; }

.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* figures */
.figs { display: grid; gap: 1rem; margin: 1.15rem 0; }
.figs--2 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
@media (max-width: 640px) { .figs--2 { grid-template-columns: 1fr; } }

figure { margin: 0; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--ground-2);
}
figcaption {
  font-size: 0.76rem;
  color: var(--ink-3);
  margin-top: 0.55rem;
  line-height: 1.5;
}

.fig--tall img { max-width: 330px; margin-inline: auto; }

/* arabic example chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.35rem 0 1rem; }
.chip {
  font-family: var(--f-ar);
  direction: rtl;
  unicode-bidi: isolate;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--ground-2);
  border-radius: var(--r-pill);
  padding: 0.28rem 1rem;
}

/* colour swatches */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 0.65rem; margin: 0.35rem 0 1rem; }
.sw {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: #fff;
}
.sw__c { height: 46px; }
.sw__m { padding: 0.5rem 0.65rem; }
.sw__hex {
  font-family: var(--f-mono);
  font-size: 0.74rem;
  color: var(--ink);
  text-transform: uppercase;
}
.sw__u { font-size: 0.7rem; color: var(--ink-3); line-height: 1.45; }

/* guidelines quick index */
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.75rem;
}
.toc a {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  background: var(--ground-2);
  border-radius: var(--r-pill);
  transition: all 0.2s var(--ease);
}
.toc a:hover { color: #fff; background: var(--accent); }

/* =================================================================== foot = */
.foot {
  border-top: 1px solid var(--line);
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-block: 2rem 2.75rem;
  background: var(--ground-2);
}
.foot__in {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--ink-3);
}
.foot a { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.foot a:hover { color: var(--accent); }

/* ================================================================= motion = */
[data-rise] {
  opacity: 0;
  transform: translateY(12px);
  animation: rise 0.7s var(--ease) forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-rise] { opacity: 1; transform: none; }
  .series__body { transition: none; }
}

/* print — the editor may want the guidelines on paper */
@media print {
  body::before { display: none; }
  .masthead, .foot, .toc { display: none; }
  .rule, .card, .series { box-shadow: none; border-color: #ccc; page-break-inside: avoid; }
}
