/* SiliconPulse Design System — Faithful to Jukan's Fact Desk UI + Modern Dark Mode */

:root {
  color-scheme: light dark;
  --bg-page: #f6f8fb;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-reported: #eef4ff;
  --border-reported: #bfdbfe;
  --text-reported-label: #1d4ed8;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;

  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-blue-soft: #eff6ff;
  --accent-dark: #0f172a;

  --ai-bg: #ecfdf5;
  --ai-text: #047857;
  --ai-border: #a7f3d0;

  --dot-active: #2563eb;
  --dot-inactive: #cbd5e1;
  --entity-dot: #10b981;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.03);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: #0b1120;
  --bg-surface: #111827;
  --bg-subtle: #1e293b;
  --bg-reported: rgba(37, 99, 235, 0.14);
  --border-reported: rgba(96, 165, 250, 0.32);
  --text-reported-label: #60a5fa;
  --border-subtle: #1f2937;
  --border-strong: #334155;

  --text-main: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --accent-blue: #3b82f6;
  --accent-blue-hover: #60a5fa;
  --accent-blue-soft: rgba(59, 130, 246, 0.16);
  --accent-dark: #f8fafc;

  --ai-bg: rgba(16, 185, 129, 0.15);
  --ai-text: #34d399;
  --ai-border: rgba(52, 211, 153, 0.3);

  --dot-active: #60a5fa;
  --dot-inactive: #334155;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", "PingFang TC",
    "Microsoft JhengHei", "Apple SD Gothic Neo", sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-blue);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.03em;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}

.brand-title {
  font-weight: 750;
  font-size: 16px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.brand-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
}

.search-wrap {
  position: relative;
  flex: 1 1 280px;
  max-width: 420px;
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 7px 12px 7px 34px;
  font-size: 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-main);
  transition: border-color 0.15s, background-color 0.15s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: var(--bg-surface);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-primary {
  background: var(--text-main);
  color: var(--bg-surface);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}

.btn-ai {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border-color: color-mix(in srgb, var(--accent-blue) 28%, transparent);
}

.btn-ai:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-blue) 18%, var(--bg-surface));
}

.btn-icon {
  padding: 7px 10px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.badge-pill {
  background: var(--accent-blue);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums;
}

.sync-icon.spinning {
  display: inline-block;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Segmented Controls */
.segmented {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 2px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.seg-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* Main Container */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 20px 56px;
}

/* Subnav & Stats */
.subnav-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.nav-tabs {
  display: inline-flex;
  align-self: flex-start;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 3px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.nav-tab.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.tab-count {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.stats-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.stat-chip-btn {
  cursor: pointer;
}

.stat-chip-btn:hover {
  border-color: var(--accent-blue);
}

.stat-label {
  color: var(--text-muted);
}

.stat-val {
  color: var(--text-main);
  font-weight: 700;
}

.stat-val.accent {
  color: var(--ai-text);
}

.stat-muted {
  color: var(--text-muted);
}

.sync-status-msg {
  font-size: 12px;
  color: var(--accent-blue);
  margin-left: 6px;
}

/* Filter Card */
.filter-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-bottom: 16px;
}

.filter-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.filter-label {
  flex: 0 0 64px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding-top: 5px;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: all 0.12s ease;
}

.filter-pill:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.filter-pill.active {
  background: var(--text-main);
  color: var(--bg-surface);
  border-color: var(--text-main);
}

.filter-pill .pill-count {
  opacity: 0.72;
  font-size: 11px;
}

.entity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--entity-dot);
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-left: 74px;
}

.select-pill {
  padding: 5px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.toggle-chip.active {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  font-weight: 600;
}

.btn-reset-filters {
  border: none;
  background: transparent;
  color: var(--accent-blue);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
}

/* Feed Layout Modes */
.feed-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-split3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.split-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.split-col-header {
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Article Card (Exact SiliconPulse Anatomy) */
.article-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  content-visibility: auto;
  contain-intrinsic-size: 220px;
  transition: border-color 0.15s ease;
}

.article-card:hover {
  border-color: var(--border-strong);
}

.card-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 12px;
}

.region-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.03em;
}

.region-KR { background: #dbeafe; color: #1d4ed8; }
.region-TW { background: #ccfbf1; color: #0f766e; }
.region-EN { background: #e2e8f0; color: #334155; }
.region-CN { background: #fef3c7; color: #b45309; }
.region-JP { background: #ede9fe; color: #6d28d9; }
.region-ARXIV { background: #ffe4e6; color: #be123c; }

html[data-theme="dark"] .region-KR { background: rgba(59, 130, 246, 0.22); color: #93c5fd; }
html[data-theme="dark"] .region-TW { background: rgba(20, 184, 166, 0.22); color: #5eead4; }
html[data-theme="dark"] .region-EN { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
html[data-theme="dark"] .region-CN { background: rgba(245, 158, 11, 0.22); color: #fcd34d; }
html[data-theme="dark"] .region-JP { background: rgba(139, 92, 246, 0.22); color: #c4b5fd; }
html[data-theme="dark"] .region-ARXIV { background: rgba(244, 63, 94, 0.22); color: #fda4af; }

.outlet-name {
  font-weight: 600;
  color: var(--text-secondary);
}

.meta-time {
  color: var(--text-muted);
}

.topic-badge {
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
}

.ai-badge {
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--ai-bg);
  color: var(--ai-text);
  border: 1px solid var(--ai-border);
  font-size: 11px;
  font-weight: 600;
}

.priority-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.p-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot-inactive);
}

.p-dot.filled {
  background: var(--dot-active);
}

.card-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card-act-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-act-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.card-act-btn.active {
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  border-color: color-mix(in srgb, var(--accent-blue) 30%, transparent);
  font-weight: 600;
}

.also-sources-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-muted);
}

.also-src-link {
  color: var(--accent-blue);
  text-decoration: none;
  background: var(--bg-subtle);
  padding: 1px 6px;
  border-radius: 4px;
}

.also-src-link:hover {
  text-decoration: underline;
}

.card-headline {
  margin: 0 0 4px;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.38;
  color: var(--text-main);
  text-wrap: balance;
}

.card-headline-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.14s ease;
}

.card-headline-link:hover {
  color: var(--accent-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-read-orig {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  border: 1px solid color-mix(in srgb, var(--accent-blue) 28%, transparent);
  text-decoration: none;
  transition: all 0.14s ease;
  white-space: nowrap;
}

.btn-read-orig:hover {
  background: var(--accent-blue);
  color: #ffffff;
}

.card-subheadline {
  margin: 0 0 9px;
  font-size: 13px;
  color: var(--text-muted);
}

.card-summary {
  margin: 0 0 11px;
  font-size: 13.8px;
  color: var(--text-secondary);
  line-height: 1.58;
  text-wrap: pretty;
}

/* Signature "Reported" Callout */
.reported-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-reported);
  border: 1px solid var(--border-reported);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  margin-bottom: 11px;
  font-size: 13px;
  line-height: 1.5;
}

.reported-label {
  font-weight: 700;
  font-size: 11.5px;
  color: var(--text-reported-label);
  flex-shrink: 0;
  padding-top: 1px;
}

.reported-text {
  color: var(--text-main);
}

/* Inline Metrics Pills */
.card-metrics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.metric-inline-chip {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  font-variant-numeric: tabular-nums;
}

.metric-inline-chip strong {
  color: var(--accent-blue);
}

/* Card Footer */
.card-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.card-entity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.entity-tag {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
}

.entity-tag:hover {
  color: var(--accent-blue);
}

.excerpt-details {
  font-size: 12px;
  color: var(--text-muted);
}

.excerpt-details summary {
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  text-align: right;
}

.excerpt-content {
  margin-top: 8px;
  padding: 8px 11px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12.5px;
  max-width: 680px;
}

/* 7x24 Flash Wire Timeline (Jin10 / Telegraph Style) */
.flash-filter-bar {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.flash-timeline {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.flash-item {
  display: grid;
  grid-template-columns: 96px 22px 1fr;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: start;
}

.flash-item:last-child {
  border-bottom: none;
}

.flash-time-col {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.flash-date-sub {
  display: block;
  font-size: 10.5px;
  font-weight: 400;
  opacity: 0.75;
}

.flash-rail-col {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 6px;
  height: 100%;
}

.flash-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-soft);
}

.flash-item.important .flash-dot {
  background: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.18);
}

.flash-item.important .flash-title-text,
.flash-item.important .flash-body-text {
  color: #dc2626;
}

html[data-theme="dark"] .flash-item.important .flash-title-text,
html[data-theme="dark"] .flash-item.important .flash-body-text {
  color: #f87171;
}

.flash-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.flash-title-text {
  margin: 0 0 4px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.45;
}

.flash-body-text {
  margin: 0 0 6px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Cross-Compare View */
.section-intro-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-heading {
  margin: 0 0 4px;
  font-size: 18px;
}

.section-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 780px;
}

.compare-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.cluster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.cluster-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

/* Metrics Table */
.metrics-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.metrics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.metrics-table th,
.metrics-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.metrics-table th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-subtle);
}

.metric-val-strong {
  font-weight: 700;
  color: var(--accent-blue);
  white-space: nowrap;
}

/* Native <dialog> Modals */
.sp-dialog {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-main);
  padding: 0;
  width: min(540px, 92vw);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.sp-dialog-wide {
  width: min(880px, 95vw);
}

.sp-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.dialog-header h3 {
  margin: 0;
  font-size: 15.5px;
}

.btn-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}

.dialog-body {
  padding: 16px 18px 20px;
}

.dialog-hint {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 10px 0 5px;
  color: var(--text-secondary);
}

.text-input,
.text-area {
  width: 100%;
  padding: 8px 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 13px;
  font-family: inherit;
}

.text-area.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.dialog-footer,
.btn-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.bridge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

.bridge-box {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.bridge-box h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.status-inline {
  font-size: 12px;
  color: var(--accent-blue);
  margin-top: 6px;
}

.muted-tag {
  font-weight: 400;
  color: var(--text-muted);
}

.schedule-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.schedule-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.add-source-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 2fr auto;
  gap: 8px;
  margin-bottom: 14px;
}

.sources-list {
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.source-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 12.5px;
}

.source-url {
  color: var(--text-muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 320px;
}

.source-status {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 42px 20px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

/* Live Stream Indicator, Pop-In Highlight & Floating Toast Notifications */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  background: var(--ai-bg);
  border: 1px solid var(--ai-border);
  color: var(--ai-text);
  font-size: 11.5px;
  font-weight: 700;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseLive 1.8s infinite;
}

@keyframes pulseLive {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.stat-chip-btn.active-chip {
  border-color: color-mix(in srgb, var(--accent-blue) 45%, transparent);
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  font-weight: 600;
}

.flash-new-arrival {
  animation: flashPopIn 2.8s ease-out;
}

@keyframes flashPopIn {
  0% {
    background-color: color-mix(in srgb, var(--accent-blue) 18%, transparent);
    transform: translateY(-6px);
  }
  100% {
    background-color: transparent;
    transform: translateY(0);
  }
}

.live-toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(390px, calc(100vw - 32px));
  pointer-events: none;
}

.live-toast {
  pointer-events: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent-blue);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  animation: toastSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.live-toast.important {
  border-left-color: #dc2626;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.live-toast-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  font-size: 11.5px;
}

.live-toast-title {
  margin: 0 0 8px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.42;
  color: var(--text-main);
}

.live-toast.important .live-toast-title {
  color: #dc2626;
}

html[data-theme="dark"] .live-toast.important .live-toast-title {
  color: #f87171;
}

.live-toast-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .feed-split3 {
    grid-template-columns: 1fr;
  }
  .controls-row {
    padding-left: 0;
  }
  .add-source-row {
    grid-template-columns: 1fr;
  }
}
