/* ============================================================================
   NR PLATFORM — Crème de la crème additions to nyakundi.css
   - Intel Wire (Bloomberg-Terminal aesthetic)
   - Dossier-style investigation cards
   - Source crests
   - Reels strip
   - Classification stamps
   ============================================================================ */

:root {
    --bg:              color-mix(in srgb, var(--paper, #fff) 86%, #e9dfcf);
    --ink:             var(--on-surface, #14171a);
    --ink-2:           var(--on-surface-variant, #3f3a3b);
    --ink-3:           var(--outline, #7e7576);
    --paper-2:         var(--surface-container-low, #f3f3f3);
    --hairline:        var(--outline-variant, #e8e3dc);
    --hairline-2:      color-mix(in srgb, var(--outline-variant, #e8e3dc) 70%, var(--outline, #7e7576));
    --brand:           var(--secondary, #b7221e);
    --brand-2:         var(--secondary-container, #8c1815);
    --brand-soft:      var(--secondary-fixed, #fde7e3);
    --gold:            #c8a45a;
    --green:           #16a34a;
    --amber:           #f59e0b;
    --serif:           var(--font-serif, "Newsreader", Georgia, serif);
    --sans:            var(--font-sans, "Inter", system-ui, sans-serif);
    --mono:            ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --intel-bg:        #15130f;
    --intel-surface:   #1d1a15;
    --intel-line:      #3a342b;
    --intel-row-alt:   #1a1712;
    --intel-text:      #eee5d4;
    --intel-text-2:    #c5bba8;
    --intel-mute:      #8a7f70;
    --intel-led:       #22c55e;
    --intel-accent:    #d8b96f;
    --font-mono:       ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

/* ── Intel Wire ──────────────────────────────────────────────────────── */
.intel-wire {
    background: var(--intel-bg);
    color: var(--intel-text);
    border: 1px solid var(--intel-line);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 480px;
    max-height: 560px;
    box-shadow: 0 16px 36px rgba(21, 19, 15, 0.12), 0 0 0 1px rgba(255,255,255,0.04) inset;
}

.intel-wire--compact { min-height: 280px; max-height: 360px; }

.intel-wire__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--intel-surface);
    border-bottom: 1px solid var(--intel-line);
}
.intel-wire__led {
    width: 8px; height: 8px;
    background: var(--intel-led);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
    animation: intel-blink 1.4s ease infinite;
    flex-shrink: 0;
}
@keyframes intel-blink { 0%,100% {opacity:1} 50% {opacity:.45} }

.intel-wire__title {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--intel-accent);
    font-weight: 700;
}
.intel-wire__meta {
    margin-left: auto;
    font-size: 10px;
    color: var(--intel-mute);
    letter-spacing: 0.08em;
}

.intel-wire__tabs {
    display: flex;
    gap: 0;
    background: var(--intel-surface);
    border-bottom: 1px solid var(--intel-line);
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #2a2d33 transparent;
}
.intel-wire__tab {
    padding: 8px 12px;
    color: var(--intel-mute);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    border: 0;
    border-right: 1px solid var(--intel-line);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.intel-wire__tab:hover { color: var(--intel-text); }
.intel-wire__tab.is-active {
    color: #fff8e8;
    background: #282217;
    border-bottom-color: var(--secondary, #b7221e);
}

.intel-wire__feed {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    font-family: var(--font-mono);
    font-size: 11.5px;
    scrollbar-width: thin;
    scrollbar-color: #2a2d33 transparent;
}

.intel-row {
    display: grid;
    grid-template-columns: 64px 60px 1fr auto;
    gap: 10px;
    padding: 6px 12px;
    border-bottom: 1px solid #0e1015;
    color: var(--intel-text);
    align-items: baseline;
}
.intel-row:nth-child(odd) { background: var(--intel-row-alt); }

.intel-wire--compact .intel-row {
    grid-template-columns: 50px 1fr auto;
}

.intel-row__time {
    color: var(--intel-accent);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    white-space: nowrap;
}
.intel-row__src {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 1px 5px;
    border-radius: 2px;
    text-align: center;
    border: 1px solid currentColor;
    align-self: center;
    white-space: nowrap;
}
.intel-row__src--reu   { color: #ff8b5c; }
.intel-row__src--afp   { color: #9bd4ff; }
.intel-row__src--osint { color: #ffd166; }
.intel-row__src--nr    { color: #fff; background: var(--secondary, #b7221e); border-color: var(--secondary, #b7221e); }
.intel-row__src--gov   { color: #a39bff; }
.intel-row__src--court { color: #7be0c2; }
.intel-row__src--sat   { color: #ff8aa9; }

.intel-row__txt {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.45;
    color: var(--intel-text);
    overflow-wrap: anywhere;
    word-break: break-word;
}
.intel-row__txt strong { color: #fff; font-weight: 700; }
.intel-row__txt em     { color: var(--intel-accent); font-style: normal; }
.intel-row__txt a:hover { text-decoration: underline !important; }

.intel-row__flag {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 2px;
    align-self: center;
    white-space: nowrap;
    border: 1px solid currentColor;
}
.intel-row__flag--breaking   { background: var(--secondary, #b7221e); color: #fff; border-color: var(--secondary, #b7221e); }
.intel-row__flag--developing { background: #3d2e10; color: #f0c876; border-color: #5d4825; }
.intel-row__flag--verified   { background: #0d3b2c; color: #8de4be; border-color: #1d6b48; }
.intel-row__flag--osint      { background: #1c2e4a; color: #9bd4ff; border-color: #1c4a8a; }
.intel-row__flag--exclusive  { background: #3d143d; color: #ffb0e8; border-color: #5d2050; }

.intel-row.is-new {
    animation: intel-flash 1s ease 1;
}
@keyframes intel-flash {
    0% { background: rgba(255, 90, 80, 0.18); transform: translateX(-4px); }
    100% { background: transparent; transform: translateX(0); }
}

.intel-row.is-hidden { display: none; }

.intel-wire__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 8px 12px;
    background: var(--intel-surface);
    border-top: 1px solid var(--intel-line);
}

.intel-wire__ticker {
    padding: 8px 12px;
    background: var(--intel-surface);
    border-top: 1px solid var(--intel-line);
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--intel-mute);
    overflow: hidden;
    white-space: nowrap;
}
.intel-wire__ticker strong { color: var(--secondary, #b7221e); font-weight: 700; letter-spacing: 0.08em; }
.intel-wire__ticker .green { color: var(--intel-led); }
.intel-wire__ticker .amber { color: #f59e0b; }

@media (max-width: 639px) {
    .intel-wire { min-height: 320px; max-height: 420px; }
    .intel-row { grid-template-columns: 44px 40px 1fr auto !important; gap: 6px; padding: 5px 8px; font-size: 11px; }
    .intel-row__txt { font-size: 11px; }
    .intel-row__time { font-size: 10px; }
    .intel-row__src { font-size: 9px; padding: 1px 4px; }
    .intel-row__flag { font-size: 8px; padding: 1px 4px; }
    .intel-wire__tabs { padding: 0 4px; }
    .intel-wire__tab { font-size: 9px; padding: 7px 9px; }
}

/* ── Reels strip ─────────────────────────────────────────────────────── */
.reels-strip { margin: 24px 0; padding: 18px 0; border-top: 1px solid var(--outline-variant); border-bottom: 1px solid var(--outline-variant); }
.reels-strip__head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 14px; }
.reels-strip__head h2 { font-family: var(--font-serif); font-size: clamp(20px, 2.4vw, 28px); font-weight: 800; margin: 0; letter-spacing: -0.012em; }
.reels-strip__head a { font-size: 12px; color: var(--secondary); font-weight: 700; }
.reels-strip__rail { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.reel-card {
    flex: 0 0 168px;
    aspect-ratio: 9 / 16;
    border-radius: 8px;
    background: linear-gradient(180deg, #2a1a1a 0%, #5d2d2d 100%);
    position: relative;
    overflow: hidden;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 220ms;
}
.reel-card:hover { transform: translateY(-2px); }
.reel-card--2 { background: linear-gradient(180deg, #1a2a3a 0%, #2d4d6d 100%); }
.reel-card--3 { background: linear-gradient(180deg, #3a2a1a 0%, #6d4d2d 100%); }
.reel-card--4 { background: linear-gradient(180deg, #1a3a2a 0%, #2d6d4d 100%); }
.reel-card--5 { background: linear-gradient(180deg, #3a1a3a 0%, #6d2d6d 100%); }
.reel-card--6 { background: linear-gradient(180deg, #2a3a1a 0%, #5d6d2d 100%); }
.reel-card--empty {
    flex-basis: min(420px, 88vw);
    aspect-ratio: 16 / 7;
    background:
        radial-gradient(circle at 18% 16%, rgba(193, 18, 31, .34), transparent 30%),
        linear-gradient(135deg, #151515 0%, #303030 100%);
    border: 1px dashed color-mix(in srgb, #fff 30%, transparent);
}
.reel-card__media { position: absolute; inset: 0; background-size: cover; background-position: center; }
.reel-card__media::after { content: ""; position: absolute; inset: 50% 0 0 0; background: linear-gradient(to bottom, transparent, rgba(0,0,0,.7)); }
.reel-card__tag {
    position: absolute; top: 8px; left: 8px;
    padding: 3px 8px;
    background: rgba(0,0,0,0.55);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-radius: 3px;
    z-index: 2;
}
.reel-card__title {
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 4px;
    text-wrap: balance;
    position: relative;
    z-index: 2;
}
.reel-card__meta {
    font-size: 10px; opacity: 0.85;
    display: flex; gap: 8px;
    position: relative; z-index: 2;
}
.reel-card__play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0.7; z-index: 1; }
.reel-card__play svg { width: 36px; height: 36px; color: #fff; }

@media (max-width: 639px) {
    .reel-card { flex: 0 0 140px; padding: 8px; }
    .reel-card__title { font-size: 12px; }
}

/* ── Source crests ───────────────────────────────────────────────────── */
.crest-stack { display: inline-flex; gap: 4px; }
.crest {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--surface-container-low, #f3f3f3);
    border: 1px solid var(--outline-variant, #e8e3dc);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--on-surface-variant, #3f3a3b);
}
.crest--more { background: var(--on-surface, #14171a); color: var(--paper, #fff); border-color: var(--on-surface, #14171a); }

/* ── Dossier-style investigation cards ──────────────────────────────── */
.dossier-card {
    background: var(--paper, #fff);
    border: 1px solid var(--outline-variant, #e8e3dc);
    border-left: 4px solid var(--secondary, #b7221e);
    border-radius: 0 8px 8px 0;
    padding: 18px 20px;
    transition: transform 200ms, box-shadow 200ms;
}
.dossier-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(15,15,15,0.06);
}
.dossier-card--gold { border-left-color: #c8a45a; }
.dossier-card--blue { border-left-color: #1c4a8a; }
.dossier-card__caseno {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    color: var(--on-surface-variant, #3f3a3b);
    text-transform: uppercase;
    margin: 0 0 8px;
    font-weight: 700;
}
.dossier-card__title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.012em;
    margin: 0 0 10px;
    text-wrap: balance;
}
.dossier-card__title a { color: inherit; text-decoration: none; }
.dossier-card__title a:hover { color: var(--secondary, #b7221e); }
.dossier-card__lede {
    font-family: var(--font-serif);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--on-surface-variant, #3f3a3b);
    margin: 0 0 14px;
}
.dossier-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: 12px;
    color: var(--on-surface-variant, #3f3a3b);
}
.dossier-card__meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    background: var(--surface-container-low, #f3f3f3);
    border: 1px solid var(--outline-variant, #e8e3dc);
    border-radius: 999px;
}
.dossier-card__meta-chip svg { width: 11px; height: 11px; }

/* ── Classification stamps (extends the existing badge family) ─────── */
.stamp {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    line-height: 1;
}
.stamp--reported       { background: #0d0d0f; color: #d6c89c; }
.stamp--investigation  { background: var(--secondary, #b7221e); color: #fff; }
.stamp--osint          { background: #1c2e4a; color: #9bd4ff; }
.stamp--verified       { background: #0d3b2c; color: #8de4be; }
.stamp--analysis       { background: #3d2e10; color: #f0c876; }
.stamp--breaking       { background: var(--secondary, #b7221e); color: #fff; animation: live-pulse 1.8s ease infinite; }
.stamp--exclusive      { background: #3d143d; color: #ffb0e8; }
.stamp--developing     { background: var(--surface-container-low, #f3f3f3); color: var(--on-surface, #14171a); border: 1px solid var(--outline-variant, #e8e3dc); }

/* ── Hero layout glue (lead + intel wire on the home) ──────────────── */
.t-front-grid--with-wire {
    display: grid !important;
    grid-template-columns: minmax(0, 1.4fr) minmax(380px, 1fr);
    gap: 24px;
    align-items: stretch;
}
@media (max-width: 1023px) {
    .t-front-grid--with-wire { grid-template-columns: 1fr !important; }
}
.t-front-grid--with-wire > .t-lead-copy { padding: 4px 0 0; min-width: 0; }
.t-front-grid--with-wire > .intel-wire-slot { display: flex; flex-direction: column; min-width: 0; }
.t-front-grid--with-wire > .intel-wire-slot > .intel-wire { flex: 1; }

/* ── Topbar Intel pill (small upgrade) ─────────────────────────────── */
.topbar__intel-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    background: var(--intel-bg);
    color: var(--intel-accent);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border-radius: 3px;
    text-decoration: none;
    border: 1px solid var(--intel-line);
}
.topbar__intel-pill::before {
    content: "";
    width: 6px; height: 6px;
    background: var(--intel-led);
    border-radius: 50%;
    animation: intel-blink 1.4s ease infinite;
}
.topbar__intel-pill:hover { color: #fff; border-color: var(--intel-accent); }

@keyframes live-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.65; }
}

@media (prefers-reduced-motion: reduce) {
    .intel-wire__led, .topbar__intel-pill::before, .stamp--breaking, .reel-card { animation: none !important; transition: none !important; }
}


/* ============================================================================
   DEEP CLEANUP v3 — z-index hierarchy, dark mode, overlap fixes (2026-04-26)
   ============================================================================ */

/* --- Canonical z-index scale --------------------------------------- */
:root {
    --z-base:           1;
    --z-overlay-glow:   2;
    --z-rail:           45;
    --z-injection:      35;
    --z-progress:       49;
    --z-topbar:         50;
    --z-bottomnav:      55;
    --z-briefing:       60;
    --z-drawer-back:    900;
    --z-drawer:         910;
    --z-toast:          950;
}
.reading-progress       { z-index: var(--z-progress) !important; }
.topbar                 { z-index: var(--z-topbar) !important; }
.rail                   { z-index: var(--z-rail) !important; }
.live-injection         { z-index: var(--z-injection) !important; }
.bottom-nav             { z-index: var(--z-bottomnav) !important; }
.live-briefing-player   { z-index: var(--z-briefing) !important; }
.drawer-backdrop        { z-index: var(--z-drawer-back) !important; }
.drawer, #primary-drawer{ z-index: var(--z-drawer) !important; }
.live-toasts, .ops-toasts { z-index: var(--z-toast) !important; }
[id*="claude-agent-glow"], [class*="claude-agent-glow"] {
    z-index: var(--z-overlay-glow) !important;
    pointer-events: none !important;
}

/* --- Drawer guards (idempotent) ----------------------------------- */
.drawer-backdrop[aria-hidden="true"],
.drawer-backdrop:not([aria-hidden="false"]) {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}
.drawer[aria-hidden="true"],
#primary-drawer[aria-hidden="true"] { pointer-events: none !important; }
.drawer-backdrop[aria-hidden="false"] {
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

/* --- Live page header + spacing correctness ----------------------- */
body.template-live.has-shell { padding-top: var(--topbar-h, 68px) !important; }
.template-live .live-feed__header { margin-top: 18px; padding-top: 28px; }
@media (max-width: 639px) {
    .template-live .live-feed__header { padding-top: 20px; }
}
.template-live .live-engage-bar { margin: 14px 0 18px !important; align-items: center; }
.template-live .live-filter-chips { margin: 10px 0 18px !important; }
.template-live .rail { top: var(--topbar-h, 68px) !important; }

/* --- Briefing player never collides with bottom nav -------------- */
@media (max-width: 959px) {
    .live-briefing-player {
        bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 12px) !important;
        left: 12px !important; right: 12px !important;
        width: auto !important; max-width: calc(100vw - 24px) !important;
        transform: none !important;
    }
}
@media (min-width: 960px) {
    .live-briefing-player {
        bottom: 18px !important; left: 24px !important; right: auto !important;
        width: min(430px, calc(100vw - 48px)) !important; transform: none !important;
    }
}

/* --- Live injection banner sits inside feed, never under page chrome ----- */
.live-injection {
    position: static !important;
    top: auto !important;
    margin-left: auto !important; margin-right: auto !important;
}

/* --- Topbar tightening ------------------------------------------- */
@media (max-width: 1280px) { .topbar__search { flex: 0 1 220px; } }
@media (max-width: 1100px) {
    .topbar__search { display: none !important; }
    .topbar__mobile-search { display: inline-flex !important; }
}

/* --- Comments tray must NOT escape its post card ---------------- */
.live-update .live-comments { max-width: 100%; box-sizing: border-box; }


/* ── DARK MODE ─────────────────────────────────────────────────────── */

/* Theme toggle button (shown next to brand in topbar) */
.theme-toggle {
    width: 36px; height: 36px; border-radius: 50%;
    background: transparent; border: 0; color: var(--on-surface-variant);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background-color 140ms, color 140ms;
}
.theme-toggle:hover { background: var(--surface-container, #eaeae8); color: var(--on-surface); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: inline; }
html[data-theme="dark"] .theme-toggle .icon-sun  { display: inline; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Token expansion — fill in surfaces the existing dark block missed */
html[data-theme="dark"] {
    --paper:                  #0e1014;
    --paper-alt:              #15171c;
    --bg:                     #07080a;
    --hairline:               #2a2d33;
    --hairline-strong:        #3a3e45;
    --term-red:               #fe5649;
    --link-color:             #8eb0ee;
    --link-color-visited:     #c1a3eb;
    --skeleton-base:          #1f1f23;
    --skeleton-shine:         #2a2a2f;
    color-scheme: dark;
}
html[data-theme="dark"] body { background: var(--surface, #07080a) !important; color: var(--on-surface, #f3f0ec) !important; }
html[data-theme="dark"] .topbar {
    background: color-mix(in srgb, var(--paper, #0e1014) 92%, transparent) !important;
    border-bottom-color: var(--hairline, #2a2d33) !important;
}
html[data-theme="dark"] .topbar__brand-name { color: var(--on-surface, #f3f0ec) !important; }
html[data-theme="dark"] .topbar__nav a { color: var(--on-surface-variant, #c9c3bd) !important; }
html[data-theme="dark"] .topbar__nav a:hover,
html[data-theme="dark"] .topbar__nav a.is-active { color: var(--secondary, #fe5649) !important; }
html[data-theme="dark"] .topbar__search input {
    background: var(--paper-alt, #15171c) !important;
    border: 1px solid var(--hairline, #2a2d33) !important;
    color: var(--on-surface) !important;
}
html[data-theme="dark"] .topbar__staff:hover,
html[data-theme="dark"] .topbar__menu:hover { background: var(--surface-container, #1f1f23); }

html[data-theme="dark"] .rail {
    background: var(--paper, #0e1014) !important;
    border-bottom-color: var(--hairline, #2a2d33) !important;
}
html[data-theme="dark"] .rail__item { color: var(--on-surface-variant); }
html[data-theme="dark"] .rail__item.is-active {
    background: var(--on-surface, #f3f0ec) !important;
    color: var(--paper, #0e1014) !important;
}

html[data-theme="dark"] .drawer {
    background: var(--paper-alt, #15171c) !important;
    color: var(--on-surface) !important;
    border-right: 1px solid var(--hairline, #2a2d33) !important;
}
html[data-theme="dark"] .drawer__nav a { color: var(--on-surface-variant); }
html[data-theme="dark"] .drawer__nav a:hover { background: var(--surface-container); color: var(--on-surface); }
html[data-theme="dark"] .drawer-backdrop[aria-hidden="false"] { background: rgba(0,0,0,0.6) !important; }

html[data-theme="dark"] .site-footer {
    background: var(--paper, #0e1014) !important;
    border-top: 1px solid var(--hairline, #2a2d33);
    color: var(--on-surface-variant);
}
html[data-theme="dark"] .site-footer__nav a { color: var(--on-surface-variant); }
html[data-theme="dark"] .site-footer__nav a:hover { color: var(--on-surface); }

html[data-theme="dark"] .bottom-nav {
    background: #000 !important;
    border-top-color: var(--hairline, #2a2d33) !important;
}

html[data-theme="dark"] .article-body,
html[data-theme="dark"] .article-detail,
html[data-theme="dark"] .live-update__body { color: var(--on-surface, #f3f0ec) !important; }

html[data-theme="dark"] blockquote, html[data-theme="dark"] .article-body blockquote {
    background: var(--paper-alt, #15171c);
    border-left-color: var(--secondary, #fe5649);
}
html[data-theme="dark"] code, html[data-theme="dark"] .article-body code {
    background: var(--paper-alt, #15171c); color: #fbb1ae;
}
html[data-theme="dark"] pre, html[data-theme="dark"] .article-body pre {
    background: #000; color: #f1f1f1; border: 1px solid var(--hairline, #2a2d33);
}

html[data-theme="dark"] .live-update__content,
html[data-theme="dark"] .live-package,
html[data-theme="dark"] .key-developments,
html[data-theme="dark"] .key-developments--side {
    background: var(--paper-alt, #15171c) !important;
    border-color: var(--hairline, #2a2d33) !important;
    color: var(--on-surface) !important;
}
html[data-theme="dark"] .live-feed__title,
html[data-theme="dark"] .live-update__title { color: var(--on-surface) !important; }
html[data-theme="dark"] .live-feed__lede { color: var(--on-surface-variant); }
html[data-theme="dark"] .live-feed { background-image: linear-gradient(to bottom, var(--hairline-strong, #3a3e45), var(--hairline-strong, #3a3e45)) !important; }
html[data-theme="dark"] .live-update::before {
    background: var(--paper-alt, #15171c) !important;
    border-color: var(--secondary, #fe5649) !important;
    box-shadow: 0 0 0 3px var(--surface, #07080a) !important;
}

html[data-theme="dark"] .live-comments {
    background: var(--paper, #0e1014) !important;
    border-color: var(--hairline, #2a2d33) !important;
}
html[data-theme="dark"] .live-comments__form input,
html[data-theme="dark"] .live-comments__form textarea {
    background: var(--paper-alt, #15171c) !important;
    border-color: var(--hairline-strong, #3a3e45) !important;
    color: var(--on-surface) !important;
}
html[data-theme="dark"] .live-react,
html[data-theme="dark"] .live-act {
    border-color: var(--hairline-strong, #3a3e45);
    color: var(--on-surface-variant);
}
html[data-theme="dark"] .live-react:hover,
html[data-theme="dark"] .live-act:hover { border-color: var(--on-surface-variant); color: var(--on-surface); }
html[data-theme="dark"] .live-filter-chip {
    border-color: var(--hairline-strong, #3a3e45);
    color: var(--on-surface-variant);
}
html[data-theme="dark"] .live-filter-chip.is-active {
    background: var(--on-surface, #f3f0ec) !important;
    color: var(--paper, #0e1014) !important;
    border-color: var(--on-surface, #f3f0ec) !important;
}
html[data-theme="dark"] [data-live-subscribe] {
    background: var(--paper-alt, #15171c);
    color: var(--on-surface);
    border: 1px solid var(--hairline-strong, #3a3e45);
}

html[data-theme="dark"] .t-lead-copy__title,
html[data-theme="dark"] .t-quickline__item h3,
html[data-theme="dark"] .t-home-briefs__item h3,
html[data-theme="dark"] .t-home-live__title { color: var(--on-surface) !important; }
html[data-theme="dark"] .t-home-live,
html[data-theme="dark"] .t-home-briefs,
html[data-theme="dark"] .t-home-video {
    background: var(--paper-alt, #15171c) !important;
    border-color: var(--hairline, #2a2d33) !important;
}
html[data-theme="dark"] .section-feature,
html[data-theme="dark"] .section-feature__body,
html[data-theme="dark"] .section-feature > * { background: var(--paper-alt, #15171c) !important; }
html[data-theme="dark"] .story-row { border-color: var(--hairline, #2a2d33); }
html[data-theme="dark"] .ticker { background: var(--paper-alt, #15171c) !important; color: var(--on-surface) !important; }

html[data-theme="dark"] .dossier-card {
    background: var(--paper-alt, #15171c) !important;
    color: var(--on-surface) !important;
}
html[data-theme="dark"] .dossier-card__caseno,
html[data-theme="dark"] .dossier-card__lede { color: var(--on-surface-variant); }
html[data-theme="dark"] .dossier-card__meta-chip {
    background: var(--paper, #0e1014); border-color: var(--hairline, #2a2d33); color: var(--on-surface-variant);
}
html[data-theme="dark"] .crest {
    background: var(--paper, #0e1014); border-color: var(--hairline, #2a2d33); color: var(--on-surface-variant);
}

html[data-theme="dark"] ::selection { background: var(--secondary, #fe5649); color: #000; }

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: var(--paper-alt, #15171c) !important;
    border-color: var(--hairline-strong, #3a3e45) !important;
    color: var(--on-surface, #f3f0ec) !important;
}
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
    border-color: var(--secondary, #fe5649) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--secondary, #fe5649) 24%, transparent) !important;
}

/* === end deep cleanup v3 === */

/* BRIEFS TICKER + /briefs/ PAGE — 2026-04-26 */

/* Top horizontal ticker (between topbar & content) */
.briefs {
    display: flex;
    align-items: stretch;
    background: var(--paper, #fff);
    border-bottom: 1px solid var(--hairline);
    overflow: hidden;
    height: 38px;
}
.briefs__label {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    background: #0d0d0f;
    color: var(--gold);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.briefs__live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--brand);
    border-radius: 50%;
    animation: pulse 1.6s ease infinite;
}
.briefs__track {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    background: var(--paper, #fff);
}
.briefs__strip {
    display: flex;
    gap: 32px;
    padding-left: 16px;
    white-space: nowrap;
    animation: tick 80s linear infinite;
    font-family: var(--sans);
    font-size: 13px;
    line-height: 1;
}
.briefs__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.briefs__flag {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .1em;
    padding: 2px 6px;
    border-radius: 2px;
    background: var(--paper-2);
    color: var(--ink-2);
    border: 1px solid var(--hairline);
}
.briefs__flag.ke { background: #0d3b2c; color: #8de4be; border-color: #1d6b48; }
.briefs__flag.af { background: #3d2e10; color: #f0c876; border-color: #5d4825; }
.briefs__flag.world { background: #1c2e4a; color: #9bd4ff; border-color: #1c4a8a; }
.briefs__flag.us { background: #3d143d; color: #ffb0e8; border-color: #5d2050; }
.briefs__flag.eu { background: #1c3a4a; color: #9bd4ff; border-color: #1c5a8a; }
.briefs__flag.asia { background: #2d1c3d; color: #e8a6ff; border-color: #4d2050; }
.briefs__flag.me { background: #3d2210; color: #ffb876; border-color: #5d3825; }
.briefs__flag.markets { background: #0d2d3d; color: #8dd4ff; border-color: #1d5d8a; }
.briefs__flag.sport { background: #3d0d1d; color: #ff8d8d; border-color: #5d1d2d; }
.briefs__src {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--ink-3);
    font-weight: 700;
}
.briefs__txt {
    color: var(--ink);
    font-weight: 500;
}
.briefs__sep {
    color: var(--hairline-2);
}
@keyframes tick {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
.briefs__ctrl {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    background: var(--paper, #fff);
    border-left: 1px solid var(--hairline);
    color: var(--ink-3);
}
.briefs__ctrl button {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Dark mode — briefs ticker */
html[data-theme="dark"] .briefs {
    background: var(--paper, #09090b);
    border-bottom-color: var(--outline-variant, #27272a);
}
html[data-theme="dark"] .briefs__label {
    background: #020203;
}
html[data-theme="dark"] .briefs__track,
html[data-theme="dark"] .briefs__ctrl {
    background: var(--paper, #09090b);
}
html[data-theme="dark"] .briefs__ctrl {
    border-left-color: var(--outline-variant, #27272a);
}
html[data-theme="dark"] .briefs__txt {
    color: var(--on-surface, #f3f0ec);
}
html[data-theme="dark"] .briefs__flag {
    background: var(--surface-container, #18181b);
    border-color: var(--outline-variant, #27272a);
    color: var(--on-surface-variant, #c9c3bd);
}

/* Standalone /briefs/ page */
.briefs-page {
    padding: 28px;
}
.briefs-page__head {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--hairline);
    margin-bottom: 18px;
}
.briefs-page__head h1 {
    font-family: var(--serif);
    font-size: 36px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -.018em;
}
.briefs-page__head .live-meta {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-3);
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.briefs-page__head .live-meta::before {
    content: "";
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(34,197,94,.18);
    animation: pulse 1.6s ease infinite;
}
.briefs-page__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 18px;
}
.briefs-filter-btn {
    padding: 7px 14px;
    background: transparent;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-2);
    font-weight: 700;
    cursor: pointer;
}
.briefs-filter-btn.is-active {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}

.briefs-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    border: 1px solid var(--hairline);
    border-radius: 10px;
    overflow: hidden;
}
.briefs-feed__row {
    display: grid;
    grid-template-columns: 76px 64px 1fr 110px;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--hairline);
    align-items: baseline;
}
.briefs-feed__row:last-child {
    border-bottom: 0;
}
.briefs-feed__row:hover {
    background: var(--paper-2);
}
.briefs-feed__time {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-3);
}
.briefs-feed__flag {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    padding: 3px 7px;
    border-radius: 3px;
    text-align: center;
}
.briefs-feed__flag.ke { background: #0d3b2c; color: #8de4be; }
.briefs-feed__flag.af { background: #3d2e10; color: #f0c876; }
.briefs-feed__flag.world { background: #1c2e4a; color: #9bd4ff; }
.briefs-feed__flag.us { background: #3d143d; color: #ffb0e8; }
.briefs-feed__flag.eu { background: #1c3a4a; color: #9bd4ff; }
.briefs-feed__flag.asia { background: #2d1c3d; color: #e8a6ff; }
.briefs-feed__flag.me { background: #3d2210; color: #ffb876; }
.briefs-feed__flag.markets { background: #0d2d3d; color: #8dd4ff; }
.briefs-feed__flag.sport { background: #3d0d1d; color: #ff8d8d; }
.briefs-feed__txt {
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.45;
    color: var(--ink);
}
.briefs-feed__txt a {
    color: inherit;
    text-decoration: underline;
}
.briefs-feed__txt strong {
    font-weight: 700;
}
.briefs-feed__src {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-3);
    text-align: right;
    font-weight: 700;
}
.briefs-feed__empty {
    padding: 28px 18px;
    text-align: center;
    color: var(--ink-3);
}

@media (max-width: 700px) {
    .briefs-feed__row {
        grid-template-columns: 50px 1fr;
        gap: 8px;
        padding: 12px 14px;
    }
    .briefs-feed__flag,
    .briefs-feed__src {
        display: none;
    }
    .briefs-feed__txt {
        font-size: 15px;
    }
}

/* === INVESTIGATIONS — /investigations/ dossier room === */
.template-investigations .dossier-header {
    max-width: 1100px; margin: 0 auto; padding: 36px 22px 22px;
    border-bottom: 1px solid var(--outline-variant);
}
.dossier-header__eyebrow {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
    color: var(--secondary, #b7221e); font-weight: 700; margin: 0 0 8px;
}
.dossier-header__title {
    font-family: var(--font-serif); font-size: clamp(36px, 5vw, 56px);
    font-weight: 800; letter-spacing: -.018em; line-height: 1.04;
    margin: 0 0 14px; max-width: 22ch;
}
.dossier-header__lede {
    font-family: var(--font-serif); font-size: 18px; line-height: 1.55;
    color: var(--on-surface-variant); margin: 0 0 14px; max-width: 64ch;
}
.dossier-header__counts {
    font-family: ui-monospace, monospace; font-size: 12px;
    letter-spacing: .14em; text-transform: uppercase; color: var(--on-surface-variant);
}
.dossier-header__counts strong { color: var(--on-surface); font-weight: 800; font-variant-numeric: tabular-nums; }
.dossier-grid {
    max-width: 1100px; margin: 0 auto; padding: 24px 22px 60px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
@media (max-width: 768px) { .dossier-grid { grid-template-columns: 1fr; } }

/* ============================================================================
   FRONT PAGE ALIGNMENT — match mockups/site-complete.html, light-first (2026-04-26)
   ============================================================================ */

html:not([data-theme="dark"]) {
    color-scheme: light;
}

html:not([data-theme="dark"]) body.template-homepage {
    background: color-mix(in srgb, var(--paper, #fff) 78%, #e9dfcf) !important;
    color: var(--on-surface, #14171a) !important;
}

.topbar__intel-pill,
.topbar__live-chip {
    flex: 0 0 auto;
}

.topbar__live-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 32px;
    padding: 4px 10px;
    border-radius: 3px;
    background: var(--secondary, #b7221e);
    color: #fff;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-decoration: none;
}

.topbar__live-chip .live-dot {
    width: 6px;
    height: 6px;
    background: #fff;
}

@media (max-width: 1080px) {
    .topbar__intel-pill { display: none; }
}

@media (max-width: 760px) {
    .topbar__live-chip { display: inline-flex; }
}

/* Keep the Intel Wire as a deliberate dark terminal object in both themes. */
.template-homepage .intel-wire-slot > .intel-wire {
    --intel-bg: #15130f !important;
    --intel-surface: #1d1a15 !important;
    --intel-line: #3a342b !important;
    --intel-row-alt: #1a1712 !important;
    --intel-text: #eee5d4 !important;
    --intel-text-2: #c5bba8 !important;
    --intel-mute: #8a7f70 !important;
    --intel-accent: #d8b96f !important;
    background: var(--intel-bg) !important;
    color: var(--intel-text) !important;
    border-color: var(--intel-line) !important;
    border-radius: 8px !important;
    min-height: 420px !important;
    max-height: 520px !important;
    box-shadow: 0 16px 36px rgba(21, 19, 15, 0.12), 0 0 0 1px rgba(255,255,255,0.04) inset !important;
}

.template-homepage .intel-wire-slot .intel-wire__bar,
.template-homepage .intel-wire-slot .intel-wire__ticker {
    background: var(--intel-surface) !important;
    color: var(--intel-mute) !important;
}

.template-homepage .intel-wire-slot .intel-row {
    border-color: #0e1015 !important;
}

.template-homepage .intel-wire-slot .intel-row:nth-child(odd) {
    background: var(--intel-row-alt) !important;
}

.template-homepage .intel-wire-slot .intel-row__txt {
    color: var(--intel-text) !important;
}

/* Light mode cleanup: only the terminal/live widgets may be dark. */
html:not([data-theme="dark"]) .template-homepage .t-home {
    background: transparent !important;
}

html:not([data-theme="dark"]) .template-homepage .t-lane,
html:not([data-theme="dark"]) .template-homepage .t-home-cluster,
html:not([data-theme="dark"]) .template-homepage .t-invest__card,
html:not([data-theme="dark"]) .template-homepage .t-feature-card,
html:not([data-theme="dark"]) .template-homepage .t-beat,
html:not([data-theme="dark"]) .template-homepage .t-entity,
html:not([data-theme="dark"]) .template-homepage .t-ledger,
html:not([data-theme="dark"]) .template-homepage .t-row,
html:not([data-theme="dark"]) .template-homepage .t-home-briefs,
html:not([data-theme="dark"]) .template-homepage .t-home-video,
html:not([data-theme="dark"]) .template-homepage .t-wire-radar {
    background: var(--paper, #fff) !important;
    color: var(--on-surface, #14171a) !important;
    border-color: var(--outline-variant, #e8e3dc) !important;
}

html:not([data-theme="dark"]) .template-homepage .t-invest__title a,
html:not([data-theme="dark"]) .template-homepage .t-row__headline a,
html:not([data-theme="dark"]) .template-homepage .t-beat__list a,
html:not([data-theme="dark"]) .template-homepage .t-home-briefs__item h3 a,
html:not([data-theme="dark"]) .template-homepage .t-quickline__item h3 a,
html:not([data-theme="dark"]) .template-homepage .t-lane__head h2,
html:not([data-theme="dark"]) .template-homepage .t-row__headline,
html:not([data-theme="dark"]) .template-homepage .t-invest__title {
    color: var(--on-surface, #14171a) !important;
}

html:not([data-theme="dark"]) .template-homepage .t-invest__brief,
html:not([data-theme="dark"]) .template-homepage .t-row__snippet,
html:not([data-theme="dark"]) .template-homepage .t-invest__meta,
html:not([data-theme="dark"]) .template-homepage .t-row__byline,
html:not([data-theme="dark"]) .template-homepage .t-row__time,
html:not([data-theme="dark"]) .template-homepage .t-entity__type {
    color: var(--on-surface-variant, #4c4546) !important;
}

html:not([data-theme="dark"]) .template-homepage .t-ledger__head,
html:not([data-theme="dark"]) .template-homepage .t-row,
html:not([data-theme="dark"]) .template-homepage .t-beat__bar,
html:not([data-theme="dark"]) .template-homepage .t-invest__card,
html:not([data-theme="dark"]) .template-homepage .t-home-cluster,
html:not([data-theme="dark"]) .template-homepage .t-lane__head {
    border-color: var(--outline-variant, #e8e3dc) !important;
}

.template-homepage .t-invest {
    gap: 1px;
    background: var(--outline-variant, #e8e3dc);
    border: 1px solid var(--outline-variant, #e8e3dc);
}

.template-homepage .t-invest__card,
.template-homepage .t-feature-card {
    border: 0 !important;
    border-radius: 0 !important;
    min-height: 100%;
}

.template-homepage .t-beats {
    gap: 1px !important;
    background: var(--outline-variant, #e8e3dc);
    border: 1px solid var(--outline-variant, #e8e3dc);
}

.template-homepage .t-beat {
    border: 0 !important;
    border-radius: 0 !important;
}

.template-homepage .t-ledger {
    border-radius: 0 !important;
}

.template-homepage .t-row {
    border-radius: 0 !important;
}

.template-homepage .t-row__thumb,
.template-homepage .t-mini-thumb,
.template-homepage .t-wire-radar__thumb {
    background: color-mix(in srgb, var(--paper, #fff) 86%, #e9dfcf) !important;
}

.template-homepage .t-row__thumb.is-broken,
.template-homepage .t-mini-thumb.is-broken,
.template-homepage .t-wire-radar__thumb.is-broken {
    display: none !important;
}

.template-homepage .t-home-video:not(:has(img)) .t-home-video__media,
.template-homepage .t-home-video:not(:has(.t-home-video__title)) {
    display: none !important;
}

@media (max-width: 760px) {
    .template-homepage .t-front-main {
        order: 1 !important;
    }

    .template-homepage .intel-wire-slot {
        display: block !important;
        order: 2 !important;
    }

    .template-homepage .t-front-stack {
        order: 3 !important;
    }

    .template-homepage .intel-wire-slot > .intel-wire {
        min-height: 310px !important;
        max-height: 420px !important;
    }
    .template-homepage .intel-wire-slot .intel-row {
        grid-template-columns: 46px minmax(0, 1fr) auto !important;
    }
    .template-homepage .t-wire-radar {
        display: none !important;
    }
}

/* ============================================================================
   HOME MOCK ALIGNMENT — remove duplicate chrome and tighten the Kenya Wire hero
   ============================================================================ */
.template-homepage .rail--live {
    display: none !important;
}

.template-homepage .topbar__nav {
    gap: clamp(12px, 1.45vw, 24px);
}

.template-homepage .kw:has(.kw__item.kw__empty:only-child) {
    min-height: 180px;
    max-height: 220px;
}

.kw__empty {
    min-height: 96px;
    display: grid;
    align-items: center;
}

@media (max-width: 760px) {
    .template-homepage .t-front-grid--3live {
        margin-top: 8px;
    }

    .template-homepage .kw {
        min-height: 300px;
        max-height: 390px;
    }

    .template-homepage .kw:has(.kw__item.kw__empty:only-child) {
        min-height: 150px;
        max-height: 180px;
    }
}

/* ============================================================================
   HOME LOWER-FEED STABILIZATION — no more skinny headlines / dead whitespace
   ============================================================================ */
.template-homepage .t-home-cluster .t-row,
.template-homepage .t-long-tail .t-row {
    grid-template-columns: 92px minmax(0, 1fr) !important;
    gap: 18px !important;
    min-height: 0 !important;
    padding: 16px 20px !important;
}

.template-homepage .t-home-cluster .t-row.has-thumb,
.template-homepage .t-long-tail .t-row.has-thumb {
    grid-template-columns: 92px 96px minmax(0, 1fr) !important;
}

.template-homepage .t-home-cluster .t-row:has(.t-row__thumb:empty),
.template-homepage .t-home-cluster .t-row:has(.t-row__thumb.is-broken),
.template-homepage .t-long-tail .t-row:has(.t-row__thumb:empty),
.template-homepage .t-long-tail .t-row:has(.t-row__thumb.is-broken) {
    grid-template-columns: 92px minmax(0, 1fr) !important;
}

.template-homepage .t-home-cluster .t-row__thumb:empty,
.template-homepage .t-home-cluster .t-row__thumb.is-broken,
.template-homepage .t-long-tail .t-row__thumb:empty,
.template-homepage .t-long-tail .t-row__thumb.is-broken,
.template-homepage .t-home-briefs__item .t-mini-thumb:empty,
.template-homepage .t-home-briefs__item .t-mini-thumb.is-broken,
.template-homepage .t-quickline__item .t-mini-thumb:empty,
.template-homepage .t-quickline__item .t-mini-thumb.is-broken {
    display: none !important;
}

.template-homepage .t-home-cluster .t-row__body,
.template-homepage .t-long-tail .t-row__body {
    min-width: 0 !important;
    max-width: 840px !important;
}

.template-homepage .t-home-cluster .t-row__headline,
.template-homepage .t-long-tail .t-row__headline {
    font-size: clamp(18px, 1.55vw, 24px) !important;
    line-height: 1.14 !important;
    max-width: 38ch !important;
}

.template-homepage .t-home-cluster .t-row__snippet,
.template-homepage .t-long-tail .t-row__snippet {
    max-width: 62ch !important;
}

.template-homepage .t-home-cluster .t-row__instruments,
.template-homepage .t-long-tail .t-row__instruments {
    display: none !important;
}

.template-homepage .t-home-briefs__item.has-thumb:has(.t-mini-thumb:empty),
.template-homepage .t-home-briefs__item.has-thumb:has(.t-mini-thumb.is-broken),
.template-homepage .t-quickline__item.has-thumb:has(.t-mini-thumb:empty) {
    grid-template-columns: minmax(0, 1fr) !important;
}

@media (max-width: 720px) {
    .template-homepage .t-home-cluster .t-row,
    .template-homepage .t-home-cluster .t-row.has-thumb,
    .template-homepage .t-home-cluster .t-row:has(.t-row__thumb:empty),
    .template-homepage .t-home-cluster .t-row:has(.t-row__thumb.is-broken),
    .template-homepage .t-long-tail .t-row,
    .template-homepage .t-long-tail .t-row.has-thumb,
    .template-homepage .t-long-tail .t-row:has(.t-row__thumb:empty),
    .template-homepage .t-long-tail .t-row:has(.t-row__thumb.is-broken) {
        grid-template-columns: 1fr !important;
        padding: 15px 0 !important;
    }

    .template-homepage .t-home-cluster .t-row__time,
    .template-homepage .t-long-tail .t-row__time {
        display: flex !important;
        gap: 10px !important;
        align-items: baseline !important;
    }

    .template-homepage .t-home-cluster .t-row__headline,
    .template-homepage .t-long-tail .t-row__headline {
        max-width: 100% !important;
        font-size: 20px !important;
    }
}

/* Dark mode should be coherent: if chosen, the light-only modules go dark together. */
html[data-theme="dark"] .template-homepage .t-lane,
html[data-theme="dark"] .template-homepage .t-home-cluster,
html[data-theme="dark"] .template-homepage .t-invest__card,
html[data-theme="dark"] .template-homepage .t-feature-card,
html[data-theme="dark"] .template-homepage .t-beat,
html[data-theme="dark"] .template-homepage .t-entity,
html[data-theme="dark"] .template-homepage .t-ledger,
html[data-theme="dark"] .template-homepage .t-row,
html[data-theme="dark"] .template-homepage .t-home-briefs,
html[data-theme="dark"] .template-homepage .t-home-video,
html[data-theme="dark"] .template-homepage .t-wire-radar {
    background: var(--paper, #09090b) !important;
    color: var(--on-surface, #f3f0ec) !important;
    border-color: var(--outline-variant, #27272a) !important;
}

/* ============================================================================
   KENYA WIRE — vertical breaking-news feed for home hero — 2026-04-26
   ============================================================================ */
.kw {
    background: var(--paper, #fff);
    border: 1px solid var(--outline-variant, #e3ddd2);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 480px;
    max-height: 560px;
    box-shadow: 0 1px 0 rgba(15,15,15,.04), 0 6px 18px rgba(15,15,15,.04);
}
html[data-theme="dark"] .kw {
    background: var(--paper-alt, #15171c);
    border-color: var(--hairline, #2a2d33);
}

.kw__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--secondary, #b7221e);
    color: #fff;
    border-bottom: 1px solid #8c1815;
}
.kw__bar::before {
    content: "";
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.25);
    animation: live-pulse 1.6s ease infinite;
    flex-shrink: 0;
}
.kw__title {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 800;
}
.kw__count {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.08em;
}

.kw__sub {
    display: flex;
    gap: 0;
    background: #a01d1a;
    border-bottom: 1px solid #8c1815;
    overflow-x: auto;
    scrollbar-width: none;
}
.kw__sub::-webkit-scrollbar { display: none; }
.kw__sub-item {
    padding: 6px 12px;
    background: transparent;
    border: 0;
    border-right: 1px solid #8c1815;
    color: rgba(255,255,255,0.78);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
}
.kw__sub-item:hover { color: #fff; background: #8c1815; }
.kw__sub-item.is-active { background: var(--paper, #fff); color: var(--secondary, #b7221e); }

/* Dark mode — Kenya Wire sub-nav */
html[data-theme="dark"] .kw__sub {
    background: color-mix(in srgb, var(--secondary, #fe5649) 72%, #000);
    border-bottom-color: color-mix(in srgb, var(--secondary, #fe5649) 45%, #000);
}
html[data-theme="dark"] .kw__sub-item {
    border-right-color: color-mix(in srgb, var(--secondary, #fe5649) 45%, #000);
    color: rgba(255, 255, 255, 0.75);
}
html[data-theme="dark"] .kw__sub-item:hover {
    background: color-mix(in srgb, var(--secondary, #fe5649) 50%, #000);
    color: #fff;
}
html[data-theme="dark"] .kw__sub-item.is-active {
    background: var(--paper, #09090b);
    color: var(--secondary, #fe5649);
}

.kw__feed {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--outline-variant) transparent;
}

.kw__item {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--outline-variant, #e3ddd2);
    position: relative;
    transition: background-color 140ms;
}
.kw__item:hover { background: var(--surface-container-low, #f3f3f3); }
.kw__item:first-child {
    background: linear-gradient(180deg, #fff7ed 0%, var(--paper, #fff) 100%);
}
html[data-theme="dark"] .kw__item:first-child {
    background: linear-gradient(180deg, color-mix(in srgb, var(--secondary) 18%, var(--paper-alt)) 0%, var(--paper-alt, #15171c) 100%);
}

.kw__time {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--secondary, #b7221e);
    padding-top: 2px;
    line-height: 1.2;
}
.kw__time small {
    display: block;
    font-weight: 400;
    color: var(--on-surface-variant, #6b6663);
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 1px;
}

.kw__copy h4 {
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 4px;
    color: var(--on-surface, #14171a);
    text-wrap: balance;
}
.kw__copy h4 a { color: inherit; text-decoration: none; }
.kw__copy h4 a:hover { color: var(--secondary, #b7221e); text-decoration: underline; text-underline-offset: 2px; }

.kw__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--on-surface-variant, #6b6663);
    letter-spacing: 0.06em;
    margin-top: 3px;
    flex-wrap: wrap;
}
.kw__src {
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 5px;
    background: var(--surface-container-low, #f3f3f3);
    border: 1px solid var(--outline-variant, #e3ddd2);
    border-radius: 2px;
    color: var(--on-surface, #14171a);
}
html[data-theme="dark"] .kw__src {
    background: var(--paper, #0e1014);
    border-color: var(--hairline, #2a2d33);
    color: var(--on-surface-variant);
}

.kw__flag {
    margin-left: auto;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 1px 5px;
    border-radius: 2px;
    text-transform: uppercase;
}
.kw__flag.brk { background: var(--secondary, #b7221e); color: #fff; }
.kw__flag.dev { background: #fef3c7; color: #854d0e; }
.kw__flag.ver { background: #dcfce7; color: #14532d; }
html[data-theme="dark"] .kw__flag.dev { background: #3d2e10; color: #f0c876; }
html[data-theme="dark"] .kw__flag.ver { background: #0d3b2c; color: #8de4be; }

.kw__item--breaking {
    border-left: 3px solid var(--secondary, #b7221e);
    padding-left: 11px;
}
.kw__item--breaking::before {
    content: "BREAKING";
    position: absolute;
    top: 6px;
    right: 8px;
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--secondary, #b7221e);
    background: #fff;
    padding: 1px 4px;
    border-radius: 2px;
    border: 1px solid var(--secondary, #b7221e);
}
html[data-theme="dark"] .kw__item--breaking::before { background: var(--paper, #0e1014); }

.kw__foot {
    padding: 10px 14px;
    background: var(--surface-container-low, #f3f3f3);
    border-top: 1px solid var(--outline-variant, #e3ddd2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--on-surface-variant, #6b6663);
    letter-spacing: 0.08em;
}
.kw__foot a {
    color: var(--secondary, #b7221e);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-decoration: none;
}
.kw__foot a:hover { text-decoration: underline; }

.template-homepage .t-home-hero > .t-lane__head {
    display: flex !important;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--on-surface, #14171a);
}

.t-front-grid--3live {
    display: grid !important;
    grid-template-columns: minmax(300px, 1fr) minmax(360px, 1.15fr) minmax(280px, 0.9fr) !important;
    gap: 22px !important;
    align-items: stretch !important;
}
.t-front-grid--3live > * { min-width: 0; }
.t-front-grid--3live .intel-wire-slot > .intel-wire {
    min-height: 480px !important;
    max-height: 560px !important;
}
.t-front-grid--3live .t-front-stack {
    align-content: start;
    max-height: 560px;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--outline-variant) transparent;
}
.t-front-grid--3live .t-home-live {
    position: static !important;
    top: auto !important;
}

.t-lead-row {
    margin: 0 0 32px;
    padding: 24px 0;
    border-top: 1px solid var(--outline-variant);
    border-bottom: 1px solid var(--outline-variant);
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
    gap: 32px;
    align-items: start;
}
.t-lead-row__copy h1 {
    font-family: var(--font-serif);
    font-size: clamp(28px, 3.6vw, 44px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.018em;
    margin: 8px 0 14px;
    text-wrap: balance;
    max-width: 24ch;
}
.t-lead-row__copy h1 a { color: inherit; text-decoration: none; }
.t-lead-row__copy h1 a:hover { color: var(--secondary); }
.t-lead-row__lede {
    font-family: var(--font-serif);
    font-size: 18px;
    line-height: 1.55;
    color: var(--on-surface-variant);
    margin: 0 0 16px;
    max-width: 62ch;
}
.t-lead-row__media {
    aspect-ratio: 5 / 4;
    background: var(--surface-container-low);
    border-radius: 8px;
    overflow: hidden;
}
.t-lead-row__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.t-lead-row__media:not(:has(img)) {
    display: none;
}
@media (max-width: 1023px) {
    .t-front-grid--3live {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
    .t-lead-row {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

@media (max-width: 760px) {
    .template-homepage .t-front-grid--3live .intel-wire-slot {
        display: flex !important;
        order: 2 !important;
    }
    .template-homepage .t-front-grid--3live .t-front-stack {
        order: 3 !important;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }
    .t-front-grid--3live .kw {
        order: 1 !important;
        min-height: 360px;
        max-height: 460px;
    }
    .t-front-grid--3live .intel-wire-slot > .intel-wire {
        min-height: 320px !important;
        max-height: 420px !important;
    }
    .t-lead-row {
        padding: 18px 0;
    }
    .t-lead-row__copy h1 {
        font-size: clamp(30px, 9vw, 40px);
        max-width: 100%;
    }
}
