:root {
  color-scheme: dark;
  --bg: #030812;
  --panel: #081321;
  --panel-2: #0d1829;
  --line: rgba(120, 173, 204, .17);
  --line-hot: rgba(20, 226, 224, .46);
  --text: #edf8ff;
  --muted: #8fa3b6;
  --cyan: #13e5e1;
  --blue: #52a8ff;
  --pink: #f13d9b;
  --green: #20e59c;
  --amber: #ffc95d;
  --red: #ff5d7d;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* v15: evidence, chronology and user-controlled motion. */
.feed-tools,.feed-pager,.dialog-actions {display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:12px 0;}
.feed-tools button,.feed-pager button,.dialog-actions button,.related-stories button,.news-histogram button,.map-tooltip button {border:1px solid var(--line);background:#0b1b2c;color:var(--text);padding:10px 14px;border-radius:10px;cursor:pointer;min-height:42px;}
.feed-tools button[aria-pressed=true],.dialog-actions button[aria-pressed=true],.histogram-bars button[aria-pressed=true] {border-color:var(--cyan);background:#123c46;}
#new-items-button {background:var(--cyan);color:#001820;font-weight:800;}
.feed-pager {justify-content:center;color:var(--muted);}
.time-group {grid-column:1/-1;font-size:14px;color:var(--cyan);margin:20px 0 0;border-left:3px solid var(--cyan);padding:8px 14px;background:linear-gradient(90deg,#123047,transparent);}
.news-histogram {padding:18px;border:1px solid var(--line);border-radius:18px;margin-bottom:18px;background:linear-gradient(135deg,#102b3b,#0c1125);}
.news-histogram header {display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;}
.histogram-bars {display:flex;gap:4px;height:100px;align-items:stretch;margin-top:14px;}
.histogram-bars button {position:relative;padding:0;flex:1;min-width:0;border:0;border-radius:4px;overflow:hidden;background:#12263c;}
.histogram-bars i {position:absolute;inset:auto 0 0;background:linear-gradient(0deg,#5660d6,#33d8d6);min-height:3px;}
.histogram-bars span {position:relative;font:700 10px ui-monospace,monospace;text-shadow:0 1px 3px #000;}
.map-explanation {font-size:12px;color:var(--muted);max-width:850px;line-height:1.6;}
.map-hub-label {display:block;color:var(--amber);font:700 12px ui-monospace,monospace;margin:12px 0;}
.map-stage {background:radial-gradient(ellipse at 70% 40%,#10344b,#040b15 70%);}
.map-tooltip {pointer-events:auto!important;max-height:240px;overflow:auto;left:14px;top:14px;}
.map-tooltip button {display:block;width:100%;margin:4px 0;}
.map-legend {flex-wrap:wrap;}
.priority-orbit {display:grid;place-content:center;text-align:center;aspect-ratio:1;max-width:220px;margin:0 auto 16px;border-radius:50%;border:1px solid #61d9d77a;background:radial-gradient(circle,#143b52,#111c35 60%,#0b1829 61%);box-shadow:inset 0 0 34px #31d6c619;}
.priority-orbit strong {font:700 58px ui-monospace,monospace;color:var(--cyan);}
.priority-orbit small {font-size:16px;color:var(--muted);}
.priority-orbit span {font-size:12px;color:var(--muted);}
.priority-factors div {display:grid;grid-template-columns:1fr 70px 25px;gap:10px;align-items:center;padding:6px 0;font-size:12px;}
.priority-factors meter {width:70px;accent-color:var(--cyan);}
.signal-evidence {display:grid;gap:5px;border-left:2px solid var(--cyan);background:#102438;padding:12px;margin:10px 0;overflow-wrap:anywhere;}
.signal-evidence time {font-size:11px;color:var(--muted);}
.related-stories {display:grid;gap:8px;}
.related-stories button {text-align:left;font-size:13px;line-height:1.5;}
.dialog-main h3,.dialog-side h3 {margin-top:24px;font-size:15px;}
.dialog-side p {font-size:12px;line-height:1.6;color:var(--muted);}
.notification-panel select {max-width:170px;padding:9px;border:1px solid var(--line);border-radius:8px;background:#102237;color:var(--text);font:inherit;}
#terminal-settings {margin-top:20px;border-top:1px solid var(--line);padding-top:10px;}
#muted-sources {display:grid;gap:10px;padding:14px 0;max-height:260px;overflow:auto;}
#muted-sources label {display:flex;gap:10px;align-items:center;font-size:13px;}
#news-ticker-track button {white-space:nowrap;border:0;background:none;color:var(--text);font:inherit;cursor:pointer;padding:0 16px;}
#news-ticker-track button small {color:var(--muted);margin-left:14px;}
#news-ticker-track.is-moving {animation-duration:var(--news-ticker-rate,100s)!important;}
#news-ticker-track:focus-within,#news-ticker-track:hover,#market-ticker-track:hover {animation-play-state:paused!important;}
[data-ticker=off] #news-ticker-track,[data-ticker=off] #market-ticker-track {animation:none!important;transform:none!important;overflow:auto;}
[data-news-density=compact] .story-visual {height:120px;}
[data-news-density=compact] .story-body {padding:14px;}
[data-news-density=compact] .story-title {font-size:17px;}
[data-news-motion=off] *,[data-news-motion=reduced] * {animation:none!important;transition:none!important;scroll-behavior:auto!important;}
@media(max-width:600px){.histogram-bars{gap:2px;height:76px;}.histogram-bars span{font-size:8px;}.dialog-actions button{flex:1 1 42%;font-size:12px;}.priority-orbit{max-width:160px;}.map-stage{height:300px!important;}.map-explanation{font-size:11px;}.live-pill{letter-spacing:0;font-size:10px;padding:8px;} .notification-panel select{max-width:140px;} }

* { box-sizing: border-box; }
html { background: var(--bg); min-width: 0; }
body { margin: 0; min-width: 0; min-height: 100vh; overflow-x: hidden; background: radial-gradient(circle at 7% -10%, rgba(3, 229, 222, .12), transparent 27rem), radial-gradient(circle at 94% 15%, rgba(241, 61, 155, .08), transparent 24rem), var(--bg); color: var(--text); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 100; left: 1rem; top: -5rem; padding: .75rem 1rem; border-radius: 10px; background: var(--cyan); color: #001014; font-weight: 800; }
.skip-link:focus { top: 1rem; }
.terminal { min-height: 100vh; }

.terminal-header { min-height: 84px; display: grid; grid-template-columns: minmax(235px, 1.15fr) minmax(430px, 2fr) auto; gap: 20px; align-items: center; padding: 12px 22px; border-bottom: 1px solid var(--line); background: rgba(3, 8, 18, .94); backdrop-filter: blur(8px); }
.brand { min-width: 0; display: flex; align-items: center; gap: 13px; }
.brand-mark { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 17px; background: linear-gradient(145deg, #20e6df, #6b5df5 56%, #f42b91); box-shadow: 0 0 32px rgba(18, 226, 224, .18); color: white; font-size: 27px; font-weight: 900; }
.brand-copy { min-width: 0; display: grid; gap: 4px; }
.brand-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(17px, 1.9vw, 27px); letter-spacing: -.04em; }
.brand-copy em { color: var(--pink); font-style: normal; }
.brand-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8295aa; font: 700 9px/1.2 ui-monospace, monospace; letter-spacing: .24em; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(82px, 1fr)); gap: 9px; margin: 0; }
.metrics div { min-width: 0; padding: 9px 8px; border: 1px solid var(--line); border-radius: 14px; background: rgba(12, 21, 36, .8); text-align: center; }
.metrics dt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--cyan); font: 850 clamp(16px, 2vw, 23px)/1 ui-monospace, monospace; }
.metrics dd { margin: 5px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8292a7; font: 750 8px/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .14em; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; padding: 10px 15px; border: 1px solid rgba(32, 229, 156, .42); border-radius: 999px; background: rgba(0, 75, 50, .28); color: var(--green); font: 800 11px ui-monospace, monospace; letter-spacing: .18em; }
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }
.live-pill.is-stale { color: var(--amber); border-color: rgba(255, 201, 93, .4); background: rgba(94, 62, 7, .26); }
.live-pill.is-offline { color: var(--red); border-color: rgba(255, 93, 125, .4); background: rgba(94, 7, 30, .26); }
.icon-button { position: relative; display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); cursor: pointer; }
.icon-button:hover { border-color: var(--line-hot); transform: translateY(-1px); }
.icon-button b { position: absolute; right: -2px; top: -3px; min-width: 18px; padding: 3px; border-radius: 10px; background: var(--pink); color: white; font-size: 10px; }

.ticker-stack { border-bottom: 1px solid var(--line); background: #050b15; contain: layout paint; }
.ticker { position: relative; height: 31px; display: flex; align-items: center; overflow: hidden; border-bottom: 1px solid rgba(120,173,204,.09); color: #b8c8d8; font: 700 11px/31px ui-monospace, monospace; white-space: nowrap; }
.ticker:last-child { border-bottom: 0; }
.ticker-label { position: relative; z-index: 2; align-self: stretch; display: inline-flex; align-items: center; flex: none; min-width: 104px; padding: 0 14px; border-right: 1px solid var(--line); background: #081421; color: var(--cyan); font-size: 9px; letter-spacing: .13em; }
.ticker--market .ticker-label { color: var(--amber); }
#news-ticker-track, #market-ticker-track { display: inline-flex; align-items: center; gap: 44px; width: max-content; min-width: calc(100% - 104px); padding-left: 26px; transform: translate3d(0,0,0); will-change: transform; }
#news-ticker-track.is-moving { animation: ticker var(--ticker-duration, 88s) linear infinite; }
#market-ticker-track.is-moving { animation: ticker-reverse var(--ticker-duration, 102s) linear infinite; }
#news-ticker-track span, #market-ticker-track span { display: inline-flex; align-items: center; gap: 8px; }
#news-ticker-track span::before { content: "◆"; color: var(--ticker-color, var(--cyan)); }
#market-ticker-track span::before { content: "●"; color: var(--ticker-color, var(--amber)); font-size: 8px; }
.ticker .up { color: var(--green); }
.ticker .down { color: var(--red); }
@keyframes ticker { to { transform: translate3d(-50%, 0, 0); } }
@keyframes ticker-reverse { from { transform: translate3d(-50%, 0, 0); } to { transform: translate3d(0, 0, 0); } }

.command-bar { position: sticky; z-index: 12; top: 0; display: flex; align-items: center; gap: 11px; padding: 12px 18px 8px; background: rgba(3, 8, 18, .97); backdrop-filter: blur(7px); }
.mode-tabs, .time-tabs { display: flex; gap: 5px; }
.mode-tabs button, .time-tabs button, .category-tabs button, .refresh-button { min-height: 39px; border: 1px solid var(--line); border-radius: 999px; background: rgba(13, 24, 41, .88); color: #aebbd0; font-weight: 760; cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease; }
.mode-tabs button { padding: 0 15px; }
.time-tabs button { padding: 0 12px; }
.mode-tabs button:hover, .time-tabs button:hover, .category-tabs button:hover, .refresh-button:hover { border-color: var(--line-hot); color: white; }
.mode-tabs button.is-active, .time-tabs button.is-active, .category-tabs button.is-active { border-color: transparent; background: var(--cyan); color: #001417; box-shadow: 0 0 22px rgba(19, 229, 225, .14); }
.search { min-width: 160px; flex: 1; height: 41px; display: flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(13, 24, 41, .76); color: #6f8298; }
.search:focus-within { border-color: var(--line-hot); }
.search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.search input::placeholder { color: #64768b; }
.refresh-button { display: inline-flex; align-items: center; gap: 8px; padding: 0 15px; }
.refresh-button.is-loading span:first-child { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.category-tabs { position: sticky; z-index: 11; top: 59px; display: flex; gap: 7px; padding: 7px 18px 11px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); background: rgba(3, 8, 18, .97); }
.category-tabs::-webkit-scrollbar { display: none; }
.category-tabs button { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 0 13px; }
.category-tabs em { min-width: 21px; padding: 2px 5px; border-radius: 10px; background: rgba(0,0,0,.2); font-size: 10px; font-style: normal; }
.connection-strip { min-height: 37px; display: flex; align-items: center; gap: 9px; padding: 7px 20px; color: var(--muted); font-size: 12px; }
.connection-strip .status-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--amber); box-shadow: 0 0 9px currentColor; }
.connection-strip.is-ready .status-dot { background: var(--green); }
.connection-strip.is-error .status-dot { background: var(--red); }
.connection-strip time { margin-left: auto; font-variant-numeric: tabular-nums; }
.translation-state { padding: 3px 7px; border-radius: 7px; background: rgba(82,168,255,.1); color: #8ec8ff; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 14px; padding: 0 16px 24px; }
.content-pane { min-width: 0; }
.news-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.news-grid[data-view="timeline"] { display: block; }
.news-card { --card-accent: var(--cyan); position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(150deg, rgba(13, 24, 41, .97), rgba(6, 13, 24, .98)); content-visibility: auto; contain-intrinsic-size: 450px; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.news-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--card-accent), transparent 44%); box-shadow: 0 17px 45px rgba(0,0,0,.26); }
.news-card::before { content: ""; position: absolute; z-index: 2; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--cyan), var(--card-accent), var(--pink)); }
.story-visual { position: relative; height: 190px; overflow: hidden; background: #06121d; }
.story-visual img { width: 100%; height: 100%; display: block; object-fit: cover; opacity: .74; transition: transform .35s ease; }
.news-card:hover .story-visual img { transform: scale(1.025); }
.story-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(4,9,18,.9), transparent 64%); pointer-events: none; }
.story-visual.generated { --hue: 180; isolation: isolate; background: radial-gradient(circle at 70% 40%, hsla(var(--hue), 82%, 53%, .2), transparent 24%), linear-gradient(122deg, #071321, #061b23 55%, #090b18); }
.story-visual.generated::before { content: ""; position: absolute; width: 58%; aspect-ratio: 1; right: -7%; top: -30%; border: 1px solid hsla(var(--hue), 90%, 62%, .38); border-radius: 50%; box-shadow: 0 0 0 22px hsla(var(--hue), 90%, 55%, .035), 0 0 0 56px hsla(var(--hue), 90%, 55%, .025); }
.generated-line { position: absolute; z-index: 1; left: 8%; right: 8%; top: 52%; height: 42%; opacity: .8; background: linear-gradient(154deg, transparent 0 12%, hsla(var(--hue), 95%, 60%, .55) 12.5% 13%, transparent 13.5% 31%, hsla(var(--hue), 95%, 60%, .55) 31.5% 32%, transparent 32.5% 53%, hsla(var(--hue), 95%, 60%, .55) 53.5% 54%, transparent 54.5%); clip-path: polygon(0 68%, 15% 47%, 30% 57%, 46% 22%, 60% 43%, 78% 10%, 100% 52%, 100% 58%, 78% 16%, 60% 49%, 46% 28%, 30% 63%, 15% 53%, 0 74%); background: hsla(var(--hue), 96%, 59%, .64); filter: drop-shadow(0 0 8px hsla(var(--hue), 96%, 59%, .4)); }
.visual-badge { position: absolute; z-index: 3; left: 13px; top: 13px; max-width: calc(100% - 26px); padding: 5px 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(3,8,18,.72); backdrop-filter: blur(8px); color: #dffeff; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.visual-impact { position: absolute; z-index: 3; right: 13px; bottom: 12px; display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px; background: rgba(3,8,18,.76); font: 760 10px ui-monospace, monospace; }
.visual-impact i { width: 6px; height: 6px; border-radius: 50%; background: var(--card-accent); box-shadow: 0 0 9px var(--card-accent); }
.story-body { min-width: 0; padding: 15px; }
.story-meta { display: flex; align-items: center; gap: 7px; min-width: 0; margin-bottom: 9px; color: var(--cyan); font: 800 10px ui-monospace, monospace; text-transform: uppercase; }
.story-meta .source { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-meta time { flex: none; margin-left: auto; color: #899aaf; text-transform: none; }
.story-title { margin: 0; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere; font-size: clamp(17px, 1.6vw, 22px); line-height: 1.18; letter-spacing: -.022em; }
.story-summary { margin: 9px 0 0; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere; color: #a9b8cb; font-size: 13px; line-height: 1.48; }
.story-tags { min-height: 25px; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.story-tags span { max-width: 100%; padding: 4px 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid rgba(130,111,235,.32); border-radius: 8px; background: rgba(91,65,180,.12); color: #c9bcff; font: 700 10px ui-monospace, monospace; }
.story-footer { display: flex; align-items: center; gap: 10px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.impact-bar { min-width: 80px; flex: 1; height: 5px; overflow: hidden; border-radius: 99px; background: rgba(141,159,184,.13); }
.impact-bar i { display: block; width: var(--impact); height: 100%; background: linear-gradient(90deg, #526cff, var(--cyan), var(--card-accent)); }
.impact-value { color: #9aa9bd; font: 750 10px ui-monospace, monospace; }
.story-open { flex: none; border: 0; background: transparent; color: var(--cyan); font-weight: 850; cursor: pointer; }

.news-grid[data-view="timeline"] .news-card { display: grid; grid-template-columns: 220px minmax(0,1fr); margin-bottom: 10px; contain-intrinsic-size: 220px; }
.news-grid[data-view="timeline"] .story-visual { height: 100%; min-height: 205px; }
.news-grid[data-view="timeline"] .story-title { -webkit-line-clamp: 2; }
.news-grid[data-view="timeline"] .story-summary { -webkit-line-clamp: 2; }

.media-desk { margin: 0 0 14px; padding: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, rgba(11,28,44,.97), rgba(8,13,27,.98)); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.section-heading h2 { margin: 0; font-size: clamp(18px, 2.2vw, 25px); }
.section-status { padding: 6px 9px; border: 1px solid rgba(32,229,156,.3); border-radius: 999px; color: var(--green); font: 800 9px ui-monospace, monospace; letter-spacing: .08em; white-space: nowrap; }
.video-stream { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 32%); gap: 10px; overflow-x: auto; padding-bottom: 5px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.video-card { min-width: 0; overflow: hidden; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 14px; background: rgba(3,9,18,.72); color: inherit; text-align: left; cursor: pointer; }
.video-thumb { position: relative; height: 122px; display: block; overflow: hidden; background: linear-gradient(135deg, #0a2631, #100d25); }
.video-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; opacity: .74; transition: transform .25s ease, opacity .25s ease; }
.video-card:hover .video-thumb img { opacity: .9; transform: scale(1.025); }
.video-play { position: absolute; inset: 50% auto auto 50%; width: 43px; height: 43px; display: grid; place-items: center; transform: translate(-50%,-50%); border: 1px solid rgba(255,255,255,.34); border-radius: 50%; background: rgba(3,8,18,.78); color: white; box-shadow: 0 0 24px rgba(19,229,225,.18); }
.video-live { position: absolute; top: 9px; left: 9px; padding: 4px 7px; border-radius: 6px; background: var(--red); color: white; font: 850 9px ui-monospace, monospace; letter-spacing: .08em; }
.video-copy { display: grid; gap: 6px; padding: 10px; }
.video-copy strong { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; font-size: 12px; line-height: 1.35; }
.video-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--cyan); font: 750 9px ui-monospace, monospace; }
.live-channels { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.live-channel { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 10px; border: 1px solid rgba(255,93,125,.23); border-radius: 999px; background: rgba(255,93,125,.06); color: #ffd6df; text-decoration: none; font-size: 10px; font-weight: 780; }
.live-channel::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 9px var(--red); }

.loading-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.loading-grid i { height: 390px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(100deg, rgba(9,20,34,.75) 20%, rgba(25,47,63,.82) 38%, rgba(9,20,34,.75) 56%); background-size: 220% 100%; animation: shimmer 1.3s ease infinite; }
@keyframes shimmer { to { background-position-x: -220%; } }
.empty-state { min-height: 370px; display: grid; place-items: center; align-content: center; padding: 40px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }
.empty-state > span { font-size: 44px; color: var(--cyan); }
.empty-state h2 { margin: 8px 0; color: var(--text); }
.empty-state p { margin: 0 0 18px; }
.empty-state button { padding: 10px 18px; border: 1px solid var(--line-hot); border-radius: 999px; background: transparent; cursor: pointer; }

.insight-rail { min-width: 0; display: grid; align-content: start; gap: 11px; }
.rail-card { min-width: 0; overflow: hidden; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: rgba(9, 19, 33, .9); content-visibility: auto; contain-intrinsic-size: 170px; }
.rail-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rail-card h2 { margin: 0; font-size: 14px; }
.rail-title > span { color: var(--cyan); font: 850 13px ui-monospace, monospace; }
.rail-card p { margin: 11px 0 0; color: var(--muted); font-size: 12px; line-height: 1.48; }
.market-prices { display: grid; gap: 11px; margin-top: 13px; }
.rail-placeholder { margin: 0 !important; }
.price-row { --price-color: var(--green); min-width: 0; padding: 9px; border: 1px solid rgba(120,173,204,.1); border-radius: 11px; background: rgba(3,9,18,.45); }
.price-head { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; }
.price-symbol { display: flex; align-items: center; min-width: 0; gap: 7px; }
.price-symbol i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--price-color); box-shadow: 0 0 9px color-mix(in srgb, var(--price-color), transparent 30%); }
.price-symbol b { font: 850 11px ui-monospace, monospace; }
.price-symbol small { overflow: hidden; text-overflow: ellipsis; color: #74899f; font-size: 8px; }
.price-value { text-align: right; font: 820 11px ui-monospace, monospace; }
.price-change { display: block; margin-top: 3px; color: var(--price-color); font-size: 9px; }
.price-range { position: relative; height: 5px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: rgba(130,151,174,.14); }
.price-range i { display: block; width: var(--range,50%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, rgba(82,108,255,.8), var(--price-color)); transition: width .45s ease; }
.price-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; color: #65798f; font: 700 7px ui-monospace, monospace; }
.activity-stream { display: grid; gap: 8px; max-height: 230px; margin-top: 12px; overflow: auto; scrollbar-width: thin; }
.activity-item { position: relative; padding: 0 0 9px 17px; border-bottom: 1px solid rgba(120,173,204,.09); color: #a8b8ca; font-size: 10px; line-height: 1.38; }
.activity-item::before { content: ""; position: absolute; left: 1px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--activity-color,var(--cyan)); box-shadow: 0 0 8px var(--activity-color,var(--cyan)); }
.activity-item time { display: block; margin-top: 3px; color: #62768c; font: 700 8px ui-monospace, monospace; }
.sentiment-meter { height: 7px; margin-top: 17px; border-radius: 99px; background: linear-gradient(90deg, var(--red), #705fd7 50%, var(--green)); }
.sentiment-meter i { display: block; width: 11px; height: 11px; margin-top: -2px; margin-left: calc(var(--sentiment, 50%) - 5px); border: 2px solid white; border-radius: 50%; background: #07111d; box-shadow: 0 0 12px rgba(255,255,255,.4); transition: margin-left .3s ease; }
.sentiment-labels { display: flex; justify-content: space-between; margin-top: 6px; color: #72859b; font-size: 9px; }
.sentiment-labels b { color: #bac9db; }
.watch-symbols { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.watch-symbols span { padding: 5px 8px; border-radius: 8px; background: rgba(19,229,225,.09); color: var(--cyan); font: 750 10px ui-monospace, monospace; }
.context-status { padding: 3px 6px; border-radius: 7px; background: rgba(32,229,156,.1); color: var(--green) !important; font-size: 9px !important; }
.source-health-list { display: grid; gap: 7px; max-height: 236px; margin-top: 12px; overflow: auto; scrollbar-width: thin; }
.health-row { display: grid; grid-template-columns: 7px minmax(0,1fr) auto; align-items: center; gap: 7px; min-width: 0; font-size: 10px; }
.health-row i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.health-row.is-online i { background: var(--green); }
.health-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #a8b7c8; }
.health-row small { color: #71849a; font-variant-numeric: tabular-nums; }
.methodology { border-style: dashed; }

.map-view { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(7, 24, 35, .94), rgba(4, 9, 19, .98)); }
.map-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 5px !important; color: var(--cyan) !important; font: 800 9px ui-monospace, monospace !important; letter-spacing: .16em; }
.map-heading h2 { margin: 0; font-size: clamp(19px, 2.3vw, 29px); }
.map-legend { display: flex; gap: 12px; flex-wrap: wrap; color: #91a2b5; font-size: 10px; }
.map-legend span { display: flex; align-items: center; gap: 5px; }
.map-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.map-legend .warm { background: var(--cyan); }
.map-legend .risk { background: var(--pink); }
.map-stage { position: relative; height: clamp(360px, 58vh, 630px); margin-top: 15px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: radial-gradient(circle at 50% 50%, rgba(10, 133, 143, .18), transparent 46%), #030912; }
#news-map { width: 100%; height: 100%; display: block; touch-action: manipulation; }
.map-tooltip { position: absolute; z-index: 4; max-width: min(260px, calc(100% - 20px)); padding: 10px; pointer-events: none; border: 1px solid var(--line-hot); border-radius: 10px; background: rgba(2, 10, 19, .94); box-shadow: 0 10px 35px rgba(0,0,0,.4); font-size: 11px; }
.map-tooltip strong, .map-tooltip span { display: block; overflow-wrap: anywhere; }
.map-tooltip span { margin-top: 4px; color: var(--muted); }
.map-summary { position: absolute; left: 13px; bottom: 13px; display: grid; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(3,9,18,.78); backdrop-filter: blur(8px); }
.map-summary strong { color: var(--cyan); font: 850 20px ui-monospace, monospace; }
.map-summary span { font-size: 11px; }
.map-summary small { margin-top: 4px; color: var(--muted); }
.map-source-list { display: flex; gap: 7px; margin-top: 11px; overflow-x: auto; scrollbar-width: thin; }
.map-source-list button { flex: none; max-width: 190px; padding: 8px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid var(--line); border-radius: 10px; background: rgba(13,24,41,.8); color: #a8bacd; cursor: pointer; }
.map-source-list button:hover, .map-source-list button.is-active { border-color: var(--line-hot); color: var(--cyan); }

.notification-panel { position: fixed; z-index: 61; top: 0; right: 0; width: min(390px, 92vw); height: 100dvh; overflow-y: auto; padding: max(20px, env(safe-area-inset-top)) 19px max(20px, env(safe-area-inset-bottom)); border-left: 1px solid var(--line-hot); background: #07111d; box-shadow: -22px 0 60px rgba(0,0,0,.48); }
.drawer-backdrop { position: fixed; z-index: 60; inset: 0; background: rgba(0,0,0,.58); backdrop-filter: blur(3px); }
.drawer-head { display: flex; justify-content: space-between; align-items: start; }
.drawer-head h2 { margin: 0; font-size: 24px; }
.drawer-head button, .dialog-close { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel-2); cursor: pointer; font-size: 24px; }
.notification-panel > p { color: var(--muted); line-height: 1.5; }
.setting-row, .setting-range { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.setting-row span, .setting-range span { min-width: 0; display: grid; gap: 4px; }
.setting-row small { color: var(--muted); line-height: 1.35; }
.setting-row input { width: 40px; height: 22px; accent-color: var(--cyan); }
.setting-range { display: grid; }
.setting-range span { display: flex; justify-content: space-between; }
.setting-range input { width: 100%; accent-color: var(--cyan); }
.permission-button { width: 100%; margin-top: 15px; padding: 12px; border: 0; border-radius: 11px; background: linear-gradient(90deg, var(--cyan), var(--blue)); color: #001319; font-weight: 850; cursor: pointer; }
.recent-alerts { display: grid; gap: 8px; margin-top: 17px; }
.recent-alert { padding: 10px; border-left: 2px solid var(--pink); border-radius: 8px; background: rgba(241,61,155,.07); font-size: 11px; }

.story-dialog { width: min(900px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); padding: 0; overflow: auto; border: 1px solid var(--line-hot); border-radius: 22px; background: #07111d; color: var(--text); box-shadow: 0 30px 100px rgba(0,0,0,.65); }
.story-dialog::backdrop { background: rgba(0, 4, 10, .74); backdrop-filter: blur(7px); }
.dialog-close { position: sticky; z-index: 2; float: right; top: 13px; right: 13px; margin: 13px; }
.dialog-layout { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(250px,.75fr); clear: both; }
.dialog-main { min-width: 0; padding: 10px 28px 28px; }
.dialog-main .eyebrow { overflow-wrap: anywhere; }
.dialog-main h2 { margin: 12px 0; overflow-wrap: anywhere; font-size: clamp(26px, 4vw, 43px); line-height: 1.08; }
.dialog-main > p { color: #b3c2d3; font-size: 15px; line-height: 1.56; }
.dialog-side { min-width: 0; padding: 20px; background: #0a1725; }
.dialog-visual { height: 220px; border-radius: 15px; }
.dialog-facts { display: grid; gap: 8px; margin-top: 12px; }
.dialog-facts div { display: flex; justify-content: space-between; gap: 12px; padding: 10px; border-radius: 10px; background: rgba(3,9,18,.56); font-size: 11px; }
.dialog-facts span { color: var(--muted); }
.original-link { display: inline-flex; margin-top: 18px; padding: 11px 15px; border: 1px solid var(--line-hot); border-radius: 999px; color: var(--cyan); text-decoration: none; font-weight: 800; }
.toast-stack { position: fixed; z-index: 80; right: 14px; bottom: 14px; width: min(360px, calc(100vw - 28px)); display: grid; gap: 8px; pointer-events: none; }
.toast { --toast-color: var(--cyan); position: relative; display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 10px; overflow: hidden; padding: 12px 12px 15px; border: 1px solid var(--line-hot); border-color: color-mix(in srgb, var(--toast-color), transparent 53%); border-radius: 13px; background: rgba(7,17,29,.97); box-shadow: 0 15px 38px rgba(0,0,0,.38); animation: toast-in .24s ease both; }
.toast-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--toast-color), transparent 87%); color: var(--toast-color); }
.toast-copy { min-width: 0; }
.toast strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast span { display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.toast-progress { position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; transform-origin: left; background: linear-gradient(90deg,var(--toast-color),var(--pink)); animation: toast-progress var(--toast-duration,5s) linear both; }
@keyframes toast-in { from { opacity: 0; transform: translate3d(24px,0,0); } }
@keyframes toast-progress { to { transform: scaleX(0); } }

.video-dialog-frame { position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; border-radius: 15px; background: #02060c; }
.video-dialog-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-dialog-copy { padding: 18px 4px 4px; }
.video-dialog-copy h2 { margin: 0 0 8px; overflow-wrap: anywhere; }
.video-dialog-copy p { color: var(--muted); }

.terminal.is-pressure .news-card:hover, .terminal.is-pressure .video-card:hover { transform: none; box-shadow: none; }
.terminal.is-pressure .story-visual img, .terminal.is-pressure .video-thumb img { transition: none; }
.terminal.is-pressure .visual-badge, .terminal.is-pressure .map-summary { backdrop-filter: none; }

@media (max-width: 1100px) {
  .terminal-header { grid-template-columns: minmax(220px,1fr) minmax(360px,1.65fr) auto; padding-inline: 15px; }
  .workspace { grid-template-columns: minmax(0,1fr) 245px; }
  .story-visual { height: 165px; }
  .metrics div:nth-child(4) { display: none; }
  .metrics { grid-template-columns: repeat(3, minmax(78px,1fr)); }
  .video-stream { grid-auto-columns: minmax(220px, 42%); }
}

@media (max-width: 820px) {
  .terminal-header { min-height: 70px; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
  .brand-mark { width: 43px; height: 43px; border-radius: 13px; }
  .metrics { grid-column: 1 / -1; order: 3; }
  .metrics div { padding: 7px; }
  .header-actions { justify-self: end; }
  .command-bar { flex-wrap: wrap; padding-inline: 12px; }
  .mode-tabs { flex: 1; }
  .mode-tabs button { flex: 1; padding-inline: 9px; }
  .time-tabs { order: 3; width: 100%; overflow-x: auto; }
  .search { min-width: 160px; }
  .refresh-button span:last-child { display: none; }
  .category-tabs { top: 98px; padding-inline: 12px; }
  .workspace { grid-template-columns: minmax(0,1fr); padding-inline: 12px; }
  .insight-rail { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .source-health-list { max-height: 150px; }
  .media-desk { padding: 13px; }
  .video-stream { grid-auto-columns: minmax(220px, 58%); }
}

@media (max-width: 590px) {
  .terminal-header { padding: 9px 10px; }
  .brand-copy strong { font-size: 16px; }
  .brand-copy small { font-size: 7px; letter-spacing: .15em; }
  .live-pill { padding: 8px 10px; }
  .live-pill span { display: none; }
  .icon-button { width: 39px; height: 39px; }
  .metrics { gap: 5px; }
  .metrics dt { font-size: 15px; }
  .metrics dd { font-size: 7px; }
  .ticker { height: 28px; line-height: 28px; }
  .ticker-label { min-width: 82px; padding-inline: 9px; font-size: 8px; }
  #news-ticker-track, #market-ticker-track { min-width: calc(100% - 82px); gap: 30px; padding-left: 18px; }
  .command-bar { position: static; gap: 8px; }
  .mode-tabs { width: 100%; flex: auto; }
  .mode-tabs button { min-width: 0; font-size: 12px; }
  .search { order: 2; width: calc(100% - 51px); flex: auto; }
  .refresh-button { order: 2; width: 43px; justify-content: center; padding: 0; }
  .time-tabs { order: 3; }
  .category-tabs { position: static; }
  .connection-strip { padding-inline: 12px; font-size: 10px; flex-wrap: wrap; }
  .connection-strip time { margin-left: 0; }
  .news-grid, .loading-grid { grid-template-columns: minmax(0,1fr); }
  .news-card { contain-intrinsic-size: 420px; }
  .story-visual { height: 178px; }
  .story-title { font-size: 18px; }
  .news-grid[data-view="timeline"] .news-card { display: block; }
  .news-grid[data-view="timeline"] .story-visual { height: 130px; min-height: 0; }
  .insight-rail { grid-template-columns: minmax(0,1fr); }
  .section-heading { align-items: start; }
  .section-status { display: none; }
  .video-stream { grid-auto-columns: minmax(220px, 84%); }
  .live-channels { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .market-prices { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .map-view { padding: 11px; }
  .map-heading { display: block; }
  .map-legend { margin-top: 10px; }
  .map-stage { height: 430px; }
  .dialog-layout { display: block; }
  .dialog-main { padding: 5px 17px 22px; }
  .dialog-side { padding: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  #news-ticker-track, #market-ticker-track { transform: none !important; will-change: auto !important; }
}

@media (max-width: 390px) {
  .market-prices { grid-template-columns: minmax(0,1fr); }
  .video-stream { grid-auto-columns: 92%; }
  .metrics div:nth-child(3) { display: none; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (prefers-contrast: more) {
  :root { --line: rgba(190, 224, 241, .4); }
}

html.signalradar-embedded .terminal-header { border-radius: 0; }
html[data-runtime-pressure="high"] .news-card { content-visibility: auto; box-shadow: none !important; }
html[data-runtime-pressure="high"] .news-card:hover { transform: none; }

/* Show freshness and sentiment on small screens as well. */
@media(max-width:600px){.metrics{grid-template-columns:repeat(2,minmax(0,1fr));}.metrics div:nth-child(3),.metrics div:nth-child(4){display:block;}.live-pill span{display:inline;font-size:9px;}.live-pill{letter-spacing:0;}.header-actions{max-width:150px;}}
.feed-pager[hidden]{display:none!important;}
#news-map{touch-action:pan-y;}
