/* Live Intelligence Briefing -- /briefing/<slug> (templates/live_intel_
   briefing.html, static/js/live_intel_briefing.js). A dark signal-
   intelligence console aesthetic, brand-locked to THIS page only -- not
   live_briefing.css's editorial palette, deliberately: this is an internal
   analyst tool for a client, not a consumer-facing feed. Single-theme by
   design (see artifact-design's own "committed to one visual world" carve-
   out) -- every color is set explicitly rather than following the OS
   theme, since a light "console" reads as a contradiction in terms. */
@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600;700&family=Sora:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700;800&display=swap');

:root{
  --bg:#05070c; --bg-1:#0a0e18; --bg-2:#0e1424; --bg-3:#131b30;
  --ink:#e9f2fb; --ink-soft:rgba(233,242,251,.68); --ink-faint:rgba(233,242,251,.42);
  --border:rgba(120,190,255,.16); --border-strong:rgba(120,190,255,.32);
  --cyan:#4ddce8; --cyan-soft:rgba(77,220,232,.12); --cyan-border:rgba(77,220,232,.4); --cyan-glow:rgba(77,220,232,.55);
  --violet:#b478ff; --violet-soft:rgba(180,120,255,.13); --violet-border:rgba(180,120,255,.42);
  --amber:#ffbd54; --amber-soft:rgba(255,189,84,.14); --amber-border:rgba(255,189,84,.45);
  --live:#57eaa9; --live-bg:rgba(87,234,169,.13); --live-border:rgba(87,234,169,.42);
  --slate:#7e93bb; --slate-soft:rgba(126,147,187,.12); --slate-border:rgba(126,147,187,.32);
  --shadow:rgba(0,0,0,.65);
  --display:'Chakra Petch',Rajdhani,sans-serif; --body:'Sora',-apple-system,sans-serif; --mono:'JetBrains Mono',ui-monospace,monospace;
  color-scheme:dark;
}
*{box-sizing:border-box}
@media (prefers-reduced-motion: reduce){ *{animation-duration:.001ms!important; animation-iteration-count:1!important; transition-duration:.001ms!important} }

html,body{margin:0}
body{
  background:
    radial-gradient(ellipse 1100px 620px at 15% -10%, rgba(77,220,232,.08), transparent 60%),
    radial-gradient(ellipse 900px 560px at 100% 0%, rgba(180,120,255,.07), transparent 55%),
    var(--bg);
  color:var(--ink); font-family:var(--body);
  padding-inline:20px; padding-block:36px 70px; line-height:1.5;
  /* Backstop, not the fix -- the real bug (a non-shrinking .handle-plats
     forcing the whole page wider than the viewport on a phone) is fixed
     at its source below (.handle-name-row). This just stops any OTHER
     stray overflow from doing the same thing to the whole page again. */
  overflow-x:hidden;
}
body::before{
  content:''; position:fixed; inset:0; pointer-events:none; z-index:0; opacity:.45;
  background-image:linear-gradient(rgba(120,190,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(120,190,255,.05) 1px, transparent 1px);
  background-size:40px 40px;
  mask-image:radial-gradient(ellipse 90% 55% at 50% 0%, #000 40%, transparent 85%);
}
.wrap{max-width:1160px;margin:0 auto;position:relative;z-index:1}
button{font:inherit;color:inherit;background:none;border:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
a{color:var(--cyan)}

/* ── Header ────────────────────────────────────────────────── */
.kicker{
  font-family:var(--mono); font-size:.7rem; font-weight:700; letter-spacing:.2em; text-transform:uppercase;
  color:var(--cyan); margin:0 0 12px; display:flex; align-items:center; gap:9px;
}
.kicker .dot{width:7px;height:7px;border-radius:50%;background:var(--amber);box-shadow:0 0 8px var(--amber);animation:blip 1.8s ease-in-out infinite}
@keyframes blip{0%,100%{opacity:1}50%{opacity:.35}}
h1{
  font-family:var(--display); font-weight:700; font-size:clamp(1.9rem,5vw,2.7rem); letter-spacing:.01em;
  margin:0 0 8px; line-height:1.05;
  background:linear-gradient(100deg, var(--ink) 30%, var(--cyan) 70%);
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.subtitle{font-size:.94rem; color:var(--ink-soft); max-width:70ch; margin:0 0 28px}

/* ── Section labels ────────────────────────────────────────── */
.section-label{
  display:flex; align-items:baseline; gap:10px; margin:0 0 12px;
  font-family:var(--mono); font-size:.72rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--cyan);
}
.section-label .sub{font-family:var(--mono); font-weight:400; letter-spacing:.02em; text-transform:none; color:var(--ink-faint)}

/* ── Signal picker (reuses the range-picker/range-btn look) ──── */
#signalPicker{margin-bottom:26px; flex-wrap:wrap}

/* ── Platform picker ───────────────────────────────────────── */
.platform-picker{display:flex; flex-wrap:wrap; gap:8px; margin-bottom:26px}
.platform-check{
  display:inline-flex; align-items:center; gap:7px; font-family:var(--mono); font-size:.72rem; font-weight:700;
  letter-spacing:.03em; text-transform:uppercase; color:var(--ink-faint); border:1px solid var(--border);
  border-radius:20px; padding:7px 14px 7px 10px; cursor:pointer; transition:color .15s, border-color .15s, background .15s;
  -webkit-tap-highlight-color:transparent;
}
.platform-check:hover{color:var(--ink-soft); border-color:var(--border-strong)}
.platform-check input{accent-color:var(--cyan); width:13px; height:13px; margin:0}
.platform-check.checked{color:var(--plat-c,var(--cyan)); border-color:var(--plat-c,var(--cyan-border)); background:color-mix(in srgb, var(--plat-c,var(--cyan)) 12%, transparent)}

/* ── Loading bar -- shown while a filter change is in flight ─── */
.load-bar{height:2px; margin:-24px 0 30px; border-radius:2px; overflow:hidden; background:rgba(255,255,255,.06); position:relative}
.load-bar[hidden]{display:none}
.load-bar::after{
  content:''; position:absolute; inset:0 auto 0 0; width:40%; border-radius:2px;
  background:linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation:loadsweep 1.1s ease-in-out infinite;
}
@keyframes loadsweep{0%{left:-40%}100%{left:100%}}

/* ── Date-range picker ─────────────────────────────────────── */
.range-row{display:flex; align-items:center; gap:18px; flex-wrap:wrap; margin-bottom:26px}
.range-picker{
  display:inline-flex; gap:2px; padding:3px;
  background:var(--bg-1); border:1px solid var(--border); border-radius:8px;
}
.range-btn{
  font-family:var(--mono); font-size:.74rem; font-weight:700; letter-spacing:.04em;
  padding:7px 16px; border-radius:6px; color:var(--ink-faint); transition:background .15s, color .15s;
}
.range-btn:hover{color:var(--ink-soft)}
.range-btn.active{background:var(--cyan-soft); color:var(--cyan); box-shadow:0 0 0 1px var(--cyan-border) inset}

.custom-range-btn{
  display:inline-flex; align-items:center; gap:8px; font-family:var(--mono); font-size:.74rem; font-weight:700;
  letter-spacing:.04em; color:var(--ink-faint); border:1px solid var(--border); border-radius:8px;
  padding:9px 14px; transition:color .15s, border-color .15s;
}
.custom-range-btn svg{width:14px; height:14px; flex:none}
.custom-range-btn .chev{width:11px; height:11px; transition:transform .15s}
.custom-range-btn:hover{color:var(--ink-soft); border-color:var(--border-strong)}
.custom-range-btn.active{color:var(--cyan); border-color:var(--cyan-border); background:var(--cyan-soft)}
.custom-range-btn.active .chev{transform:rotate(180deg)}

.date-picker{display:flex; align-items:center; gap:14px; margin:-14px 0 26px; padding:14px 16px;
  background:var(--bg-1); border:1px solid var(--border); border-radius:8px; width:fit-content;}
.date-picker[hidden]{display:none}
.date-picker label{
  display:flex; align-items:center; gap:8px; font-family:var(--mono); font-size:.66rem;
  color:var(--ink-faint); letter-spacing:.06em; text-transform:uppercase;
}
.date-picker input[type="date"]{
  font-family:var(--mono); font-size:.74rem; color:var(--ink); background:var(--bg-2);
  border:1px solid var(--border); border-radius:6px; padding:6px 8px; color-scheme:dark;
}
.date-picker input[type="date"]:focus{outline:none; border-color:var(--cyan-border)}

/* ── Scope banner ──────────────────────────────────────────── */
.scope-banner{
  display:flex; align-items:center; gap:16px; flex-wrap:wrap;
  background:linear-gradient(100deg, var(--cyan-soft), transparent 70%);
  border:1px solid var(--cyan-border); border-left:3px solid var(--cyan);
  border-radius:8px; padding:14px 20px; margin-bottom:30px;
}
.scope-banner .live-pill{
  display:inline-flex; align-items:center; gap:6px; font-family:var(--mono); font-size:.66rem; font-weight:700;
  letter-spacing:.08em; text-transform:uppercase; color:var(--live); background:var(--live-bg);
  border:1px solid var(--live-border); border-radius:20px; padding:4px 10px; flex:none;
}
.scope-banner .live-pill .dot2{width:6px;height:6px;border-radius:50%;background:var(--live)}
.scope-banner .headline{font-family:var(--display); font-weight:600; font-size:1.05rem; color:var(--ink)}
.scope-banner .headline b{color:var(--cyan)}
.scope-banner .figs{
  display:flex; gap:20px; margin-left:auto; font-family:var(--mono); font-size:.78rem; color:var(--ink-soft);
}
.scope-banner .figs b{color:var(--ink); font-weight:700}
.scope-banner .figs b.amber-fig{color:var(--amber)}
@media (max-width:680px){ .scope-banner .figs{margin-left:0; width:100%} }

/* ── Trend chart ───────────────────────────────────────────── */
.trend-panel{
  background:linear-gradient(160deg, var(--bg-2), var(--bg-1)); border:1px solid var(--border); border-radius:10px;
  padding:20px 22px 14px; margin-bottom:34px;
}
.trend-head{display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:6px; flex-wrap:wrap; gap:8px}
.trend-stats{display:flex; gap:22px; font-family:var(--mono); font-size:.72rem; color:var(--ink-faint); flex-wrap:wrap}
.trend-stats b{color:var(--ink); font-weight:700}
.trend-stats .amber{color:var(--amber)}
.trend-svg-wrap{width:100%; overflow-x:auto}
.trend-svg-wrap svg{width:100%; min-width:520px; height:auto; display:block}
.trend-legend{display:flex; gap:18px; margin-top:8px; font-family:var(--mono); font-size:.68rem; color:var(--ink-faint)}
.trend-legend span{display:inline-flex; align-items:center; gap:6px}
.trend-legend i{width:12px;height:2px;border-radius:2px;display:inline-block}
.trend-empty{padding:40px 10px; text-align:center; font-family:var(--mono); font-size:.8rem; color:var(--ink-faint)}

/* ── Ring + outside labels ─────────────────────────────────── */
/* The pie is always horizontally centered in this card -- RING_CX/RING_CY
   (static/js/live_intel_briefing.js) sit exactly at the midpoint of the
   400x240 viewBox, so centering .ring-plot centers the donut itself,
   regardless of how many labels land on which side. */
.overview{display:flex; justify-content:center; margin-bottom:8px;
  background:linear-gradient(160deg, var(--bg-2), var(--bg-1)); border:1px solid var(--border); border-radius:10px; padding:28px 24px;}
.ring-plot{position:relative; width:100%; max-width:760px}
.ring-plot-head{display:flex; justify-content:center; margin-bottom:10px}
/* The explicit "show everything" control next to the pie -- toggleBand(null)
   always clears regardless of current state, so this isn't a toggle, just
   a reset; .active just reflects "nothing is currently filtered". */
.ring-all-btn{
  display:inline-flex; align-items:center; gap:7px; font-family:var(--mono); font-size:.7rem; font-weight:700;
  letter-spacing:.04em; text-transform:uppercase; color:var(--ink-faint); border:1px solid var(--border);
  border-radius:20px; padding:6px 14px; transition:color .15s, border-color .15s, background .15s;
}
.ring-all-btn svg{width:13px; height:13px; flex:none}
.ring-all-btn:hover{color:var(--ink-soft); border-color:var(--border-strong)}
.ring-all-btn.active{color:var(--cyan); border-color:var(--cyan-border); background:var(--cyan-soft)}
.ring-wrap{position:relative; width:100%; aspect-ratio:400/240}
.ring-wrap svg{width:100%;height:100%;display:block}
.ring-wrap svg circle[data-band]{cursor:pointer; transition:opacity .15s, stroke-width .15s}
.ring-center{position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; pointer-events:none}
.ring-center .num{font-family:var(--mono); font-weight:800; font-size:1.9rem; color:var(--ink)}
.ring-center .lbl{font-family:var(--mono); font-size:.62rem; color:var(--ink-faint); letter-spacing:.08em; text-transform:uppercase; margin-top:2px}

/* HTML overlay, positioned by JS via left/top % of the same viewBox the
   SVG leader lines use -- tracks the SVG's own responsive scaling exactly
   (see renderRingLabels). Each item is a real button so it's clickable
   like the old legend rows were, just positioned next to its own arc
   instead of stacked in an unrelated list. */
.ring-labels{position:absolute; inset:0; pointer-events:none}
.ring-label-item{
  position:absolute; display:flex; flex-direction:column; gap:5px; pointer-events:auto;
  padding:5px 9px; border-radius:7px; border:1px solid transparent; white-space:nowrap;
  transition:background .15s, border-color .15s, opacity .15s;
}
.ring-label-item.side-right{ transform:translate(0,-50%) }
.ring-label-item.side-left{ transform:translate(-100%,-50%) }
.ring-label-item:hover{background:rgba(255,255,255,.04)}
.ring-label-item.active{border-color:var(--row-c); background:color-mix(in srgb, var(--row-c) 14%, transparent)}
.ring-label-item.active::before{
  /* A thin corner-bracket accent on the active label -- HUD "selected
     target" cue, same spirit as the per-platform accent stripes elsewhere
     on this page, just drawn as brackets instead of a stripe. */
  content:''; position:absolute; top:-1px; left:-1px; width:7px; height:7px;
  border-top:2px solid var(--row-c); border-left:2px solid var(--row-c); border-radius:3px 0 0 0;
}
.ring-label-item.dim{opacity:.4}
.ring-label-row1{display:inline-flex; align-items:flex-start; gap:7px}
.ring-label-sw{width:9px;height:9px;border-radius:3px;flex:none; margin-top:2px}
/* Wraps instead of ellipsizing -- the matched band's name is the live
   signal's own real label (bandDisplayLabel()), which can run well past
   what the old fixed-width single-line truncation handled gracefully
   ("Negative Sentiment" and longer both got cut to "NEGATIV..."). 150px
   wraps a long name to 2 lines cleanly rather than hiding it. */
.ring-label-name{
  font-family:var(--mono); font-size:.72rem; text-transform:uppercase; letter-spacing:.03em; color:var(--ink-soft);
  max-width:150px; white-space:normal; word-break:break-word; line-height:1.25; text-align:center;
}
.ring-label-item.active .ring-label-name{color:var(--ink)}
.ring-label-stats{display:inline-flex; align-items:baseline; gap:5px; font-family:var(--mono); margin-top:1px}
.ring-label-stats b{font-size:.84rem; font-weight:700}
.ring-label-stats i{font-style:normal; font-size:.64rem; color:var(--ink-faint)}
/* The per-label "view below" cue -- a small chevron that's always present
   (not just on hover) so it reads as "every one of these opens something
   below", not decoration on just one label. margin-top: row1 switched to
   align-items:flex-start (so a wrapped 2-line name doesn't get vertically
   centered against its single-line siblings) -- nudges the swatch/stats/
   chevron down to roughly align with the name's own first line instead of
   sitting flush with the row's very top edge. */
.ring-label-view{flex:none; width:12px; height:12px; margin-top:3px; color:var(--ink-faint); opacity:.55; transition:opacity .15s, transform .15s}
.ring-label-view svg{width:100%; height:100%; display:block}
.ring-label-item:hover .ring-label-view{opacity:1; transform:translateY(1px)}

/* ── Thumbnail collage ("data fragments") ──────────────────────
   Real recent post images for this band, cut-corner tiles instead of
   plain squares/circles so this reads as instrument-panel hardware, not a
   photo grid -- a light sci-fi HUD treatment that fits the rest of this
   page's dark console aesthetic. Entirely skipped (ringCollageHtml) for a
   band with nothing to show, rather than empty placeholder tiles. */
.ring-label-collage{
  display:inline-flex; align-items:center; padding-left:2px; margin-top:1px;
  --thumb-size:50px; --thumb-overlap:18px;
}
.ring-thumb{
  position:relative; width:var(--thumb-size); height:var(--thumb-size); flex:none;
  margin-left:calc(-1 * var(--thumb-overlap));
  clip-path:polygon(22% 0, 100% 0, 100% 78%, 78% 100%, 0 100%, 0 22%);
  box-shadow:0 0 0 1px color-mix(in srgb, var(--row-c) 55%, transparent), 0 0 9px color-mix(in srgb, var(--row-c) 45%, transparent);
  background:var(--bg-2); transition:translate .18s, scale .18s, rotate .18s, box-shadow .18s; cursor:pointer;
  /* Only opacity/scale/clip-path are keyframed below -- `rotate` is a
     SEPARATE css property (not part of the `transform` shorthand), so the
     static alternating tilt two rules down keeps applying on top of this
     animation the whole time instead of the animation clobbering it (and
     snapping back only once the animation ends). */
  animation:ring-thumb-in .5s cubic-bezier(.2,.8,.3,1.1) backwards;
  animation-delay:calc(var(--i, 0) * 70ms);
}
.ring-thumb:first-child{margin-left:0}
.ring-thumb:nth-child(odd){rotate:-4deg}
.ring-thumb:nth-child(even){rotate:4deg}
.ring-thumb img{width:100%; height:100%; object-fit:cover; display:block}
.ring-label-item:hover .ring-thumb{
  translate:0 -4px; scale:1.08; rotate:0deg;
  box-shadow:0 0 0 1px var(--row-c), 0 0 16px color-mix(in srgb, var(--row-c) 75%, transparent);
}
.ring-thumb-play{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  background:rgba(5,7,12,.4);
}
.ring-thumb-play svg{width:calc(var(--thumb-size) * .32); height:calc(var(--thumb-size) * .32); fill:rgba(255,255,255,.92)}
.ring-collage-more{
  margin-left:5px; font-family:var(--mono); font-weight:800; font-size:.68rem;
  border:1px solid; border-radius:20px; padding:4px 10px; flex:none; align-self:center;
}
@keyframes ring-thumb-in{
  from{opacity:0; scale:.6; clip-path:polygon(50% 50%,50% 50%,50% 50%,50% 50%,50% 50%,50% 50%)}
  to{opacity:1; scale:1; clip-path:polygon(22% 0, 100% 0, 100% 78%, 78% 100%, 0 100%, 0 22%)}
}

@media (max-width:820px){
  /* Same breakpoint the handles/feed split and mobile tabs already use
     below -- side-by-side leader-line labels need real width either side
     of the ring (the longer labels, "Pending classification"/"Clear / no
     match", are ~20ch), which a narrower-than-desktop viewport doesn't
     reliably have. Rebuilt here as its own proper card list, NOT the
     desktop overlay with its positioning stripped off -- a plain list of
     bordered rows, each with its own background so a list of several
     reads as distinct rows, not a loose stack of near-invisible text. */
  /* No max-width override here anymore -- that 220px cap was sized for
     when labels sat beside the ring as an overlay; capping the ring small
     made sense then. Now labels stack BELOW it in normal flow (see
     .ring-labels below), so the ring should just fill the card like a
     normal mobile chart -- the old cap was starving it down to ~75px
     actual rendered diameter against the 550/POSTS text's fixed font-size,
     which is the "circle too small for the text" bug. */
  #ringSvg .ring-leaders{display:none}
  .ring-labels{position:static; display:flex; flex-direction:column; gap:10px; margin-top:20px; pointer-events:auto}
  .ring-label-item, .ring-label-item.side-left, .ring-label-item.side-right{
    /* relative, not static -- still needs to be a positioning context for
       its own .active::before corner bracket; "take it out of the
       absolute overlay" only requires dropping left/top/transform below,
       not position itself. !important on left/top specifically: JS sets
       those as an INLINE style (renderRingLabels' left:/top:% for the
       desktop overlay) -- inline styles beat any plain selector here, so
       without !important they silently persist as position:relative
       OFFSETS instead of the absolute coordinates they were meant to be,
       shoving every row off to one side and straight off the edge of a
       narrow screen. This was the actual "looks terrible on mobile" bug,
       not the width/background rules below (those were already correct). */
    position:relative; left:auto !important; top:auto !important; transform:none; width:100%;
    background:rgba(255,255,255,.025); border-color:var(--border); padding:10px 12px;
  }
  .ring-label-item.dim{opacity:.55} /* .4 reads as near-invisible against a list of real card rows, not a bright ring */
  /* Row 1 regrouped: swatch+name as one wrapping block on the left,
     stats+chevron anchored together on the right -- NOT space-between
     across all 4 children, which scattered them with uneven gaps and no
     visual relationship between a label and its own numbers. */
  .ring-label-row1{width:100%}
  .ring-label-name{flex:1 1 auto; max-width:none; min-width:0}
  .ring-label-stats{margin-left:auto; flex:none}
  /* Smaller collage on a phone-width card -- 50px desktop tiles would eat
     most of the row's width here. */
  .ring-label-collage{--thumb-size:38px; --thumb-overlap:13px}
}

.sample-note{font-family:var(--mono); font-size:.68rem; color:var(--ink-faint); margin:16px 2px 20px; letter-spacing:.02em}
.sample-note b{color:var(--ink-soft)}

/* ── Band filter panel (below the breakdown) ──────────────────
   Same activeBand state the ring/labels above read and write via
   toggleBand() -- a click here has exactly the same effect as clicking a
   segment or a label. A plain single-active-pill-group (All + the 4
   bands), same convention as the Signal/Range pickers above. */
.band-filter{display:flex; flex-wrap:wrap; gap:10px; margin-bottom:30px}
.band-chip{
  display:inline-flex; align-items:center; gap:8px; font-family:var(--mono); font-size:.72rem; font-weight:700;
  letter-spacing:.03em; text-transform:uppercase; color:var(--ink-faint); border:1px solid var(--border);
  border-radius:20px; padding:8px 14px; transition:color .15s, border-color .15s, background .15s, opacity .15s;
}
.band-chip:hover{color:var(--ink-soft); border-color:var(--border-strong)}
.band-chip.selected{
  color:var(--chip-c); border-color:color-mix(in srgb, var(--chip-c) 55%, transparent);
  background:color-mix(in srgb, var(--chip-c) 12%, transparent);
}
.band-chip:not(.selected){opacity:.45}
.band-chip-sw{width:9px;height:9px;border-radius:3px;flex:none;background:var(--chip-c)}
.band-chip-count{font-weight:800}
/* "All" carries no single band color (it's the reset option, not a band)
   -- styled with the page's general accent instead of --chip-c, which it
   never has set. */
.band-chip--all.selected{
  color:var(--cyan); border-color:var(--cyan-border); background:var(--cyan-soft);
}

/* ── Split: handles | feed ─────────────────────────────────── */
.split{display:grid; grid-template-columns:1fr 1.5fr; gap:22px; align-items:start; min-width:0}

.mobile-tabs{display:none}
@media (max-width:820px){
  .split{grid-template-columns:1fr}
  .mobile-tabs{
    display:flex; gap:2px; padding:3px; margin-bottom:16px;
    background:var(--bg-1); border:1px solid var(--border); border-radius:8px;
  }
  .mobile-tab{
    flex:1; text-align:center; font-family:var(--mono); font-size:.76rem; font-weight:700; letter-spacing:.03em;
    padding:9px 10px; border-radius:6px; color:var(--ink-faint);
  }
  .mobile-tab.active{background:var(--cyan-soft); color:var(--cyan)}
  .panel.mobile-inactive{display:none}
}
.mobile-tab-dot{display:inline-block; width:6px; height:6px; border-radius:50%; margin-left:6px; vertical-align:middle}

/* min-width:0 is the actual fix for the mobile horizontal-overflow bug --
   a grid item defaults to min-width:auto, meaning it's NEVER allowed to
   shrink below its content's intrinsic (min-content) width no matter what
   the track's 1fr says. Any unbreakable content anywhere inside this
   panel (long unbroken text, a wide inline row, ...) was free to force
   the whole grid track -- and with it .split/.wrap/body -- wider than the
   viewport. This is the standard fix, not a max-width clamp: it lets the
   panel actually respect its grid column, and everything inside it (the
   handle-name-row wrap fix, text ellipsis, etc.) handles its own overflow
   from there. */
.panel{background:linear-gradient(160deg, var(--bg-2), var(--bg-1)); border:1px solid var(--border); border-radius:10px; padding:18px 20px 20px; position:relative; min-width:0}
.panel-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; flex-wrap:wrap; gap:8px}

/* Visible "working" feedback for the handles/feed panels specifically --
   every loadData() call re-queries both (signal/range/platform/band/paging
   change), so this is the thing that's actually waiting on the network,
   closer to where the user is looking than the thin loadBar hairline up
   top. A quiet dim + spinner, not a full skeleton -- the existing content
   stays legible/readable while the fresh page loads in behind it. */
.panel.is-loading > *:not(.panel-head){opacity:.35; transition:opacity .15s}
.panel.is-loading::after{
  content:''; position:absolute; top:18px; right:20px; width:16px; height:16px;
  border-radius:50%; border:2px solid var(--border-strong); border-top-color:var(--cyan);
  animation:panel-spin .7s linear infinite;
}
@keyframes panel-spin{to{transform:rotate(360deg)}}
.panel-title-row{display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.panel-title{font-family:var(--mono); font-size:.72rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--cyan)}
.panel-sub{font-family:var(--mono); font-size:.66rem; color:var(--ink-faint)}

/* Filled in next to the panel title whenever a signal band is isolated --
   see filterTagHtml() in the JS. Makes "All Handles"/"Live Stream" show
   their own filtered state instead of staying static regardless of what
   the ring/band-filter above is doing. */
.filter-tag-pill{
  display:inline-flex; align-items:center; gap:6px; font-family:var(--mono); font-size:.64rem; font-weight:700;
  letter-spacing:.04em; text-transform:uppercase; color:var(--tag-c); border:1px solid color-mix(in srgb, var(--tag-c) 50%, transparent);
  background:color-mix(in srgb, var(--tag-c) 14%, transparent); border-radius:14px; padding:4px 6px 4px 10px;
}
.filter-tag-x{
  color:var(--tag-c); font-size:.9rem; line-height:1; padding:0 2px; border-radius:50%; transition:background .15s;
}
.filter-tag-x:hover{background:color-mix(in srgb, var(--tag-c) 25%, transparent)}

.post-list{display:flex; flex-direction:column; gap:2px}
.post-item{padding:11px 8px; border-radius:6px; border-bottom:1px solid var(--border); display:block; text-decoration:none; color:inherit; transition:background .15s}
.post-item:hover{background:rgba(255,255,255,.03)}
.post-item:last-child{border-bottom:none}
.post-body{display:flex; gap:12px}
.post-main{flex:1; min-width:0}
.post-thumb{position:relative; flex:none; width:76px; height:76px; border-radius:6px; overflow:hidden; background:var(--bg-2)}
.post-thumb img{width:100%; height:100%; object-fit:cover; display:block}
.post-thumb .play-badge{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  background:rgba(5,7,12,.25);
}
.post-thumb .play-badge svg{width:26px; height:26px; fill:rgba(255,255,255,.92); filter:drop-shadow(0 1px 3px rgba(0,0,0,.5))}
.post-top{display:flex; align-items:center; gap:8px; margin-bottom:5px}
.plat-tag{
  font-family:var(--mono); font-size:.6rem; font-weight:700; letter-spacing:.05em; text-transform:uppercase;
  padding:2px 6px; border-radius:3px; flex:none; color:var(--ink); background:rgba(255,255,255,.06);
}
.post-author{font-size:.8rem; font-weight:600; color:var(--ink); flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.post-time{font-family:var(--mono); font-size:.66rem; color:var(--ink-faint); flex:none}
.post-title{font-size:.82rem; color:var(--ink-soft); line-height:1.45; margin-bottom:7px;
  display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden}
.meter{display:flex; align-items:center; gap:8px}
.meter-track{flex:1; height:4px; border-radius:3px; background:rgba(255,255,255,.07); overflow:hidden}
.meter-fill{height:100%; border-radius:3px}
.meter-val{font-family:var(--mono); font-size:.66rem; font-weight:700; width:56px; text-align:right; flex:none}
.meter-val.pending{color:var(--slate)}

.handle-list{display:flex; flex-direction:column; gap:3px}
.handle-row{border-radius:6px; overflow:hidden}
.handle-btn{width:100%; display:flex; align-items:center; gap:10px; padding:10px 10px; border-radius:6px; transition:background .15s}
.handle-btn:hover{background:rgba(255,255,255,.04)}
.handle-btn.open{background:rgba(77,220,232,.07)}
.handle-rank{font-family:var(--mono); font-size:.66rem; color:var(--ink-faint); width:16px; flex:none}
.handle-main{flex:1; min-width:0; text-align:left}
/* flex-wrap, not nowrap -- a handle tagged on 3 platforms (Facebook/
   Instagram/X) doesn't fit next to its own name on a narrow screen, and
   .handle-plats below refuses to shrink (flex:none, it's a group of fixed-
   width pills, not shrinkable text) -- without wrap, that forced the whole
   row, and with it the whole page, wider than the viewport (real mobile
   horizontal-scroll bug). Wrapping just drops the platform pills to their
   own line when there's no room, same row otherwise. */
.handle-name-row{display:flex; align-items:center; gap:6px; row-gap:3px; min-width:0; flex-wrap:wrap}
.handle-name{font-size:.82rem; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.handle-plats{display:flex; gap:4px; flex:none}
.handle-plats .plat-tag{font-size:.56rem; padding:1px 5px}
.handle-bar-track{height:3px; border-radius:2px; background:rgba(255,255,255,.07); margin-top:5px; overflow:hidden}
.handle-bar-fill{height:100%; background:var(--cyan); border-radius:2px}
.handle-count{font-family:var(--mono); font-weight:700; font-size:.82rem; color:var(--ink); flex:none}
.handle-neg{font-family:var(--mono); font-size:.62rem; color:var(--amber); flex:none; width:52px; text-align:right}
.handle-chev{flex:none; width:14px; height:14px; color:var(--ink-faint); transition:transform .15s}
.handle-btn.open .handle-chev{transform:rotate(90deg); color:var(--cyan)}
.handle-sub{padding:2px 10px 10px 42px; display:flex; flex-direction:column; gap:8px}
.handle-sample-note{font-family:var(--mono); font-size:.66rem; color:var(--ink-faint); padding:2px 0 2px}
.handle-sub .post-item{border-bottom:1px dashed var(--border); padding:9px 6px}

.handle-page-nav{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:6px 2px; flex-wrap:wrap}
.page-btn{
  font-family:var(--mono); font-size:.68rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  color:var(--cyan); border:1px solid var(--cyan-border); background:var(--cyan-soft);
  padding:5px 12px; border-radius:5px; display:flex; align-items:center; gap:6px; transition:opacity .15s;
}
.page-btn:disabled{opacity:.3; cursor:default}
.page-btn svg{width:11px;height:11px}
.page-info{font-family:var(--mono); font-size:.66rem; color:var(--ink-faint); letter-spacing:.02em}

.empty{padding:28px 10px; text-align:center; font-family:var(--mono); font-size:.78rem; color:var(--ink-faint)}
.clear-filter{
  font-family:var(--mono); font-size:.68rem; color:var(--cyan); border:1px solid var(--cyan-border);
  padding:4px 10px; border-radius:14px; background:var(--cyan-soft);
}

.footer{
  margin-top:50px; padding-top:20px; border-top:1px solid var(--border);
  font-family:var(--mono); font-size:.72rem; color:var(--ink-faint); text-align:center;
}
