/* === ГлавРед Studio — Aurora Design System ===
   Источник: reference/glavred-studio-1.html
   Базовая палитра + Bento-сетка + Glassmorphism + Live indicators.
*/

:root {
  --bg-0: #07070f;
  --bg-1: #0a0b19;
  --bg-2: #0f1024;
  --panel: rgba(20, 22, 45, 0.55);
  --panel-strong: rgba(24, 26, 52, 0.75);
  --panel-hover: rgba(34, 37, 68, 0.6);
  --border: rgba(140, 150, 220, 0.10);
  --border-strong: rgba(140, 150, 220, 0.22);
  --border-glow: rgba(124, 92, 255, 0.35);

  --fg: #e9ecff;
  --fg-mute: #8890b5;
  --fg-sub: #5b6288;

  --accent: #7c5cff;
  --accent-2: #00e0ff;
  --accent-3: #ff8a3d;
  --accent-4: #ff3d8b;

  --ok: #10d99a;
  --warn: #ffb547;
  --bad: #ff4d6d;

  --grad-primary: linear-gradient(135deg, #7c5cff 0%, #00e0ff 100%);
  --grad-warm: linear-gradient(135deg, #ff8a3d 0%, #ff3d8b 100%);
  --grad-bg:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(124, 92, 255, 0.25), transparent 50%),
    radial-gradient(ellipse 60% 50% at 80% 30%, rgba(0, 224, 255, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(255, 61, 139, 0.12), transparent 55%);

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset,
                 0 20px 40px -20px rgba(0, 0, 0, 0.6),
                 0 0 0 1px rgba(255, 255, 255, 0.02);
  --shadow-glow: 0 0 30px rgba(124, 92, 255, 0.35);

  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-0);
  color: var(--fg);
  font-size: 13.5px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* === Aurora Mesh Background === */
body::before {
  content: "";
  position: fixed; inset: 0;
  background: var(--grad-bg);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.035) 1px, transparent 0);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

/* === Top Bar === */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8, 9, 22, 0.7);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 64px;
  display: flex; align-items: center; gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 15px; letter-spacing: -0.3px;
  color: var(--fg);
  text-decoration: none;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--grad-primary);
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #fff;
  box-shadow: 0 6px 20px -4px rgba(124, 92, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: -4px; border-radius: 13px;
  background: var(--grad-primary); filter: blur(10px); opacity: 0.5; z-index: -1;
}
.brand span.accent {
  background: var(--grad-primary);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.search {
  flex: 0 1 420px;
  height: 38px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  color: var(--fg-mute);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.search:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--border-strong); }
.search .kbd {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--fg-mute);
}

.nav-pills { display: flex; gap: 4px; }
.nav-pills a {
  color: var(--fg-mute); text-decoration: none;
  padding: 7px 14px; border-radius: 8px;
  font-weight: 500; font-size: 13px;
  transition: all 0.2s;
}
.nav-pills a:hover { color: var(--fg); background: rgba(255, 255, 255, 0.04); }
.nav-pills a.active {
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.18), rgba(124, 92, 255, 0.08));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.35);
}

.spacer { flex: 1; }

.status-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(16, 217, 154, 0.08);
  border: 1px solid rgba(16, 217, 154, 0.25);
  font-size: 12px; color: #c8f5e3;
}
.status-chip.warn { background: rgba(255, 181, 71, 0.08); border-color: rgba(255, 181, 71, 0.25); color: #ffe6b8; }
.status-chip.bad { background: rgba(255, 77, 109, 0.08); border-color: rgba(255, 77, 109, 0.25); color: #ffc4d2; }

.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg-mute);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  text-decoration: none;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--fg); border-color: var(--border-strong); }
.icon-btn .badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--accent-4);
  border-radius: 8px;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
  color: white;
  border: 2px solid var(--bg-0);
}

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--grad-warm);
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(255, 138, 61, 0.25);
  transition: transform 0.2s;
}
.avatar:hover { transform: scale(1.05); }

/* === Shell === */
.shell {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 64px);
}
.sidebar {
  padding: 24px 18px;
  border-right: 1px solid var(--border);
  background: rgba(10, 11, 25, 0.35);
  backdrop-filter: blur(10px);
}
.sidebar h4 {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--fg-sub); font-weight: 600;
  padding: 0 12px; margin: 18px 0 8px;
}
.side-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--fg-mute);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  margin-bottom: 2px;
  text-decoration: none;
}
.side-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--fg); }
.side-item.active {
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.18), rgba(124, 92, 255, 0.04));
  color: #fff;
}
.side-item.active::before {
  content: ""; position: absolute; left: -18px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--grad-primary);
  box-shadow: 0 0 12px rgba(124, 92, 255, 0.6);
}
.side-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.side-item .meta {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  padding: 2px 6px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg-mute);
}
.side-item .dot-ok {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
  margin-left: auto;
}

.side-ai-card {
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(124, 92, 255, 0.22), rgba(0, 224, 255, 0.08));
  border: 1px solid rgba(124, 92, 255, 0.35);
  position: relative; overflow: hidden;
}
.side-ai-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 0%, rgba(0, 224, 255, 0.25), transparent 60%);
  pointer-events: none;
}
.side-ai-card .label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.1px;
  color: #a8a5ff; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  position: relative;
}
.side-ai-card .label::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2);
  animation: pulse-dot 1.5s ease-in-out infinite;
}
.side-ai-card h3 { font-size: 13px; margin: 8px 0 4px; position: relative; }
.side-ai-card p { font-size: 11.5px; color: var(--fg-mute); position: relative; }

/* === Main === */
.main { padding: 24px 28px 40px; min-width: 0; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 24px; flex-wrap: wrap;
}
/* v3.18.7-s17: текстовая колонка page-head должна сжиматься и переносить
   текст. Без min-width:0 flex-элемент не может стать уже своего контента,
   и длинный абзац уезжает за правый край экрана (страница /settings/agents,
   /authors, /team). */
.page-head > div:first-child {
  min-width: 0;
  flex: 1 1 420px;
}
.page-head p {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}
.page-head h1 {
  font-size: 26px; font-weight: 700; letter-spacing: -0.6px;
  display: flex; align-items: center; gap: 12px;
}
.page-head h1 .tag {
  font-size: 10.5px; padding: 3px 8px; border-radius: 6px;
  background: rgba(124, 92, 255, 0.15);
  border: 1px solid rgba(124, 92, 255, 0.3);
  color: #c9bdff;
  letter-spacing: 0.8px; text-transform: uppercase; font-weight: 600;
}
.page-head p { color: var(--fg-mute); font-size: 13px; margin-top: 4px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 10px; border: 0;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  color: var(--fg);
  text-decoration: none;
}
.btn-primary {
  background: var(--grad-primary); color: white;
  box-shadow: 0 6px 20px -6px rgba(124, 92, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px -6px rgba(124, 92, 255, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); }
.btn-danger { background: rgba(255, 77, 109, 0.12); border: 1px solid rgba(255, 77, 109, 0.35); color: #ffb3c0; }
.btn-danger:hover { background: rgba(255, 77, 109, 0.2); }
.btn-approve { background: rgba(16, 217, 154, 0.14); border: 1px solid rgba(16, 217, 154, 0.4); color: #c8f5e3; }
.btn-approve:hover { background: rgba(16, 217, 154, 0.22); }
.btn-approve:disabled { opacity: 0.5; cursor: wait; }

/* === Bento Grid === */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.card {
  background: var(--panel);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s, transform 0.3s;
}
.card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}
.card:hover { border-color: var(--border-strong); }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.card-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--fg-mute); font-weight: 600;
}
.card-label .ico {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(124, 92, 255, 0.15);
  color: #c9bdff;
}
.card-label .ico.cyan { background: rgba(0, 224, 255, 0.15); color: #a9f0ff; }
.card-label .ico.amber { background: rgba(255, 138, 61, 0.15); color: #ffd0a8; }
.card-label .ico.pink { background: rgba(255, 61, 139, 0.15); color: #ffbadb; }
.card-label .ico.green { background: rgba(16, 217, 154, 0.15); color: #c8f5e3; }
.card-actions { display: flex; gap: 6px; }
.card-actions .mini-btn {
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--fg-mute);
  display: grid; place-items: center;
  cursor: pointer; transition: all 0.2s;
  text-decoration: none;
}
.card-actions .mini-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--fg); }

/* === Grid items === */
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* === Stat cards === */
.stat-hero { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
.stat-hero .num {
  font-size: 42px; font-weight: 700; letter-spacing: -1.5px;
  background: linear-gradient(180deg, #fff 0%, #a8adcc 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-hero .divider { font-size: 24px; color: var(--fg-sub); }
.stat-hero .total { font-size: 22px; color: var(--fg-mute); font-weight: 500; }
.stat-sub { color: var(--fg-mute); font-size: 12.5px; margin-top: 2px; }
.trend {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; font-weight: 600;
  padding: 2px 7px; border-radius: 6px;
}
.trend.up { background: rgba(16, 217, 154, 0.12); color: var(--ok); }
.trend.down { background: rgba(255, 77, 109, 0.12); color: #ffb3c0; }

.deadline-banner {
  margin-top: 14px; padding: 10px 12px; border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 181, 71, 0.1), rgba(255, 181, 71, 0.03));
  border: 1px solid rgba(255, 181, 71, 0.25);
  display: flex; align-items: center; gap: 10px; font-size: 12.5px;
}
.deadline-banner .clock { color: var(--warn); }
.deadline-banner .time {
  margin-left: auto; font-family: 'JetBrains Mono', monospace;
  font-weight: 600; color: var(--warn);
}
.sparkline { width: 100%; height: 40px; margin-top: 14px; }

/* === Pipeline === */
.pipeline { display: flex; flex-direction: column; gap: 4px; }
.pipe-step {
  display: grid; grid-template-columns: 24px 1fr auto auto;
  align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 10px;
  transition: background 0.2s;
}
.pipe-step:hover { background: rgba(255, 255, 255, 0.03); }
.pipe-icon {
  width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
}
.pipe-icon.done { background: rgba(16, 217, 154, 0.15); color: var(--ok); }
.pipe-icon.run {
  background: var(--grad-primary); color: white;
  position: relative;
  animation: pulse-icon 1.6s ease-in-out infinite;
}
@keyframes pulse-icon {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 92, 255, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(124, 92, 255, 0); }
}
.pipe-icon.pending { background: rgba(255, 255, 255, 0.05); color: var(--fg-sub); }
.pipe-name { font-size: 13px; font-weight: 500; }
.pipe-name .sub { color: var(--fg-sub); font-size: 11px; margin-left: 6px; font-weight: 400; }
/* === v3.20 / T6: бейдж наблюдаемости шага (AC-6.1…AC-6.4) ===
   Шаг может быть «✓», но пустым/деградированным. Бейдж делает это
   видимым, не меняя сам статус шага. */
.pipe-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  cursor: help;
  white-space: nowrap;
}
.pipe-badge-empty { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.pipe-badge-degraded { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
.pipe-badge-no_source { background: rgba(99, 102, 241, 0.20); color: #a5b4fc; }
.pipe-badge-warn { background: rgba(255, 255, 255, 0.07); color: var(--fg-sub); }
.pipe-time { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--fg-mute); }
.pipe-bar { width: 80px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.06); overflow: hidden; position: relative; }
.pipe-bar-fill { height: 100%; background: var(--grad-primary); border-radius: 2px; box-shadow: 0 0 8px rgba(124, 92, 255, 0.6); }
.pipe-bar.run .pipe-bar-fill {
  animation: shimmer 1.5s linear infinite;
  background: linear-gradient(90deg, transparent, #7c5cff, transparent);
  background-size: 40px 100%;
  width: 30%;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* === Quality === */
.quality-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.q-metric {
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
}
.q-metric .lbl {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--fg-sub); font-weight: 600;
}
.q-metric .val {
  font-size: 24px; font-weight: 700; letter-spacing: -0.8px;
  margin-top: 4px;
  display: flex; align-items: baseline; gap: 4px;
}
.q-metric .val small { font-size: 13px; color: var(--fg-mute); font-weight: 500; }
.q-metric .val.ok { color: var(--ok); }
.ring { width: 44px; height: 44px; position: relative; margin-left: auto; }
.ring svg { transform: rotate(-90deg); }
.ring .num {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
}

/* === Timeline === */
.timeline-wrap { position: relative; margin-top: 8px; }
.timeline-ruler {
  display: flex; justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--fg-sub);
  margin-bottom: 6px; padding: 0 2px;
}
.timeline-bar {
  position: relative; height: 56px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.timeline-seg {
  position: absolute; top: 6px; bottom: 6px;
  border-radius: 7px;
  display: flex; align-items: center; padding: 0 10px;
  font-size: 11px; font-weight: 500;
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid;
  cursor: grab;
  /* Phase 7 fix: min-width prevents overlap when many segments cluster together */
  min-width: 28px;
}
.timeline-seg.pipe { background: rgba(124, 92, 255, 0.15); border-color: rgba(124, 92, 255, 0.35); color: #c9bdff; }
.timeline-seg.news { background: rgba(0, 224, 255, 0.12); border-color: rgba(0, 224, 255, 0.3); color: #a9f0ff; }
.timeline-seg.source { background: rgba(0, 224, 255, 0.12); border-color: rgba(0, 224, 255, 0.3); color: #a9f0ff; }
.timeline-seg.action { background: rgba(16, 217, 154, 0.14); border-color: rgba(16, 217, 154, 0.35); color: #a3f5d4; }
.timeline-seg.deadline {
  background: linear-gradient(90deg, rgba(255, 181, 71, 0.25), rgba(255, 181, 71, 0.1));
  border-color: rgba(255, 181, 71, 0.5); color: #ffd0a8; border-style: dashed;
}
.timeline-seg .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; margin-right: 8px; flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}
/* Tooltip на hover (Phase 7) */
.timeline-seg { transition: transform 0.15s, box-shadow 0.15s; }
.timeline-seg:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); z-index: 3; }
.timeline-seg::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--bg-1, #0c0d1a);
  border: 1px solid var(--border);
  color: var(--fg, #e8e9ff);
  font-size: 11px; font-weight: 400;
  padding: 6px 10px; border-radius: 6px;
  white-space: nowrap;
  /* Phase 7 fix: tooltip overflow protection */
  max-width: min(90vw, 420px);
  overflow: hidden; text-overflow: ellipsis;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 10;
  font-family: 'JetBrains Mono', monospace;
}
.timeline-seg:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Phase 7b: Cross-link — action segments кликабельны */
.timeline-seg.action { cursor: pointer; }
.timeline-seg.action::before {
  content: '';
  position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: currentColor; opacity: 0.6;
  box-shadow: 0 0 6px currentColor;
  pointer-events: none;
}

/* Phase 7b: Co-pilot hints card */
.hints-card {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.06), rgba(0, 224, 255, 0.04));
  border: 1px solid rgba(124, 92, 255, 0.18);
  border-radius: 10px;
  padding: 14px;
}
.hints-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--accent);
  margin-bottom: 10px;
}
.hints-head .ai-avatar {
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; color: #07070f;
}
.hint {
  display: flex; gap: 10px; padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  margin-bottom: 8px;
  align-items: flex-start;
  transition: background 0.15s;
}
.hint:last-child { margin-bottom: 0; }
.hint:hover { background: rgba(255, 255, 255, 0.05); }
.hint-tag {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.hint-tag.warn { background: rgba(255, 181, 71, 0.18); color: #ffd595; }
.hint-tag.tip { background: rgba(0, 224, 255, 0.18); color: #a9f0ff; }
.hint-tag.data { background: rgba(124, 92, 255, 0.18); color: #c9bdff; }
.hint-body { flex: 1; min-width: 0; }
.hint-text { font-size: 12px; color: var(--fg); margin-bottom: 4px; line-height: 1.5; }
.hint-text b { color: var(--accent-2); font-weight: 600; }
.hint-meta { font-size: 10px; color: var(--fg-mute); text-transform: uppercase; letter-spacing: 0.5px; }
.hint-link {
  font-size: 11px; color: var(--accent-2); text-decoration: none;
  margin-top: 4px; display: inline-block;
}
.hint-link:hover { text-decoration: underline; }

/* Phase 7b: Highlight pulse animation for cross-link target */
.article-card { transition: box-shadow 0.3s, border-color 0.3s; }
.article-card.highlight {
  animation: pulse-highlight 2s ease-out;
  border-color: var(--accent-2) !important;
}
@keyframes pulse-highlight {
  0%   { box-shadow: 0 0 0 0 rgba(0, 224, 255, 0.7); }
  50%  { box-shadow: 0 0 24px 8px rgba(0, 224, 255, 0.4); }
  100% { box-shadow: 0 0 0 0 rgba(0, 224, 255, 0); }
}
.timeline-now {
  position: absolute; top: -4px; bottom: -4px; width: 2px;
  background: var(--accent-4);
  box-shadow: 0 0 10px var(--accent-4);
  z-index: 2;
}
.timeline-now::before {
  content: "now"; position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  font-size: 9px; color: var(--accent-4);
  font-family: 'JetBrains Mono', monospace; font-weight: 700; letter-spacing: 1px;
}

.ai-tip {
  margin-top: 14px; padding: 14px 16px; border-radius: 12px;
  background: linear-gradient(100deg, rgba(124, 92, 255, 0.14), rgba(0, 224, 255, 0.06));
  border: 1px solid rgba(124, 92, 255, 0.28);
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 13px;
  position: relative; overflow: hidden;
}
.ai-tip::before {
  content: ""; position: absolute; top: -20px; right: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 224, 255, 0.35), transparent 70%);
  filter: blur(15px);
}
.ai-tip .ai-avatar {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: var(--grad-primary);
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 13px;
  box-shadow: 0 0 14px rgba(124, 92, 255, 0.5);
}
.ai-tip .txt { flex: 1; position: relative; }
.ai-tip .txt .who {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px;
  color: #a8a5ff; font-weight: 600; margin-bottom: 3px;
}
.ai-tip .txt a {
  color: var(--accent-2); cursor: pointer; text-decoration: none;
  font-weight: 600; margin-left: 6px;
}
.ai-tip .txt a:hover { text-decoration: underline; }

/* === News table === */
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  font-size: 11.5px; color: var(--fg-mute);
  cursor: pointer; transition: all 0.2s;
  font-weight: 500;
  user-select: none;
}
.chip:hover { color: var(--fg); border-color: var(--border-strong); }
.chip.active {
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.2), rgba(124, 92, 255, 0.08));
  color: #fff; border-color: rgba(124, 92, 255, 0.45);
}

.news-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.news-table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.1px;
  color: var(--fg-sub); font-weight: 600;
  padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.news-table td {
  padding: 13px 10px; border-bottom: 1px solid rgba(140, 150, 220, 0.06);
  font-size: 13px;
}
.news-table tr { transition: background 0.15s; }
.news-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.news-table tr.muted { opacity: 0.45; }

.n-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; font-size: 14px;
  background: rgba(255, 255, 255, 0.04);
}
.n-title { font-weight: 500; }
.n-title .sub {
  display: block; color: var(--fg-sub); font-size: 11px;
  margin-top: 2px; font-weight: 400;
}
.n-source { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--fg-mute); }
.score {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; font-weight: 600;
}
.score.hi { background: rgba(16, 217, 154, 0.14); color: var(--ok); box-shadow: inset 0 0 0 1px rgba(16, 217, 154, 0.3); }
.score.md { background: rgba(255, 181, 71, 0.14); color: var(--warn); box-shadow: inset 0 0 0 1px rgba(255, 181, 71, 0.3); }
.score.lo { background: rgba(255, 255, 255, 0.05); color: var(--fg-mute); }

.n-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; }
.n-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; }
.n-status.ok { color: var(--ok); }
.n-status.ok::before { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.n-status.warn { color: var(--warn); }
.n-status.warn::before { background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.n-status.mute { color: var(--fg-mute); }
.n-status.mute::before { background: var(--fg-sub); }

.n-actions a {
  font-size: 11.5px; color: var(--accent-2);
  text-decoration: none; font-weight: 500;
}
.n-actions a:hover { text-decoration: underline; }

/* === Sources === */
.source {
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.source-top {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px;
}
.source-top .name { flex: 1; font-family: 'JetBrains Mono', monospace; }
.source-top .count { font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.fresh-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
  padding: 2px 6px; border-radius: 5px;
}
.fresh-tag.ok { background: rgba(16, 217, 154, 0.14); color: var(--ok); }
.fresh-tag.warn { background: rgba(255, 181, 71, 0.14); color: var(--warn); }

.source-bar {
  height: 4px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  margin-top: 8px; overflow: hidden;
}
.source-bar-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #7c5cff, #00e0ff);
  box-shadow: 0 0 8px rgba(124, 92, 255, 0.5);
}

/* === Copilot === */
.copilot {
  margin-top: 14px; padding: 14px;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(124, 92, 255, 0.1), rgba(255, 61, 139, 0.06));
  border: 1px solid rgba(124, 92, 255, 0.25);
  position: relative; overflow: hidden;
}
.copilot-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.copilot-head .ai-dot {
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--grad-primary);
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 11px;
}
.copilot-head .t { font-weight: 600; font-size: 13px; }
.copilot-head .s { font-size: 11px; color: var(--fg-mute); margin-left: auto; }

.cop-msg { display: flex; gap: 10px; padding: 8px 0; font-size: 12.5px; }
.cop-msg .tag {
  width: 20px; height: 20px; border-radius: 6px;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
  flex-shrink: 0;
}
.cop-msg .tag.warn { background: rgba(255, 181, 71, 0.2); color: var(--warn); }
.cop-msg .tag.tip { background: rgba(0, 224, 255, 0.15); color: var(--accent-2); }
.cop-msg .tag.data { background: rgba(124, 92, 255, 0.18); color: #c9bdff; }
.cop-msg .txt a {
  color: var(--accent-2); cursor: pointer; text-decoration: none;
  font-weight: 500; font-size: 11.5px; margin-left: 4px;
}

/* === Articles === */
.article-card {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  position: relative; overflow: hidden;
}
.article-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--ok);
}
.article-card.pending::before { background: var(--warn); }
.article-card.hot::before { background: var(--accent-4); }
.article-card.approved::before { background: var(--ok); }
.article-card.rejected::before { background: var(--bad); }

.article-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.article-title { font-size: 14px; font-weight: 600; line-height: 1.4; }
.article-title .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--fg-mute);
  padding: 2px 6px; border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  margin-right: 8px; font-weight: 500;
}
.sentiment {
  font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
  flex-shrink: 0;
}
.sentiment.neutral { background: rgba(140, 150, 220, 0.15); color: #c9cdff; }
.sentiment.positive { background: rgba(16, 217, 154, 0.14); color: var(--ok); }
.sentiment.critical { background: rgba(255, 77, 109, 0.14); color: #ffb3c0; }

.article-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--fg-mute);
  margin-bottom: 12px;
}
.article-meta span { display: inline-flex; align-items: center; gap: 4px; }
.article-meta .visual-degraded {
  /* v3.18.0-s12 Phase A: визуальный indicator что visual-step degraded */
  color: #ffb3c0;
  background: rgba(255, 77, 109, 0.10);
  border-radius: 6px;
  padding: 2px 8px;
  border: 1px solid rgba(255, 77, 109, 0.30);
  cursor: help;
}

.article-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid rgba(140, 150, 220, 0.08);
}
.article-actions .btn { padding: 6px 11px; font-size: 12px; }

/* === Settings === */
.settings-block {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.settings-block h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.1px;
  color: var(--fg-sub); font-weight: 600;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.set-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0;
  font-size: 12.5px;
  border-bottom: 1px solid rgba(140, 150, 220, 0.06);
}
.set-row:last-child { border: 0; }
.set-row .lbl { color: var(--fg-mute); }
.set-row .val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; color: var(--fg); font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.set-row .val.ok { color: var(--ok); }
.set-row .val.mute { color: var(--fg-sub); }

/* Inline-edit (Быстрые настройки на dashboard) */
.set-row .val[data-edit] {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 6px;
  margin: -2px -6px;
  transition: background 120ms ease, box-shadow 120ms ease;
  border: 1px dashed transparent;
}
.set-row .val[data-edit]:hover {
  background: rgba(124, 92, 255, 0.10);
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.35);
}
.set-row .val[data-edit]:focus,
.set-row .val[data-edit] *:focus {
  outline: none;
  background: rgba(124, 92, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.55);
}
.inline-edit-input { outline: none; }
.inline-edit-input:focus { box-shadow: 0 0 0 2px var(--accent); }
.inline-edit-select {
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

/* --- v3.16.9: tenant switcher dropdown --- */
.tenant-switcher {
  position: relative;
  margin: 0 0 12px 0;
  padding: 0 8px;
  border-bottom: 1px solid rgba(140,150,220,0.10);
  padding-bottom: 10px;
}
.tenant-trigger {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(124,92,255,0.10);
  border: 1px solid rgba(124,92,255,0.30);
  color: var(--fg);
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.tenant-trigger:hover { background: rgba(124,92,255,0.18); border-color: rgba(124,92,255,0.55); }
.tenant-trigger svg { flex-shrink: 0; opacity: 0.85; }
.tenant-trigger .tenant-name { flex: 1; text-align: left; }
.tenant-menu {
  position: absolute; top: calc(100% + 4px); left: 8px; right: 8px;
  background: var(--card, #1a1d2e);
  border: 1px solid var(--border, rgba(140,150,220,0.20));
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.40);
  list-style: none; margin: 0; padding: 4px 0;
  z-index: 200;
}
.tenant-menu li { margin: 0; padding: 0; }
.tenant-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  color: var(--fg);
  text-decoration: none;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 100ms ease;
}
.tenant-item:hover { background: rgba(124,92,255,0.10); }
.tenant-item.active { background: rgba(124,92,255,0.18); font-weight: 600; }
.tenant-item .tenant-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(140,150,220,0.30);
  flex-shrink: 0;
}
.tenant-item .tenant-dot.on { background: var(--dot-color, var(--ok, #10b981)); box-shadow: 0 0 6px var(--dot-accent, var(--ok, #10b981)); }
.tenant-sep { height: 1px; background: rgba(140,150,220,0.10); margin: 4px 0; }
/* Bool toggles: клик по всей row переключает */
.set-row[data-edit][data-type="bool"] {
  cursor: pointer;
  border-radius: 6px;
  padding: 6px 8px;
  margin: 2px -8px;
  transition: background 120ms ease;
}
.set-row[data-edit][data-type="bool"]:hover {
  background: rgba(124, 92, 255, 0.06);
}
.set-row[data-edit][data-type="bool"] .toggle {
  cursor: pointer;
}

.toggle {
  width: 32px; height: 18px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
  position: relative; cursor: pointer;
  display: inline-block;
}
.toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
}
.toggle.on { background: var(--grad-primary); }
.toggle.on::after { left: 16px; }

/* === Style Sliders (Phase 12, v3.16.0) === */
.slider-row {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.slider-row:last-child { border-bottom: 0; }
.slider-row .lbl {
  color: var(--fg-mute); font-size: 12px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.slider-row .lbl .val {
  color: var(--fg); font-weight: 600; font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}
.slider-row .lbl .val .hint {
  color: var(--fg-sub); font-weight: 400; margin-left: 6px;
}
.slider-row input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 3px;
  background: var(--grad-primary); opacity: 0.85;
  outline: none;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; cursor: pointer;
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.35);
}
.slider-row input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; cursor: pointer;
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.35);
  border: none;
}
.slider-segments {
  display: flex; gap: 4px; margin-top: 6px;
}
.slider-segments button {
  flex: 1; padding: 6px 8px; border-radius: 8px;
  background: rgba(255,255,255,0.04); color: var(--fg-mute);
  border: 1px solid var(--border); cursor: pointer; font-size: 11px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.slider-segments button:hover { background: rgba(124, 92, 255, 0.1); }
.slider-segments button.active {
  background: var(--grad-primary); color: #fff;
  border-color: transparent;
}
.slider-help {
  margin-top: 12px; padding: 10px 12px;
  background: rgba(124, 92, 255, 0.08);
  border: 1px solid rgba(124, 92, 255, 0.25);
  border-radius: 10px;
  font-size: 11px; color: var(--fg-mute); line-height: 1.5;
}
.slider-help code {
  background: rgba(255,255,255,0.06); padding: 1px 5px; border-radius: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
}
.style-preview {
  margin-top: 12px; padding: 14px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(124,92,255,0.10), rgba(0,224,255,0.06));
  border: 1px solid rgba(124,92,255,0.30);
  font-size: 12px; color: var(--fg); line-height: 1.55;
  white-space: pre-wrap;
  font-family: 'JetBrains Mono', monospace;
  min-height: 120px;
}
.style-preview-block {
  font-weight: 700; margin-bottom: 6px; color: var(--accent, #a9f0ff);
}

/* === Iframe preview === */
.preview-frame {
  width: 100%; min-height: 600px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  margin-top: 12px;
}

/* === Login === */
.login-page {
  display: grid; place-items: center;
  min-height: calc(100vh - 64px);
  padding: 40px 20px;
}
.login-card {
  width: 100%; max-width: 420px;
  padding: 32px;
  background: var(--panel);
  backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.login-card h1 {
  font-size: 22px; font-weight: 700;
  margin-bottom: 6px; letter-spacing: -0.4px;
}
.login-card .lead {
  color: var(--fg-mute); font-size: 13px;
  margin-bottom: 24px;
}
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--fg-sub); font-weight: 600;
}
.login-form input {
  height: 42px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s;
}
.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(124, 92, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}
.login-form .hint {
  font-size: 11px; color: var(--fg-sub);
  margin-top: -2px;
}
.login-form .err {
  font-size: 12px; color: var(--bad);
  padding: 8px 12px;
  background: rgba(255, 77, 109, 0.08);
  border: 1px solid rgba(255, 77, 109, 0.25);
  border-radius: 8px;
}
.login-form .btn { width: 100%; justify-content: center; height: 42px; }

/* === Alerts / flash === */
.alert {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex; gap: 10px; align-items: center;
}
.alert.ok { background: rgba(16, 217, 154, 0.1); border: 1px solid rgba(16, 217, 154, 0.3); color: #c8f5e3; }
.alert.err { background: rgba(255, 77, 109, 0.1); border: 1px solid rgba(255, 77, 109, 0.3); color: #ffc4d2; }

/* === Scrollbar === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

/* === Responsive === */
@media (max-width: 1200px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .col-4, .col-5, .col-6, .col-7, .col-8 { grid-column: span 12; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 14px; gap: 12px; }
  .nav-pills, .search { display: none; }
  .main { padding: 16px; }
  .page-head h1 { font-size: 20px; }
  .stat-hero .num { font-size: 32px; }
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === Split Editor modal (Phase 8) === */
.split-overlay {
  position: fixed; inset: 0;
  background: rgba(7, 7, 15, 0.72);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 24px;
  animation: split-fade-in 0.18s ease-out;
}
/* v3.15.2 FIX: .split-overlay{ display:flex } overrides the [hidden] HTML
   attribute, so the modal was always visible on first dashboard load. */
.split-overlay[hidden] { display: none !important; }
@keyframes split-fade-in { from { opacity: 0; } to { opacity: 1; } }

.split-modal {
  width: 100%;
  max-width: 1280px;
  max-height: calc(100vh - 64px);
  background: var(--panel-strong);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card), 0 40px 80px -20px rgba(0, 0, 0, 0.7);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: split-pop-in 0.22s cubic-bezier(0.22, 0.9, 0.32, 1);
}
@keyframes split-pop-in {
  from { transform: translateY(12px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.split-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.06), transparent);
}
.split-head-left { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.split-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: var(--grad-primary);
  border-radius: 8px; font-size: 14px;
}
#split-modal-title { font-weight: 600; letter-spacing: 0.3px; }
.split-meta {
  margin-left: 6px; font-size: 11px; color: var(--fg-mute);
  font-weight: 400; letter-spacing: 0;
}
.split-close {
  background: transparent; border: 1px solid var(--border-strong);
  color: var(--fg-mute); width: 30px; height: 30px;
  border-radius: 8px; cursor: pointer; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.split-close:hover {
  background: rgba(255, 77, 109, 0.1);
  color: var(--bad);
  border-color: rgba(255, 77, 109, 0.4);
}

.split-banner {
  margin: 0;
  padding: 10px 20px;
  background: rgba(255, 181, 71, 0.08);
  border-bottom: 1px solid rgba(255, 181, 71, 0.18);
  color: var(--warn);
  font-size: 12px;
}

.split-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 20px;
}
.split-loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px;
  color: var(--fg-mute); font-size: 13px;
}

/* 3-pane grid */
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  min-height: 100%;
}
@media (max-width: 1024px) {
  .split-grid { grid-template-columns: 1fr; }
}

.split-pane {
  background: rgba(15, 16, 36, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.split-pane-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
  color: var(--fg-sub);
  flex-shrink: 0;
}
.split-pane-head .pane-title { display: flex; align-items: center; gap: 8px; }
.split-pane-head .pane-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px; font-size: 11px;
}
.split-pane.source .pane-ico { background: rgba(0, 224, 255, 0.18); color: var(--accent-2); }
.split-pane.draft  .pane-ico { background: rgba(124, 92, 255, 0.18); color: var(--accent); }
.split-pane.diff   .pane-ico { background: rgba(255, 138, 61, 0.18); color: var(--accent-3); }

.split-pane-body {
  padding: 14px 16px;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.split-pane-body h4 {
  margin: 0 0 6px 0; font-size: 12px;
  color: var(--fg-sub);
  text-transform: uppercase; letter-spacing: 0.8px;
  font-weight: 600;
}
.split-pane-body .field-block { margin-bottom: 18px; }
.split-pane-body .field-block:last-child { margin-bottom: 0; }

.field-headline {
  font-size: 16px; line-height: 1.35;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 4px;
}
.field-text {
  font-size: 13px; line-height: 1.55;
  color: var(--fg);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.field-text small { color: var(--fg-mute); }

.source-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
  font-size: 11px;
  color: var(--fg-mute);
}
.source-meta .src-name { color: var(--accent-2); font-weight: 500; }
.source-meta .src-auth {
  padding: 1px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 600;
}
.source-meta .src-auth.high   { background: rgba(16, 217, 154, 0.12); color: var(--ok); }
.source-meta .src-auth.medium { background: rgba(0, 224, 255, 0.12); color: var(--accent-2); }
.source-meta .src-auth.low    { background: rgba(255, 138, 61, 0.12); color: var(--accent-3); }
.source-meta .src-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.source-meta .src-tag {
  padding: 1px 7px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--fg-mute);
}

/* Diff pane */
.diff-summary {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: rgba(255, 138, 61, 0.05);
  border: 1px solid rgba(255, 138, 61, 0.18);
  border-radius: 8px;
  font-size: 11px; color: var(--fg-mute);
}
.diff-summary strong { color: var(--fg); }

.diff-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.02);
}
.diff-row:last-child { margin-bottom: 0; }
.diff-row-label {
  font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.8px;
  font-weight: 600;
  color: var(--fg-sub);
  display: flex; align-items: flex-start;
  padding-top: 2px;
}
.diff-row-body { display: flex; flex-direction: column; gap: 6px; }
.diff-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 600;
  align-self: flex-start;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.diff-status.equal   { background: rgba(16, 217, 154, 0.12); color: var(--ok); }
.diff-status.changed { background: rgba(255, 181, 71, 0.12); color: var(--warn); }
.diff-status.added   { background: rgba(124, 92, 255, 0.18); color: var(--accent); }
.diff-status.removed { background: rgba(255, 77, 109, 0.12); color: var(--bad); }
.diff-status .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.diff-chars {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 11px;
  color: var(--fg-mute);
}
.diff-chars .nums { display: flex; gap: 4px; align-items: baseline; }
.diff-chars .nums strong { color: var(--fg); font-size: 13px; font-weight: 600; }
.diff-chars .arrow { color: var(--fg-sub); font-size: 10px; }
.diff-chars .delta { color: var(--warn); font-weight: 600; }
.diff-chars .delta.down { color: var(--accent-2); }

/* === ⌘K Command Palette (Phase 10, v3.14.0) === */
.palette-overlay {
  position: fixed; inset: 0;
  background: rgba(7, 7, 15, 0.72);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  z-index: 9998;  /* ниже split-overlay (9999), чтобы split мог открыться поверх */
  display: flex; align-items: flex-start; justify-content: center;
  padding: 10vh 24px 24px;
  animation: palette-fade-in 0.18s ease-out;
}
@keyframes palette-fade-in { from { opacity: 0; } to { opacity: 1; } }

.palette-modal {
  width: 100%;
  max-width: 720px;
  max-height: 70vh;
  background: var(--panel-strong);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card), 0 40px 80px -20px rgba(0, 0, 0, 0.7),
              0 0 60px -10px rgba(124, 92, 255, 0.35);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: palette-pop-in 0.22s cubic-bezier(0.22, 0.9, 0.32, 1);
}
@keyframes palette-pop-in {
  from { transform: translateY(-8px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.palette-head {
  display: flex; flex-direction: column;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.06), transparent);
}

.palette-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.palette-search-ico { font-size: 16px; opacity: 0.7; }
.palette-input {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--fg);
  font: 500 15px/1.4 'Inter', sans-serif;
  padding: 4px 0;
  letter-spacing: 0.2px;
}
.palette-input::placeholder { color: var(--fg-sub); font-weight: 400; }
.palette-input:focus { color: var(--fg); }
.palette-input-wrap:focus-within {
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.08), transparent 60%);
}
.palette-input-wrap .palette-kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--fg-mute);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.palette-tabs {
  display: flex;
  padding: 8px 14px 10px;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.palette-tabs::-webkit-scrollbar { display: none; }
.palette-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-mute);
  padding: 5px 12px;
  border-radius: 999px;
  font: 500 12px/1 'Inter', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.palette-tab:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.04);
}
.palette-tab.active {
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.18), rgba(124, 92, 255, 0.06));
  color: #fff;
  border-color: rgba(124, 92, 255, 0.4);
  box-shadow: 0 0 12px -2px rgba(124, 92, 255, 0.3);
}

.palette-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px;
  scroll-behavior: smooth;
}

.palette-list {
  display: flex; flex-direction: column;
  gap: 2px;
}

.palette-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  width: 100%;
  color: var(--fg);
  font: 500 13px/1.3 'Inter', sans-serif;
  transition: all 0.12s ease;
  position: relative;
}
.palette-item:hover,
.palette-item.selected {
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.16), rgba(0, 224, 255, 0.06));
  border-color: rgba(124, 92, 255, 0.4);
  box-shadow: 0 0 18px -4px rgba(124, 92, 255, 0.4);
}
.palette-item.selected .palette-label { color: #fff; }

.palette-icon {
  font-size: 18px;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  flex-shrink: 0;
}
.palette-item.selected .palette-icon {
  background: var(--grad-primary);
  border-color: transparent;
}

.palette-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.palette-label {
  display: flex; align-items: center; gap: 8px;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.palette-scope {
  font: 500 9.5px/1 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg-mute);
  flex-shrink: 0;
}
.palette-scope-pages    { background: rgba(124, 92, 255, 0.18); color: var(--accent); }
.palette-scope-dates    { background: rgba(0, 224, 255, 0.15);  color: var(--accent-2); }
.palette-scope-articles { background: rgba(255, 138, 61, 0.15); color: var(--accent-3); }
.palette-scope-actions  { background: rgba(255, 61, 139, 0.15); color: var(--accent-4); }

.palette-hint {
  font-size: 11.5px;
  color: var(--fg-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.palette-item.selected .palette-hint { color: rgba(255, 255, 255, 0.75); }

.palette-recent-badge {
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 224, 255, 0.12);
  color: var(--accent-2);
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}
.palette-item-recent .palette-icon { opacity: 0.85; }

.palette-kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-strong);
  color: var(--fg);
  flex-shrink: 0;
}

.palette-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 36px 16px 24px;
  color: var(--fg-mute);
  text-align: center;
}
.palette-empty-icon { font-size: 36px; opacity: 0.6; margin-bottom: 8px; }
.palette-empty-title { font-size: 14px; color: var(--fg); font-weight: 600; margin-bottom: 4px; }
.palette-empty-hint { font-size: 12px; max-width: 280px; }

.palette-foot {
  display: flex; flex-wrap: wrap; gap: 14px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--fg-mute);
  font-size: 11px;
}
.palette-foot-kbd {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  padding: 1px 5px;
  margin-right: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--fg-sub);
}

/* === Mobile: bottom-sheet === */
@media (max-width: 720px) {
  .palette-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .palette-modal {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius) var(--radius) 0 0;
    animation: palette-sheet-in 0.26s cubic-bezier(0.22, 0.9, 0.32, 1);
  }
  @keyframes palette-sheet-in {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .palette-input { font-size: 16px; }  /* предотвратить iOS zoom */
  .palette-foot { font-size: 10.5px; gap: 10px; }
  .palette-tabs { padding: 6px 10px 8px; }
  .palette-tab { padding: 5px 10px; font-size: 11px; }
}

/* === v3.16.11: WebSocket live indicator === */
#ws-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(124,92,255,0.05);
  border: 1px solid rgba(124,92,255,0.20);
  transition: background 0.2s, color 0.2s;
}
#ws-status::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px rgba(124,92,255,0.10);
  transition: background 0.2s, box-shadow 0.2s;
}
#ws-status[data-state="live"]::before,
#ws-status[data-state="connected"]::before {
  background: var(--accent);
  animation: ws-pulse 1.6s ease-in-out infinite;
}
#ws-status[data-state="offline"]::before,
#ws-status[data-state="error"]::before {
  background: var(--fg-mute);
}
@keyframes ws-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}


/* === Censor Visual Diff UI (Phase #4, v3.17.0) === */
.split-grid-4 { grid-template-columns: 1fr 1fr; }
@media (min-width: 1400px) { .split-grid-4 { grid-template-columns: 1fr 1fr 1.1fr 1fr; } }
.split-pane.censor .pane-ico { background: rgba(244, 63, 94, 0.18); color: #f43f5e; }
.censor-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
}
.censor-block-pill { background: rgba(244, 63, 94, 0.18); color: #f43f5e; }
.censor-warn-pill  { background: rgba(245, 158, 11, 0.18); color: #f59e0b; }
.censor-clean-pill { background: rgba(16, 185, 129, 0.18); color: #10b981; }
.censor-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.censor-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  border-left: 3px solid #555;
  background: rgba(0, 0, 0, 0.04);
}
.censor-row.censor-block { border-left-color: #f43f5e; background: rgba(244, 63, 94, 0.10); }
.censor-row.censor-warn  { border-left-color: #f59e0b; background: rgba(245, 158, 11, 0.10); }
.censor-row .censor-text {
  background: rgba(0, 0, 0, 0.20);
  padding: 1px 6px;
  border-radius: 4px;
  font-style: italic;
}
.censor-row .censor-sev {
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
}
.censor-row .censor-law {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
  background: rgba(0,0,0,0.30);
  padding: 1px 6px;
  border-radius: 4px;
  color: #aaa;
}
.censor-row .censor-repl {
  color: #10b981;
  font-weight: 500;
}
.censor-row .censor-hint {
  margin-left: auto;
  font-size: 10px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.censor-empty { padding: 12px; color: #888; }
.censor-clean-msg {
  padding: 18px 12px;
  background: rgba(16,185,129,0.10);
  border: 1px solid rgba(16,185,129,0.30);
  border-radius: 8px;
  color: #10b981;
  text-align: center;
  font-weight: 500;
}
.censor-version {
  margin-top: 12px;
  font-size: 10px;
  color: #888;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}


/* === Command Palette (Phase #15, v3.17.0) === */
.cmd-palette { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.cmd-palette[hidden] { display: none; }
.cmd-palette-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(4px); }
.cmd-palette-modal { position: relative; width: min(640px, 92vw); background: var(--card, #1a1f2e); border-radius: 12px; padding: 18px; box-shadow: 0 24px 56px rgba(0,0,0,0.6); border: 1px solid var(--border, #2a3040); }
.cmd-palette-input { width: 100%; padding: 12px 16px; font-size: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg, #0e1320); color: var(--fg, #e5e7eb); outline: none; }
.cmd-palette-input:focus { border-color: var(--accent, #7c5cff); }
.cmd-palette-list { list-style: none; margin: 12px 0 0 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.cmd-palette-list .cmd-item { display: grid; grid-template-columns: 32px 1fr auto 24px; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.cmd-palette-list .cmd-item:hover, .cmd-palette-list .cmd-item.cmd-sel { background: rgba(124,92,255,0.20); }
.cmd-palette-list .cmd-item .cmd-ico { font-size: 18px; }
.cmd-palette-list .cmd-item .cmd-title { font-weight: 600; }
.cmd-palette-list .cmd-item .cmd-desc { color: var(--muted, #9ca3af); font-size: 13px; }
.cmd-palette-list .cmd-item .cmd-kbd { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 11px; font-family: ui-monospace, monospace; color: var(--muted); }
.cmd-palette-list .cmd-empty { padding: 24px; text-align: center; color: var(--muted); }
.cmd-palette-foot { display: flex; gap: 18px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }
.cmd-palette-foot kbd { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-family: ui-monospace, monospace; }
.cmd-palette-help { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); }
.cmd-palette-help h3 { color: var(--fg); margin: 0 0 8px 0; }
.cmd-palette-help ul { margin: 0; padding-left: 18px; }
.cmd-palette-help li { padding: 4px 0; }
.cmd-palette-help li kbd { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-family: ui-monospace, monospace; font-size: 11px; color: var(--fg); }
.cmd-palette-help .cmd-hint { margin-top: 10px; font-size: 12px; font-style: italic; }


/* === Saved Views (Phase #14, v3.17.0) === */
.saved-views { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.saved-view-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(0,224,255,0.10);
  color: var(--accent-2, #00e0ff);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  border: 1px solid rgba(0,224,255,0.25);
  transition: background 0.1s ease;
}
.saved-view-chip:hover { background: rgba(0,224,255,0.22); }
.saved-view-chip.built-in { font-weight: 600; }
.saved-view-chip.save-action {
  background: rgba(255,138,61,0.10);
  color: var(--accent-3, #ff8a3d);
  border-color: rgba(255,138,61,0.25);
}
.saved-view-chip.custom {
  background: rgba(124,92,255,0.10);
  color: var(--accent, #7c5cff);
  border-color: rgba(124,92,255,0.30);
}
.saved-view-chip-list { display: inline-flex; gap: 6px; flex-wrap: wrap; }


/* === Clusters Panel (Phase #7, v3.17.0) === */
.clusters-panel { margin: 12px 0; padding: 10px 12px; background: rgba(124,92,255,0.06); border: 1px solid rgba(124,92,255,0.18); border-radius: 10px; }
.clusters-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.clusters-title { font-weight: 600; color: var(--accent, #7c5cff); }
.clusters-status { color: var(--muted, #9ca3af); font-size: 12px; flex: 1; }
.clusters-refresh { background: transparent; border: 1px solid var(--border, #2a3040); border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 12px; }
.clusters-refresh:hover { background: rgba(124,92,255,0.15); }
.clusters-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cluster-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 9999px; font-size: 12px; background: rgba(0,224,255,0.10); color: var(--accent-2, #00e0ff); border: 1px solid rgba(0,224,255,0.25); }
.cluster-chip.focus { background: rgba(124,92,255,0.20); color: var(--accent, #7c5cff); border-color: rgba(124,92,255,0.40); }
.cluster-chip .cluster-count { background: rgba(0,0,0,0.30); padding: 1px 5px; border-radius: 8px; font-weight: 700; }
.cluster-empty { color: var(--muted, #9ca3af); font-size: 12px; padding: 6px 0; }


/* === Image A/B Testing (Phase #5, v3.17.0) === */
.ab-panel { margin-top: 14px; padding: 12px; background: rgba(0,224,255,0.06); border: 1px solid rgba(0,224,255,0.18); border-radius: 10px; }
.ab-panel-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.ab-title { font-weight: 600; color: var(--accent-2, #00e0ff); }
.ab-sub { color: var(--muted, #9ca3af); font-size: 12px; }
.ab-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.ab-variant { flex: 1; min-width: 180px; }
.ab-frame { position: relative; width: 100%; border-radius: 8px; overflow: hidden; background: #000; min-height: 110px; }
.ab-image { position: absolute; inset: 0; background-size: cover; background-position: center; filter: brightness(0.85); }
.ab-overlay { position: absolute; inset: 0; }
.ab-frame-label { position: absolute; bottom: 6px; left: 8px; font-size: 13px; font-weight: 600; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.7); z-index: 2; }
.ab-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; font-size: 11px; color: var(--muted, #9ca3af); }
.ab-meta .ab-id { background: var(--accent-2, #00e0ff); color: #000; padding: 1px 6px; border-radius: 8px; font-weight: 700; }
.ab-meta .ab-crop { background: rgba(255,255,255,0.10); padding: 1px 6px; border-radius: 8px; font-family: ui-monospace, monospace; }

/* v3.18.0 (#5c) — реальная генерация обложек через MiniMax image-01 */
.ab-generate-btn {
  white-space: nowrap;
  border: 1px solid rgba(124,92,255,0.35);
  color: #c9b8ff;
}
.ab-generate-btn:hover:not(:disabled) { background: rgba(124,92,255,0.16); }
.ab-generate-btn:disabled { opacity: 0.6; cursor: progress; }
.ab-gen-note {
  margin: 6px 0 10px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  background: rgba(124,92,255,0.10);
  border: 1px solid rgba(124,92,255,0.25);
  color: #c9b8ff;
}
.ab-gen-note.ab-gen-ok {
  background: rgba(0,224,255,0.08);
  border-color: rgba(0,224,255,0.28);
  color: #9ce8ff;
}
.ab-gen-note.ab-gen-fail {
  background: rgba(255,77,109,0.10);
  border-color: rgba(255,77,109,0.30);
  color: #ffb3c0;
}


/* === Audit Replay (Phase #18, v3.17.0) === */
.audit-replay { margin: 14px 0; padding: 10px 12px; background: rgba(255,138,61,0.06); border: 1px solid rgba(255,138,61,0.20); border-radius: 10px; }
.ar-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ar-title { font-weight: 600; color: var(--accent-3, #ff8a3d); }
.ar-stats { color: var(--muted, #9ca3af); font-size: 12px; flex: 1; }
.ar-agent { background: var(--bg, #0e1320); border: 1px solid var(--border, #2a3040); border-radius: 6px; color: var(--fg, #e5e7eb); padding: 4px 8px; font-size: 12px; }
.ar-timeline { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; padding-right: 6px; }
.ar-row { display: grid; grid-template-columns: 100px 90px 1fr; gap: 10px; padding: 4px 6px; border-radius: 6px; font-size: 12px; font-family: ui-monospace, monospace; border-left: 3px solid transparent; }
.ar-row:hover { background: rgba(255,255,255,0.04); }
.ar-row.ok { border-left-color: #10b981; }
.ar-row.error { border-left-color: #f43f5e; }
.ar-row.warning { border-left-color: #f59e0b; }
.ar-row.done_artifact { border-left-color: #00e0ff; }
.ar-row.censor_audit_artifact { border-left-color: #7c5cff; }
.ar-row .ar-ts { color: var(--muted); font-size: 11px; }
.ar-row .ar-event { font-weight: 600; }
.ar-row .ar-details { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


/* === Timeline Editor (Phase #2, v3.17.0) === */
.tl-slot { transition: background 0.1s ease; }
.tl-slot-filled { background: rgba(124,92,255,0.40) !important; color: #fff; font-size: 11px; padding: 4px; text-align: center; }
.tl-slot-filled .tl-slot-emoji { margin-right: 2px; }
tr[draggable="true"] { cursor: grab; }
tr[draggable="true"]:active { cursor: grabbing; }


/* === Competitors Panel (Phase #8, v3.17.0) === */
.comp-panel { margin: 14px 0; padding: 10px 12px; background: rgba(245,158,11,0.06); border: 1px solid rgba(245,158,11,0.20); border-radius: 10px; }
.comp-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.comp-title { font-weight: 600; color: #f59e0b; }
.comp-note { color: var(--muted, #9ca3af); font-size: 12px; flex: 1; }
.comp-stats { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.comp-stat { padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.comp-stat-exclusive { background: rgba(124,92,255,0.20); color: var(--accent, #7c5cff); }
.comp-stat-shared { background: rgba(16,185,129,0.20); color: #10b981; }
.comp-source { border-left: 3px solid #555; padding: 6px 10px; margin-bottom: 6px; background: rgba(0,0,0,0.20); border-radius: 6px; }
.comp-source-name { color: #f59e0b; font-weight: 600; }
.comp-source-url { color: var(--muted, #9ca3af); font-size: 11px; margin-left: 6px; font-family: ui-monospace, monospace; }
.comp-item { padding: 4px 0; font-size: 12px; display: grid; grid-template-columns: 1fr 60px; gap: 8px; align-items: center; }
.comp-item .comp-tag { text-align: right; font-size: 10px; padding: 1px 6px; border-radius: 6px; font-weight: 700; text-transform: uppercase; }
.comp-item.shared .comp-tag { background: rgba(16,185,129,0.20); color: #10b981; }
.comp-item.exclusive .comp-tag { background: rgba(124,92,255,0.20); color: var(--accent, #7c5cff); }
.comp-item a { color: var(--fg, #e5e7eb); }
/* === Inbox / Analytics: колонки-сводки (v3.18.3-s14) === */

/* .col-3 ОТСУТСТВОВАЛ в CSS — при этом использовался в analytics.html и
   inbox.html. Карточки без grid-column сжимались в узкую колонку, текст
   переносился по буквам. Добавлен как span 3 из 12. */
.col-3 { grid-column: span 3; }

/* Переключатель ракурсов /inbox: «Важное» / «Свежее».
   Класс .seg использовался в /inbox ещё с s13, но НИГДЕ не был описан —
   переключатель рендерился неоформленным. */
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}
.seg button,
.seg a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--fg-mute);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.seg button:hover,
.seg a:hover { background: rgba(255, 255, 255, 0.08); color: var(--fg); }
.seg button.on,
.seg a.on {
  background: rgba(124, 92, 255, 0.18);
  color: #c9bdff;
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.35);
}
.seg span {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(0, 224, 255, 0.16);
  color: #a9f0ff;
}
.seg button.on span,
.seg a.on span { background: rgba(0, 224, 255, 0.24); }

/* Таблица очереди тем / свежих сюжетов.
   Класс inbox-tbl — собственный (не .cfg-table): тот описан инлайном в
   integrations.html, и в /inbox раньше просто не был оформлен. */
.inbox-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.inbox-tbl thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg-mute);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.inbox-tbl tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.inbox-tbl tbody tr:last-child td { border-bottom: none; }
.inbox-tbl tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

/* Чипы-бейджи в ячейках таблицы (тон, число реакций, статус). */
.inbox-tbl .tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(150, 150, 150, 0.18);
  color: var(--fg-mute);
  white-space: nowrap;
}

/* На узких экранах сводка из 3-колоночных карточек становится в одну
   колонку (как .col-4…col-8 выше). */
@media (max-width: 1200px) {
  .col-3 { grid-column: span 6; }
}
@media (max-width: 720px) {
  .col-3 { grid-column: span 12; }
}
