:root {
  --bg: #090b0f;
  --bg-soft: #0f1319;
  --panel: rgba(18, 21, 28, 0.94);
  --panel-2: #151922;
  --line: rgba(255,255,255,0.08);
  --text: #f6f7fb;
  --muted: #9aa2b2;
  --red: #ee281f;
  --red-2: #ff4c3f;
  --gold: #d8a849;
  --orange: #f28a2f;
  --yellow: #e5c74f;
  --green: #4ac47a;
  --shadow: 0 24px 60px rgba(0,0,0,.36);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(126,32,22,.16), transparent 32%),
    radial-gradient(circle at 80% 15%, rgba(213,141,38,.09), transparent 26%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }

.site-shell { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto minmax(160px, 1fr);
  align-items: center;
  gap: 26px;
  padding: 10px clamp(20px, 4vw, 64px);
  background: rgba(8,10,14,.88);
  border-bottom: 1px solid rgba(255,255,255,.07);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand img {
  width: 100px;
  height: 40px;
  object-fit: cover;
  object-position: center;
  border-radius: 7px;
  box-shadow: 0 0 24px rgba(238,40,31,.18);
}
.brand-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-copy span { font-weight: 800; letter-spacing: -.02em; }
.brand-copy small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main-nav { display: flex; align-items: center; gap: 25px; }
.main-nav a { color: #b8bfca; font-size: 14px; font-weight: 700; position: relative; }
.main-nav a:hover, .main-nav a.active { color: white; }
.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -10px;
  height: 2px;
  background: var(--red);
  border-radius: 2px;
}
.tip-button {
  justify-self: end;
  border: 1px solid rgba(255,83,72,.45);
  background: linear-gradient(180deg, #f0392e, #c71913);
  color: white;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-radius: 9px;
  padding: 11px 18px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(238,40,31,.22);
}
.tip-button:hover { filter: brightness(1.08); transform: translateY(-1px); }

.breaking-strip {
  height: 42px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  overflow: hidden;
  background: #11141a;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.breaking-label {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 0 18px;
  background: var(--red);
  font-family: Oswald, sans-serif;
  font-weight: 700;
  letter-spacing: .08em;
}
.ticker-wrap { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 2%, #000 98%, transparent); }
.ticker {
  display: inline-flex;
  gap: 20px;
  white-space: nowrap;
  min-width: max-content;
  color: #d6dae3;
  font-size: 13px;
  animation: ticker 31s linear infinite;
  padding-left: 2vw;
}
@keyframes ticker { to { transform: translateX(-45%); } }
.live-pill { color: #ff655b; padding: 0 18px; font-size: 12px; font-weight: 900; letter-spacing: .08em; }

.hero {
  position: relative;
  min-height: 610px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: end;
  gap: 36px;
  padding: 64px clamp(20px, 5vw, 76px) 72px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 43%; filter: saturate(.95) contrast(1.04) brightness(.66); }
.hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(5,6,9,.93) 0%, rgba(5,6,9,.74) 42%, rgba(5,6,9,.26) 73%, rgba(5,6,9,.54) 100%),
    linear-gradient(0deg, rgba(9,11,15,.92) 0%, transparent 60%);
}
.hero-content, .hero-status { position: relative; z-index: 2; }
.eyebrow, .kicker {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .18em;
  color: #ff6d62;
  text-transform: uppercase;
}
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red-2); box-shadow: 0 0 0 0 rgba(255,76,63,.6); animation: pulse 1.7s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(255,76,63,0); } 100% { box-shadow: 0 0 0 0 rgba(255,76,63,0); } }
.hero h1 {
  max-width: 900px;
  margin: 0;
  font-family: Oswald, sans-serif;
  font-size: clamp(48px, 6vw, 84px);
  line-height: .98;
  text-transform: uppercase;
  letter-spacing: -.035em;
  text-shadow: 0 8px 40px rgba(0,0,0,.55);
}
.hero h1 span { color: #ff4c3f; }
.hero p { max-width: 780px; color: #c6cbd5; font-size: 17px; line-height: 1.72; margin: 26px 0 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.primary-btn, .secondary-btn, .ghost-btn {
  border-radius: 9px;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: .18s ease;
  border: 1px solid transparent;
}
.primary-btn { color: white; background: linear-gradient(180deg, #f13d31, #ca1d16); box-shadow: 0 10px 28px rgba(238,40,31,.25); }
.secondary-btn { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.07); color: white; backdrop-filter: blur(12px); }
.primary-btn:hover, .secondary-btn:hover, .ghost-btn:hover { transform: translateY(-1px); filter: brightness(1.07); }
.glass-card { background: linear-gradient(180deg, rgba(22,25,33,.86), rgba(11,13,18,.9)); backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.1); box-shadow: var(--shadow); }
.hero-status { padding: 22px; border-radius: 16px; align-self: center; }
.status-head { display: flex; justify-content: space-between; align-items: center; color: #bfc5d0; font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red-2); box-shadow: 0 0 15px rgba(255,76,63,.75); }
.heat-number { font-family: Oswald, sans-serif; font-size: 86px; font-weight: 700; line-height: 1; margin-top: 14px; }
.heat-label { font-weight: 900; color: #ff5a4f; margin-bottom: 15px; letter-spacing: .08em; }
.meter { height: 8px; border-radius: 100px; background: rgba(255,255,255,.08); overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, #e4a13b, #ff4c3f); border-radius: inherit; }
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.status-grid div { padding: 10px; border-radius: 10px; background: rgba(255,255,255,.04); text-align: center; }
.status-grid strong { display: block; font-size: 18px; }
.status-grid span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }

.dashboard-grid {
  width: min(1500px, calc(100% - 40px));
  margin: 38px auto 70px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 24px;
  align-items: start;
}
.content-column, .sidebar { display: grid; gap: 24px; }
.panel { background: linear-gradient(180deg, #14171f, #0d1016); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 45px rgba(0,0,0,.18); overflow: hidden; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 24px 24px 18px; border-bottom: 1px solid var(--line); }
.section-heading.compact { align-items: center; }
.section-heading h2 { margin: 4px 0 0; font-size: 24px; letter-spacing: -.03em; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.035); color: #aeb5c2; border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 800; cursor: pointer; }
.filter.active { color: white; background: rgba(238,40,31,.16); border-color: rgba(238,40,31,.5); }

.incident-list { display: grid; }
.incident-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 120px;
  gap: 18px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  transition: background .15s ease;
}
.incident-card:last-child { border-bottom: 0; }
.incident-card:hover { background: rgba(255,255,255,.025); }
.incident-thumb {
  min-height: 102px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(244,170,63,.25), transparent 26%),
    linear-gradient(145deg, #2c1f18, #11151c 70%);
  border: 1px solid rgba(255,255,255,.07);
}
.incident-thumb::before { content: "ZNN"; font-family: Oswald, sans-serif; font-size: 31px; font-weight: 700; opacity: .1; transform: rotate(-9deg); }
.thumb-label { position: absolute; left: 10px; bottom: 10px; background: rgba(5,6,8,.78); border: 1px solid rgba(255,255,255,.08); padding: 5px 7px; border-radius: 6px; font-size: 10px; color: #d7dbe2; }
.incident-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 700; margin-bottom: 8px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 7px; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.badge.breaking { background: rgba(238,40,31,.17); color: #ff6258; border: 1px solid rgba(238,40,31,.35); }
.badge.developing { background: rgba(242,138,47,.14); color: #f5a05a; border: 1px solid rgba(242,138,47,.3); }
.badge.monitoring { background: rgba(229,199,79,.12); color: #e7cd67; border: 1px solid rgba(229,199,79,.27); }
.incident-title { margin: 0 0 8px; font-size: 18px; line-height: 1.35; letter-spacing: -.02em; }
.incident-summary { margin: 0; color: #aab1bd; font-size: 13px; line-height: 1.6; }
.incident-links { margin-top: 11px; display: flex; gap: 10px; color: #d4d9e3; font-size: 11px; font-weight: 700; }
.incident-links span { padding: 5px 7px; border-radius: 6px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.05); }
.juice { align-self: center; justify-self: end; width: 104px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.06); text-align: center; }
.juice strong { display: block; font-family: Oswald, sans-serif; font-size: 34px; line-height: 1; }
.juice span { display: block; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .12em; margin-top: 6px; }

.source-panel { padding-bottom: 22px; }
.subtle-text { color: var(--muted); font-size: 12px; }
.funnel { display: grid; grid-template-columns: repeat(4, minmax(105px, 1fr)) auto 1.8fr auto 1.25fr; gap: 10px; align-items: stretch; padding: 22px; }
.source-node, .funnel-core { min-height: 104px; border-radius: 12px; border: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.035); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 7px; font-size: 11px; font-weight: 800; color: #cbd0da; padding: 12px; }
.source-node strong { font-family: Oswald, sans-serif; font-size: 27px; color: white; }
.source-node.twitch { box-shadow: inset 0 3px 0 rgba(145,71,255,.7); }
.source-node.youtube { box-shadow: inset 0 3px 0 rgba(255,0,0,.7); }
.source-node.reddit { box-shadow: inset 0 3px 0 rgba(255,69,0,.7); }
.source-node.tips { box-shadow: inset 0 3px 0 rgba(76,174,255,.7); }
.source-node.newsroom { box-shadow: inset 0 3px 0 rgba(238,40,31,.8); }
.funnel-arrow { display: grid; place-items: center; color: #606775; font-size: 22px; }
.funnel-core { background: linear-gradient(145deg, rgba(76,26,21,.7), rgba(23,16,18,.88)); }
.funnel-core img { width: 86px; height: 34px; object-fit: cover; border-radius: 5px; }
.funnel-core span { color: white; font-size: 10px; letter-spacing: .1em; }
.funnel-core small { color: var(--muted); font-size: 9px; line-height: 1.45; }

.radar-panel { position: relative; top: auto; z-index: 1; }
.radar-live { color: #ff6258; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.radar-search { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.radar-search input { width: 100%; border-radius: 9px; border: 1px solid rgba(255,255,255,.08); background: #0d1016; color: white; padding: 10px 12px; outline: none; }
.radar-search input:focus { border-color: rgba(238,40,31,.5); box-shadow: 0 0 0 3px rgba(238,40,31,.08); }
.streamer-list { max-height: 520px; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.streamer-row { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.streamer-row:last-child { border-bottom: 0; }
.avatar { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; color: white; background: linear-gradient(145deg, #34251d, #171b22); border: 1px solid rgba(255,255,255,.07); }
.streamer-name { font-weight: 800; font-size: 13px; }
.streamer-tags { color: var(--muted); font-size: 10px; margin-top: 3px; }
.signal { min-width: 86px; text-align: right; }
.signal strong { display: block; font-family: Oswald, sans-serif; font-size: 18px; }
.signal span { display: block; max-width: 86px; font-size: 8px; line-height: 1.25; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.signal.hot strong { color: #ff5b50; }
.signal.warm strong { color: #f5a05a; }
.signal.low strong { color: #8d97a7; }

.studio-panel { overflow: hidden; }
.studio-image-wrap { height: 180px; position: relative; overflow: hidden; }
.studio-image-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: center 62%; filter: saturate(.9) brightness(.75); }
.studio-image-wrap::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(13,16,22,.96), transparent 66%); }
.studio-badge { position: absolute; z-index: 2; top: 12px; right: 12px; background: #d61d16; border: 1px solid rgba(255,255,255,.16); border-radius: 7px; padding: 6px 8px; font-size: 10px; font-weight: 900; letter-spacing: .09em; }
.studio-copy { padding: 0 20px 20px; margin-top: -4px; position: relative; z-index: 3; }
.studio-copy h3 { margin: 4px 0 8px; font-size: 22px; }
.studio-copy p { color: var(--muted); font-size: 12px; line-height: 1.55; }
.ghost-btn { width: 100%; margin-top: 8px; background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); color: #d6dae3; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(4,5,8,.72); backdrop-filter: blur(10px); padding: 20px; }
.modal-backdrop[hidden] { display: none; }
.modal { position: relative; width: min(560px, 100%); background: #131720; border: 1px solid rgba(255,255,255,.1); border-radius: 16px; padding: 26px; box-shadow: 0 30px 90px rgba(0,0,0,.55); }
.modal h2 { margin: 5px 0 8px; }
.modal p { color: var(--muted); margin: 0 0 20px; font-size: 13px; }
.modal-close { position: absolute; right: 14px; top: 12px; background: transparent; border: 0; color: #b9c0cb; font-size: 28px; cursor: pointer; }
.modal form { display: grid; gap: 14px; }
.modal label { display: grid; gap: 7px; font-size: 12px; font-weight: 700; color: #ccd1db; }
.modal input, .modal textarea, .modal select { width: 100%; border-radius: 9px; border: 1px solid rgba(255,255,255,.08); background: #0b0e13; color: white; padding: 11px 12px; outline: none; }
.modal textarea { min-height: 118px; resize: vertical; }
.form-submit { border: 0; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 120; background: #181d25; border: 1px solid rgba(255,255,255,.1); border-left: 3px solid var(--red); color: white; border-radius: 10px; padding: 12px 15px; box-shadow: var(--shadow); opacity: 0; transform: translateY(14px); pointer-events: none; transition: .2s ease; font-size: 12px; }
.toast.show { opacity: 1; transform: translateY(0); }

body.studio-mode .hero-bg { filter: saturate(1.08) contrast(1.08) brightness(.82); }
body.studio-mode .hero-overlay { background: linear-gradient(90deg, rgba(5,6,9,.82), rgba(5,6,9,.42) 50%, rgba(5,6,9,.16)); }
body.studio-mode .hero::after { content: "ON AIR"; position: absolute; z-index: 4; top: 34px; right: 5vw; color: #fff3ef; background: #b91611; border: 1px solid rgba(255,255,255,.25); box-shadow: 0 0 28px rgba(232,40,28,.44); padding: 9px 18px; border-radius: 6px; font-family: Oswald, sans-serif; font-weight: 700; letter-spacing: .12em; }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 1fr auto; }
  .main-nav { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-status { width: min(360px, 100%); justify-self: start; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); align-items: start; }
  .radar-panel { position: static; }
  .streamer-list { max-height: 430px; }
  .funnel { grid-template-columns: repeat(2, 1fr); }
  .funnel-arrow { display: none; }
  .funnel-core, .source-node.newsroom { grid-column: span 2; }
}

@media (max-width: 900px) {
  .sidebar { grid-template-columns: 1fr; }
  .twitch-clip-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .topbar { padding: 9px 14px; gap: 10px; }
  .brand img { width: 78px; height: 34px; }
  .brand-copy { display: none; }
  .tip-button { padding: 9px 12px; font-size: 11px; }
  .breaking-strip { grid-template-columns: auto 1fr; }
  .live-pill { display: none; }
  .hero { min-height: auto; padding: 56px 18px 44px; }
  .hero h1 { font-size: clamp(43px, 14vw, 66px); }
  .hero p { font-size: 14px; }
  .dashboard-grid { width: min(100% - 24px, 1500px); margin-top: 20px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .incident-card { grid-template-columns: 88px minmax(0,1fr); padding: 16px; }
  .incident-thumb { min-height: 88px; }
  .juice { grid-column: 2; justify-self: start; display: flex; width: auto; align-items: baseline; gap: 7px; }
  .juice strong { font-size: 22px; }
  .funnel { grid-template-columns: 1fr; }
  .funnel-core, .source-node.newsroom { grid-column: auto; }
}

/* --- Live Twitch intake prototype --- */
.demo-tag {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .09em;
  font-weight: 900;
}
.twitch-live-panel { overflow: hidden; }
.twitch-heading { align-items: flex-start; }
.section-intro {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.twitch-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; }
.compact-btn { width: auto; margin: 0; padding: 8px 11px; cursor: pointer; }
.compact-btn:disabled { opacity: .55; cursor: wait; }
.api-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #b8bfca;
}
.api-dot { width: 8px; height: 8px; border-radius: 50%; background: #737b89; box-shadow: 0 0 0 4px rgba(115,123,137,.08); }
.api-state.online { color: #73dfa0; }
.api-state.online .api-dot { background: #4ac47a; box-shadow: 0 0 0 4px rgba(74,196,122,.1), 0 0 18px rgba(74,196,122,.35); }
.api-state.loading { color: #d3b873; }
.api-state.loading .api-dot { background: #d8a849; animation: pulseApi 1.2s infinite; }
.api-state.offline, .api-state.error { color: #ff776e; }
.api-state.offline .api-dot, .api-state.error .api-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(238,40,31,.1); }
@keyframes pulseApi { 50% { opacity: .38; transform: scale(.78); } }

.twitch-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.twitch-stats > div {
  background: rgba(12,15,20,.88);
  padding: 15px 20px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.twitch-stats strong { font-family: Oswald, sans-serif; font-size: 25px; }
.twitch-stats span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.twitch-message {
  margin: 16px 20px 0;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.025);
  color: #b6bdc8;
  font-size: 11px;
  line-height: 1.5;
}
.twitch-message strong, .twitch-message span { display: block; }
.twitch-message.setup { border-color: rgba(216,168,73,.24); background: rgba(216,168,73,.055); }
.twitch-message.success { border-color: rgba(74,196,122,.18); background: rgba(74,196,122,.035); }
.twitch-message.error { border-color: rgba(238,40,31,.25); background: rgba(238,40,31,.05); }

.mini-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px 10px;
  color: #d9dde5;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
}
.mini-heading small { color: var(--muted); font-size: 9px; letter-spacing: 0; text-transform: none; font-weight: 600; }
.clips-heading { border-top: 1px solid var(--line); margin-top: 17px; }
.cluster-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 0 20px 4px;
}
.cluster-card {
  min-height: 102px;
  padding: 12px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,.07);
  background: linear-gradient(145deg, rgba(45,20,18,.52), rgba(18,21,28,.68));
}
.cluster-topline { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.cluster-topline span { font-size: 10px; font-weight: 900; color: #f0d6d2; }
.cluster-topline strong { font-family: Oswald, sans-serif; color: #ff665c; font-size: 22px; line-height: 1; }
.cluster-card p { margin: 10px 0 5px; color: #d0d5dd; font-size: 10px; line-height: 1.45; }
.cluster-card small { color: var(--muted); font-size: 9px; line-height: 1.4; }

.twitch-clip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0 20px 22px;
}
.twitch-clip-card {
  min-width: 0;
  overflow: hidden;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,.07);
  background: #10141b;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.twitch-clip-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.13); }
.twitch-clip-card.candidate { border-color: rgba(238,40,31,.23); box-shadow: inset 0 3px 0 rgba(238,40,31,.72); }
.twitch-clip-card.needs-context { border-color: rgba(216,168,73,.22); box-shadow: inset 0 3px 0 rgba(216,168,73,.62); }
.clip-thumb { display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #080a0e; }
.clip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .22s ease; }
.twitch-clip-card:hover .clip-thumb img { transform: scale(1.025); }
.clip-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(4,5,8,.55), transparent 50%); }
.clip-play { position: absolute; z-index: 2; left: 12px; bottom: 10px; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: rgba(145,71,255,.94); color: white; font-size: 11px; box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.clip-views { position: absolute; z-index: 2; right: 9px; bottom: 9px; padding: 5px 7px; border-radius: 6px; background: rgba(3,4,7,.78); color: white; font-size: 9px; font-weight: 800; }
.clip-body { padding: 14px; display: flex; flex-direction: column; min-height: 206px; }
.clip-meta { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 9px; font-weight: 700; }

.clip-body h3 { margin: 7px 0 12px; font-size: 15px; line-height: 1.35; min-height: 40px; overflow-wrap: anywhere; }
.headline-candidate { display: grid; gap: 4px; padding: 10px 11px; border-radius: 9px; background: rgba(238,40,31,.065); border: 1px solid rgba(238,40,31,.16); }
.headline-candidate span { color: #ff756c; font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.headline-candidate strong { font-size: 11px; line-height: 1.35; color: #f0f2f6; }
.headline-candidate small { color: #9ca4b1; font-size: 9px; line-height: 1.4; }
.headline-candidate.quiet { background: rgba(255,255,255,.025); border-color: rgba(255,255,255,.05); }
.headline-candidate.quiet span { color: #8c95a5; }
.headline-candidate.quiet strong { color: #aeb5c0; }
.headline-candidate.context { background: rgba(216,168,73,.07); border-color: rgba(216,168,73,.2); }
.headline-candidate.context span { color: #e4bd67; }
.headline-candidate.context strong { color: #f2e2bd; }
.clip-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; }
.clip-signal { flex: 0 0 auto; padding: 4px 6px; border-radius: 6px; font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; background: rgba(255,255,255,.04); color: #9da5b2; }
.clip-signal.strong { background: rgba(238,40,31,.12); color: #ff6e64; }
.clip-signal.watch { background: rgba(242,138,47,.1); color: #f4aa68; }
.clip-signal.context { background: rgba(216,168,73,.11); color: #e7c36e; }
.keyword-list { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8b94a3; font-size: 8px; text-align: right; }
.twitch-loading-card, .twitch-empty {
  grid-column: 1 / -1;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 20px;
}
.twitch-empty strong { color: #dce1e9; font-size: 13px; }
.twitch-empty span { max-width: 650px; font-size: 11px; line-height: 1.55; }
.setup-card { border-color: rgba(216,168,73,.19); }

.avatar-img { width: 42px; height: 42px; object-fit: cover; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); }
.streamer-live-pill { display: inline-flex; margin-left: 5px; padding: 2px 5px; border-radius: 999px; background: rgba(238,40,31,.13); color: #ff685e; border: 1px solid rgba(238,40,31,.22); font-size: 7px; letter-spacing: .07em; vertical-align: 2px; }
.streamer-clip-count { color: #7160a8; margin-left: 5px; }

@media (max-width: 1180px) {
  .cluster-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .twitch-clip-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .sidebar { grid-template-columns: 1fr; }
  .twitch-clip-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .twitch-controls { align-items: flex-start; }
  .twitch-stats { grid-template-columns: repeat(2, 1fr); }
  .cluster-grid { grid-template-columns: 1fr; padding-inline: 14px; }
  .twitch-clip-grid { grid-template-columns: 1fr; padding-inline: 14px; }
  .mini-heading { align-items: flex-start; flex-direction: column; padding-inline: 14px; }
  .twitch-message { margin-inline: 14px; }
}

.streamer-avatar-link { display: block; border-radius: 11px; text-decoration: none; }
.streamer-avatar-link:focus-visible, .streamer-name-link:focus-visible { outline: 2px solid #9a7cff; outline-offset: 3px; }
.streamer-info { min-width: 0; }
.streamer-name-link { color: #f4f6fb; text-decoration: none; transition: color .16s ease; }
.streamer-name-link:hover { color: #b69cff; text-decoration: underline; text-underline-offset: 3px; }
.streamer-name-link span { font-size: .78em; opacity: .72; }
.streamer-discovered-pill { display: inline-flex; margin-left: 5px; padding: 2px 5px; border-radius: 999px; background: rgba(145,71,255,.12); color: #b99cff; border: 1px solid rgba(145,71,255,.22); font-size: 7px; letter-spacing: .07em; vertical-align: 2px; }
.clip-streamer { color: #b69cff; font-weight: 900; text-decoration: none; }
.clip-streamer:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Twitch era scope switch */
.scope-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.035);
  gap: 3px;
}
.scope-btn {
  appearance: none;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 7px 10px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  cursor: pointer;
}
.scope-btn:hover { color: white; background: rgba(255,255,255,.045); }
.scope-btn.active {
  color: white;
  background: linear-gradient(180deg, rgba(238,40,31,.95), rgba(179,25,19,.95));
  box-shadow: 0 5px 16px rgba(238,40,31,.18);
}
.era-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: #c4cad3;
}
.era-pill.tbc { color: #ffd990; border-color: rgba(216,168,73,.28); background: rgba(216,168,73,.08); }
.era-pill.retail { color: #9fc3ff; border-color: rgba(90,145,235,.25); background: rgba(90,145,235,.07); }
.era-pill.uncertain { color: #adb4c0; }
.vod-context {
  margin-top: 7px;
  color: #8f98a8;
  font-size: 9px;
  line-height: 1.4;
}
