:root {
  --bg: #07070f;
  --surface: #0f0f1a;
  --surface2: #141428;
  --border: #1e1e32;
  --text: #f0f0f5;
  --text-2: #8888a0;
  --text-3: #4a4a65;
  --blue: #007aff;
  --green: #30d158;
  --red: #ff3b30;
  --orange: #ff9500;
  --purple: #bf5af2;
  --market-height: 48px;
  --alert-height: 0px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ─── AUTH ─── */
#auth-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 320px;
  text-align: center;
}
.auth-box h2 { font-size: 20px; margin-bottom: 8px; }
.auth-box p { color: var(--text-2); margin-bottom: 24px; font-size: 13px; }
.auth-box input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  margin-bottom: 12px;
}
.auth-box input:focus { border-color: var(--blue); }
.auth-box button {
  width: 100%;
  background: var(--blue);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px;
  cursor: pointer;
}
.auth-box button:hover { opacity: 0.85; }
.auth-error { color: var(--red); font-size: 12px; margin-top: 8px; }

/* ─── MARKET STRIP ─── */
#market-strip {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--market-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 20px;
  z-index: 100;
  overflow-x: auto;
  white-space: nowrap;
}
#market-strip::-webkit-scrollbar { display: none; }
.live-dot {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700;
  color: var(--red); letter-spacing: 0.5px;
  flex-shrink: 0;
}
.live-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.market-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; flex-shrink: 0;
}
.market-item .coin { color: var(--text-2); font-weight: 600; }
.market-item .price { font-weight: 700; }
.market-item .change { font-size: 12px; }
.change.up { color: var(--green); }
.change.down { color: var(--red); }
.market-divider {
  width: 1px; height: 20px;
  background: var(--border); flex-shrink: 0;
}
.market-meta { color: var(--text-2); font-size: 12px; flex-shrink: 0; }

/* ─── ALERT BANNER ─── */
#alert-banner {
  position: fixed;
  top: var(--market-height);
  left: 0; right: 0;
  background: rgba(255, 149, 0, 0.15);
  border-bottom: 1px solid var(--orange);
  padding: 0 16px;
  height: 0;
  overflow: hidden;
  transition: height 0.3s ease;
  z-index: 99;
  display: flex; align-items: center;
}
#alert-banner.visible { height: 40px; }
#alert-banner-text { color: var(--orange); font-size: 13px; font-weight: 600; }

/* ─── MAIN LAYOUT ─── */
#app {
  display: none;
  padding-top: calc(var(--market-height) + 1px);
}
#app.authed { display: block; }

.main-container {
  display: flex;
  height: calc(100vh - var(--market-height));
}

/* ─── TABS ─── */
#tab-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  overflow-x: auto;
  gap: 2px;
  height: 44px;
  flex-shrink: 0;
}
#tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
  padding: 6px 12px;
  position: relative;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.tab-btn:hover { background: var(--surface2); color: var(--text); }
.tab-btn.active { background: var(--surface2); color: var(--text); font-weight: 600; }
.tab-badge {
  position: absolute;
  top: 2px; right: 4px;
  background: var(--red);
  color: #fff;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
}

/* ─── CONTENT AREA ─── */
.content-wrap {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - var(--market-height) - 44px);
}

/* ─── STORIES PANEL ─── */
#stories-panel {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.stories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: start;
}
#stories-panel::-webkit-scrollbar { width: 4px; }
#stories-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ─── STORY CARD ─── */
.story-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  transition: border-color 0.15s;
  cursor: pointer;
  position: relative;
}
.story-card:hover { border-color: var(--text-3); }
.story-card.pinned { border-color: var(--orange); }
.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.source-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}
.tier-1 { background: rgba(0,122,255,0.2); color: var(--blue); }
.tier-2 { background: rgba(191,90,242,0.2); color: var(--purple); }
.tier-3 { background: rgba(136,136,160,0.15); color: var(--text-2); }
.time-ago { color: var(--text-3); font-size: 11px; margin-left: auto; }
.breaking {
  font-size: 10px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.5px;
}
.sentiment {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.sentiment.bullish { background: rgba(48,209,88,0.15); color: var(--green); }
.sentiment.bearish { background: rgba(255,59,48,0.15); color: var(--red); }
.sentiment.neutral { background: rgba(136,136,160,0.1); color: var(--text-2); }
.pin-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.4;
  padding: 0;
  transition: opacity 0.15s;
}
.pin-btn:hover, .pin-btn.pinned { opacity: 1; }
.card-image {
  width: 100%;
  height: 180px;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  margin-bottom: 10px;
  background-color: var(--surface2);
}
.card-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
  color: var(--text);
}
.card-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 10px;
}
.card-link {
  font-size: 12px;
  color: var(--blue);
  text-decoration: none;
}
.card-link:hover { text-decoration: underline; }
.confidence-bar {
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  margin-top: 8px;
  overflow: hidden;
}
.confidence-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 1px;
  transition: width 0.3s;
}

.empty-state {
  text-align: center;
  color: var(--text-3);
  padding: 60px 20px;
  font-size: 13px;
}

/* ─── SIDEBAR ─── */
#sidebar {
  width: 300px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-section {
  border-bottom: 1px solid var(--border);
}
.sidebar-section-header {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-3);
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.sidebar-section-header:hover { background: var(--surface2); }
.sidebar-body { padding: 12px 16px; }

/* Search */
#search-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
}
#search-input:focus { border-color: var(--blue); }

/* Signal filter toggle */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-2);
}
.toggle {
  position: relative;
  width: 36px; height: 20px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 2px; top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--blue); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

/* Alert history */
#alert-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#alert-list::-webkit-scrollbar { width: 3px; }
#alert-list::-webkit-scrollbar-thumb { background: var(--border); }
.alert-item {
  background: var(--surface2);
  border: 1px solid rgba(255,149,0,0.2);
  border-radius: 8px;
  padding: 8px 10px;
}
.alert-item .alert-kw {
  font-size: 11px;
  font-weight: 700;
  color: var(--orange);
  margin-bottom: 3px;
}
.alert-item .alert-title {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.4;
}
.alert-empty { color: var(--text-3); font-size: 12px; text-align: center; padding: 12px 0; }

/* Settings panel */
#settings-body { overflow-y: auto; flex: 1; }
.settings-group { margin-bottom: 16px; }
.settings-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: block;
}
.settings-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  margin-bottom: 8px;
}
.settings-input:focus { border-color: var(--blue); }
.keyword-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.keyword-tag {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
}
.keyword-tag span { flex: 1; color: var(--text); }
.keyword-tag .kw-tg { font-size: 11px; color: var(--text-3); cursor: pointer; }
.keyword-tag .kw-tg.on { color: var(--blue); }
.keyword-tag .kw-del { color: var(--red); cursor: pointer; background: none; border: none; font-size: 14px; }
.btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  padding: 7px 12px;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--border); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { opacity: 0.85; background: var(--blue); }
.btn-danger { color: var(--red); border-color: rgba(255,59,48,0.3); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cat-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-2);
}
.status-msg { font-size: 11px; color: var(--green); margin-top: 6px; }
.error-msg { font-size: 11px; color: var(--red); margin-top: 6px; }

/* ─── MOBILE ─── */
@media (max-width: 768px) {
  .stories-grid { grid-template-columns: 1fr; }
  .content-wrap { flex-direction: column; }
  #sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: 280px;
  }
  #stories-panel {
    height: auto;
    min-height: 300px;
  }
  .main-container {
    flex-direction: column;
    height: auto;
  }
  .content-wrap {
    height: auto;
  }
  #market-strip { gap: 12px; }
  .card-image { height: 120px; }
}

/* ─── LOAD MORE ─── */
#load-more-btn {
  display: none;
  margin: 24px auto 8px;
  width: 160px;
  padding: 10px 0;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
#load-more-btn:hover {
  border-color: rgba(255,255,255,0.25);
  color: var(--text-1);
  background: rgba(255,255,255,0.04);
}
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1200px) and (min-width: 769px) {
  .stories-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Placeholder image with source label */
.placeholder-img {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.placeholder-img::after {
  content: attr(data-source);
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

/* ─── INTEL / TELEGRAM RAW POSTS ─── */
.card-raw-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
}

/* ─── INTEL FEED (single column, X-style) ─── */
#stories-panel.intel-mode .stories-grid {
  grid-template-columns: 1fr;
  max-width: 680px;
  margin: 0 auto;
}

.story-card .card-raw-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
}

/* Image grid for Telegram posts */
.tg-img-grid {
  display: grid;
  gap: 4px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
  cursor: pointer;
}
.tg-img-grid-1 { grid-template-columns: 1fr; }
.tg-img-grid-2 { grid-template-columns: 1fr 1fr; }
.tg-img-grid-3 { grid-template-columns: 1fr 1fr; }
.tg-img-grid-3 .tg-img:first-child { grid-column: 1 / -1; }
.tg-img-grid-4 { grid-template-columns: 1fr 1fr; }

.tg-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.tg-img:hover { opacity: 0.85; }

.tg-video-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--blue);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  transition: background 0.15s;
}
.tg-video-link:hover { background: var(--surface); }

/* Hide card-image placeholder for intel posts */
#stories-panel.intel-mode .card-image {
  display: none;
}

/* ─── X/TWITTER STYLE POSTS (Intel tab) ─── */
#stories-panel.intel-mode .stories-grid {
  grid-template-columns: 1fr;
  max-width: 600px;
  margin: 0 auto;
  gap: 0;
}

.xpost {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.xpost:hover { background: rgba(255,255,255,0.03); }

.xpost-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d9bf0, #0d6fbd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}

.xpost-right {
  flex: 1;
  min-width: 0;
}

.xpost-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.xpost-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.xpost-dot {
  color: var(--text-2);
  font-size: 13px;
}

.xpost-time {
  color: var(--text-2);
  font-size: 13px;
}

.xpost-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
}

/* Image grids */
.xpost-imgs {
  display: grid;
  gap: 2px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 10px;
}
.xpost-imgs-1 { grid-template-columns: 1fr; }
.xpost-imgs-2 { grid-template-columns: 1fr 1fr; }
.xpost-imgs-3 { grid-template-columns: 1fr 1fr; }
.xpost-imgs-3 img:first-child { grid-column: 1 / -1; aspect-ratio: 16/7; }
.xpost-imgs-4 { grid-template-columns: 1fr 1fr; }

.xpost-imgs img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.xpost-imgs-1 img { aspect-ratio: auto; max-height: 480px; object-fit: contain; background: #000; }
.xpost-imgs img:hover { opacity: 0.85; }

.xpost-video-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: #1d9bf0;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}
.xpost-video-btn:hover { background: rgba(29,155,240,0.1); }

/* ─── VIDEO EMBED ─── */
.xpost-video-wrap {
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 10px;
  background: #000;
}

.xpost-video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 220px;
  background: #111;
  cursor: pointer;
  border-radius: 14px;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  transition: background 0.15s;
}
.xpost-video-placeholder:hover { background: #1a1a1a; }

.xpost-play-icon {
  font-size: 42px;
  color: #1d9bf0;
  line-height: 1;
}

.xpost-video-iframe {
  width: 100%;
  height: 360px; /* overridden by postMessage resize */
  border: none;
  display: block;
  background: #000;
  transition: height 0.2s ease;
}
.intel-video-wrap, .xpost-video-wrap {
  border-radius: 10px;
  overflow: hidden;
}

/* ─── TWEET EMBEDS ─── */
.tweet-wrap {
  padding: 4px 16px !important;
  border-bottom: 1px solid var(--border) !important;
  background: transparent !important;
  display: block !important;
}
.tweet-embed-iframe {
  width: 100% !important;
  min-height: 150px;
  height: 300px;
  border: none !important;
  display: block;
  transition: height 0.2s;
}

/* ─── OEMBED TWEET CARDS ─── */
.tweet-wrap {
  padding: 8px 16px !important;
  border-bottom: 1px solid var(--border) !important;
  display: block !important;
  background: transparent !important;
}
.tweet-loading {
  padding: 20px;
  color: var(--text-2);
  font-size: 13px;
}
.tweet-fallback {
  padding: 12px 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}
.tweet-fallback a, .tweet-open-link {
  display: inline-block;
  margin-top: 8px;
  color: #1d9bf0;
  font-size: 13px;
  text-decoration: none;
  font-weight: 500;
}
.tweet-open-link { display: block; margin-top: 6px; }
/* Let Twitter widget control its own width */
.tweet-wrap .twitter-tweet { margin: 0 auto !important; }

/* Pause market ticker on hover */
.market-strip:hover .market-ticker {
  animation-play-state: paused;
}

/* ─── FEAR & GREED GAUGE ─── */
.fg-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fg-label { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.fg-bar-wrap { width: 80px; }
.fg-bar {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #34c759 0%, #30d158 25%, #ffd60a 50%, #ff9500 75%, #ff3b30 100%);
}
.fg-pointer {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 0 4px rgba(0,0,0,0.5);
  transition: left 0.5s ease;
}
.fg-value { font-size: 11px; white-space: nowrap; font-weight: 600; }

/* ─── SIDEBAR CATEGORIES ─── */
.cat-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cat-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 12px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s;
}
.cat-btn:hover { background: var(--surface2); }
.cat-btn.active { background: var(--surface2); color: var(--blue); font-weight: 600; }

/* ─── CATEGORY TOGGLE ROWS ─── */
.cat-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 8px;
}
.cat-toggle-row .cat-btn {
  flex: 1;
}
.toggle-sm {
  transform: scale(0.75);
  transform-origin: right center;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   INTEL FEED — REDESIGNED
═══════════════════════════════════════════ */

/* Single column, wider for readability */
#stories-panel.intel-mode .stories-grid {
  grid-template-columns: 1fr;
  max-width: 680px;
  margin: 0 auto;
  gap: 0;
}

.intel-post {
  display: flex;
  gap: 0;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.12s;
  position: relative;
}
.intel-post:hover { background: rgba(255,255,255,0.03); }

/* Color accent bar on the left */
.intel-accent {
  width: 3px;
  min-height: 100%;
  background: #444;
  flex-shrink: 0;
  border-radius: 0;
  transition: background 0.2s;
}
.intel-post:hover .intel-accent { background: #555; }
.intel-breaking .intel-accent { background: #ff3b30; }

.intel-body {
  flex: 1;
  padding: 14px 16px 14px 14px;
  min-width: 0;
}

/* Source + time + badge row */
.intel-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.intel-source {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #666;
}

.intel-time {
  font-size: 11px;
  color: #444;
}

.intel-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ff3b30;
  background: rgba(255, 59, 48, 0.12);
  border: 1px solid rgba(255, 59, 48, 0.25);
  padding: 2px 7px;
  border-radius: 4px;
  animation: pulse-badge 1.5s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Main text — bigger, more readable */
.intel-text {
  font-size: 15px;
  line-height: 1.65;
  color: #e5e5e5;
  white-space: pre-wrap;
  word-break: break-word;
  letter-spacing: 0.01em;
}

.intel-breaking .intel-text {
  color: #fff;
  font-weight: 500;
}

/* Images */
.intel-imgs {
  display: grid;
  gap: 3px;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
}
.intel-imgs-1 { grid-template-columns: 1fr; }
.intel-imgs-2 { grid-template-columns: 1fr 1fr; }
.intel-imgs-3 { grid-template-columns: 1fr 1fr; }
.intel-imgs-3 img:first-child { grid-column: 1/-1; }
.intel-imgs-4 { grid-template-columns: 1fr 1fr; }
.intel-imgs img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.intel-imgs-1 img { aspect-ratio: auto; max-height: 400px; object-fit: contain; background: #111; }
.intel-imgs img:hover { opacity: 0.85; }

/* Video */
.intel-video-wrap {
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
}
.intel-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 180px;
  background: #111;
  cursor: pointer;
  font-size: 14px;
  color: #888;
  transition: background 0.15s;
}
.intel-play-btn:hover { background: #1a1a1a; color: #aaa; }
.intel-play-icon {
  font-size: 32px;
  color: #fff;
  opacity: 0.7;
}

/* ═══════════════════════════════════════════
   INTEL FEED — SHINE POLISH v2
═══════════════════════════════════════════ */

/* ─── LIVE indicator ─── */
.intel-live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #666;
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
}
.intel-live-indicator .live-pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff3b30;
  animation: pulse-live 1.8s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-live {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255,59,48,0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(255,59,48,0); }
}
.intel-live-text { color: #ff3b30; }
.intel-post-count { color: #444; margin-left: auto; font-weight: 400; font-size: 10px; }

/* ─── SLIDE IN animation for new posts ─── */
@keyframes intelSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.intel-post.intel-new {
  animation: intelSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ─── Post accent color tiers ─── */
.intel-post.intel-alert .intel-accent   { background: #ff9500; }
.intel-post.intel-report .intel-accent  { background: #ffd60a; }
.intel-post:hover { background: rgba(255,255,255,0.025) !important; }
.intel-post.intel-breaking:hover { background: rgba(255,59,48,0.04) !important; }
.intel-post.intel-alert:hover    { background: rgba(255,149,0,0.04) !important; }

/* ─── Meta row ─── */
.intel-source { font-size: 11px !important; font-weight: 700 !important; letter-spacing: 0.06em !important; color: #999 !important; }
.intel-time   { font-size: 11px !important; color: #666 !important; font-variant-numeric: tabular-nums; }
.intel-breaking .intel-source { color: #bbb !important; }

/* ─── Breaking badge ─── */
.intel-badge {
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.1em !important;
  color: #ff3b30 !important;
  background: rgba(255,59,48,0.1) !important;
  border: 1px solid rgba(255,59,48,0.3) !important;
  padding: 2px 8px !important;
  border-radius: 3px !important;
  animation: pulse-badge-v2 1.8s ease-in-out infinite !important;
  text-shadow: 0 0 8px rgba(255,59,48,0.3);
}
@keyframes pulse-badge-v2 {
  0%, 100% { opacity: 1; border-color: rgba(255,59,48,0.4); }
  50%       { opacity: 0.75; border-color: rgba(255,59,48,0.15); }
}
.intel-badge.badge-alert {
  color: #ff9500 !important;
  background: rgba(255,149,0,0.1) !important;
  border-color: rgba(255,149,0,0.3) !important;
  text-shadow: 0 0 8px rgba(255,149,0,0.3);
}

/* ─── Intel text ─── */
.intel-text { font-size: 15px !important; line-height: 1.72 !important; color: #d4d4d4 !important; letter-spacing: 0.015em !important; }
.intel-breaking .intel-text { color: #efefef !important; font-weight: 500 !important; }
.intel-alert .intel-text    { color: #e0e0e0 !important; }

/* ─── Body padding ─── */
.intel-body  { padding: 14px 18px 16px 14px !important; }
.intel-meta  { margin-bottom: 6px !important; }

/* ─── Image grid ─── */
.intel-imgs { margin-top: 12px !important; border-radius: 12px !important; overflow: hidden !important; gap: 2px !important; }
.intel-imgs img { opacity: 0; transition: opacity 0.45s ease !important; }
.intel-imgs img.img-loaded { opacity: 1; }
.intel-imgs img:hover { opacity: 0.85 !important; }
.intel-imgs-1 img { aspect-ratio: 16/9 !important; object-fit: cover !important; max-height: 360px !important; background: #111 !important; }

/* ─── Video placeholder ─── */
.intel-play-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  height: 200px !important;
  background: #0e0e0e !important;
  border: 1px solid rgba(255,255,255,0.07) !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  transition: background 0.2s, border-color 0.2s !important;
  margin: 0 !important;
}
.intel-play-btn:hover { background: #161616 !important; border-color: rgba(255,255,255,0.13) !important; }
.intel-play-icon-wrap {
  position: relative;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.13);
  display: flex; align-items: center; justify-content: center;
}
.intel-play-triangle {
  width: 0; height: 0;
  border-style: solid;
  border-width: 9px 0 9px 17px;
  border-color: transparent transparent transparent rgba(255,255,255,0.8);
  margin-left: 3px;
}
.intel-play-label {
  font-size: 11px !important;
  color: #555 !important;
  font-weight: 500 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}
.intel-video-wrap { margin-top: 12px !important; border-radius: 12px !important; overflow: hidden !important; border: 1px solid rgba(255,255,255,0.06) !important; }

/* ─── Feed layout ─── */
#stories-panel.intel-mode { padding: 0 !important; }
#stories-panel.intel-mode .stories-grid { max-width: 700px !important; margin: 0 auto !important; }
.intel-post { border-bottom: 1px solid rgba(255,255,255,0.05) !important; }
.intel-accent { width: 3px !important; transition: background 0.3s ease !important; }

