/* Copy Monitor — design system, in the Jordan News Agency (Petra) theme.
   Colours come from petra.gov.jo: primary blue #3A76C0, cyan #14B9F3, gold #AA9767,
   urgent red #B10202, text/footer #231F20; font Tajawal. One accent (Petra blue). Status colours (live / edited / removed) are
   reserved for state and always paired with a label. */
:root {
  --paper: #f3f5f8;
  --paper-2: #e8edf3;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #231f20;
  --ink-2: #3a414c;
  --muted: #636d7a;
  --faint: #949eaa;
  --line: #e0e6ee;
  --line-2: #cbd5e1;

  --accent: #3a76c0;
  --accent-ink: #2a5c9c;
  --accent-soft: #e7f0fa;
  --cyan: #14b9f3;
  --gold: #aa9767;
  --urgent: #b10202;
  --petra-ink: #231f20;

  --night: #0f2440;
  --night-2: #16335a;
  --night-line: rgba(255, 255, 255, .13);
  --night-text: #ffffff;
  --night-muted: #a9bdd6;

  --live: #1f9a62;
  --edit: #a96200;
  --edit-soft: #fff2d9;
  --del: #b42318;
  --del-soft: #fde8e5;
  --ins: #116b45;
  --ins-soft: #dcf3e6;

  --r-xl: 20px;
  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 6px;

  --shadow-1: 0 1px 2px rgba(16, 38, 66, .06), 0 1px 1px rgba(16, 38, 66, .04);
  --shadow-2: 0 2px 4px rgba(16, 38, 66, .05), 0 12px 28px -14px rgba(16, 38, 66, .28);
  --shadow-3: 0 4px 10px rgba(16, 38, 66, .07), 0 24px 48px -20px rgba(16, 38, 66, .38);

  /* One family for everything: Tajawal covers Arabic and Latin. */
  --f-ui: "Tajawal", "Segoe UI", Tahoma, system-ui, sans-serif;
  --f-mono: var(--f-ui);        /* numbers use Tajawal with tabular figures */
  --f-head: var(--f-ui);
  --f-ar-head: var(--f-ui);
  --f-ar: var(--f-ui);
  --f-code: ui-monospace, "Cascadia Mono", Consolas, monospace;   /* only for code snippets */

  --ease: cubic-bezier(.2, .8, .2, 1);
  --wrap: 1320px;
  --topbar-h: 76px;
  --z-toolbar: 20;
  --z-topbar: 30;
  --z-toast: 50;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 16px/1.6 var(--f-ui);
  font-feature-settings: "tnum" 1;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
body > * { position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent-soft); color: var(--accent-ink); }

[lang="ar"] { font-family: var(--f-ar); }
time, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

.skip-link {
  position: absolute; inset-inline-start: 12px; top: -48px; z-index: 100; background: var(--ink); color: #fff;
  padding: 8px 14px; border-radius: var(--r-sm); transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: var(--z-topbar);
  background: rgba(18, 20, 25, .92);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--night-line);
  color: var(--night-text);
}
.topbar .wrap { height: var(--topbar-h); display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; display: block; line-height: 1.15; }
.brand-sub { font-size: 12px; color: var(--night-muted); display: block; line-height: 1.2; }
.nav { display: flex; gap: 4px; }
.nav a {
  position: relative; padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--night-muted); transition: color .2s, background .2s;
}
.nav a:hover { color: var(--night-text); background: rgba(255, 255, 255, .06); }
.nav a[aria-current="page"] { color: var(--night-text); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; inset-inline: 12px; bottom: -13px; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.topbar .spacer { flex: 1; }
.live-pill {
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
  font: 500 12.5px var(--f-ui); color: var(--night-text);
  padding: 7px 13px 7px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--night-line);
}
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: #3ddc97; position: relative; }
.live-pill i::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #3ddc97;
  opacity: 0; animation: ping 2s var(--ease) infinite;
}
.live-pill.down i { background: #8b8f97; }
.live-pill.down i::after { display: none; }
.live-pill.warn i { background: #f5b83d; }
.live-pill.warn i::after { border-color: #f5b83d; }
@media (max-width: 560px) { .live-pill .lp-extra { display: none; } }
@keyframes ping { 0% { transform: scale(.6); opacity: .9; } 80%, 100% { transform: scale(1.9); opacity: 0; } }
@media (max-width: 860px) {
  .topbar .wrap { height: auto; flex-wrap: wrap; gap: 10px 16px; padding-top: 12px; padding-bottom: 12px; }
  .brand-sub { display: none; }
  .nav { order: 3; width: 100%; }
  .nav a[aria-current="page"]::after { bottom: -6px; }
  .topbar .spacer { display: none; }
  .live-pill { margin-inline-start: auto; }
}

/* ---------------------------------------------------------------- hero (home) */
.hero {
  background:
    radial-gradient(900px 340px at 85% -10%, rgba(58, 118, 192, .28), transparent 60%),
    radial-gradient(700px 300px at 0% 120%, rgba(61, 220, 151, .08), transparent 60%),
    var(--night);
  color: var(--night-text);
  padding: 56px 0 64px;
  border-bottom: 1px solid var(--night-line);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: end; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; gap: 32px; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px;
  font: 500 12.5px var(--f-mono); letter-spacing: .02em; color: var(--night-muted);
}
.eyebrow .tag {
  color: #fff; background: var(--accent); padding: 3px 8px; border-radius: 4px;
  font: 600 11px var(--f-ui); letter-spacing: .06em; text-transform: uppercase;
}
.hero h1 {
  font: 800 clamp(34px, 4.6vw, 58px)/1.08 var(--f-head); letter-spacing: -.025em;
  margin: 0 0 18px; text-wrap: balance;
}
.hero h1 em { font-style: normal; color: #7fd3ff; }
.hero .lede { font-size: 16.5px; line-height: 1.6; color: #c3d3e6; max-width: 56ch; margin: 0; text-wrap: pretty; }
.hero-stats {
  margin: 0; display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--night-line); border-radius: var(--r-lg); overflow: hidden;
  background: rgba(255, 255, 255, .03);
}
.hero-stats > div { padding: 18px 20px 20px; }
.hero-stats > div + div { border-inline-start: 1px solid var(--night-line); }
.hero-stats dt { font-size: 12.5px; color: var(--night-muted); margin-bottom: 8px; }
.hero-stats dd { margin: 0; font: 600 30px/1 var(--f-mono); letter-spacing: -.015em; color: #fff; }
.hero-stats dd small { font: 500 12px var(--f-ui); letter-spacing: 0; color: var(--night-muted); display: block; margin-top: 8px; }
@media (max-width: 560px) {
  .hero { padding: 36px 0 40px; }
  .hero-stats { grid-template-columns: 1fr; }
  .hero-stats > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px; }
  .hero-stats > div + div { border-inline-start: 0; border-top: 1px solid var(--night-line); }
  .hero-stats dt { margin: 0; }
  .hero-stats dd { font-size: 22px; text-align: end; }
  .hero-stats dd small { margin-top: 4px; }
  .toasts .toast:nth-child(n+3) { display: none; }
  .toasts { bottom: 12px; inset-inline-end: 12px; width: calc(100vw - 24px); }
}

/* ---------------------------------------------------------------- toolbar */
.toolbar {
  position: sticky; top: var(--topbar-h); z-index: var(--z-toolbar);
  margin: 8px -28px 0; padding: 14px 28px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: transparent;
  border-bottom: 1px solid transparent; transition: border-color .2s, background .2s;
}
.toolbar.stuck {
  background: rgba(243, 245, 248, .94); border-bottom-color: var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
@media (max-width: 860px) { .toolbar { position: static; } }
@media (max-width: 640px) { .toolbar { margin: 0 -16px; padding: 12px 16px; } }
.seg {
  display: inline-flex; padding: 4px; gap: 2px; border-radius: 12px;
  background: var(--paper-2); box-shadow: inset 0 1px 2px rgba(16, 38, 66, .08);
}
.seg button {
  border: 0; background: transparent; cursor: pointer; border-radius: 9px;
  padding: 8px 14px; font-size: 14px; font-weight: 500; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .2s var(--ease), color .2s, box-shadow .2s;
}
.seg button[lang="ar"] { font-family: var(--f-ar-head); font-size: 13.5px; }
.seg button:hover { color: var(--ink); }
.seg button:active { transform: translateY(1px); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.seg .n { font: 500 11.5px var(--f-mono); color: var(--muted); }
.seg button.active .n { color: var(--accent); }
.date-filter {
  display: inline-flex; align-items: center; gap: 2px; padding: 4px;
  border-radius: 12px; background: var(--paper-2);
  box-shadow: inset 0 1px 2px rgba(16, 38, 66, .08);
}
.date-filter button {
  height: 38px; border: 0; border-radius: 9px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: transparent; color: var(--ink-2); font: 500 13px var(--f-ui);
  white-space: nowrap; cursor: pointer;
}
.date-filter button:hover { color: var(--ink); }
.date-filter button.active {
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line);
}
.search {
  position: relative; flex: 1; min-width: 200px; max-width: 360px;
}
.search input {
  width: 100%; height: 40px; border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--surface); padding-block: 0; padding-inline: 38px 14px; font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search svg { position: absolute; inset-inline-start: 13px; top: 50%; translate: 0 -50%; color: var(--faint); }
.toolbar .count { margin-inline-start: auto; font-size: 13px; color: var(--muted); }
.toolbar .count b { font-family: var(--f-mono); color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------- notice */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--edit-soft); color: #6d4300; border: 1px solid #f1d7a6;
  border-radius: var(--r-md); padding: 11px 14px; font-size: 13.5px; margin: 18px 0 0;
}

/* ---------------------------------------------------------------- story grid */
.home-main { padding-bottom: 72px; }
.grid {
  display: grid; gap: 22px; margin-top: 22px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 292px), 1fr));
}
.card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-1), 0 0 0 1px rgba(16, 38, 66, .05);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-3); }
.card:active { transform: translateY(-1px) scale(.995); }
.card-media { position: relative; margin: 0; aspect-ratio: 16 / 10; background: var(--paper-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card-media img { transform: scale(1.04); }
.card-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 10, 12, .38) 0%, transparent 34%);
}
.noimg {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 12px;
  color: var(--muted); font-size: 12.5px; font-weight: 500;
  background: repeating-linear-gradient(-45deg, var(--paper-2) 0 10px, #e6e1d8 10px 20px);
}
.media-chips {
  position: absolute; top: 12px; inset-inline-start: 12px; inset-inline-end: 12px; z-index: 1;
  display: flex; gap: 6px; align-items: center;
}
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 5px;
  font: 600 10.5px var(--f-ui); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.chip-glass { background: rgba(14, 15, 18, .55); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.chip-count { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11.5px; }
.media-chips .flags { margin-inline-start: auto; display: flex; gap: 6px; }
.flag-new { background: var(--accent); color: #fff; }
.flag-edit { background: var(--edit-soft); color: var(--edit); }
.flag-gone { background: var(--ink); color: #fff; }

.card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 16px; flex: 1; }
.kicker { font-size: 12px; font-weight: 600; color: var(--accent-ink); letter-spacing: .01em; }
[lang="ar"] .kicker { font-family: var(--f-ar-head); font-size: 12px; }
.headline {
  margin: 0; font: 700 19px/1.32 var(--f-head); letter-spacing: -.005em; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-wrap: pretty;
}
.card[lang="ar"] .headline { font: 700 18px/1.55 var(--f-ar-head); letter-spacing: 0; }
.card-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }

/* mini timeline: ● published on Petra → ● copied by us (reads top to bottom in AR and EN) */
.tl { position: relative; display: grid; gap: 9px; }
.tl::before {
  content: ""; position: absolute; inset-inline-start: 4px; top: 11px; bottom: 11px; width: 2px; border-radius: 2px;
  background: linear-gradient(var(--line-2), var(--accent));
}
.tl.is-catchup::before { background: none; border-inline-start: 2px dashed var(--line-2); width: 0; }
.tl-row { position: relative; display: grid; grid-template-columns: 10px auto minmax(0, 1fr); align-items: center; column-gap: 10px; font-size: 13.5px; line-height: 1.35; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-2); z-index: 1; }
.tl-k { color: var(--muted); white-space: nowrap; }
.tl-v { justify-self: end; text-align: end; color: var(--ink); font-weight: 500; white-space: nowrap; }
.tl-copy .tl-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tl-copy .tl-v b { color: var(--accent-ink); font-weight: 700; }
.tl-copy .tl-v small { margin-inline-start: 7px; color: var(--faint); font-size: 12px; font-weight: 400; }
.tl-catchup { grid-template-columns: 10px minmax(0, 1fr); }
.tl-catchup .tl-dot { border-color: var(--line-2); background: var(--paper-2); }
.tl-catchup .tl-k { color: var(--ink-2); white-space: normal; }
.tl-note { grid-column: 2; font-size: 12px; color: var(--faint); }
@media (max-width: 380px) { .tl-copy .tl-v small { display: none; } }

.nophoto {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  padding: 18px 18px 16px; color: #fff; overflow: hidden;
  background:
    radial-gradient(140% 120% at 100% 0%, rgba(58, 118, 192, .55), transparent 55%),
    linear-gradient(160deg, #23262e, #121419);
}
.nophoto::before {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px); background-size: 14px 14px;
  mask-image: linear-gradient(200deg, #000, transparent 70%);
}
.nophoto b { position: relative; font: 800 24px/1.25 var(--f-ar-head); letter-spacing: -.01em; }
.card[lang="en"] .nophoto b { font: 800 24px/1.15 var(--f-head); }
.nophoto small { position: relative; font-size: 12px; color: rgba(255, 255, 255, .7); }

/* lead story: first visible card with a photo becomes a wide feature, lifted to the top */
.card.is-lead { order: -1; }
@media (min-width: 900px) {
  .card.is-lead {
    grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    min-height: 380px;
  }
  .card.is-lead .card-media { aspect-ratio: auto; height: 100%; }
  .card.is-lead .card-body { padding: 34px 38px 30px; gap: 14px; justify-content: center; }
  .card.is-lead .headline { font-size: 34px; line-height: 1.12; -webkit-line-clamp: 4; letter-spacing: -.02em; }
  .card.is-lead[lang="ar"] .headline { font-size: 32px; line-height: 1.45; }
  .card.is-lead .kicker { font-size: 13px; }
  .card.is-lead .card-foot { margin-top: 18px; }
  .card.is-lead .tl-row { font-size: 15px; }
  .card.is-lead .lead-label {
    display: inline-flex; align-self: flex-start; font: 600 11px var(--f-mono); letter-spacing: .08em;
    text-transform: uppercase; color: var(--muted);
  }
}
.lead-label { display: none; }

/* motion for live updates */
.card.slide-in { animation: slideIn .7s var(--ease) both; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-16px) scale(.98); } to { opacity: 1; transform: none; } }
.card.fresh { box-shadow: 0 0 0 2px var(--accent), var(--shadow-2); }
.card.flash { animation: flash 2.6s var(--ease); }
@keyframes flash {
  0%, 30% { box-shadow: 0 0 0 3px #f0b44a, 0 20px 40px -18px rgba(169, 98, 0, .55); }
  100% { box-shadow: var(--shadow-1), 0 0 0 1px rgba(16, 38, 66, .05); }
}

/* skeletons */
.skeleton { pointer-events: none; }
.skeleton .card-media, .sk-line {
  background: linear-gradient(90deg, var(--paper-2) 0%, #f3efe8 40%, var(--paper-2) 80%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
.sk-line { height: 12px; border-radius: 6px; }
.sk-line:first-child { width: 32%; }
.sk-line:last-child { width: 68%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty {
  text-align: center; padding: 72px 24px; margin-top: 22px; border-radius: var(--r-xl);
  border: 1px dashed var(--line-2); color: var(--muted); background: var(--surface-2);
}
.empty h3 { margin: 0 0 6px; font: 600 22px var(--f-head); color: var(--ink); }
.empty p { margin: 0; }

/* ---------------------------------------------------------------- toasts */
.toasts {
  position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: 10px; width: min(400px, calc(100vw - 40px));
}
.toast {
  background: var(--night); color: var(--night-text); border-radius: 12px; padding: 13px 16px 13px 18px;
  font-size: 13.5px; line-height: 1.45; box-shadow: var(--shadow-3); position: relative; overflow: hidden;
  animation: toastIn .45s var(--ease) both; transition: opacity .4s, transform .4s var(--ease);
}
.toast::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px; background: var(--accent); }
.toast.edit::before { background: #f0b44a; }
.toast b { font-weight: 600; color: #fff; }
.toast .t-sub { display: block; color: #c3d3e6; margin-top: 3px; }
.toast.out { opacity: 0; transform: translateY(10px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- shared panels */
.panel {
  background: var(--surface); border-radius: var(--r-lg); padding: 24px 26px;
  box-shadow: var(--shadow-1), 0 0 0 1px rgba(16, 38, 66, .05);
}
.panel-title { margin: 0 0 4px; font: 600 21px/1.2 var(--f-head); letter-spacing: -.01em; }
.panel-sub { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }

/* ---------------------------------------------------------------- article page */
.article-main { padding-block: 28px 80px; }
.back {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  padding: 6px 10px 6px 6px; margin-inline-start: -6px; border-radius: 8px; transition: background .2s, color .2s;
}
.back:hover { background: var(--paper-2); color: var(--ink); }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; margin-top: 18px; align-items: start; }
@media (max-width: 1040px) { .article-layout { grid-template-columns: 1fr; } }
.story { background: var(--surface); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-2), 0 0 0 1px rgba(16, 38, 66, .05); }
.story-head { padding: 36px 44px 24px; }
@media (max-width: 640px) { .story-head { padding: 24px 20px 18px; } }
.story-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.tag-soft { background: var(--paper-2); color: var(--ink-2); }
.story-head .kicker { font-size: 13px; }
.story h1 {
  margin: 8px 0 0; font: 600 clamp(28px, 3.4vw, 42px)/1.12 var(--f-head); letter-spacing: -.022em; text-wrap: balance;
}
.story[lang="ar"] h1 { font: 800 clamp(26px, 3vw, 38px)/1.45 var(--f-ar-head); letter-spacing: 0; }
.story-hero { margin: 0; background: var(--paper-2); aspect-ratio: 16 / 9; overflow: hidden; position: relative; }
.story-hero img { width: 100%; height: 100%; object-fit: cover; }
.story-hero a { display: block; height: 100%; }
.story-body { padding: 32px 44px 40px; }
@media (max-width: 640px) { .story-body { padding: 24px 20px 28px; } }
.prose { max-width: 68ch; font: 400 18.5px/1.8 var(--f-head); color: #24272d; }
.prose p { margin: 0 0 1.1em; white-space: pre-line; text-wrap: pretty; }
.prose p:first-child::first-line { font-weight: 600; }
.prose[lang="ar"] { font: 400 19px/1.95 var(--f-ar); max-width: 70ch; }
.gallery-title { margin: 32px 0 12px; font: 600 12px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.gallery a { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; background: var(--paper-2); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.gallery a:hover img { transform: scale(1.05); }

.record { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1040px) { .record { position: static; } }
.steps { list-style: none; margin: 4px 0 0; padding: 0; position: relative; }
.steps li { position: relative; padding-block: 0 18px; padding-inline: 26px 0; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: ""; position: absolute; inset-inline-start: 4px; top: 6px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line-2);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 8px; top: 20px; bottom: 2px; width: 2px; background: var(--line); }
.steps li.s-petra::before { border-color: var(--ink); }
.steps li.s-copy::before { border-color: var(--accent); background: var(--accent); }
.steps li.s-edit::before { border-color: #f0b44a; background: #f0b44a; }
.steps .s-k { font-size: 12.5px; color: var(--muted); display: block; }
.steps .s-v { font: 500 14px var(--f-mono); color: var(--ink); }
.steps .s-note { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.big-delay { flex-wrap: wrap;
  display: flex; align-items: baseline; gap: 10px; padding: 14px 16px; margin: 14px 0 6px; border-radius: var(--r-md);
  background: var(--accent-soft); color: var(--accent-ink);
}
.big-delay b { font: 600 26px/1 var(--f-mono); letter-spacing: -.01em; }
.big-delay span { font-size: 12.5px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 14px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: end; font-family: var(--f-mono); font-size: 13px; color: var(--ink); word-break: break-all; }
.src-link {
  display: flex; gap: 8px; align-items: center; margin-top: 16px; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2);
  transition: border-color .2s, color .2s;
}
.src-link:hover { border-color: var(--accent); color: var(--accent-ink); }
.src-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* version history */
.history { margin-top: 36px; }
.history-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.history-head h2 { margin: 0; font: 600 28px/1.1 var(--f-head); letter-spacing: -.02em; }
.history-empty {
  border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: 28px; color: var(--muted);
  background: var(--surface-2); font-size: 14px; max-width: 70ch;
}
.version-block { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1), 0 0 0 1px rgba(16, 38, 66, .06); }
.version-block + .version-block { margin-top: 16px; }
.version-block > header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 20px;
  border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 13.5px;
}
.vtag { font: 600 13px var(--f-mono); background: var(--ink); color: #fff; padding: 3px 8px; border-radius: 5px; }
.version-block > header .when { color: var(--muted); }
.version-block > header .when b { font-family: var(--f-mono); color: var(--ink); font-weight: 500; }
.chip-edit { background: var(--edit-soft); color: var(--edit); text-transform: none; letter-spacing: 0; font-size: 11.5px; }
.chip-add { background: var(--ins-soft); color: var(--ins); text-transform: none; letter-spacing: 0; font-size: 11.5px; }
.chip-rem { background: var(--del-soft); color: var(--del); text-transform: none; letter-spacing: 0; font-size: 11.5px; }
.diff-row { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.diff-row:last-child { border-bottom: 0; }
.diff-row > div { padding: 16px 20px; min-width: 0; }
.diff-row > div + div { border-inline-start: 1px solid var(--line); }
.diff-row.same { grid-template-columns: 1fr; }
.diff-label { font: 500 11.5px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.diff-label .v-old, .diff-label .v-new { font-weight: 600; padding: 1px 6px; border-radius: 4px; }
.diff-label .v-old { background: var(--del-soft); color: var(--del); }
.diff-label .v-new { background: var(--ins-soft); color: var(--ins); }
.diff-txt { white-space: pre-wrap; font: 400 15.5px/1.85 var(--f-head); word-wrap: break-word; }
.diff-txt[lang="ar"] { font: 400 16px/1.95 var(--f-ar); }
.diff-txt del { background: var(--del-soft); color: var(--del); text-decoration: line-through; text-decoration-color: rgba(180, 35, 24, .45); border-radius: 3px; padding: 0 1px; }
.diff-txt ins { background: var(--ins-soft); color: var(--ins); text-decoration: none; border-radius: 3px; padding: 0 1px; }
.unchanged { color: var(--faint); font-size: 13.5px; }
.img-changes { display: flex; flex-wrap: wrap; gap: 14px; padding: 16px 20px; }
.img-changes figure { margin: 0; width: 190px; }
.img-changes .thumb { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; background: var(--paper-2); }
.img-changes img { width: 100%; height: 100%; object-fit: cover; }
.img-changes figure.add .thumb { box-shadow: 0 0 0 3px #4ccf8f; }
.img-changes figure.rem .thumb { box-shadow: 0 0 0 3px #f08a7f; }
.img-changes figure.rem img { opacity: .55; filter: grayscale(.7); }
.img-changes figcaption { font: 600 12px var(--f-ui); margin-top: 8px; }
.img-changes .add figcaption { color: var(--ins); }
.img-changes .rem figcaption { color: var(--del); }
@media (max-width: 720px) { .diff-row { grid-template-columns: 1fr; } .diff-row > div + div { border-inline-start: 0; border-top: 1px solid var(--line); } }

/* ---------------------------------------------------------------- dashboard */
.dash-main { padding-block: 40px 80px; }
.dash-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 26px; }
.dash-head .eyebrow { color: var(--muted); margin-bottom: 12px; }
.dash-head h1 { margin: 0; font: 600 clamp(30px, 3.6vw, 46px)/1.06 var(--f-head); letter-spacing: -.025em; text-wrap: balance; max-width: 22ch; }
.dash-head p { margin: 10px 0 0; color: var(--ink-2); max-width: 60ch; }

.headline-card {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 0;
  border-radius: var(--r-xl); overflow: hidden; color: var(--night-text);
  background:
    radial-gradient(600px 260px at 0% 0%, rgba(58, 118, 192, .32), transparent 60%),
    var(--night);
  box-shadow: var(--shadow-3);
}
@media (max-width: 960px) { .headline-card { grid-template-columns: 1fr; } }
.hc-number { padding: 32px 36px; }
.hc-number .label { font-size: 13.5px; color: var(--night-muted); }
.hc-number .hero-num { font: 600 clamp(56px, 7vw, 88px)/1 var(--f-mono); letter-spacing: -.02em; margin: 12px 0 14px; color: #fff; }
.hc-number .sub { font-size: 13.5px; color: #c3d3e6; }
.hc-number .sub b { color: #fff; font-family: var(--f-mono); font-weight: 500; }
.hc-split { display: flex; gap: 24px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--night-line); flex-wrap: wrap; }
.hc-split div { font-size: 12.5px; color: var(--night-muted); }
.hc-split b { display: block; font: 600 18px var(--f-mono); color: #fff; letter-spacing: -.02em; margin-top: 3px; }
.hc-breakdown { padding: 32px 36px; border-inline-start: 1px solid var(--night-line); background: rgba(255, 255, 255, .025); display: flex; flex-direction: column; }
@media (max-width: 960px) { .hc-breakdown { border-inline-start: 0; border-top: 1px solid var(--night-line); } }
.hc-breakdown h2 { margin: 0 0 6px; font: 600 20px var(--f-head); color: #fff; }
.hc-breakdown > p { margin: 0 0 22px; font-size: 13.5px; color: var(--night-muted); max-width: 52ch; }
.bd-bar { display: flex; height: 44px; gap: 2px; border-radius: 8px; overflow: hidden; }
.bd-seg { position: relative; min-width: 6px; flex: 1 1 0; transition: flex-grow .6s var(--ease); }
.bd-seg.petra { background: repeating-linear-gradient(135deg, #4a4d55 0 6px, #42454d 6px 12px); border-start-start-radius: 8px; border-end-start-radius: 8px; border-start-end-radius: 4px; border-end-end-radius: 4px; }
.bd-seg.us { background: var(--accent); border-start-start-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 8px; border-end-end-radius: 8px; }
.bd-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.bd-legend div { font-size: 13px; color: #c3d3e6; display: grid; grid-template-columns: 12px 1fr; gap: 4px 10px; align-items: start; }
.bd-legend i { width: 12px; height: 12px; border-radius: 3px; margin-top: 4px; }
.bd-legend .lg-petra i { background: #4a4d55; }
.bd-legend .lg-us i { background: var(--accent); }
.bd-legend b { grid-column: 2; font: 600 20px var(--f-mono); color: #fff; letter-spacing: -.02em; }
.bd-note { margin-top: auto; padding-top: 20px; font-size: 12.5px; color: var(--night-muted); line-height: 1.55; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
@media (max-width: 1040px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } }
.kpi {
  background: var(--surface); border-radius: var(--r-lg); padding: 20px 22px 18px;
  box-shadow: var(--shadow-1), 0 0 0 1px rgba(16, 38, 66, .05); display: flex; flex-direction: column;
}
.kpi .label { font-size: 13px; font-weight: 500; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.kpi .label .ar { font-family: var(--f-ar-head); font-size: 12px; color: var(--muted); }
.kpi .big { font: 600 44px/1 var(--f-mono); letter-spacing: -.02em; margin: 14px 0 12px; color: var(--ink); }
.kpi .foot { font-size: 12.5px; color: var(--muted); margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); line-height: 1.5; }
.kpi .foot b { color: var(--ink); font-family: var(--f-mono); font-weight: 500; }
.kpi.bump .big { animation: bump .9s var(--ease); }
@keyframes bump { 0% { transform: none; } 30% { transform: translateY(-3px); color: var(--accent); } 100% { transform: none; } }

.dash-cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
@media (max-width: 1040px) { .dash-cols { grid-template-columns: 1fr; } }
.feed-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.toggle {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  font-size: 12.5px; color: var(--ink-2); padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); transition: border-color .2s, background .2s;
}
.toggle:hover { border-color: var(--ink-2); }
.toggle input { appearance: none; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line-2); margin: 0; display: grid; place-items: center; transition: background .2s, border-color .2s; }
.toggle input:checked { background: var(--ink); border-color: var(--ink); }
.toggle input:checked::after { content: ""; width: 7px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; rotate: -45deg; translate: 0 -1px; }
.feed { list-style: none; margin: 8px 0 0; padding: 0; max-height: 660px; overflow: auto; scrollbar-width: thin; }
.feed li {
  display: grid; grid-template-columns: 74px 22px minmax(0, 1fr); gap: 0 8px; padding: 12px 6px;
  border-bottom: 1px solid var(--line); align-items: start; border-radius: 8px;
}
.feed li:last-child { border-bottom: 0; }
.feed li.in { animation: feedIn .7s var(--ease) both; }
@keyframes feedIn { from { opacity: 0; transform: translateY(-8px); background: var(--accent-soft); } 60% { background: var(--accent-soft); } to { opacity: 1; transform: none; background: transparent; } }
.feed time { font-size: 12.5px; color: var(--muted); padding-top: 2px; }
.ev-dot { width: 10px; height: 10px; border-radius: 50%; margin: 6px 0 0 5px; background: var(--faint); }
.ev-new .ev-dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ev-edit .ev-dot { background: #f0b44a; box-shadow: 0 0 0 4px var(--edit-soft); }
.ev-err .ev-dot { background: var(--del); }
.ev-catch .ev-dot { background: var(--line-2); }
.ev-body { min-width: 0; }
.ev-type { font-size: 12px; font-weight: 600; display: block; margin-bottom: 2px; }
.ev-new .ev-type { color: var(--accent-ink); }
.ev-edit .ev-type { color: var(--edit); }
.ev-err .ev-type { color: var(--del); }
.ev-catch .ev-type { color: var(--muted); }
.ev-title { font-size: 14.5px; line-height: 1.5; color: var(--ink); display: block; }
a.ev-title:hover { color: var(--accent-ink); }
.ev-title[lang="ar"] { font-family: var(--f-ar); font-weight: 600; }
.ev-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; display: block; }
.ev-meta b { font-family: var(--f-mono); font-weight: 500; color: var(--ink-2); }
.ev-err .ev-title { font-size: 13px; color: var(--ink-2); }

.plain ol { list-style: none; counter-reset: p; margin: 6px 0 0; padding: 0; }
.plain li { counter-increment: p; position: relative; padding-block: 14px; padding-inline: 40px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.plain li:last-child { border-bottom: 0; padding-bottom: 0; }
.plain li::before {
  content: counter(p, decimal-leading-zero); position: absolute; inset-inline-start: 0; top: 15px;
  font: 600 12px var(--f-mono); color: var(--muted); width: 28px; height: 22px; border-radius: 5px;
  display: grid; place-items: center; background: var(--paper-2);
}
.plain li.warn::before { background: var(--edit-soft); color: var(--edit); }
.plain li b { color: var(--ink); font-weight: 600; }
.plain code { font: 12px var(--f-code); background: var(--paper-2); padding: 1px 6px; border-radius: 4px; color: var(--ink); }
.footer-note { color: var(--muted); font-size: 12.5px; margin-top: 28px; text-align: center; text-wrap: balance; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.diff-row .img-changes { padding: 0; }
.empty a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.story.skeleton .story-head { display: grid; gap: 12px; }
.story.skeleton .card-media { aspect-ratio: 16 / 9; }

/* ---------------------------------------------------------------- engine room (live scraper view) */
.engine {
  --k-list: #dbe7f5; --k-article: var(--accent); --k-photo: #c9a27e; --k-recheck: #7d818a;
  --k-edited: #f0b44a; --k-error: #f06a5b;
  color: var(--night-text); border-radius: var(--r-xl); padding: 26px 28px 24px;
  border: 1px solid var(--night-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
}
.engine.on-light {
  margin-top: 18px; border: 0; box-shadow: var(--shadow-3);
  background: radial-gradient(700px 260px at 100% 0%, rgba(58, 118, 192, .22), transparent 60%), var(--night);
}
.eng-head { display: flex; align-items: end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 22px; }
.eng-head h2 { margin: 0; font: 800 23px/1.2 var(--f-head); letter-spacing: -.01em; color: #fff; }
.eng-kicker { display: flex; align-items: center; gap: 9px; margin: 0 0 6px; font-size: 13px; font-weight: 500; color: var(--night-muted); }
.eng-led { width: 8px; height: 8px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 0 0 rgba(61, 220, 151, .6); animation: led 1.6s ease-out infinite; }
@keyframes led { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, .55); } 100% { box-shadow: 0 0 0 10px rgba(61, 220, 151, 0); } }
.eng-meta { margin: 0; font-size: 13px; color: var(--night-muted); }

.eng-grid { display: grid; grid-template-columns: 190px minmax(0, 1fr) minmax(0, 1.35fr); gap: 30px; align-items: start; }
@media (max-width: 1180px) { .eng-grid { grid-template-columns: 170px minmax(0, 1fr); } .eng-stream { grid-column: 1 / -1; } }
@media (max-width: 640px) { .eng-grid { grid-template-columns: 1fr; } .eng-clock { justify-self: center; } }

/* countdown ring */
.eng-clock { position: relative; width: 180px; aspect-ratio: 1; }
.eng-clock svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .3s linear; filter: drop-shadow(0 0 6px rgba(58, 118, 192, .55)); }
.eng-clock.working svg { animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(270deg); } }
.clock-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px; }
.clock-c b { font: 800 48px/1 var(--f-mono); color: #fff; letter-spacing: -.02em; }
.clock-c span { font-size: 12px; color: var(--night-muted); max-width: 110px; line-height: 1.3; }

/* pipeline */
.eng-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.eng-steps li { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 14px; padding: 7px 0; transition: opacity .3s; }
.eng-steps li:not(:last-child)::after {
  content: ""; position: absolute; inset-inline-start: 18px; top: 45px; bottom: -11px; width: 2px; background: rgba(255, 255, 255, .08);
}
.eng-steps li.done:not(:last-child)::after { background: rgba(61, 220, 151, .35); }
.st-icon {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; grid-row: span 2;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); color: var(--night-muted);
  transition: background .3s, color .3s, border-color .3s, box-shadow .3s;
}
.st-text { display: flex; flex-direction: column; min-width: 0; }
.st-name { font-size: 14.5px; font-weight: 700; color: #fff; }
.st-sub { font-size: 12.5px; color: var(--night-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-bar { display: block; height: 3px; margin-top: 7px; border-radius: 3px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.st-bar i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
[dir="rtl"] .st-bar i { transform-origin: right; }
.eng-steps li.pending { opacity: .42; }
.eng-steps li.skipped { opacity: .55; }
.eng-steps li.skipped .st-bar i { background: rgba(255, 255, 255, .18); }
.eng-steps li.done .st-icon { color: #3ddc97; border-color: rgba(61, 220, 151, .35); background: rgba(61, 220, 151, .08); }
.eng-steps li.done .st-bar i { background: #3ddc97; }
.eng-steps li.active .st-icon {
  color: #fff; background: var(--accent); border-color: transparent;
  box-shadow: 0 0 0 4px rgba(58, 118, 192, .2), 0 8px 22px -6px rgba(58, 118, 192, .8); animation: breathe 1.6s ease-in-out infinite;
}
.eng-steps li.active .st-sub { color: #cfe3f7; }
@keyframes breathe { 50% { box-shadow: 0 0 0 8px rgba(58, 118, 192, .08), 0 8px 22px -6px rgba(58, 118, 192, .8); } }

/* request stream */
.eng-stream { min-width: 0; }
.es-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--night-muted); margin-bottom: 10px; }
.es-head > span:first-child { color: #fff; font-weight: 700; font-size: 14.5px; }
.es-pulse { display: block; width: 100%; height: 64px; border-radius: 10px; background: rgba(0, 0, 0, .25); }
.es-pulse .grid { stroke: rgba(255, 255, 255, .06); stroke-width: 1; }
.es-pulse .b { opacity: .95; }
.es-pulse .k-list { fill: var(--k-list); } .es-pulse .k-article { fill: var(--k-article); }
.es-pulse .k-photo { fill: var(--k-photo); } .es-pulse .k-recheck { fill: var(--k-recheck); }
.es-pulse .k-edited { fill: var(--k-edited); } .es-pulse .k-error { fill: var(--k-error); }
.es-axis { display: flex; justify-content: space-between; font-size: 11px; color: #6c6b67; margin: 4px 2px 10px; }
.es-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; min-height: 236px; }
.es-list li {
  display: grid; grid-template-columns: 66px minmax(0, 1fr) auto 58px 58px; gap: 10px; align-items: center;
  padding: 6px 10px; border-radius: 8px; font-size: 12.5px; background: rgba(255, 255, 255, .03);
  border-inline-start: 3px solid var(--k-recheck); animation: rowIn .45s var(--ease) both;
}
@keyframes rowIn { from { opacity: 0; transform: translateY(-6px); background: rgba(255, 255, 255, .1); } }
.es-list li.k-list { border-color: var(--k-list); } .es-list li.k-article { border-color: var(--k-article); }
.es-list li.k-photo { border-color: var(--k-photo); } .es-list li.k-edited { border-color: var(--k-edited); background: rgba(240, 180, 74, .1); }
.es-list li.k-error { border-color: var(--k-error); background: rgba(240, 106, 91, .08); }
.es-type { font-weight: 700; color: #fff; }
.es-label { color: #d6e2f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es-res { color: var(--night-muted); white-space: nowrap; }
.es-list li.k-edited .es-res { color: var(--k-edited); font-weight: 700; }
.es-list li.k-error .es-res { color: var(--k-error); font-weight: 700; }
.es-num { color: var(--night-muted); text-align: end; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .es-list li { grid-template-columns: 58px minmax(0, 1fr) auto; } .es-list li .es-num { display: none; } }
.es-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--night-muted); }
.es-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-inline-end: 6px; vertical-align: 0; }
.es-legend .k-list { background: var(--k-list); } .es-legend .k-article { background: var(--k-article); }
.es-legend .k-photo { background: var(--k-photo); } .es-legend .k-recheck { background: var(--k-recheck); }
.es-legend .k-edited { background: var(--k-edited); } .es-legend .k-error { background: var(--k-error); }

/* ---------------------------------------------------------------- login */
.login-page {
  background:
    radial-gradient(800px 420px at 85% -10%, rgba(58, 118, 192, .35), transparent 60%),
    radial-gradient(600px 360px at 0% 110%, rgba(61, 220, 151, .08), transparent 60%),
    var(--night);
  color: var(--night-text);
}
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; }
.login-card {
  width: min(440px, 100%); padding: 34px 34px 28px; border-radius: var(--r-xl);
  background: rgba(255, 255, 255, .04); border: 1px solid var(--night-line);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-brand .brand-sub { display: block; }
.login-card h1 { margin: 0 0 8px; font: 800 30px/1.1 var(--f-head); color: #fff; letter-spacing: -.01em; }
.login-lede { margin: 0 0 22px; color: var(--night-muted); font-size: 14.5px; line-height: 1.6; }
.login-lede [lang="ar"] { display: block; margin-top: 4px; }
.login-label { display: block; font-size: 13.5px; font-weight: 500; color: #d6e2f0; margin-bottom: 8px; }
.pw-field { position: relative; }
.pw-field input {
  width: 100%; height: 50px; border-radius: 12px; padding-block: 0; padding-inline: 16px 50px; font-size: 16px; color: #fff;
  background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .14); transition: border-color .2s, box-shadow .2s;
}
.pw-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(58, 118, 192, .25); }
.pw-toggle {
  position: absolute; inset-inline-end: 6px; top: 50%; translate: 0 -50%; width: 40px; height: 40px; border-radius: 9px;
  border: 0; background: transparent; color: var(--night-muted); cursor: pointer; display: grid; place-items: center;
}
.pw-toggle:hover, .pw-toggle[aria-pressed="true"] { color: #fff; background: rgba(255, 255, 255, .07); }
.login-btn {
  width: 100%; height: 50px; margin-top: 16px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: #fff; font: 700 16px var(--f-ui);
  box-shadow: 0 12px 24px -12px rgba(58, 118, 192, .9); transition: background .2s, transform .15s;
}
.login-btn:hover { background: #dd5536; }
.login-btn:active { transform: translateY(1px); }
.login-btn:disabled { opacity: .7; cursor: progress; }
.login-msg {
  margin: 0 0 16px; padding: 11px 14px; border-radius: 10px; font-size: 14px;
  background: rgba(240, 106, 91, .12); border: 1px solid rgba(240, 106, 91, .35); color: #ffc9c2;
}
.login-msg.ok { background: rgba(61, 220, 151, .1); border-color: rgba(61, 220, 151, .3); color: #b8f0d6; }
.login-foot { margin: 18px 0 0; font-size: 12.5px; color: #77767a; }

/* sign-out button in the top bar */
.signout { margin: 0; }
.signout button {
  border: 1px solid var(--night-line); background: transparent; color: var(--night-muted); cursor: pointer;
  font: 500 13px var(--f-ui); padding: 7px 12px; border-radius: 999px; transition: color .2s, border-color .2s, background .2s;
}
.signout button:hover { color: #fff; border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .05); }
@media (max-width: 560px) { .signout button { padding: 7px 10px; } }

/* ---------------------------------------------------------------- version filter */
.ver-filter button { padding: 8px 11px; font-size: 13.5px; }
.ver-filter button[data-ver="all"] { padding-inline: 12px; }

/* ---------------------------------------------------------------- what changed (word-level edits) */
.chg-wrap { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.chg-title { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.chg-group + .chg-group { margin-top: 14px; }
.chg-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.chg {
  display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line);
}
.chg-kind { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 5px; text-align: center; justify-self: start; }
.chg-replaced .chg-kind { background: var(--edit-soft); color: var(--edit); }
.chg-added .chg-kind { background: var(--ins-soft); color: var(--ins); }
.chg-removed .chg-kind { background: var(--del-soft); color: var(--del); }
.chg-body { display: grid; gap: 4px; min-width: 0; }
.chg-what { font-size: 16.5px; line-height: 1.6; word-wrap: break-word; }
.chg-what del { background: var(--del-soft); color: var(--del); text-decoration: line-through; text-decoration-color: rgba(180, 35, 24, .5); border-radius: 4px; padding: 1px 4px; }
.chg-what ins { background: var(--ins-soft); color: var(--ins); text-decoration: none; border-radius: 4px; padding: 1px 4px; font-weight: 700; }
.chg-arrow { margin: 0 8px; color: var(--muted); font-weight: 700; }
.chg-ctx { font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.chg-ctx mark { background: var(--ins-soft); color: var(--ins); border-radius: 3px; padding: 0 2px; }
.chg-ctx s { color: var(--del); }
@media (max-width: 560px) { .chg { grid-template-columns: 1fr; gap: 6px; } }
details.sbs { border-bottom: 1px solid var(--line); }
details.sbs > summary {
  cursor: pointer; padding: 12px 20px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); list-style: none;
}
details.sbs > summary::-webkit-details-marker { display: none; }
details.sbs > summary::before { content: "▸"; display: inline-block; margin-inline-end: 8px; transition: transform .2s; }
details.sbs[open] > summary::before { transform: rotate(90deg); }
details.sbs > summary:hover { color: var(--ink); }
details.sbs[open] > summary { border-bottom: 1px solid var(--line); }

/* removed photos on the article page */
.gallery-removed .rm-item { position: relative; }
.gallery-removed a { display: block; aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; background: var(--paper-2); box-shadow: 0 0 0 3px #f08a7f; }
.gallery-removed img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.55); opacity: .8; transition: filter .3s, opacity .3s; }
.gallery-removed a:hover img { filter: none; opacity: 1; }
.rm-tag {
  position: absolute; top: 8px; inset-inline-start: 8px; background: var(--del); color: #fff;
  font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 5px; pointer-events: none;
}
.img-changes figure a, .gallery a, .story-hero a { cursor: zoom-in; }

/* ---------------------------------------------------------------- photo viewer */
body.lb-on { overflow: hidden; }
.lb {
  position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center; background: rgba(10, 11, 14, .92); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: toastIn .25s var(--ease);
}
.lb[hidden] { display: none; }
.lb-fig { margin: 0; display: grid; gap: 12px; justify-items: center; max-height: 100dvh; padding: 56px 0 24px; }
.lb-stage { display: grid; place-items: center; min-height: 200px; }
.lb-stage img { max-width: min(100%, 1400px); max-height: calc(100dvh - 140px); object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lb-missing { color: #cfe3f7; max-width: 420px; text-align: center; font-size: 15px; background: rgba(255, 255, 255, .06); padding: 18px 20px; border-radius: 10px; }
.lb figcaption { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: center; color: #d6e2f0; font-size: 14px; }
.lb-count { color: var(--night-muted); }
.lb-open { color: #ffb39f; text-decoration: underline; text-underline-offset: 3px; }
.lb-close, .lb-nav {
  border: 0; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .08); border-radius: 50%;
  width: 46px; height: 46px; font-size: 22px; display: grid; place-items: center; justify-self: center;
  transition: background .2s;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, .18); }
.lb-nav { font-size: 30px; line-height: 1; }
.lb-nav[hidden] { visibility: hidden; display: grid; }
.lb-close { position: absolute; top: 14px; inset-inline-end: 14px; width: 42px; height: 42px; font-size: 18px; }
@media (max-width: 640px) { .lb { grid-template-columns: 40px minmax(0, 1fr) 40px; } .lb-close, .lb-nav { width: 36px; height: 36px; } }

/* ---------------------------------------------------------------- right-to-left interface */
[dir="rtl"] .eng-steps li:not(:last-child)::after { inset-inline-start: 18px; }
[dir="rtl"] .nav a, [dir="rtl"] .seg button, [dir="rtl"] .date-filter button { letter-spacing: 0; }
[dir="rtl"] .hero h1, [dir="rtl"] .dash-head h1, [dir="rtl"] .history-head h2 { letter-spacing: 0; line-height: 1.3; }
[dir="rtl"] .eyebrow, [dir="rtl"] .lead-label, [dir="rtl"] .diff-label, [dir="rtl"] .gallery-title { letter-spacing: 0; text-transform: none; }
[dir="rtl"] .lb-prev { order: 3; } [dir="rtl"] .lb-next { order: 1; } [dir="rtl"] .lb-fig { order: 2; }
.vtag, .es-num, .cov-axis, time { unicode-bidi: isolate; }

/* language switch in the top bar */
.lang-toggle {
  border: 1px solid var(--night-line); background: rgba(255, 255, 255, .06); color: var(--night-text);
  font: 700 13px var(--f-ui); padding: 7px 12px; border-radius: 999px; cursor: pointer; transition: background .2s, border-color .2s;
}
.lang-toggle:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); }
.login-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.login-top .login-brand { margin-bottom: 0; }

/* status filter + "all days" */
.st-filter button { padding: 8px 11px; font-size: 13.5px; }

/* home: when the selected day was not fully monitored */
.cov-note {
  margin: 16px 0 0; padding: 11px 14px; border-radius: var(--r-md); font-size: 13.5px;
  background: var(--paper-2); color: var(--ink-2); border: 1px dashed var(--line-2);
}

/* home: articles pulled before we could copy them */
.pulled { margin-top: 28px; }
.pulled-title { font: 800 19px var(--f-head); margin: 0 0 4px; display: flex; gap: 8px; align-items: center; }
.pulled-title .n { font: 700 12px var(--f-ui); background: var(--del-soft); color: var(--del); padding: 2px 8px; border-radius: 999px; }
.pulled-sub { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.pulled-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pulled-list li {
  display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface);
  border: 1px solid var(--line); border-inline-start: 3px solid #f08a7f;
}
.pl-title { font-weight: 700; font-size: 15px; }
.pl-meta { font-size: 12.5px; color: var(--muted); }

/* article: taken down by Petra */
.removed-banner {
  margin: 14px 0 0; padding: 12px 16px; border-radius: var(--r-md); font-size: 14px; font-weight: 500;
  background: var(--del-soft); color: #7f1d1d; border: 1px solid #f5c2c2;
}
.steps li.s-removed::before { border-color: var(--del); background: var(--del); }

/* dashboard: monitoring coverage timeline */
.coverage { margin-top: 18px; }
.cov-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 24px; flex-wrap: wrap; }
.cov-head .panel-sub { max-width: 70ch; }
.cov-now { margin: 0; font-size: 13px; font-weight: 700; color: var(--live); display: inline-flex; align-items: center; gap: 8px; }
.cov-now::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cov-now.off { color: var(--muted); }
.cov-axis {
  display: flex; justify-content: space-between; font-size: 11.5px; color: var(--faint);
  margin: 6px 0 6px; padding-inline: 120px 132px;
}
.cov-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cov-day { display: grid; grid-template-columns: 108px minmax(0, 1fr) 120px; gap: 12px; align-items: center; }
.cov-label { font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cov-track { position: relative; height: 18px; border-radius: 5px; background: var(--paper-2); overflow: hidden; }
.cv-seg, .cv-gap, .cv-future { position: absolute; top: 0; bottom: 0; }
.cv-on { background: var(--live); border-radius: 3px; }
.cv-approx { background: repeating-linear-gradient(135deg, var(--live) 0 4px, #66c497 4px 8px); border-radius: 3px; opacity: .85; }
.cv-gap { background: transparent; }
.cv-gap:hover { background: rgba(180, 35, 24, .08); }
.cv-future { inset-inline-end: 0; background: repeating-linear-gradient(90deg, transparent 0 4px, rgba(16, 38, 66, .05) 4px 8px); }
.cov-stat { font-size: 12.5px; color: var(--ink-2); text-align: end; white-space: nowrap; }
.cov-stat.low { color: var(--edit); font-weight: 700; }
.cov-empty { color: var(--muted); font-size: 14px; }
.cov-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.cov-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.cov-legend .cv-on { background: var(--live); }
.cov-legend .cv-approx { background: repeating-linear-gradient(135deg, var(--live) 0 3px, #66c497 3px 6px); }
.cov-legend .cv-off { background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line-2); }
@media (max-width: 640px) {
  .cov-day { grid-template-columns: 1fr; gap: 4px; }
  .cov-stat { text-align: start; }
  .cov-axis { padding-inline: 0; }
}
@media (max-width: 560px) {
  .date-filter, .seg { flex-wrap: wrap; max-width: 100%; }
  }

/* date range: From – To inside the date filter */
.date-range {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border-radius: 9px;
  color: var(--muted); transition: background .2s, box-shadow .2s;
}
.date-range.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.date-range svg { flex: 0 0 auto; }
.dr-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.dr-field input {
  width: 128px; height: 28px; border: 1px solid var(--line-2); border-radius: 7px; padding: 0 6px;
  background: var(--surface); color: var(--ink); font: 500 13px var(--f-ui); cursor: pointer;
}
.dr-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dr-field input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; }
.dr-clear {
  border: 0; background: transparent; color: var(--muted); cursor: pointer; width: 26px; height: 26px;
  border-radius: 50%; font-size: 12px; display: grid; place-items: center;
}
.dr-clear:hover { background: var(--paper-2); color: var(--ink); }
.dr-clear[hidden] { display: none; }
@media (max-width: 560px) {
  .date-range { height: auto; flex-wrap: wrap; padding: 6px 8px; }
  .dr-field input { width: 120px; }
}

/* character counts: four figures as a 2 x 2 block */
.hero-stats { grid-template-columns: repeat(2, 1fr); }
.hero-stats > div:nth-child(3) { border-inline-start: 0; }
.hero-stats > div:nth-child(n+3) { border-top: 1px solid var(--night-line); }
.hero-stats dd { white-space: nowrap; }
.hero-stats dd small { white-space: normal; }
.card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card-top .chars { unicode-bidi: isolate; font-size: 11.5px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.card.is-lead .card-top .chars { font-size: 12.5px; }
.kv-split { display: block; font-size: 11.5px; color: var(--muted); font-family: var(--f-ui); }
@media (max-width: 560px) { .hero-stats { grid-template-columns: 1fr; } .hero-stats > div:nth-child(n+2) { border-top: 1px solid var(--night-line); } }


/* =================================================================== Petra theme
   Header like petra.gov.jo: white bar under a Petra-blue line, real logo, bold nav. */
.topbar {
  background: rgba(255, 255, 255, .97); color: var(--ink);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 4px 0 var(--accent), 0 8px 20px -16px rgba(16, 38, 66, .45);
}
.topbar .wrap { padding-top: 4px; }
.brand { gap: 14px; }
.brand-logo { height: 52px; width: auto; display: block; }
.brand-div { width: 1px; height: 36px; background: var(--line-2); }
.brand-name { color: var(--accent-ink); font-weight: 800; font-size: 16px; }
.brand-sub { color: var(--muted); }
.nav a { color: var(--ink); font-weight: 700; font-size: 14.5px; }
.nav a:hover { color: var(--accent-ink); background: var(--accent-soft); }
.nav a[aria-current="page"] { color: var(--accent-ink); }
.nav a[aria-current="page"]::after { bottom: -19px; height: 3px; }
.live-pill { color: var(--ink-2); background: var(--surface-2); border-color: var(--line); }
.topbar .lang-toggle { color: var(--accent-ink); background: #fff; border-color: var(--line-2); }
.topbar .lang-toggle:hover { background: var(--accent-soft); border-color: var(--accent); }
.signout button { color: var(--ink-2); border-color: var(--line-2); }
.signout button:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 860px) {
  .topbar .wrap { padding-top: 14px; }
  .brand-logo { height: 42px; }
  .brand-div, .brand .brand-text { display: none; }
  .nav a[aria-current="page"]::after { bottom: -6px; }
}

/* deep Petra blue for the dark areas (hero, dashboard headline, engine room, login) */
.hero, .login-page {
  background:
    radial-gradient(900px 380px at 88% -15%, rgba(20, 185, 243, .30), transparent 60%),
    radial-gradient(800px 360px at 0% 120%, rgba(58, 118, 192, .45), transparent 60%),
    linear-gradient(160deg, #1b4677 0%, #0f2440 100%);
}
.eyebrow .tag { background: var(--urgent); }          /* like Petra's red "urgent" button */
.hero h1 em { color: #7fd3ff; }
.engine { --k-article: var(--cyan); --k-photo: #d9c79a; }
.bd-seg.us, .bd-legend .lg-us i { background: var(--cyan); }

/* section titles like Petra's: coloured bar at the start of the line */
.panel-title, .pulled-title {
  border-inline-start: 4px solid var(--accent); padding-inline-start: 12px; color: var(--accent-ink);
}
.pulled-title { border-inline-start-color: var(--urgent); color: var(--ink); }

/* login: the white Petra logo on deep blue */
.login-logo { height: 64px; width: auto; display: block; margin-bottom: 14px; }
.login-brand { flex-direction: column; align-items: flex-start; gap: 0; }

/* site footer like petra.gov.jo: dark band with the white logo */
.site-foot { margin-top: 56px; background: var(--petra-ink); color: #c9c6c6; border-top: 4px solid var(--accent); }
.site-foot .wrap { display: flex; align-items: center; gap: 24px; padding-top: 26px; padding-bottom: 26px; flex-wrap: wrap; }
.site-foot img { height: 58px; width: auto; }
.site-foot p { margin: 0; font-size: 13.5px; line-height: 1.6; max-width: 70ch; }
.site-foot a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.login-brand .brand-name { color: #fff; }
.login-brand .brand-sub { color: var(--night-muted); }
.login-logo { height: 78px; }
.brand-logo { height: 60px; }
@media (max-width: 860px) { .brand-logo { height: 46px; } }

/* sign-out confirmation panel (under the button) */
.signout { position: relative; }
.so-pop {
  position: absolute; top: calc(100% + 12px); inset-inline-end: 0; z-index: 40;
  width: min(280px, calc(100vw - 32px)); padding: 16px 16px 14px; border-radius: 12px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  box-shadow: var(--shadow-3); animation: so-in .16s var(--ease);
}
.so-pop::before {
  content: ""; position: absolute; top: -7px; inset-inline-end: 26px; width: 12px; height: 12px; rotate: 45deg;
  background: var(--surface); border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.so-q { margin: 0 0 4px; font-weight: 700; font-size: 15px; line-height: 1.4; }
.so-sub { margin: 0 0 14px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.so-actions { display: flex; justify-content: flex-end; gap: 8px; }
.so-actions button {
  font: 700 13.5px var(--f-ui); padding: 8px 14px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
}
.so-actions .so-cancel:hover { background: var(--paper); }
.so-actions .so-yes { background: var(--accent); border-color: var(--accent); color: #fff; }
.so-actions .so-yes:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.so-actions button:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 1px; }
@keyframes so-in { from { opacity: 0; transform: translateY(-4px); } }
@media (max-width: 560px) {
  .so-pop { position: fixed; inset-inline: 16px; width: auto; }   /* top is set from the button's position */
  .so-pop::before { display: none; }
}

/* photos inside the text, in the places Petra gives them */
.story-inline { margin: 1.5em 0 1.6em; }
.story-inline a { display: block; border-radius: var(--r-md); overflow: hidden; background: var(--paper-2); cursor: zoom-in; }
.story-inline img { width: 100%; height: auto; max-height: 560px; object-fit: contain; background: var(--paper-2); }
.story-hero + .story-hero { margin-top: 12px; }
.prose p:first-of-type::first-line { font-weight: 600; }   /* lead line even when a photo comes first */


/* ---------------------------------------------------------------- stored data + delete old news */
.data-panel { margin-top: 20px; }
.data-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 22px; }
@media (max-width: 760px) { .data-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.data-stats > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; }
.data-stats dt { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.data-stats dd { margin: 0; font: 700 20px/1.2 var(--f-ui); font-variant-numeric: tabular-nums; }
.data-stats dd small { display: block; font: 500 12px var(--f-ui); color: var(--muted); margin-top: 3px; }
.purge { border-top: 1px solid var(--line); padding-top: 18px; }
.purge-label { display: block; font-weight: 700; margin-bottom: 8px; }
.purge-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.purge-row input {
  height: 40px; border: 1px solid var(--line-2); border-radius: 9px; padding: 0 10px;
  background: var(--surface); font: 500 14px var(--f-ui); color: var(--ink);
}
.purge-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#purge-typed { width: 140px; }
.purge-hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.btn {
  height: 40px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink); font: 700 13.5px var(--f-ui); cursor: pointer; transition: background .15s, border-color .15s;
}
.btn:hover:not(:disabled) { background: var(--paper); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-danger { background: var(--del); border-color: var(--del); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #8f1c13; border-color: #8f1c13; }
.btn:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 1px; }
.purge-step { margin-top: 14px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); }
.purge-step p { margin: 0 0 12px; line-height: 1.6; }
.purge-step p:last-child { margin-bottom: 0; }
.purge-step.plan { border-color: #e9b8b2; background: var(--del-soft); }
.purge-step.danger { border: 2px solid var(--del); background: var(--del-soft); }
.purge-step.ok { border-color: #b7e0c9; background: var(--ins-soft); color: var(--ins); }
.purge-step.warn { border-color: #f1d08f; background: var(--edit-soft); color: var(--edit); }
.purge-final-title { font-weight: 800; color: var(--del); font-size: 16px; }
.purge-actions { display: flex; flex-wrap: wrap; gap: 8px; }
