:root {
  --bg: #eef3f7;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --line: #d8e1ea;
  --soft: #f4f7fa;
  --accent: #16736f;
  --accent-strong: #0f5f5b;
  --blue: #3f6fd8;
  --violet: #6f5bd6;
  --warning: #bb5a2a;
  --shadow: 0 18px 44px rgba(35, 52, 77, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(22, 115, 111, 0.13), transparent 32%),
    radial-gradient(circle at 78% 8%, rgba(63, 111, 216, 0.13), transparent 26%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea, select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, #0f172a, #111827 58%, #14201f);
  color: #f4f6fb;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid rgba(255,255,255,0.08);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, #64d6c9, #9fb7ff);
  color: #0d1824;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.brand h1 {
  font-size: 18px;
  margin: 0;
  letter-spacing: 0;
}

.brand p {
  margin: 3px 0 0;
  color: #a8b3c5;
  font-size: 12px;
}

nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: block;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #c8d1df;
  text-align: left;
  padding: 12px 12px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
}

.nav-item.active, .nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  color: #aeb8c8;
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #50d494;
}

main {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

h2, h3 {
  margin: 0;
  letter-spacing: 0;
}

h2 { font-size: 28px; }
h3 { font-size: 17px; }

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.primary-btn, .icon-btn {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 42px;
  cursor: pointer;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  padding: 0 18px;
  font-weight: 700;
}

.primary-btn:hover { background: var(--accent-strong); }
.primary-btn:disabled { opacity: 0.65; cursor: progress; }

.icon-btn {
  width: 42px;
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  font-size: 20px;
}

.view { display: none; }
.view.active { display: block; }

.offline-banner {
  display: none;
  margin-bottom: 14px;
  border: 1px solid #f0c98d;
  background: #fff7e8;
  color: #6f4714;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
}

body.preview-mode .offline-banner {
  display: block;
}

body.readonly-mode .offline-banner {
  display: block;
  border-color: #b7c8dd;
  background: #f1f6fb;
  color: #334155;
}

body.readonly-mode #knowledgeForm button {
  opacity: 0.58;
  cursor: not-allowed;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.45fr);
  gap: 22px;
  align-items: center;
  background:
    linear-gradient(120deg, rgba(15, 95, 91, 0.95), rgba(23, 32, 47, 0.96)),
    #17202f;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 26px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.hero-panel h3 {
  max-width: 860px;
  font-size: 28px;
  line-height: 1.32;
}

.hero-panel .eyebrow {
  color: rgba(255,255,255,0.72);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 10px;
}

.hero-stats div {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  padding: 15px;
  min-width: 108px;
}

.hero-stats b {
  display: block;
  font-size: 30px;
}

.hero-stats span {
  display: block;
  color: rgba(255,255,255,0.72);
  font-size: 12px;
  margin-bottom: 6px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.brand-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.brand-tabs button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(35, 52, 77, 0.05);
}

.brand-tabs button.active {
  border-color: var(--accent);
  background: #e6f3f2;
  color: var(--accent-strong);
  font-weight: 750;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 17px;
  min-height: 124px;
  box-shadow: 0 8px 20px rgba(25, 40, 65, 0.06);
}

.metric .label {
  color: var(--muted);
  font-size: 13px;
}

.metric .value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 850;
}

.metric .delta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--accent-strong);
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  gap: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 8px 22px rgba(25, 40, 65, 0.07);
}

.account-growth-panel {
  grid-column: 1 / -1;
}

.chart-panel {
  min-height: 480px;
  grid-row: span 2;
}

.chart-panel.wide-chart {
  grid-column: 1 / -1;
  grid-row: auto;
}

.chart-panel.small-chart {
  min-height: 380px;
  grid-row: span 1;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.compact-head {
  margin-bottom: 8px;
}

.date-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.date-control select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 750;
}

.metric-section {
  margin-bottom: 16px;
}

.metric-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

canvas {
  width: 100%;
  height: 380px;
  display: block;
}

#universeMentionChart {
  height: 340px;
}

.universe-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.62fr);
  gap: 28px;
  align-items: center;
  background:
    linear-gradient(120deg, rgba(17, 95, 91, 0.96), rgba(23, 32, 51, 0.96)),
    #172033;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 26px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.universe-hero-copy {
  min-width: 0;
}

.universe-hero h3 {
  max-width: 860px;
  font-size: 28px;
  line-height: 1.32;
  letter-spacing: 0;
}

.universe-hero .eyebrow {
  color: rgba(255,255,255,0.72);
}

.universe-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.universe-hero-side {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.universe-hero-controls {
  display: grid;
  grid-template-columns: minmax(150px, 0.78fr) minmax(170px, 0.86fr) minmax(230px, 1.15fr);
  gap: 12px;
}

.universe-hero-controls select,
.universe-hero-controls input {
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  padding: 0 12px;
  font-weight: 750;
  width: 100%;
}

.universe-hero-controls option {
  color: #101828;
}

.universe-hero-controls input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.8;
}

.universe-coverage {
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  line-height: 1.45;
}

.universe-hero-stats div {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  min-height: 96px;
  padding: 15px;
  min-width: 0;
  display: grid;
  align-content: center;
}

.universe-hero-stats span {
  display: block;
  color: rgba(255,255,255,0.72);
  font-size: 12px;
  margin-bottom: 6px;
}

.universe-hero-stats b {
  display: block;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.universe-grid {
  display: grid;
  gap: 16px;
}

.universe-grid.two {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  margin-top: 16px;
}

.universe-reddit-panel {
  grid-column: 1 / -1;
}

.universe-reddit-pro-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.universe-reddit-pro-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.universe-reddit-pro-card.tripo {
  border-top: 3px solid #6b5fd6;
}

.universe-reddit-pro-card.meshy {
  border-top: 3px solid #16736f;
}

.universe-reddit-pro-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: baseline;
}

.universe-reddit-pro-head span,
.universe-reddit-pro-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.universe-reddit-pro-head b {
  font-size: 32px;
  line-height: 1;
}

.universe-reddit-pro-head small {
  grid-column: 1 / -1;
}

.universe-reddit-pro-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.universe-reddit-pro-kpis div {
  border: 1px solid #e1e8f1;
  border-radius: 8px;
  background: #ffffff;
  padding: 9px;
}

.universe-reddit-pro-kpis span,
.universe-reddit-pro-row > span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 5px;
}

.universe-reddit-pro-kpis strong {
  font-size: 18px;
}

.universe-reddit-pro-row div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.universe-reddit-pro-row i,
.universe-reddit-pro-row em {
  border: 1px solid #d7e0ea;
  border-radius: 999px;
  background: #ffffff;
  color: #233044;
  font-size: 12px;
  font-style: normal;
  padding: 5px 8px;
}

.universe-section {
  margin-top: 16px;
}

.universe-comparison-panel {
  min-width: 0;
}

.universe-comparison-head {
  align-items: flex-start;
}

.universe-comparison-head h3 {
  margin-bottom: 4px;
}

.universe-metric-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f6f9;
  flex-shrink: 0;
}

.universe-metric-tabs button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  min-height: 30px;
  padding: 0 10px;
}

.universe-metric-tabs button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12);
}

.universe-compare-table {
  display: grid;
  gap: 8px;
}

.universe-exposure-total {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.universe-exposure-total[hidden] {
  display: none;
}

.universe-total-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  margin-bottom: 10px;
}

.universe-brand-total-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.universe-brand-total-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.universe-brand-total-card span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 750;
}

.universe-brand-total-card b {
  display: block;
  font-size: 24px;
  margin: 4px 0 10px;
}

.universe-brand-total-track {
  height: 8px;
  border-radius: 999px;
  background: #e9eef4;
  overflow: hidden;
}

.universe-brand-total-track i {
  display: block;
  height: 100%;
  min-width: 2px;
}

.universe-brand-total-card.tripo i {
  background: #6b5fd6;
}

.universe-brand-total-card.meshy i {
  background: #16736f;
}

.universe-compare-header,
.universe-compare-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1fr) 56px;
  gap: 10px;
  align-items: center;
}

.universe-compare-header {
  color: var(--muted);
  font-size: 12px;
  padding: 0 2px;
}

.universe-compare-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px 10px;
}

.universe-compare-row b {
  min-width: 0;
  font-size: 14px;
}

.universe-compare-row strong {
  font-size: 13px;
  text-align: right;
}

.universe-compare-cell {
  height: 30px;
  border-radius: 6px;
  background: #e9eef4;
  overflow: hidden;
  position: relative;
}

.universe-compare-cell i {
  display: block;
  height: 100%;
  min-width: 2px;
}

.universe-compare-cell i.tripo {
  background: #6b5fd6;
}

.universe-compare-cell i.meshy {
  background: #16736f;
}

.universe-compare-cell span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #172033;
  font-size: 12px;
  font-weight: 750;
}

.universe-bars,
.universe-list,
.universe-content-list {
  display: grid;
  gap: 10px;
}

.universe-bar-row {
  display: grid;
  grid-template-columns: 96px 1fr 1fr;
  gap: 10px;
  align-items: center;
}

.universe-bar-track {
  height: 28px;
  border-radius: 6px;
  background: #edf1f5;
  overflow: hidden;
  position: relative;
}

.universe-bar-fill {
  height: 100%;
  min-width: 2px;
}

.universe-bar-fill.tripo {
  background: #6b5fd6;
}

.universe-bar-fill.meshy {
  background: #16736f;
}

.universe-bar-track span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #1f2937;
}

.universe-class-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.universe-class-panel {
  display: grid;
  align-content: start;
}

.universe-class-card,
.universe-item,
.universe-content-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 13px;
}

.universe-class-card b {
  display: block;
  font-size: 22px;
  margin-top: 5px;
}

.universe-ai-chat {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 10px;
}

.universe-chat-head,
.universe-chat-controls,
.universe-chat-form,
.universe-chat-prompts {
  display: flex;
  align-items: center;
  gap: 10px;
}

.universe-chat-head {
  justify-content: space-between;
}

.universe-chat-head h3 {
  margin-bottom: 3px;
}

.universe-chat-controls {
  flex-shrink: 0;
}

.universe-chat-controls select {
  min-height: 34px;
  max-width: 160px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 10px;
}

.universe-chat-controls span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.universe-chat-messages {
  display: grid;
  gap: 8px;
  min-height: 156px;
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.universe-chat-empty {
  display: grid;
  gap: 5px;
  align-content: center;
  min-height: 132px;
  color: var(--muted);
}

.universe-chat-message {
  display: grid;
  gap: 5px;
  max-width: 92%;
}

.universe-chat-message span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.universe-chat-message div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
  color: var(--ink);
  line-height: 1.48;
}

.universe-chat-message.user {
  justify-self: end;
}

.universe-chat-message.user div {
  background: #eaf4f3;
  border-color: #c7dfdc;
}

.universe-chat-message p {
  margin: 0 0 8px;
}

.universe-chat-message p:last-child {
  margin-bottom: 0;
}

.universe-chat-prompts {
  flex-wrap: wrap;
}

.universe-chat-prompts button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  min-height: 32px;
  padding: 0 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.universe-chat-form {
  align-items: stretch;
}

.universe-chat-form textarea {
  flex: 1;
  min-height: 74px;
  resize: vertical;
}

.universe-strategy {
  border-left: 4px solid var(--accent);
}

.universe-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.universe-filters select,
.universe-filters input,
.universe-filters button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 12px;
  max-width: 240px;
}

.universe-filters button {
  color: var(--ink);
  font-weight: 750;
  cursor: pointer;
}

.universe-content-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.universe-stat-pill {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.universe-stat-pill span,
.universe-stat-pill small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.universe-stat-pill b {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.05;
}

.universe-content-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef6fb;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.universe-reddit-diagnostics {
  display: grid;
  gap: 10px;
  border: 1px solid #ffd6a8;
  border-radius: 8px;
  background: #fff8ef;
  color: #67420f;
  padding: 12px;
  margin-bottom: 10px;
  font-size: 13px;
}

.universe-reddit-diagnostics > div:first-child {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: baseline;
}

.universe-reddit-diag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.universe-reddit-diag-grid span {
  border: 1px solid #f2c48f;
  border-radius: 999px;
  background: #fff;
  padding: 6px 10px;
  font-weight: 700;
}

.architecture-health-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.health-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.health-card b {
  color: var(--ink);
  font-size: 15px;
}

.health-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.health-card.ok {
  border-color: #b7dfc5;
  background: #f3fbf6;
}

.health-card.warn {
  border-color: #f2c48f;
  background: #fff8ef;
}

.universe-content-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.universe-content-item a {
  color: #175cd3;
  font-weight: 750;
  text-decoration: none;
}

.universe-missing-link {
  color: #334155;
  font-weight: 750;
}

.universe-missing-link::after {
  color: #b45309;
  content: "（源链接缺失）";
  font-size: 0.86em;
  font-weight: 700;
  margin-left: 8px;
}

.universe-content-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.universe-class-meta {
  font-size: 12px;
}

.universe-tag {
  align-self: start;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  background: #e9eef5;
  white-space: nowrap;
}

.universe-tag.negative {
  background: #fff1e7;
  color: var(--warning);
}

.universe-tag.creator {
  background: #edeaff;
  color: #4b3db8;
}

.universe-tag.ugc {
  background: #e8f7f4;
  color: var(--accent-strong);
}

.universe-tag.irrelevant {
  background: #eef2f6;
  color: #475467;
}

.small-chart canvas {
  height: 300px;
}

.ai-brief {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.7fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 16px;
  border-color: #a8ccc8;
  background:
    linear-gradient(120deg, rgba(22, 115, 111, 0.1), rgba(255,255,255,0.9)),
    var(--surface);
}

.analysis-text {
  line-height: 1.65;
  margin: 0;
  font-size: 17px;
  color: #1f2937;
}

.brief-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.brief-stats div {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.78);
  border-radius: 9px;
  padding: 13px;
  min-width: 0;
}

.brief-stats b, .brief-stats span, .brief-stats strong {
  display: block;
}

.brief-stats b {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.brief-stats span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.brief-stats strong {
  color: var(--accent-strong);
  font-size: 24px;
  margin-top: 8px;
}

.signal-list, .run-list, .report-list, .knowledge-list, .source-status-list {
  display: grid;
  gap: 10px;
}

.account-growth-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2px;
}

.account-growth-meta span {
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
}

.account-growth-head,
.account-growth-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) repeat(4, minmax(86px, 0.7fr));
  gap: 10px;
  align-items: center;
}

.account-growth-head {
  color: var(--muted);
  font-size: 12px;
  padding: 0 12px;
}

.account-growth-head span:not(:first-child) {
  text-align: right;
}

.account-growth-row {
  background: var(--soft);
  border: 1px solid #dce4ef;
  border-radius: 9px;
  padding: 12px;
}

.account-growth-row > div {
  min-width: 0;
}

.account-growth-row b,
.account-growth-row span,
.account-growth-row strong {
  display: block;
}

.account-growth-account b {
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.account-growth-row > div:not(.account-growth-account) {
  text-align: right;
}

.account-growth-row > div:not(.account-growth-account) span {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 3px;
}

.account-growth-row strong {
  font-size: 17px;
  line-height: 1.15;
  color: #17202f;
}

.brand-compare {
  display: grid;
  gap: 10px;
}

.compare-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--soft);
  border: 1px solid #dce4ef;
  border-radius: 9px;
  padding: 13px;
}

.compare-row b, .compare-row span {
  display: block;
}

.compare-row strong {
  font-size: 20px;
  color: var(--accent-strong);
}

.account-matrix {
  display: grid;
  gap: 18px;
}

.brand-account-block {
  display: grid;
  gap: 12px;
}

.brand-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-row-head h3 {
  margin-bottom: 2px;
}

.brand-avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #17202f;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
}

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

.account-card {
  display: grid;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  background: #fbfcff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 9px;
  padding: 14px;
}

.account-card:hover {
  border-color: #c7d3e3;
  box-shadow: 0 8px 20px rgba(25, 40, 65, 0.08);
}

.account-card span, .account-card small {
  color: var(--muted);
}

.account-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.account-card-head b,
.account-card-head span {
  display: block;
}

.account-card-head small {
  border: 1px solid #cfd9e6;
  background: #ffffff;
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
  font-size: 12px;
}

.capture-date {
  color: var(--muted);
  font-size: 12px;
}

.account-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.account-kpis div {
  min-width: 0;
  border: 1px solid #e1e8f1;
  background: #ffffff;
  border-radius: 8px;
  padding: 8px;
}

.account-kpis span,
.video-links span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.account-kpis strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.video-links {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.video-links a {
  color: var(--accent-strong);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.video-links a:hover {
  text-decoration: underline;
}

.video-links em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.signal, .run-item, .report-item, .kb-item {
  background: var(--soft);
  border: 1px solid #dce4ef;
  border-radius: 9px;
  padding: 13px;
}

.signal b, .kb-item b {
  display: block;
  margin-bottom: 4px;
}

.source-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 6px 12px;
  align-items: center;
  background: var(--soft);
  border: 1px solid #dce4ef;
  border-left: 4px solid #9aa4b2;
  border-radius: 9px;
  padding: 13px;
}

.source-status b,
.source-status span,
.source-status small {
  display: block;
  min-width: 0;
}

.source-status strong {
  justify-self: end;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef2f6;
  color: #42526b;
  font-size: 12px;
}

.source-status small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.source-status.fresh {
  border-left-color: #28a36a;
}

.source-status.fresh strong {
  background: #e8f7ef;
  color: #167348;
}

.source-status.manual_corrected {
  border-left-color: #2f6fed;
}

.source-status.manual_corrected strong {
  background: #e8f0ff;
  color: #1f57c3;
}

.source-status.partial {
  border-left-color: #7a64d8;
}

.source-status.partial strong {
  background: #f0edff;
  color: #5a44b6;
}

.source-status.carried_forward {
  border-left-color: #c98922;
}

.source-status.carried_forward strong {
  background: #fff4dd;
  color: #87560a;
}

.source-status.missing {
  border-left-color: #c84c4c;
}

.source-status.missing strong {
  background: #ffecec;
  color: #9f2f2f;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.stage {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcff;
  min-height: 90px;
}

.stage b, .stage span {
  display: block;
}

.stage span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.wide-btn {
  width: 100%;
}

.kb-form {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 170px 130px;
  gap: 10px;
  margin-bottom: 16px;
}

.kb-form textarea {
  grid-column: 1 / -1;
  min-height: 96px;
  resize: vertical;
}

input, textarea, select {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
}

.source-table {
  width: 100%;
  border-collapse: collapse;
}

.source-table th, .source-table td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  vertical-align: top;
}

.source-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #152033;
  color: #fff;
  border-radius: 7px;
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

.api-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.api-card.ok { border-top: 4px solid #16836f; }
.api-card.warn { border-top: 4px solid #d98a21; }
.api-card.danger { border-top: 4px solid #c43b3b; }
.api-card.idle { border-top: 4px solid #98a2b3; }

.api-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.api-card-head b {
  display: block;
  font-size: 17px;
}

.api-card-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.api-card-head strong {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef2f6;
  color: #344054;
  font-size: 12px;
}

.api-card.ok .api-card-head strong { background: #e8f7f4; color: #0f766e; }
.api-card.warn .api-card-head strong { background: #fff4e5; color: #b54708; }
.api-card.danger .api-card-head strong { background: #fee4e2; color: #b42318; }

.api-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ebf2;
}

.api-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.api-card.warn .api-meter i { background: #d98a21; }
.api-card.danger .api-meter i { background: #c43b3b; }
.api-card.idle .api-meter i { background: #98a2b3; }

.api-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.api-stats span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.api-stats b {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.api-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.universe-review-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.review-bucket {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #f8fafc;
}

.review-bucket.priority { border-top: 4px solid #175cd3; }
.review-bucket.creator { border-top: 4px solid var(--violet); }
.review-bucket.ugc { border-top: 4px solid var(--accent); }
.review-bucket.negative { border-top: 4px solid var(--warning); }

.review-bucket-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.review-bucket-head b {
  display: block;
  font-size: 16px;
}

.review-bucket-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.review-bucket-head strong {
  flex: 0 0 auto;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef2f6;
  font-size: 13px;
}

.review-items {
  display: grid;
  gap: 9px;
}

.review-item,
.review-empty {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #fff;
}

.review-item a {
  display: block;
  color: #175cd3;
  font-weight: 750;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.review-item p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.review-item small {
  display: block;
  margin-top: 6px;
  color: #344054;
  line-height: 1.4;
}

.review-empty {
  color: var(--muted);
  font-size: 13px;
}

body {
  background: var(--bg);
}

.topbar {
  margin-bottom: 16px;
}

.command-board {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.command-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 0.76fr);
  gap: 18px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 8px 22px rgba(25, 40, 65, 0.07);
}

.command-head h3 {
  font-size: 24px;
}

.command-head span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.command-controls {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(150px, 0.9fr) minmax(220px, 1.2fr);
  gap: 10px;
}

.command-controls select,
.command-controls input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 750;
}

.command-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.command-kpis div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 14px;
  box-shadow: 0 8px 20px rgba(25, 40, 65, 0.05);
}

.command-kpis span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.command-kpis b {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.command-board .universe-coverage {
  display: block;
  border: 1px solid #c8d9e9;
  border-radius: 8px;
  background: #f2f7fb;
  color: #53657b;
  padding: 10px 12px;
}

.priority-section {
  margin-top: 0;
}

.universe-grid.two {
  align-items: start;
}

.universe-chart-panel {
  min-width: 0;
}

.universe-chart-panel canvas {
  height: 320px;
}

.strategy-panel {
  margin-top: 0;
  min-width: 0;
}

.strategy-panel .universe-list {
  gap: 8px;
}

.universe-review-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.review-bucket {
  background: #fff;
}

.review-bucket-head {
  min-height: 58px;
}

.review-item {
  background: #f8fafc;
}

.universe-reddit-panel {
  grid-column: 1 / -1;
}

.universe-comparison-panel,
.universe-class-panel {
  min-width: 0;
}

.panel {
  box-shadow: 0 8px 22px rgba(25, 40, 65, 0.06);
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .command-head { grid-template-columns: 1fr; }
  .command-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .command-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .universe-review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .layout-grid { grid-template-columns: 1fr; }
  .universe-grid.two { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .hero-panel { grid-template-columns: 1fr; }
  .universe-hero { grid-template-columns: 1fr; }
  .universe-hero h3 { max-width: 760px; }
  .universe-comparison-head { flex-direction: column; }
  .universe-content-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .architecture-health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-brief { grid-template-columns: 1fr; }
  .account-growth-head { display: none; }
  .account-growth-row { grid-template-columns: minmax(180px, 1.2fr) repeat(2, minmax(96px, 1fr)); }
  .account-growth-row > div:not(.account-growth-account) { text-align: left; }
}

@media (max-width: 680px) {
  main { padding: 16px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .top-actions { width: 100%; }
  .primary-btn { flex: 1; }
  .command-head { padding: 14px; }
  .command-head h3 { font-size: 22px; }
  .command-controls,
  .command-kpis,
  .universe-review-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
  .kb-form { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr; }
  .universe-hero-stats { grid-template-columns: 1fr; }
  .universe-hero-controls { grid-template-columns: 1fr; }
  .universe-hero-stats div { min-height: 96px; }
  .universe-metric-tabs { width: 100%; }
  .universe-metric-tabs button { flex: 1; }
  .universe-compare-header { display: none; }
  .universe-compare-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .universe-compare-row strong {
    text-align: left;
  }
  .universe-brand-total-grid {
    grid-template-columns: 1fr;
  }
  .universe-reddit-pro-grid {
    grid-template-columns: 1fr;
  }
  .universe-bar-row { grid-template-columns: 1fr; }
  .universe-class-grid { grid-template-columns: 1fr; }
  .universe-chat-head,
  .universe-chat-form { align-items: stretch; flex-direction: column; }
  .universe-chat-controls { flex-wrap: wrap; }
  .universe-chat-message { max-width: 100%; }
  .universe-content-stats { grid-template-columns: 1fr; }
  .architecture-health-grid { grid-template-columns: 1fr; }
  .universe-content-item { grid-template-columns: 1fr; }
  .universe-filters { justify-content: stretch; }
  .universe-filters select,
  .universe-filters input,
  .universe-filters button { width: 100%; }
  .brief-stats { grid-template-columns: 1fr; }
  .account-growth-row { grid-template-columns: 1fr 1fr; }
  .account-growth-account { grid-column: 1 / -1; }
}
