/* ==========================================================================
   Portal — public web design system (RTL-first, light + dark)
   ========================================================================== */
:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #0e1626;
  --ink-2: #334155;
  --muted: #667085;
  --line: #e6e3da;
  --accent: #d42e1e;
  --accent-ink: #ffffff;
  --accent-soft: #fdebe8;
  --accent-text: #c0281a;
  --num: #b9b4a6;
  --brand: #0e1626;
  --brand-ink: #ffffff;
  --ok: #12a150;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(14, 22, 38, .06), 0 1px 3px rgba(14, 22, 38, .05);
  --shadow: 0 10px 30px -12px rgba(14, 22, 38, .22);
  --shadow-lg: 0 24px 60px -20px rgba(14, 22, 38, .35);
  --maxw: 1240px;
  --font: "IBM Plex Sans Arabic", "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --read-size: 1.15rem;
}
[data-theme="dark"] {
  --bg: #0a0e16;
  --surface: #121926;
  --surface-2: #0f1520;
  --ink: #eaf0f8;
  --ink-2: #c3cddc;
  --muted: #8a97ab;
  --line: #222d42;
  --accent: #ff5a47;
  --accent-soft: #2b1815;
  --accent-text: #ff7a69;
  --num: #3a4a66;
  --brand: #05080e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body.pw {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink);
  line-height: 1.7; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background .25s, color .25s;
}
.pw a { color: inherit; text-decoration: none; }
.pw img { max-width: 100%; display: block; }
.pw h1, .pw h2, .pw h3, .pw h4 { margin: 0; line-height: 1.35; font-weight: 700; letter-spacing: -.01em; }
.pw p { margin: 0; }
.pw button { font-family: inherit; cursor: pointer; }
.pw :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.pw .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 768px) { .wrap { padding-inline: 28px; } }

.ico { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.fill { fill: currentColor; stroke: none; }

/* ---------- Buttons / chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .62rem 1.1rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: .92rem;
  transition: transform .15s, background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { border-color: var(--ink-2); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { box-shadow: 0 8px 20px -8px var(--accent); }
.btn.dark { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.icon { padding: .6rem; width: 42px; height: 42px; }
.btn.is-on { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .7rem;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-text);
  font-size: .78rem; font-weight: 700;
}
.chip.solid { background: var(--accent); color: var(--accent-ink); }
.chip.glass { background: rgba(255, 255, 255, .16); color: #fff; backdrop-filter: blur(8px); }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: relative; display: inline-block; }
.dot-live::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent); animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .8rem; color: var(--muted); font-size: .8rem; }
.meta .sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }

/* ---------- Top utility bar ---------- */
.utility { background: var(--brand); color: #b8c2d4; font-size: .82rem; }
.utility .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; }
.utility .l, .utility .r { display: flex; align-items: center; gap: 14px; }
.utility a:hover { color: #fff; }
.utility .clock { font-variant-numeric: tabular-nums; color: #fff; font-weight: 600; }
@media (max-width: 640px) { .utility .hide-sm { display: none; } }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.hbar { display: flex; align-items: center; gap: 14px; min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.45rem; letter-spacing: -.02em; }
.logo .mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #ff8a4c); color: #fff; font-size: 1.1rem; box-shadow: 0 8px 18px -8px var(--accent); }
.nav { display: none; align-items: center; gap: 2px; margin-inline-start: 18px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav { mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); padding-inline: 10px; }
.nav a { padding: .45rem .72rem; border-radius: 999px; font-weight: 600; font-size: .93rem; color: var(--ink-2); white-space: nowrap; transition: background .2s, color .2s; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.on { background: var(--ink); color: var(--surface); }
.nav a.live { color: var(--accent-text); display: inline-flex; align-items: center; gap: .4rem; }
.hactions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
@media (min-width: 1024px) { .nav { display: flex; } .burger { display: none !important; } }
.badge { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; display: none; place-items: center; }
.badge.show { display: grid; }
.btn.icon { position: relative; }
.progress { position: absolute; bottom: -1px; inset-inline-start: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--accent), #ff8a4c); transition: width .1s; }

/* ---------- Ticker ---------- */
.ticker { background: var(--surface); border-bottom: 1px solid var(--line); }
.ticker .wrap { display: flex; align-items: center; gap: 14px; height: 44px; }
.ticker .tag { flex: none; background: var(--accent); color: #fff; font-weight: 700; font-size: .8rem; padding: .25rem .8rem; border-radius: 999px; display: inline-flex; align-items: center; gap: .45rem; }
.ticker .tag .dot-live { background: #fff; }
.ticker .tag .dot-live::after { border-color: #fff; }
.ticker .track { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker .move { display: inline-flex; gap: 2.6rem; white-space: nowrap; animation: tick 70s linear infinite; padding-inline-end: 2.6rem; }
.ticker .track:hover .move { animation-play-state: paused; }
.ticker .move a { font-weight: 600; font-size: .92rem; color: var(--ink-2); }
.ticker .move a:hover { color: var(--accent); }
.ticker .move a::before { content: "●"; color: var(--accent); margin-inline-end: .6rem; font-size: .55rem; vertical-align: middle; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(50%); } }
html[dir="ltr"] .ticker .move { animation-name: tick-ltr; }
@keyframes tick-ltr { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker .move { animation: none; } }

/* ---------- Drawer / overlay ---------- */
.scrim { position: fixed; inset: 0; background: rgba(5, 8, 14, .55); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 80; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(380px, 92vw); background: var(--surface); z-index: 90; transform: translateX(-105%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); visibility: hidden; }
.drawer.open { visibility: visible; }
html[dir="ltr"] .drawer { transform: translateX(105%); }
.drawer.open { transform: none; }
.drawer .dh { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
.drawer .db { padding: 14px 18px; overflow-y: auto; flex: 1; }
.drawer .mnav a { display: flex; align-items: center; justify-content: space-between; padding: .8rem .2rem; border-bottom: 1px dashed var(--line); font-weight: 600; }
.saved-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.saved-item img { width: 76px; height: 60px; object-fit: cover; border-radius: 10px; flex: none; background: var(--surface-2); }
.saved-item h4 { font-size: .92rem; }
.saved-item button { background: none; border: 0; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 36px 10px; }

.search-overlay { position: fixed; inset: 0; z-index: 100; display: none; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(16px); padding: 9vh 16px 16px; overflow-y: auto; }
.search-overlay.open { display: block; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.search-box { max-width: 760px; margin: 0 auto; }
.search-box form { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 22px; padding: 8px 8px 8px 18px; box-shadow: var(--shadow); }
.search-box input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 1.15rem; color: var(--ink); padding: .8rem .4rem; outline: none; min-width: 0; }
.suggest { margin-top: 14px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.suggest a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.suggest a:last-child { border: 0; }
.suggest a:hover, .suggest a.hl { background: var(--surface-2); }
.suggest img { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; }
.suggest .t { font-weight: 600; font-size: .96rem; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ---------- Sections ---------- */
main.pm { min-height: 60vh; padding-bottom: 56px; }
.sec { margin-top: 44px; }
.sec-h { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sec-h h2 { font-size: 1.45rem; display: flex; align-items: center; gap: .6rem; }
.sec-h h2::before { content: ""; width: 6px; height: 1.4em; border-radius: 4px; background: var(--accent); }
.sec-h .more { color: var(--accent-text); font-weight: 700; font-size: .9rem; display: inline-flex; align-items: center; gap: .3rem; }
.sec-h .more:hover { gap: .55rem; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.layout { display: grid; gap: 32px; margin-top: 28px; }
@media (min-width: 1024px) { .layout { grid-template-columns: minmax(0, 1fr) 340px; } .layout.rev { grid-template-columns: 340px minmax(0, 1fr); } }
.side { display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 1024px) { .side .sticky { position: sticky; top: 92px; } }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s, border-color .25s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.card .ph { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.card .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.card:hover .ph img { transform: scale(1.06); }
.card .ph .chip { position: absolute; top: 12px; inset-inline-start: 12px; }
.card .bd { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-size: 1.08rem; }
.card p.ex { color: var(--muted); font-size: .9rem; }
.clamp2, .clamp3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp2 { -webkit-line-clamp: 2; line-clamp: 2; }
.clamp3 { -webkit-line-clamp: 3; line-clamp: 3; }
.row-card { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row-card:last-child { border: 0; }
.row-card .th { width: 92px; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; flex: none; background: var(--surface-2); }
.row-card .th img { width: 100%; height: 100%; object-fit: cover; }
.row-card h3 { font-size: .98rem; margin-bottom: 4px; }
.row-card:hover h3, .card:hover h3, .tile:hover h3 { color: var(--accent); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel > h3 { font-size: 1.05rem; margin-bottom: 8px; display: flex; align-items: center; gap: .5rem; }

/* ---------- Hero ---------- */
.hero { display: grid; gap: 16px; margin-top: 24px; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.55fr 1fr; grid-template-rows: repeat(3, 1fr); } .hero .lead { grid-row: 1 / span 3; } }
.tile { position: relative; border-radius: var(--radius); overflow: hidden; isolation: isolate; background: var(--brand); color: #fff; min-height: 190px; display: flex; align-items: flex-end; box-shadow: var(--shadow-sm); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(5, 8, 14, 0) 10%, rgba(5, 8, 14, .6) 55%, rgba(5, 8, 14, .92) 100%); }
.tile:hover img { transform: scale(1.06); }
.tile .in { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.tile h3 { font-size: 1.02rem; color: #fff; text-shadow: 0 1px 12px rgba(0, 0, 0, .4); }
.tile.lead { min-height: 440px; }
.tile.lead h2 { font-size: clamp(1.5rem, 3.4vw, 2.3rem); line-height: 1.3; color: #fff; }
.tile.lead p { color: #dfe6f1; max-width: 62ch; }
.tile .meta { color: #cbd5e3; }

/* ---------- Home specials ---------- */
.live-feed { display: flex; flex-direction: column; }
.live-feed a { display: grid; grid-template-columns: 54px 1fr; gap: 12px; padding: 11px 0; position: relative; }
.live-feed a + a { border-top: 1px dashed var(--line); }
.live-feed time { color: var(--accent-text); font-weight: 700; font-size: .82rem; font-variant-numeric: tabular-nums; padding-top: 2px; }
.live-feed h4 { font-size: .95rem; font-weight: 600; }
.live-feed a:hover h4 { color: var(--accent); }
.ranked { counter-reset: r; display: flex; flex-direction: column; }
.ranked a { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 12px 0; align-items: start; }
.ranked a + a { border-top: 1px solid var(--line); }
.ranked a::before { counter-increment: r; content: counter(r); font-size: 1.9rem; font-weight: 800; line-height: 1; color: var(--num); transition: color .2s; font-variant-numeric: tabular-nums; }
.ranked a:hover::before { color: var(--accent); }
.ranked h4 { font-size: .95rem; font-weight: 600; }
.cat-rail { display: grid; gap: 20px; align-items: start; }
@media (min-width: 900px) { .cat-rail { grid-template-columns: 1fr 1fr; } }
.stack { display: flex; flex-direction: column; }

.services { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.svc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 10px; text-align: start; transition: transform .25s, box-shadow .25s, border-color .25s; color: inherit; }
.svc:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent); }
.svc .i { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-size: 1.3rem; }
.svc h3 { font-size: 1.02rem; }
.svc p { color: var(--muted); font-size: .88rem; }
button.svc { font: inherit; }

.cats-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.cats-strip::-webkit-scrollbar { display: none; }
.cat-pill { flex: none; display: inline-flex; align-items: center; gap: .55rem; padding: .6rem 1.1rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; transition: all .2s; }
.cat-pill:hover, .cat-pill.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.band { margin-top: 48px; background: var(--brand); color: #fff; border-radius: 28px; padding: 28px; overflow: hidden; position: relative; isolation: isolate; }
.band::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(closest-side, rgba(229, 57, 42, .5), transparent); inset-inline-end: -120px; top: -160px; z-index: -1; }
.band .sec-h h2 { color: #fff; }
.band .card { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); color: #fff; }
.band .card p.ex, .band .card .meta { color: #b9c4d6; }

/* ---------- Article ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; color: var(--muted); font-size: .85rem; margin-top: 22px; }
.crumbs a:hover { color: var(--accent); }
.article { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; overflow: clip; }
.article .ahead { padding: 28px 22px 8px; }
@media (min-width: 768px) { .article .ahead { padding: 40px 48px 12px; } }
.article h1 { font-size: clamp(1.6rem, 3.6vw, 2.5rem); line-height: 1.38; margin: 14px 0 12px; font-weight: 800; }
.article .lede { font-size: 1.12rem; color: var(--ink-2); border-inline-start: 4px solid var(--accent); padding-inline-start: 14px; margin: 14px 0; }
.article .cover { margin: 20px 0 0; }
.article .cover img { width: 100%; max-height: 560px; object-fit: cover; }
.article .cover figcaption { padding: 8px 22px; font-size: .8rem; color: var(--muted); }
.toolbar { position: sticky; top: 70px; z-index: 30; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 22px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-block: 1px solid var(--line); }
@media (min-width: 768px) { .toolbar { padding-inline: 48px; } }
.toolbar .btn { padding: .45rem .85rem; font-size: .85rem; }
.toolbar .grow { flex: 1; }
.body { padding: 26px 22px 34px; font-size: var(--read-size); line-height: 2.05; color: var(--ink); }
@media (min-width: 768px) { .body { padding: 34px 48px 44px; } }
.body > * + * { margin-top: 1.2em; }
.body p { text-wrap: pretty; }
.body h2, .body h3 { margin-top: 1.8em; font-size: 1.4em; }
.body img { border-radius: 14px; margin-inline: auto; }
.body a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.body blockquote { margin-inline: 0; padding: 1rem 1.3rem; background: var(--surface-2); border-inline-start: 4px solid var(--accent); border-radius: 12px; color: var(--ink-2); }
.body ul, .body ol { padding-inline-start: 1.4em; }
.body table { width: 100%; border-collapse: collapse; font-size: .92em; display: block; overflow-x: auto; }
.body td, .body th { border: 1px solid var(--line); padding: .5rem .7rem; }
.afoot { padding: 0 22px 28px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
@media (min-width: 768px) { .afoot { padding-inline: 48px; } }
.src-box { background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin: 0 22px 28px; }
@media (min-width: 768px) { .src-box { margin-inline: 48px; } }
.share { display: flex; gap: 8px; flex-wrap: wrap; }
.share a, .share button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); transition: all .2s; }
.share a:hover, .share button:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-2px); }
.speaking .listen-ico { animation: pulse-s 1s infinite alternate; }
@keyframes pulse-s { to { transform: scale(1.25); } }

/* ---------- Page heading / filters / pagination ---------- */
.phead { margin-top: 28px; padding: 28px; border-radius: 26px; background: linear-gradient(135deg, var(--brand), #1b2740); color: #fff; position: relative; overflow: hidden; isolation: isolate; }
.phead::after { content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%; inset-inline-end: -80px; top: -140px; background: radial-gradient(closest-side, rgba(229, 57, 42, .55), transparent); z-index: -1; }
.phead h1 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.phead p { color: #c3cddc; margin-top: 6px; max-width: 60ch; }
.filter { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.filter input[type=search], .filter select { padding: .7rem 1rem; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1); color: #fff; font: inherit; min-width: 0; }
.filter input::placeholder { color: #b9c4d6; }
.filter select option { color: #111; }
.filter input[type=search] { flex: 1; min-width: 200px; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 34px; }
.pager a, .pager span { min-width: 42px; height: 42px; padding: 0 .8rem; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager .cur { background: var(--accent); color: #fff; border-color: var(--accent); }
.pager .dis { opacity: .4; }
.no-results { text-align: center; padding: 60px 16px; color: var(--muted); }

/* ---------- Footer ---------- */
.footer { background: var(--brand); color: #aab5c8; margin-top: 20px; }
.footer .top { display: grid; gap: 32px; padding-block: 52px 32px; }
@media (min-width: 900px) { .footer .top { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.footer a { display: block; padding: .22rem 0; }
.footer a:hover { color: #fff; }
.footer .logo { color: #fff; }
.footer .bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding-block: 18px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; font-size: .85rem; }
.fab { position: fixed; inset-block-end: 22px; inset-inline-start: 22px; z-index: 40; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--ink); color: var(--surface); display: grid; place-items: center; box-shadow: var(--shadow); opacity: 0; transform: translateY(14px); pointer-events: none; transition: all .25s; }
.fab.show { opacity: 1; transform: none; pointer-events: auto; }
.toast { position: fixed; inset-block-end: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: var(--surface); padding: .7rem 1.2rem; border-radius: 999px; font-weight: 600; font-size: .9rem; opacity: 0; transition: all .25s; z-index: 120; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Prose pages ---------- */
.prose-page { max-width: 820px; margin: 28px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px 22px; }
@media (min-width: 768px) { .prose-page { padding: 44px 52px; } }

@media print {
  @page { margin: 16mm 14mm; }
  /* Print only the article itself: no chrome, sidebars, related news, ads or tools. */
  .utility, .site-header, .ticker, .footer, .toolbar, .side, .fab, .toast, .scrim, .drawer, .search-overlay,
  .crumbs, .afoot, .share, .progress, .ad-zone, main.pm > .wrap > .sec, .wrap > .sec, .article ~ *, .layout > aside { display: none !important; }
  body.pw { background: #fff !important; color: #000 !important; }
  main.pm { padding: 0; min-height: 0; }
  .wrap { max-width: none; padding: 0; }
  .layout { display: block !important; margin: 0; }
  .article { border: 0 !important; border-radius: 0; background: #fff; overflow: visible; }
  .article .ahead, .body { padding: 0 !important; }
  .article h1 { font-size: 22pt; margin: 6pt 0 8pt; }
  .article .lede { font-size: 12pt; color: #222; }
  .article .cover { margin: 10pt 0; }
  .article .cover img { max-height: 110mm; width: auto; max-width: 100%; margin-inline: auto; }
  .body { font-size: 12pt; line-height: 1.9; color: #000; }
  .body a { color: #000; text-decoration: none; }
  .body img, .body table, .body blockquote { break-inside: avoid; }
  .chip { border: 1px solid #999; background: none; color: #000; }
  .src-box { margin: 12pt 0 0; border: 0; border-top: 1px solid #999; border-radius: 0; background: none; padding: 8pt 0 0; }
  .src-box .btn { display: none; }
}
.logo-img { height: 44px; width: auto; max-width: 220px; object-fit: contain; display: block; }
.footer .logo-img { height: 48px; }

/* ---------- Advertising ---------- */
.ad-zone { max-width: 100%; }
.ad-list { display: grid; gap: 14px; justify-items: center; }
.ad-list.ad-slots-2, .ad-list.ad-slots-3, .ad-list.ad-slots-4, .ad-list.ad-slots-5, .ad-list.ad-slots-6 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.ad { position: relative; margin-block: 18px; max-width: 100%; width: 100%; text-align: center; }
.ad-sticky_bottom .ad, .ad-popup .ad { margin-block: 0; }
.ad-link { display: inline-block; max-width: 100%; line-height: 0; border-radius: var(--radius-sm, 12px); overflow: hidden; }
.ad-link img { max-width: 100%; height: auto; display: block; margin-inline: auto; }
.ad-label { display: block; margin-top: 4px; font-size: .68rem; letter-spacing: .02em; color: var(--ink-3, #8a93a3); }
.ad-html { display: flex; justify-content: center; max-width: 100%; overflow: hidden; }
.ad-html iframe, .ad-html img, .ad-html video { max-width: 100%; }
.ad-dev-mobile { display: none; }
@media (max-width: 767px) { .ad-dev-desktop { display: none; } .ad-dev-mobile { display: block; } }

/* sidebar: sticky half-page unit */
.ad-z-sidebar_sticky { position: sticky; top: 90px; }
.ad-z-sidebar_top .ad, .ad-z-sidebar_sticky .ad { margin-top: 0; }

/* in-article: separate clearly from the text */
.body .ad { margin-block: 1.6em; padding-block: 10px; border-block: 1px dashed var(--line); }

/* native sponsored card */
.ad-native { display: grid; grid-template-columns: 1fr; gap: 0; text-align: start; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm, 14px); overflow: hidden; color: inherit; transition: transform .2s, box-shadow .2s; }
.ad-native:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -18px rgba(0, 0, 0, .35); }
.ad-native-img { aspect-ratio: 16 / 9; background: var(--surface-2); display: block; overflow: hidden; }
.ad-native-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-native-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; align-items: flex-start; }
.ad-native-body strong { font-size: 1.05rem; line-height: 1.5; }
.ad-desc { font-size: .9rem; opacity: .8; line-height: 1.7; }
.ad-cta { display: inline-block; padding: .45rem 1rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink, #fff); font-size: .85rem; font-weight: 700; }
@media (min-width: 640px) {
  .ad-list.ad-slots-1 .ad-native:has(.ad-native-img) { grid-template-columns: 38% 1fr; }
  .ad-list.ad-slots-1 .ad-native-img { aspect-ratio: auto; min-height: 140px; }
  .ad-list.ad-slots-1 .ad-t-native { max-width: 760px; }
}
.side .ad-native { grid-template-columns: 1fr !important; }
.side .ad-native-img { aspect-ratio: 16 / 9 !important; min-height: 0 !important; }

/* text ad */
.ad-text { display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: start; padding: 14px 18px; border: 1px solid var(--line); background: var(--accent-soft); border-radius: var(--radius-sm, 14px); color: inherit; }
.ad-text-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ad-text-body strong { font-size: 1.02rem; line-height: 1.5; }
.ad-text .ad-cta { flex-shrink: 0; }
@media (max-width: 520px) { .ad-text { flex-direction: column; align-items: stretch; text-align: center; } }

/* floating formats */
.ad-close { position: absolute; top: -12px; inset-inline-end: -4px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.2rem; line-height: 1; cursor: pointer; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); z-index: 2; }
.ad-close:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.ad-sticky_bottom { position: fixed; inset-inline: 0; bottom: 0; z-index: 70; display: flex; justify-content: center; padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); pointer-events: none; }
.ad-sticky_bottom[hidden] { display: none; }
.ad-sticky_bottom .ad-box { position: relative; pointer-events: auto; max-width: min(100%, 760px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 8px 2px; box-shadow: 0 -8px 30px -12px rgba(0, 0, 0, .35); animation: ad-rise .35s ease-out; }
.ad-sticky_bottom .ad-label { margin-top: 2px; }

.ad-popup { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(8, 12, 22, .66); backdrop-filter: blur(3px); }
.ad-popup[hidden] { display: none; }
.ad-popup .ad-box { position: relative; width: min(100%, 520px); max-height: 90vh; overflow: auto; background: var(--surface); border-radius: 20px; padding: 18px 16px 12px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); animation: ad-pop .3s ease-out; }
.ad-popup .ad-close { top: 8px; inset-inline-end: 8px; }
@keyframes ad-rise { from { transform: translateY(24px); opacity: 0; } }
@keyframes ad-pop { from { transform: scale(.94); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ad-box { animation: none !important; } }
@media print { .ad-zone { display: none !important; } }
.side .panel.sticky:has(~ .ad-z-sidebar_sticky) { position: static; } /* avoid two stacked sticky blocks overlapping */
