/* === JS Manager v2 — Design System === */
/* Based on JS Agency/Writer design tokens — accent: amber/orange */

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

html {
  scrollbar-width: thin;
  scrollbar-color: #c4cfdd #eef2f7;
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: #eef2f7;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d3dce8 0%, #bcc8d8 100%);
  border: 3px solid #eef2f7;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #f7c96d 0%, #f59e0b 100%);
}

*::-webkit-scrollbar-corner {
  background: #eef2f7;
}

:root {
  --bg: #f4f6fb;
  --sidebar-bg: #f7f8fc;
  --surface: #ffffff;
  --surface2: #f3f5f9;
  --surface3: #e9eef5;
  --border: #dbe3ee;
  --border2: #c5d2e4;
  --text: #243245;
  --text-dim: #5f6f84;
  --text-muted: #8793a4;
  --heading: #101828;
  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.08);
  --accent2: #6366f1;
  --green: #10b981;
  --yellow: #f59e0b;
  --red: #ef4444;
  --pink: #ec4899;
  --blue: #3b82f6;
  --orange: #f97316;
  --cyan: #22d3ee;
  --sidebar-w: 220px;
  --topbar-h: 56px;
  --radius: 12px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10;
  transition: width 0.25s ease, min-width 0.25s ease;
  overflow: hidden;
  box-shadow: 16px 0 32px rgba(15, 23, 42, 0.05);
}

.sidebar.collapsed { --sidebar-w: 56px; }
.sidebar.collapsed .logo-text { display: none; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 0; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 9px 0; font-size: 0; }
.sidebar.collapsed .nav-icon { font-size: 17px; width: auto; }
.sidebar.collapsed .sidebar-section-title { font-size: 0; padding: 12px 0 4px; text-align: center; }
.sidebar.collapsed .sidebar-section-title::after { content: '\2022\2022\2022'; font-size: 10px; color: var(--text-muted); }
.sidebar.collapsed .sidebar-filter { padding: 0 4px; }
.sidebar.collapsed .sidebar-filter select { font-size: 0; padding: 6px 4px; }
.sidebar.collapsed .sidebar-status { display: none; }
.sidebar.collapsed .logout-btn span:not(:first-child),
.sidebar.collapsed .logout-btn { font-size: 0; justify-content: center; padding: 8px 0; }
.sidebar.collapsed .logout-btn span { font-size: 15px; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
}

.logo-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--heading);
  white-space: nowrap;
  overflow: hidden;
}

.logo-js {
  color: var(--accent);
  font-weight: 800;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.sidebar-toggle svg { width: 18px; height: 18px; }
.sidebar-toggle:hover { color: var(--heading); background: var(--surface2); }

.sidebar-nav {
  padding: 12px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-item:hover { color: var(--heading); background: var(--surface2); }
.nav-item.active { color: var(--accent); background: var(--accent-soft); }
.nav-icon { font-size: 15px; width: 20px; text-align: center; }

.sidebar-section-title {
  padding: 16px 18px 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  padding: 0 4px;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.logout-btn:hover { border-color: var(--red); color: var(--red); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-yellow { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.dot-red { background: var(--red); box-shadow: 0 0 6px var(--red); }
.dot-gray { background: #4b5060; }

/* === Main === */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  height: 100vh;
  transition: margin-left 0.25s ease;
  min-width: 0;
  overflow-x: hidden;
}

body.sidebar-collapsed .main { margin-left: 56px; }

/* === Topbar === */
.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(14px);
}

.page-title { font-size: 14px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--heading); }
.topbar-right { display: flex; align-items: center; gap: 16px; }

.ed-assistant-fab-shell {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 60;
}

.ed-assistant-fab {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.28);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.ed-assistant-fab:hover,
.ed-assistant-fab.is-active {
  transform: translateY(-2px);
  box-shadow: 0 20px 46px rgba(37, 99, 235, 0.34);
}

.ed-assistant-float {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 110px);
  background: rgba(255,255,255,0.98);
  border: 1px solid #dbe3ee;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
  padding: 14px;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
}

.ed-assistant-float.is-open {
  display: block;
}

.ed-assistant-float-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ed-assistant-float-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--heading);
}

.ed-assistant-float-subtitle {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.ed-assistant-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ed-assistant-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ed-assistant-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ed-assistant-chip {
  appearance: none;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s ease;
}

.ed-assistant-chip:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.ed-assistant-compose {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
}

.ed-assistant-compose label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--heading);
}

.ed-assistant-compose textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  line-height: 1.55;
  padding: 12px 14px;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.ed-assistant-compose textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.ed-assistant-compose-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ed-assistant-history-wrap {
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
}

.ed-assistant-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: visible;
  padding-right: 2px;
  padding-bottom: 10px;
}

.ed-assistant-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.ed-assistant-card-summary {
  list-style: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  cursor: pointer;
}

.ed-assistant-card-summary::-webkit-details-marker {
  display: none;
}

.ed-assistant-card-summary-text {
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ed-assistant-card-body {
  padding: 0 14px 14px;
}

.ed-assistant-user {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
}

.ed-assistant-answer {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
  white-space: pre-line;
}

.ed-assistant-suggestions-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.ed-assistant-suggestions-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 8px;
}

.ed-assistant-choice-list,
.ed-assistant-link-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ed-assistant-choice,
.ed-assistant-link {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
}

.ed-assistant-link span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ed-assistant-link small {
  color: var(--text-dim);
  word-break: break-word;
}

.ed-assistant-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.gateway-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

/* === Content === */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 32px;
  min-width: 0;
}

.hidden { display: none !important; }

/* === Cards === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.card h2 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--heading);
}

/* === KPI Cards === */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.kpi-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--heading);
}

.link-sales-dashboard {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.link-sales-content {
  margin-top: 16px;
}

.link-sales-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.link-sales-kpi {
  min-height: 108px;
}

.link-sales-delta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.link-sales-delta.is-up { color: var(--green); }
.link-sales-delta.is-down { color: var(--red); }
.link-sales-delta.is-flat { color: var(--text-muted); }

.link-sales-panel {
  padding: 18px;
}

.link-sales-info {
  background: linear-gradient(180deg, rgba(59,130,246,0.08), rgba(59,130,246,0.04));
  border-color: rgba(59,130,246,0.18);
}

.link-sales-info__title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--heading);
}

.link-sales-info p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
}

.link-sales-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.link-sales-panel__head h3 {
  margin: 0;
  font-size: 17px;
  color: var(--heading);
}

.link-sales-panel__head p {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 12px;
}

.link-sales-chart-wrap {
  position: relative;
  min-height: 320px;
}

.link-sales-toggles {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ls-toggle {
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 7px 12px;
  font: 600 12px/1.1 inherit;
  cursor: pointer;
  transition: all .15s ease;
}

.ls-toggle.is-active {
  background: var(--heading);
  border-color: var(--heading);
  color: #fff;
}

.link-sales-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.link-sales-table-wrap {
  overflow-x: auto;
}

.link-sales-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.link-sales-table th,
.link-sales-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.link-sales-table th {
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}

.link-sales-table tbody tr {
  transition: background 0.1s ease;
}

.link-sales-table tbody tr:hover td {
  background: #f8fafc;
}

.link-sales-table__entity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-sales-table__main {
  color: var(--heading);
  font-weight: 600;
}

.link-sales-table__secondary {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}
.link-sales-table__secondary a {
  color: inherit;
  text-decoration: none;
}
.link-sales-table__secondary a:hover {
  color: var(--accent);
}

.link-sales-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.link-sales-filter-toggle input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--accent);
}

.link-sales-filter-toggle.is-active {
  color: var(--accent);
  border-color: rgba(37, 99, 235, .28);
  background: rgba(37, 99, 235, .06);
}

.link-sales-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
}
.link-sales-status.is-success {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}
.link-sales-status.is-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}
.link-sales-status.is-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}
.link-sales-status.is-info {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.link-sales-expired-metric {
  display: inline-grid;
  min-width: 54px;
  justify-items: center;
  gap: 1px;
  padding: 6px 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--text-muted);
  line-height: 1.05;
}

.link-sales-expired-metric small {
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.link-sales-expired-metric strong {
  color: var(--heading);
  font-size: 14px;
  font-weight: 800;
}

.link-sales-expired-metric.is-orange {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.link-sales-expired-metric.is-green {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.link-sales-semrush-import {
  display: grid;
  gap: 12px;
}
.link-sales-semrush-import__fields,
.link-sales-semrush-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: center;
}
.link-sales-semrush-filters {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface2);
}
.link-sales-semrush-filter-preset {
  border-color: rgba(245, 158, 11, 0.34);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), #fff 58%);
  color: var(--heading);
  font-weight: 750;
}
.link-sales-semrush-keywords-section {
  display: grid;
  gap: 14px;
}
.link-sales-semrush-keywords-head {
  padding: 0;
}
.link-sales-semrush-textarea {
  min-height: 180px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
  font: inherit;
  color: var(--text);
  background: #fff;
}
.link-sales-semrush-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
}
.link-sales-semrush-preview span {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--heading);
  font-size: 12px;
  font-weight: 650;
}
.link-sales-domain-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
}
.link-sales-domain-checkall {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
}
.link-sales-domain-db {
  min-width: 128px;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 12px;
}
.link-sales-semrush-keywords-table th:nth-child(1),
.link-sales-semrush-keywords-table td:nth-child(1) {
  min-width: 340px;
}
.link-sales-semrush-table-shell {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.link-sales-semrush-table-shell .ss-table {
  margin: 0;
}
.link-sales-kw-title-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.link-sales-kw-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  min-width: 44px;
  margin-top: 1px;
  padding: 4px 7px;
  border: 1px solid rgba(245, 158, 11, 0.30);
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.10);
  color: #92400e;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.link-sales-kw-toggle:hover {
  border-color: rgba(245, 158, 11, 0.52);
  background: rgba(245, 158, 11, 0.18);
}
.link-sales-kw-toggle span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fff;
  line-height: 1;
}
.link-sales-kw-occurrences-row td {
  background: #f8fafc;
  border-top: 0;
}
.link-sales-kw-occurrences {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: #fff;
}
.link-sales-kw-occurrences__head,
.link-sales-kw-occurrence {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px 110px;
  gap: 12px;
  align-items: center;
}
.link-sales-kw-occurrences__head {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}
.link-sales-kw-occurrences__list {
  display: grid;
  gap: 7px;
}
.link-sales-kw-occurrence {
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background: var(--surface2);
}
.link-sales-kw-occurrence__domain {
  color: var(--heading);
  font-size: 13px;
  font-weight: 750;
}
.link-sales-kw-occurrence__metric {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}
.link-sales-intent-badge,
.link-sales-kd-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
}
.link-sales-intent-badge {
  background: rgba(37, 99, 235, 0.10);
  color: #1d4ed8;
}
.link-sales-kd-badge.is-strong {
  background: rgba(22, 163, 74, 0.16);
  color: #166534;
}
.link-sales-kd-badge.is-good {
  background: rgba(74, 222, 128, 0.18);
  color: #15803d;
}
.link-sales-kd-badge.is-medium {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}
.link-sales-kd-badge.is-hard {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}
.link-sales-kd-badge.is-muted {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
}
.link-sales-semrush-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.link-sales-rank {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
}

.link-sales-summary-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.link-sales-summary-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface2);
}

.link-sales-summary-card__label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.link-sales-summary-card__value {
  margin-top: 6px;
  color: var(--heading);
  font-size: 20px;
  font-weight: 700;
}

.link-sales-empty {
  border: 1px dashed var(--border2);
  border-radius: 12px;
  padding: 20px;
  background: var(--surface2);
  color: var(--text-dim);
}

/* === Affiliation Tracking === */
.afftrack-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 14px;
}

.afftrack-kpis .analytics-summary-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, var(--surface2));
  padding: 14px 16px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.afftrack-kpi__label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.afftrack-kpi__label i {
  color: var(--blue);
  font-size: 13px;
}

.afftrack-kpi__value {
  color: var(--heading);
  font-size: 24px;
  line-height: 1;
  font-weight: 850;
}

.affcamp-source {
  margin: 0 0 12px;
}

.affcamp-table-shell {
  margin-top: 12px;
}

.affcamp-table th,
.affcamp-table td {
  vertical-align: top;
}

.affcamp-table th:nth-child(1),
.affcamp-table td:nth-child(1) {
  width: 72px;
}

.affcamp-table th:nth-child(2),
.affcamp-table td:nth-child(2) {
  min-width: 245px;
}

.affcamp-table th:nth-child(3),
.affcamp-table td:nth-child(3) {
  min-width: 190px;
}

.affcamp-table th:nth-child(4),
.affcamp-table td:nth-child(4) {
  min-width: 135px;
}

.affcamp-table th:nth-child(5),
.affcamp-table td:nth-child(5) {
  min-width: 120px;
}

.affcamp-table th:nth-child(6),
.affcamp-table td:nth-child(6) {
  min-width: 260px;
}

.affcamp-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 34px;
  border-radius: 11px;
  background: rgba(59, 130, 246, 0.10);
  color: #1d4ed8;
  font-weight: 850;
}

.affcamp-score.is-good {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.affcamp-score.is-high {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.affcamp-campaign {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.affcamp-campaign img,
.affcamp-campaign__placeholder {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  object-fit: contain;
}

.affcamp-campaign__placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: 800;
}

.affcamp-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.affcamp-flags span,
.affcamp-fit span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  padding: 4px 7px;
}

.affcamp-fit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.affcamp-reasons {
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
}

.affcamp-reasons div + div {
  margin-top: 4px;
  color: var(--text-muted);
}

.afftrack-table-shell {
  margin-top: 12px;
}

.afftrack-table {
  table-layout: fixed;
}

.afftrack-table a {
  text-decoration: none;
}

.afftrack-table th,
.afftrack-table td {
  vertical-align: top;
}

.afftrack-col-site { width: 150px; }
.afftrack-col-page { width: 24%; }
.afftrack-col-product { width: 22%; }
.afftrack-col-go { width: 275px; }
.afftrack-col-aff { width: 95px; }
.afftrack-table th.text-right { width: 44px; }

.afftrack-cell-page,
.afftrack-cell-product {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.afftrack-title-link {
  display: block;
  color: var(--heading);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.afftrack-title-link:hover {
  color: var(--blue);
}

.afftrack-muted {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
  margin-top: 3px;
}

.afftrack-url-path {
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.afftrack-site-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: none;
}

.afftrack-go-pill,
.afftrack-domain-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  max-width: 100%;
}

.afftrack-go-pill {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 6px 9px;
}

.afftrack-go-pill {
  white-space: nowrap;
}

.afftrack-go-pill:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.afftrack-domain-pill {
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  padding: 6px 9px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.afftrack-domain-pill:hover {
  background: #ccfbf1;
  border-color: #5eead4;
}

.afftrack-product-name {
  display: block;
  color: var(--heading);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .afftrack-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .afftrack-kpis {
    grid-template-columns: 1fr;
  }
}

.link-sales-import-wrap {
  overflow-x: auto;
}

.link-sales-import-table {
  width: 100%;
  min-width: 940px;
  border-collapse: separate;
  border-spacing: 0;
}

.link-sales-import-table th,
.link-sales-import-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.link-sales-import-table th {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface2);
}

.link-sales-import-table td input,
.link-sales-import-table td select {
  width: 100%;
}

.link-sales-import-site {
  color: var(--heading);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.link-sales-import-title {
  min-width: 280px;
}

.link-sales-import-title a {
  color: var(--heading);
  font-weight: 600;
  text-decoration: none;
}

.link-sales-import-title a:hover {
  color: var(--accent);
}

.link-sales-sites-table th:last-child,
.link-sales-sites-table td:last-child {
  width: 120px;
  text-align: right;
}

.link-sales-sites-table tbody td {
  background: #fff;
}

.link-sales-sites-table tbody tr:hover td {
  background: #fff;
}

.link-sale-site-notes {
  max-width: 340px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.link-sale-site-list {
  display: grid;
  gap: 14px;
}

.link-sale-site-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.link-sale-site-row__identity,
.link-sale-site-row__metrics {
  min-width: 0;
}

.link-sale-site-row__metrics {
  display: block;
}

.link-sale-site-row__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.link-sale-site-row__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.link-sale-site-row__favicon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #fff;
  flex: 0 0 auto;
}

.link-sale-site-row__title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--heading);
}

.link-sale-site-row__title a {
  color: inherit;
  text-decoration: none;
}

.link-sale-site-row__title a:hover {
  color: var(--accent);
}

.link-sale-site-row__domain {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.link-sale-site-row__actions {
  flex: 0 0 auto;
}

.link-sale-site-row__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.link-sale-site-row__notes {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.link-sale-site-row__metric-kpis {
  display: grid;
  gap: 8px;
  align-content: start;
}

.link-sale-site-row__metric-pill {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.link-sale-site-row__metric-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.link-sale-site-row__metric-pill strong {
  font-size: 16px;
  color: var(--heading);
}

.link-sale-site-row__sparklines {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.seo-metrics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.seo-metrics-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.seo-metrics-kpi {
  padding: 18px;
}

.seo-metrics-panel {
  padding: 20px;
  margin-bottom: 18px;
}

.seo-metrics-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.seo-metrics-panel__head h3 {
  margin: 0 0 4px;
  font-size: 19px;
}

.seo-metrics-panel__head p {
  margin: 0;
  color: var(--text-muted);
}

.seo-metrics-chart-wrap {
  min-height: 320px;
}

.seo-metrics-note {
  background: #f7f9fc;
  border: 1px solid var(--line);
}

.seo-metrics-note__title {
  font-weight: 700;
  margin-bottom: 6px;
}

.seo-metrics-note p {
  margin: 0;
  color: var(--text-muted);
}

.seo-metrics-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.seo-metrics-list {
  display: grid;
  gap: 14px;
}

.seo-metrics-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 16px;
  align-items: center;
  border: 1px solid #d8e0ec;
  border-radius: 14px;
  background: #fff;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.seo-metrics-list-row:hover {
  border-color: #bfd4ff;
  box-shadow: 0 8px 18px rgba(17, 34, 68, 0.06);
  transform: translateY(-1px);
}

.seo-metrics-list-row.is-selected {
  border-color: #0b63f6;
  box-shadow: 0 10px 22px rgba(11, 99, 246, 0.10);
}

.seo-metrics-list-row__main {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.seo-metrics-list-row__identity {
  min-width: 0;
}

.seo-metrics-list-row__title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.seo-metrics-list-row__favicon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex: 0 0 auto;
}

.seo-metrics-list-row__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.2;
  min-width: 0;
}

.seo-metrics-list-row__meta {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seo-metrics-list-row__stats {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}

.seo-metrics-list-row__ttf {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.seo-metrics-list-row__gauges {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.seo-metrics-list-row__gauges .seo-metrics-gauge {
  min-width: 48px;
  gap: 2px;
}

.seo-metrics-list-row__gauges .seo-metrics-gauge__ring,
.seo-metrics-list-row__gauges .seo-metrics-gauge__svg {
  width: 38px;
  height: 38px;
}

.seo-metrics-list-row__gauges .seo-metrics-gauge__center {
  inset: 9px;
}

.seo-metrics-list-row__gauges .seo-metrics-gauge__value {
  font-size: 12px;
}

.seo-metrics-list-row__gauges .seo-metrics-gauge__label {
  font-size: 10px;
}

.seo-metrics-list-row__chart {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.seo-metrics-table-shell {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.seo-metrics-table {
  margin: 0;
}

.seo-metrics-table th,
.seo-metrics-table td {
  vertical-align: middle;
}

.seo-metrics-table th:nth-child(1),
.seo-metrics-table td:nth-child(1) {
  min-width: 210px;
}

.seo-metrics-table--serpzilla-purchases th:nth-child(1),
.seo-metrics-table--serpzilla-purchases td:nth-child(1) {
  width: 320px;
  min-width: 260px;
  max-width: 320px;
}

.seo-metrics-table th:nth-child(9),
.seo-metrics-table td:nth-child(9) {
  width: 280px;
}

.seo-metrics-table tbody tr {
  cursor: pointer;
}

.seo-metrics-table tbody tr.is-selected td {
  background: rgba(11, 99, 246, 0.045);
}

.seo-metrics-table--serpzilla-grouped .serpzilla-domain-row td {
  background: #fff;
  border-top: 0;
  box-shadow: inset 0 1px 0 rgba(148, 163, 184, .18);
}

.seo-metrics-table--serpzilla-grouped tbody tr:first-child td {
  box-shadow: none;
}

.seo-metrics-table--serpzilla-grouped .serpzilla-domain-row .link-sales-table__main {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
}

.serpzilla-domain-toggle {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(148, 163, 184, .45);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.serpzilla-domain-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.seo-metrics-table--serpzilla-grouped .serpzilla-url-row td:first-child {
  padding-left: 28px;
}

.seo-metrics-table--serpzilla-grouped .serpzilla-url-row td {
  background: #f8fafc;
}

.seo-metrics-table--serpzilla-grouped .serpzilla-url-row.is-collapsed {
  display: none;
}

.seo-metrics-table--serpzilla-grouped .serpzilla-url-row.is-muted {
  opacity: .28;
}

.seo-metrics-table--serpzilla-grouped .serpzilla-url-row.is-muted:hover {
  opacity: .55;
}

.seo-metrics-table__site {
  min-width: 0;
}

.seo-metrics-table__value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.seo-metrics-table__metric-stack {
  display: inline-grid;
  gap: 4px;
  justify-items: start;
  min-height: 50px;
}

.seo-metrics-table__metric-label {
  display: block;
  font-size: 8px;
  line-height: 1;
  font-weight: 600;
  color: rgba(95, 111, 132, 0.34);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.seo-metrics-table__metric-badge.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  min-height: 22px;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: middle;
}

.seo-metrics-table__metric-spacer {
  display: block;
  height: 11px;
}

.seo-metrics-table__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 220px;
}

.seo-metrics-table__site-link {
  color: var(--heading);
  text-decoration: none;
}

.seo-metrics-table__site-link:hover {
  color: var(--accent);
}

.seo-metrics-table__site-link--wrap {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.seo-metrics-table__url-badge {
  max-width: 260px;
  white-space: normal;
  word-break: break-all;
  text-decoration: none;
  text-transform: lowercase !important;
}

.seo-metrics-table__url-badge:hover {
  color: var(--accent);
}

.link-sales-metrics-t3-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.link-sales-serpzilla-summary {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  white-space: nowrap;
}

.seo-metrics-table__actions {
  white-space: nowrap;
  text-align: right;
}

.seo-metrics-table__gauges {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
}

.seo-metrics-table__gauge {
  display: flex;
  justify-content: center;
}

.seo-metrics-table__gauge .seo-metrics-gauge {
  min-width: 50px;
  gap: 2px;
}

.seo-metrics-table__gauge .seo-metrics-gauge__ring,
.seo-metrics-table__gauge .seo-metrics-gauge__svg {
  width: 40px;
  height: 40px;
}

.seo-metrics-table__gauge .seo-metrics-gauge__center {
  inset: 9px;
}

.seo-metrics-table__gauge .seo-metrics-gauge__value {
  font-size: 12px;
}

.seo-metrics-table__gauge .seo-metrics-gauge__label {
  font-size: 10px;
}

.seo-metrics-table__chart {
  min-width: 260px;
  height: 92px;
}

.seo-metrics-mini-stat {
  display: inline-grid;
  gap: 2px;
  align-content: start;
  min-width: 66px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

.seo-metrics-mini-stat__label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.seo-metrics-mini-stat__line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.seo-metrics-mini-stat__value {
  font-size: 16px;
  line-height: 1;
  color: var(--heading);
}

.seo-metrics-mini-stat__delta {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  color: var(--text-muted);
  white-space: nowrap;
}

.seo-metrics-mini-stat__delta.is-up {
  color: #157347;
}

.seo-metrics-mini-stat__delta.is-down {
  color: #b42318;
}

.seo-metrics-mini-stat__delta.is-flat {
  color: #475467;
}

.seo-metrics-detail {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.seo-metrics-detail__head h4 {
  margin: 0;
  font-size: 16px;
}

.seo-metrics-detail__head p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.seo-metrics-card {
  border: 1px solid #cfd8e6;
  border-radius: 16px;
  background: #fff;
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.seo-metrics-card:hover {
  border-color: #bfd4ff;
  box-shadow: 0 10px 24px rgba(17, 34, 68, 0.06);
  transform: translateY(-1px);
}

.seo-metrics-card.is-selected {
  border-color: #0b63f6;
  box-shadow: 0 12px 28px rgba(11, 99, 246, 0.12);
}

.seo-metrics-card.is-static {
  cursor: default;
}

.seo-metrics-card.is-static:hover {
  border-color: #cfd8e6;
  box-shadow: none;
  transform: none;
}

.seo-metrics-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.seo-metrics-card__body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 16px;
  align-items: stretch;
}

.seo-metrics-card__panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fbfcfe;
  padding: 14px;
}

.seo-metrics-card__panel--data {
  display: grid;
  align-content: start;
}

.seo-metrics-card__panel--charts {
  display: grid;
  align-content: stretch;
}

.seo-metrics-card__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--heading);
}

.seo-metrics-card__meta,
.seo-metrics-card__date {
  color: var(--text-muted);
  font-size: 12px;
}

.seo-metrics-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.seo-metrics-card__primary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.seo-metrics-stat {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.seo-metrics-stat--traffic {
  background: linear-gradient(180deg, #eff6ff 0%, #f8fbff 100%);
  border-color: rgba(11, 99, 246, 0.18);
}

.seo-metrics-stat--keywords {
  background: linear-gradient(180deg, #ecfdf5 0%, #f7fffb 100%);
  border-color: rgba(15, 157, 88, 0.18);
}

.seo-metrics-stat__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.seo-metrics-stat__value {
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--heading);
}

.seo-metrics-stat--traffic .seo-metrics-stat__value {
  color: #0b63f6;
}

.seo-metrics-stat--keywords .seo-metrics-stat__value {
  color: #0f9d58;
}

.seo-metrics-stat__delta {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.seo-metrics-stat__delta.is-up {
  color: #157347;
}

.seo-metrics-stat__delta.is-down {
  color: #b42318;
}

.seo-metrics-stat__delta.is-flat {
  color: #475467;
}

.seo-metrics-card__majestic {
  display: grid;
  gap: 12px;
}

.seo-metrics-card__majestic-metrics {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.seo-metrics-gauge {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 70px;
}

.seo-metrics-gauge__ring {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seo-metrics-gauge__svg {
  position: absolute;
  inset: 0;
  width: 56px;
  height: 56px;
  overflow: visible;
}

.seo-metrics-gauge__center {
  position: absolute;
  inset: 12px;
  border-radius: 999px;
  background: #fff;
  z-index: 1;
}

.seo-metrics-gauge__value {
  position: relative;
  z-index: 2;
  font-size: 16px;
  font-weight: 800;
  color: var(--heading);
}

.seo-metrics-gauge__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.seo-metrics-rd {
  min-width: 88px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  background: #f8fafc;
  display: grid;
  gap: 4px;
}

.seo-metrics-rd__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.seo-metrics-rd__value {
  font-size: 24px;
  line-height: 1;
  color: var(--heading);
}

.seo-metrics-card__ttf {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seo-metrics-ttf-badge {
  --ttf-color: #2563eb;
  --ttf-bg: rgba(37, 99, 235, 0.10);
  --ttf-border: rgba(37, 99, 235, 0.22);
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ttf-color);
  background: var(--ttf-bg);
  border: 1px solid var(--ttf-border);
}

.seo-metrics-ttf-badge.is-empty {
  --ttf-color: #64748b;
}

.seo-metrics-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f2f5fb;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.seo-metrics-badge.is-up {
  background: #eef9f1;
  color: #157347;
}

.seo-metrics-badge.is-down {
  background: #fff1f0;
  color: #b42318;
}

.seo-metrics-combo-chart {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px 8px;
  background: #fbfcfe;
  height: 100%;
}

.seo-metrics-combo-chart.is-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.seo-metrics-combo-chart.is-clickable:hover {
  border-color: rgba(11, 99, 246, 0.28);
  box-shadow: 0 10px 22px rgba(11, 99, 246, 0.08);
  transform: translateY(-1px);
}

.seo-metrics-combo-chart.is-clickable:focus-visible {
  outline: 2px solid rgba(11, 99, 246, 0.28);
  outline-offset: 2px;
}

.seo-metrics-combo-chart__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.seo-metrics-combo-chart__canvas {
  display: block;
  width: 100%;
  height: 220px !important;
}

.seo-metrics-combo-chart__canvas--compact {
  height: 84px !important;
}

.seo-metrics-combo-chart__canvas--table {
  height: 92px !important;
}

.seo-metrics-combo-chart__empty {
  min-height: 220px;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
}

.seo-metrics-combo-chart__empty--compact {
  min-height: 84px;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #f8fafc;
  font-size: 11px;
}

.seo-metrics-sparklines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  height: 100%;
}

.seo-metrics-sparkline {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px 10px;
  background: #fbfcfe;
}

.seo-metrics-sparkline.is-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.seo-metrics-sparkline.is-clickable:hover {
  border-color: rgba(11, 99, 246, 0.28);
  box-shadow: 0 10px 22px rgba(11, 99, 246, 0.08);
  transform: translateY(-1px);
}

.seo-metrics-sparkline.is-clickable:focus-visible {
  outline: 2px solid rgba(11, 99, 246, 0.28);
  outline-offset: 2px;
}

.seo-metrics-sparkline__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.seo-metrics-sparkline__canvas {
  display: block;
  width: 100%;
  height: 128px !important;
}

.seo-metrics-sparkline__empty {
  min-height: 128px;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
}

.link-sales-metric-modal {
  display: grid;
  gap: 18px;
}

.link-sales-metric-modal__head {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.link-sales-metric-modal__kpi {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}

.link-sales-metric-modal__kpi span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.link-sales-metric-modal__kpi strong {
  font-size: 22px;
  line-height: 1.1;
  color: var(--heading);
}

.link-sales-metric-modal__kpi em {
  font-style: normal;
}

.link-sales-metric-modal__chart {
  position: relative;
  min-height: 420px;
}

.link-sales-home-links-modal {
  display: grid;
  gap: 16px;
}

.link-sales-home-links-modal__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.link-sales-home-links-modal__list {
  display: grid;
  gap: 14px;
}

.link-sales-home-links-modal__item {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.link-sales-home-links-modal__item-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.link-sales-home-links-modal__urls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.link-sales-home-links-modal__text {
  color: var(--heading);
  line-height: 1.55;
}

.link-sales-home-links-modal__code {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.5;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.link-sales-expired-modal {
  display: grid;
  gap: 18px;
}

.link-sales-expired-modal__hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 18px;
  align-items: start;
}

.link-sales-expired-modal__hero-main {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.04), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.link-sales-expired-modal__hero-main h4 {
  margin: 10px 0 8px;
  font-size: 24px;
  line-height: 1.15;
  color: var(--heading);
}

.link-sales-expired-modal__hero-main p {
  margin: 0;
  color: var(--text-dim);
  line-height: 1.55;
}

.link-sales-expired-modal__hero-side,
.link-sales-expired-modal__breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.link-sales-expired-modal__metric {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: #fff;
  display: grid;
  gap: 4px;
}

.link-sales-expired-modal__metric.is-success { background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.22); }
.link-sales-expired-modal__metric.is-info { background: rgba(59, 130, 246, 0.08); border-color: rgba(59, 130, 246, 0.22); }
.link-sales-expired-modal__metric.is-warning { background: rgba(245, 158, 11, 0.10); border-color: rgba(245, 158, 11, 0.24); }
.link-sales-expired-modal__metric.is-danger { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.22); }

.link-sales-expired-modal__metric span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.link-sales-expired-modal__metric strong {
  font-size: 18px;
  color: var(--heading);
}

.link-sales-expired-modal__sections {
  display: grid;
  gap: 16px;
}

.link-sales-expired-modal__section {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: #fff;
  display: grid;
  gap: 12px;
}

.link-sales-expired-modal__section h5 {
  margin: 0;
  font-size: 14px;
  color: var(--heading);
}

.link-sales-expired-modal__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.link-sales-expired-modal__chip {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.link-sales-expired-modal__chip.is-positive {
  background: rgba(16, 185, 129, 0.10);
  color: #057857;
}

.link-sales-expired-modal__chip.is-risk {
  background: rgba(239, 68, 68, 0.10);
  color: #b42318;
}

.link-sales-expired-modal__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--text-dim);
  font-size: 12px;
}

.link-sales-expired-modal__snapshots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.link-sales-expired-modal__snapshot {
  padding: 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.16);
  display: grid;
  gap: 8px;
}

.link-sales-expired-modal__snapshot.is-empty {
  opacity: 0.72;
}

.link-sales-expired-modal__snapshot-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--heading);
}

.link-sales-expired-modal__snapshot-grid {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

.link-sales-expired-modal__snapshot-grid strong {
  color: var(--heading);
}

.link-sales-expired-modal__refs {
  display: grid;
  gap: 8px;
}

.link-sales-expired-modal__ref {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.link-sales-expired-modal__ref strong {
  color: var(--heading);
  font-size: 13px;
}

.link-sales-expired-modal__ref span {
  color: var(--text-dim);
  font-size: 12px;
  text-align: right;
}

.link-sales-expired-modal__code {
  padding: 12px;
  border-radius: 12px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.55;
  overflow: auto;
}

.link-sales-expired-modal__empty {
  color: var(--text-dim);
  font-size: 12px;
}

/* === Forms === */
.form-row { margin-bottom: 12px; }
.form-row label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-row textarea { resize: vertical; min-height: 60px; }

.portal-notification-list {
  display: grid;
  gap: 8px;
}

.portal-notification-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}

.portal-notification-row:hover {
  background: var(--surface2);
}

.portal-notification-row input {
  margin-top: 3px;
}

.portal-notification-row strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.portal-notification-row small {
  display: block;
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.35;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.link-sale-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.link-sale-modal-grid .form-row {
  margin: 0;
}
.link-sale-modal-grid .form-row--span-2 {
  grid-column: span 2;
}
.link-sale-modal-grid .form-row--full {
  grid-column: 1 / -1;
}
.link-sale-modal-section {
  grid-column: 1 / -1;
  padding-top: 4px;
  color: var(--heading);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.modal-footer .link-sale-delete-action {
  margin-right: auto;
}

.link-sales-pricing-wrap {
  overflow-x: auto;
}

.link-sales-pricing-table th,
.link-sales-pricing-table td {
  min-width: 190px;
  vertical-align: top;
}

.link-sales-pricing-table th:first-child,
.link-sales-pricing-table td:first-child {
  min-width: 220px;
}

.link-sales-pricing-table th:nth-child(2),
.link-sales-pricing-table td:nth-child(2) {
  min-width: 150px;
}

.link-sales-pricing-table__platform {
  font-weight: 700;
  color: var(--heading);
}

.link-sales-pricing-table__platform-meta {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

.link-sales-pricing-site {
  display: grid;
  gap: 6px;
}

.link-sales-pricing-site__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.link-sales-pricing-site__title {
  font-weight: 700;
  color: var(--heading);
}

.link-sales-pricing-site__domain {
  color: var(--text-muted);
  font-size: 12px;
}

.link-sales-pricing-net {
  display: grid;
  gap: 10px;
  font-size: 13px;
}

.link-sales-pricing-net__group,
.link-sales-pricing-reco {
  display: grid;
  gap: 5px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
}

.link-sales-pricing-reco {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.8) 0%, rgba(255, 255, 255, 0.96) 100%);
  border-color: rgba(59, 130, 246, 0.16);
}

.link-sales-pricing-net__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.link-sales-pricing-net strong {
  color: var(--heading);
}

.link-sales-pricing-reco__range {
  font-size: 12px;
  color: var(--text-dim);
}

.link-sales-pricing-reco__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.link-sales-pricing-reco__meta-text {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.35;
}

.link-sales-pricing-cell {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  min-height: 132px;
}

.link-sales-pricing-cell.is-enabled {
  border-color: rgba(11, 99, 246, 0.18);
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.link-sales-pricing-cell__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.link-sales-pricing-cell__prices {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

.link-sales-pricing-cell__prices strong {
  color: var(--heading);
}

.link-sales-pricing-cell__writing {
  margin-top: auto;
  font-size: 12px;
  color: #3159b6;
  font-weight: 700;
}

/* === Buttons === */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--accent); color: #1b1300; box-shadow: 0 10px 20px rgba(245, 158, 11, 0.2); }
.btn-secondary { background: #fff; color: var(--heading); border: 1px solid var(--border); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-icon { padding: 6px 8px; }

/* === Status badges === */
.status {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-block;
}
.status-draft { background: var(--surface2); color: var(--text-dim); }
.status-to_write { background: rgba(245,158,11,0.14); color: #b45309; }
.status-pending { background: var(--surface2); color: var(--text-dim); }
.status-planned { background: rgba(148,163,184,0.14); color: #475569; }
.status-generating { background: rgba(59,130,246,0.12); color: var(--blue); }
.status-running { background: rgba(59,130,246,0.12); color: var(--blue); }
.status-active { background: rgba(16,185,129,0.12); color: var(--green); }
.status-completed { background: rgba(16,185,129,0.12); color: var(--green); }
.status-published { background: rgba(99,102,241,0.12); color: var(--accent2); }
.status-error { background: rgba(239,68,68,0.12); color: var(--red); }
.status-needs-review { background: rgba(245,158,11,0.12); color: var(--yellow); }
.status-failed { background: rgba(239,68,68,0.12); color: var(--red); }
.status-paused { background: rgba(245,158,11,0.12); color: var(--yellow); }
.status-sold { background: rgba(249,115,22,0.15); color: var(--orange); }
.status-analyzing { background: rgba(59,130,246,0.12); color: var(--blue); }
.status-ready { background: rgba(16,185,129,0.12); color: var(--green); }
.status-new { background: rgba(59,130,246,0.12); color: var(--blue); }
.status-read { background: rgba(148,163,184,0.14); color: #475569; }
.status-archived { background: var(--surface2); color: var(--text-dim); }

/* === Tabs === */
.tabs-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
}
.tab-btn {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--heading); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.mlang-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 16px;
  margin: 16px 0;
}

.mlang-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.mlang-panel--static {
  background: linear-gradient(135deg, #fff 0%, #f8fbff 100%);
}

.mlang-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--heading);
}

.mlang-help {
  margin: 0;
  max-width: 760px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.45;
}

.mlang-actions,
.mlang-code {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mlang-label {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 12px;
}

.mlang-static-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.mlang-static-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.mlang-static-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eef6ff;
  color: var(--accent);
  font-size: 16px;
}

.mlang-link {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.mlang-link:hover {
  text-decoration: underline;
}

.mlang-table th {
  background: var(--border);
}

.mlang-table td {
  vertical-align: middle;
}

.tab-content {
  margin-top: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 200px;
}

#project-tab-content {
  padding-top: 16px;
}

/* === Data Table === */
.data-table-wrapper { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  background: var(--surface2);
  color: var(--text-dim);
  font-weight: 700;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.data-table th:hover { color: var(--heading); }
.data-table th .sort-arrow { margin-left: 4px; font-size: 9px; }

.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

.data-table tr:hover td { background: #f8fafc; }
.data-table tr { cursor: pointer; transition: background 0.1s; }

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

.table-search {
  padding: 7px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  min-width: 200px;
}
.table-search:focus { outline: none; border-color: var(--accent); }
.table-search::placeholder { color: var(--text-muted); }

.table-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-dim);
}
.table-pagination .btn { padding: 4px 10px; }
.table-results-card {
  margin-top: 0;
}

.table-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table-filters select {
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
}

.project-listing-site {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.project-listing-site__favicon,
.project-listing-site__fallback {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
}
.project-listing-site__favicon {
  object-fit: cover;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.project-listing-site__fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}
.project-listing-site__body {
  min-width: 0;
}
.project-listing-site__title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.project-listing-site__name {
  display: block;
  color: var(--heading);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}
.project-listing-site__wp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #e0f2fe;
  color: #00749c;
  text-decoration: none;
  font-size: 14px;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.project-listing-site__wp:hover {
  background: #00749c;
  color: #fff;
  transform: translateY(-1px);
}
.project-listing-site__lab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #ecfdf5;
  color: #15803d;
  text-decoration: none;
  font-size: 12px;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.project-listing-site__lab:hover {
  background: #15803d;
  color: #fff;
  transform: translateY(-1px);
}

/* === Tree Component === */
.tree { list-style: none; padding: 0; }
.tree .tree { padding-left: 20px; }

.tree-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
}
.tree-node:hover { background: #f8fafc; }
.tree-node.selected { background: var(--accent-soft); color: var(--accent); }

.tree-toggle {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.15s;
}
.tree-toggle.expanded { transform: rotate(90deg); }

.tree-icon { font-size: 14px; flex-shrink: 0; }
.tree-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tree-actions {
  display: none;
  gap: 4px;
}
.tree-node:hover .tree-actions { display: flex; }

.tree-drop-zone {
  height: 3px;
  border-radius: 2px;
  margin: 1px 0;
  transition: background 0.15s, height 0.15s;
}
.tree-drop-zone.active {
  height: 6px;
  background: var(--accent);
}

/* === Pipeline Tracker === */
.pipeline-tracker {
  display: flex;
  gap: 4px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.pipeline-step {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface2);
  color: var(--text-dim);
  position: relative;
}

.pipeline-step.running {
  background: rgba(59,130,246,0.12);
  color: var(--blue);
  animation: pulse 1.5s infinite;
}
.pipeline-step.completed {
  background: rgba(16,185,129,0.12);
  color: var(--green);
}
.pipeline-step.failed {
  background: rgba(239,68,68,0.12);
  color: var(--red);
}
.pipeline-step .step-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
}
.pipeline-step.completed .step-num { background: var(--green); color: #fff; }
.pipeline-step.running .step-num { background: var(--blue); color: #fff; }
.pipeline-step.failed .step-num { background: var(--red); color: #fff; }

.pipeline-step .step-cost {
  font-size: 10px;
  color: var(--green);
  margin-left: 4px;
}

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

/* === Calendar Grid === */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calendar-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.calendar-day-header {
  background: var(--surface2);
  padding: 8px 4px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-cell {
  background: var(--surface);
  padding: 6px;
  min-height: 92px;
  cursor: pointer;
  transition: background 0.1s;
}
.calendar-cell:hover { background: var(--surface2); }
.calendar-cell.other-month { opacity: 0.4; }
.calendar-cell.today { box-shadow: inset 0 0 0 2px var(--accent); }

.calendar-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.calendar-entry {
  font-size: 10px;
  padding: 5px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
  overflow: hidden;
  cursor: pointer;
  line-height: 1.35;
}
.calendar-entry__meta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.calendar-entry__text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  text-wrap: pretty;
  word-break: break-word;
}
.calendar-entry.type-post { background: rgba(99,102,241,0.15); color: var(--accent2); }
.calendar-entry.type-production { background: rgba(59,130,246,0.15); color: var(--blue); }
.calendar-entry.type-sale { background: rgba(249,115,22,0.15); color: var(--orange); }
.calendar-entry.type-new_article { background: rgba(99,102,241,0.15); color: var(--accent2); }
.calendar-entry.type-rewrite { background: rgba(245,158,11,0.18); color: #fbbf24; }
.calendar-entry.type-refresh { background: rgba(16,185,129,0.15); color: #34d399; }
.calendar-entry.type-delete {
  background: rgba(239,68,68,0.10);
  color: #b91c1c;
  border: 1px solid rgba(239,68,68,0.18);
}
.calendar-time-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  min-height: 18px;
  border-radius: 999px;
  background: rgba(15,23,42,0.08);
  color: var(--heading);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.calendar-workflow-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  min-height: 18px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
}
.calendar-workflow-badge--new_article { background: rgba(99,102,241,0.12); color: #4338ca; border-color: rgba(99,102,241,0.18); }
.calendar-workflow-badge--rewrite { background: rgba(245,158,11,0.12); color: #b45309; border-color: rgba(245,158,11,0.2); }
.calendar-workflow-badge--refresh { background: rgba(16,185,129,0.12); color: #047857; border-color: rgba(16,185,129,0.18); }
.calendar-workflow-badge--delete { background: rgba(239,68,68,0.12); color: #b91c1c; border-color: rgba(239,68,68,0.18); }
.calendar-entry.status-draft { background: rgba(148,163,184,0.18); color: #475569; border: 1px solid rgba(148,163,184,0.24); }
.calendar-entry.status-to_write { background: rgba(245,158,11,0.16); color: #b45309; border: 1px solid rgba(245,158,11,0.24); }
.calendar-entry.status-ready,
.calendar-entry.status-scheduled { background: rgba(59,130,246,0.16); color: #1d4ed8; border: 1px solid rgba(59,130,246,0.22); }
.calendar-entry.status-published { background: rgba(16,185,129,0.16); color: #047857; border: 1px solid rgba(16,185,129,0.22); }
.calendar-entry.status-generating { background: rgba(168,85,247,0.16); color: #7e22ce; border: 1px solid rgba(168,85,247,0.22); }
.calendar-entry.status-error { background: rgba(239,68,68,0.14); color: #b91c1c; border: 1px solid rgba(239,68,68,0.22); }
.calendar-entry.status-archived { background: rgba(239,68,68,0.14); color: #b91c1c; border: 1px solid rgba(239,68,68,0.22); }
.calendar-entry.status-delete { background: rgba(239,68,68,0.14); color: #b91c1c; border: 1px solid rgba(239,68,68,0.22); }
.calendar-workflow-badge--status-draft { background: rgba(255,255,255,0.82); color: #475569; border-color: rgba(148,163,184,0.32); }
.calendar-workflow-badge--status-to_write { background: rgba(255,255,255,0.86); color: #b45309; border-color: rgba(245,158,11,0.32); }
.calendar-workflow-badge--status-ready,
.calendar-workflow-badge--status-scheduled { background: rgba(255,255,255,0.84); color: #1d4ed8; border-color: rgba(59,130,246,0.3); }
.calendar-workflow-badge--status-published { background: rgba(255,255,255,0.84); color: #047857; border-color: rgba(16,185,129,0.28); }
.calendar-workflow-badge--status-generating { background: rgba(255,255,255,0.84); color: #7e22ce; border-color: rgba(168,85,247,0.28); }
.calendar-workflow-badge--status-error { background: rgba(255,255,255,0.84); color: #b91c1c; border-color: rgba(239,68,68,0.28); }
.calendar-workflow-badge--status-archived { background: rgba(255,255,255,0.84); color: #b91c1c; border-color: rgba(239,68,68,0.28); }
.calendar-workflow-badge--status-delete { background: rgba(255,255,255,0.84); color: #b91c1c; border-color: rgba(239,68,68,0.28); }
.calendar-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  min-height: 18px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
}
.calendar-type-badge--info { background: rgba(14,165,233,0.12); color: #0369a1; border-color: rgba(14,165,233,0.18); }
.calendar-type-badge--cocon { background: rgba(168,85,247,0.12); color: #7e22ce; border-color: rgba(168,85,247,0.18); }
.calendar-type-badge--pilier,
.calendar-type-badge--pillar { background: rgba(249,115,22,0.12); color: #c2410c; border-color: rgba(249,115,22,0.18); }
.calendar-type-badge--quick-win { background: rgba(16,185,129,0.12); color: #047857; border-color: rgba(16,185,129,0.18); }
.calendar-entry__open,
.calendar-agenda__open {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(59,130,246,0.18);
  background: rgba(59,130,246,0.12);
  color: #93c5fd;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.calendar-entry__open {
  margin-left: auto;
  flex-shrink: 0;
}
.calendar-agenda__open {
  flex-shrink: 0;
}
.calendar-entry__open:hover,
.calendar-agenda__open:hover {
  background: rgba(59,130,246,0.18);
  border-color: rgba(59,130,246,0.34);
  color: #dbeafe;
  transform: translateY(-1px);
}
.calendar-delete-chip {
  appearance: none;
  border: 0;
  background: rgba(239,68,68,0.12);
  color: #b91c1c;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  cursor: pointer;
  margin: 2px 0 4px;
  width: 100%;
  text-align: left;
}
.calendar-delete-chip:hover {
  background: rgba(239,68,68,0.18);
}
.calendar-entry__more {
  appearance: none;
  border: 0;
  background: rgba(15,23,42,0.05);
  color: var(--accent);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 4px;
  text-align: left;
  width: 100%;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.calendar-entry__more:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
  transform: translateY(-1px);
}
.calendar-entry__open i,
.calendar-agenda__open i {
  font-size: 12px;
}
.calendar-toolbar { display:flex; justify-content:flex-end; margin-bottom:12px; }
.calendar-delete-summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  margin-bottom:12px;
  border:1px solid rgba(239,68,68,0.18);
  border-radius:10px;
  background: rgba(239,68,68,0.06);
}
.calendar-delete-summary__copy {
  display:grid;
  gap:2px;
}
.calendar-delete-summary__copy strong {
  font-size:13px;
  color: var(--heading);
}
.calendar-delete-summary__copy span {
  font-size:12px;
  color: var(--text-dim);
}
.calendar-delete-summary__actions {
  flex-shrink: 0;
}
.calendar-agenda { margin-top:16px; background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:14px; }
.calendar-agenda__header { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; }
.calendar-agenda__header h3 { margin:0; font-size:14px; color:var(--heading); }
.calendar-agenda__tabs { display:flex; gap:8px; margin-bottom:14px; flex-wrap:wrap; }
.calendar-agenda__tab {
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px; border-radius:999px; border:1px solid var(--border);
  background:var(--surface2); color:var(--text-dim); font:inherit; font-size:12px; font-weight:700;
  cursor:pointer; transition:border-color .15s, color .15s, background .15s;
}
.calendar-agenda__tab:hover { color:var(--heading); border-color:var(--border2); }
.calendar-agenda__tab.is-active { color:var(--accent); border-color:rgba(249,115,22,0.4); background:rgba(249,115,22,0.08); }
.calendar-agenda__tab-count {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:20px; height:20px; padding:0 6px; border-radius:999px;
  background:rgba(15,23,42,0.06); color:inherit; font-size:10px;
}
.calendar-agenda__section { display:grid; gap:10px; }
.calendar-agenda__section + .calendar-agenda__section { margin-top:18px; padding-top:18px; border-top:1px solid var(--border); }
.calendar-agenda__section-head { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.calendar-agenda__section-head h4 { margin:0; font-size:13px; color:var(--heading); }
.calendar-agenda__list { display:grid; gap:10px; }
.calendar-agenda__item { width:100%; text-align:left; display:grid; gap:6px; padding:12px; border-radius:10px; border:1px solid var(--border); background:var(--surface2); cursor:pointer; transition:border-color .15s, transform .15s; }
.calendar-agenda__item:hover { border-color: var(--accent); transform: translateY(-1px); }
.calendar-agenda__item.is-history { background: rgba(148,163,184,0.08); border-color: rgba(148,163,184,0.18); opacity: 0.82; }
.calendar-agenda__item.is-history:hover { border-color: var(--border2); transform:none; }
.calendar-agenda__row { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.calendar-agenda__date-group { display:flex; align-items:baseline; gap:10px; min-width:0; flex-wrap:wrap; }
.calendar-agenda__row-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.calendar-agenda__date { font-size:13px; font-weight:800; color:var(--heading); }
.calendar-agenda__time { font-size:13px; font-weight:800; color:var(--accent); letter-spacing:0.01em; }
.calendar-agenda__badges { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.calendar-agenda__title {
  font-size:13px; color:var(--heading); line-height:1.45;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  overflow:hidden; text-wrap:pretty;
}
.calendar-agenda__notes { font-size:12px; color:var(--text-dim); line-height:1.45; }
.calendar-day-groups { display:grid; gap:12px; }
.calendar-day-group {
  display:grid;
  gap:10px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:10px;
  background: rgba(15,23,42,0.02);
}
.calendar-day-group__head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.calendar-day-group__head strong {
  font-size:13px;
  color: var(--heading);
}
.calendar-day-detail { display:grid; gap:14px; }
.calendar-day-detail__head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.calendar-day-detail__list { display:grid; gap:10px; max-height:min(70vh, 720px); overflow:auto; padding-right:4px; }

/* === Editor === */
.editor-container {
  display: grid;
  grid-template-columns: 1fr 550px;
  gap: 22px;
}

.editor-timeline-card {
  margin-top: 18px;
}

.editor-timeline-card__body {
  overflow-x: auto;
}

.editor-timeline-card .seo-decision-history-table {
  min-width: 760px;
}

.editor-timeline-card .seo-decision-history-table--compact .seo-decision-history-table {
  min-width: 0;
}

.editor-timeline-card .seo-decision-history-table,
.editor-timeline-card .seo-decision-history-table th,
.editor-timeline-card .seo-decision-history-table td {
  font-size: 12px;
}

.editor-timeline-card .seo-decision-history-detail {
  font-size: 12px;
  line-height: 1.35;
}

.editor-timeline-card .seo-decision-history-detail span {
  font-size: 11px;
}

.seo-decision-history-detail span {
  display: block;
  color: var(--text-muted);
}

.editor-timeline-card .badge {
  font-size: 11px;
  padding: 4px 8px !important;
}

.seo-timeline-date-compact {
  display: grid;
  gap: 2px;
  line-height: 1.25;
}

.seo-timeline-date-compact span:first-child {
  color: var(--text);
  font-weight: 600;
}

.seo-timeline-date-compact span:last-child {
  color: var(--text-muted);
  font-size: 11px;
}

.seo-timeline-date-compact em {
  color: var(--text-muted);
  font-style: normal;
  margin-left: 6px;
}

.editor-toolbar {
  display: flex;
  gap: 4px;
  padding: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  flex-wrap: wrap;
}

.editor-toolbar button {
  padding: 5px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.editor-toolbar button:hover { color: var(--heading); border-color: var(--border2); }
.editor-toolbar button.active { color: var(--accent); border-color: var(--accent); }

.editor-body {
  min-height: 400px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  outline: none;
}

.editor-body:focus {
  border-color: var(--accent);
}

.editor-body h2 { font-size: 1.3em; color: var(--heading); margin: 2em 0 0.8em; padding-top: 0.5em; border-top: 1px solid var(--border); }
.editor-body h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.editor-body h3 { font-size: 1.1em; color: var(--heading); margin: 1.5em 0 0.5em; }
.editor-body p { margin-bottom: 0.8em; }
.editor-body a { color: var(--accent); }
.editor-body ul, .editor-body ol { padding-left: 1.5em; margin-bottom: 0.8em; }

.editor-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.editor-meta .card { padding: 14px; }

/* Editor sidebar tabs */
.ed-sidebar-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin: -14px -14px 12px;
  padding: 0 6px;
}
.ed-stab {
  padding: 8px 10px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.ed-stab:hover { color: var(--heading); }
.ed-stab.active { color: var(--accent); border-bottom-color: var(--accent); }
.ed-stab-content { display: none; }
.ed-stab-content.active { display: block; }
.ed-stats-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--heading);
}

/* TOC in sidebar */
.stoc-item { display: flex; align-items: center; padding: 2px 0; font-size: 11px; cursor: pointer; border-radius: 4px; }
.stoc-item:hover { background: var(--surface2); }
.stoc-h3 { padding-left: 12px; }
.stoc-h4 { padding-left: 24px; }
.stoc-badge { font-size: 8px; padding: 1px 3px; border-radius: 3px; }
.stoc-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); font-size: 11px; }
.stoc-item:hover .stoc-text { color: var(--text); }
.stoc-select { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px 4px; font-size: 11px; }
.stoc-select:hover { color: var(--accent); }

/* === Infos tab redesign === */
.ed-info-section { margin-bottom: 12px; }
.ed-info-section:last-child { margin-bottom: 0; }

.ed-status-select {
  width: 100%; padding: 7px 10px; border-radius: 6px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  font-family: inherit; transition: border-color 0.15s;
}
.ed-status-select:focus { outline: none; border-color: var(--accent); }
.ed-status-select.status-published { border-color: var(--green); color: var(--green); }
.ed-status-select.status-draft { border-color: var(--text-muted); color: var(--text-dim); }
.ed-status-select.status-to_write { border-color: var(--yellow); color: var(--yellow); }
.ed-status-select.status-ready { border-color: var(--blue); color: var(--blue); }
.ed-status-select.status-validated { border-color: var(--accent); color: var(--accent); }
.ed-status-select.status-scheduled { border-color: var(--cyan); color: var(--cyan); }
.ed-status-select.status-archived { border-color: var(--text-muted); color: var(--text-muted); }

.ed-info-author {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: var(--surface2); border-radius: 8px;
}
.ed-info-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.ed-info-author-name { font-size: 12px; font-weight: 600; color: var(--text); }
.ed-info-author-role { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }

.ed-category-tree {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  max-height: 230px;
  overflow: auto;
  padding: 4px;
}

.ed-category-tree--empty {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.4;
}

.ed-category-node {
  margin: 0;
}

.ed-category-check {
  display: flex !important;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  margin: 0;
  padding: 2px 7px 2px calc(7px + (var(--depth, 0) * 14px));
  border-radius: 6px;
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
}

.ed-category-check:hover {
  background: var(--surface2);
}

.ed-category-check input {
  width: 13px;
  height: 13px;
  margin: 0;
  flex: 0 0 auto;
}

.ed-category-node.has-children > .ed-category-check {
  font-weight: 700;
}

.ed-tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 6px; margin: 2px 4px 2px 0;
  font-size: 11px; line-height: 1.4;
}
.ed-tag-text { outline: none; cursor: text; color: var(--text); }
.ed-tag-text:focus { color: var(--blue); }
.ed-tag-remove { cursor: pointer; color: var(--text-muted); font-size: 12px; }
.ed-tag-remove:hover { color: var(--red); }

.ed-info-row { display: flex; align-items: center; gap: 8px; }
.ed-info-row > i { color: var(--text-muted); font-size: 13px; flex-shrink: 0; }
.ed-info-date-input {
  flex: 1; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); padding: 5px 8px; font-size: 12px; font-family: inherit;
}
.ed-info-date-input:focus { outline: none; border-color: var(--accent); }
.ed-info-publish {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  display: grid;
  gap: 4px;
}
.ed-info-publish-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.ed-info-publish-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.ed-info-publish-note {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.45;
}
.ed-info-publish--danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.24);
}
.ed-info-publish--danger .ed-info-publish-label {
  color: #b91c1c;
}
.ed-info-publish--danger .ed-info-publish-date {
  color: #991b1b;
}
.ed-info-publish--danger .ed-info-publish-note {
  color: #b91c1c;
}

.ed-info-grid {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: 12px;
}
.ed-info-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; background: var(--surface2); border-radius: 6px; text-align: center;
}
.ed-info-item > i { font-size: 12px; color: var(--text-muted); }
.ed-info-value { font-size: 13px; font-weight: 600; color: var(--text); }
.ed-info-link { color: var(--accent) !important; text-decoration: none; }
.ed-info-link:hover { text-decoration: underline; }
.ed-info-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }

.ed-info-meta-list { border-top: 1px solid var(--border); padding-top: 8px; }

.ed-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.ed-image-lightbox__dialog {
  position: relative;
  max-width: min(96vw, 1400px);
  max-height: 92vh;
}

.ed-image-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  background: #fff;
}

.ed-image-lightbox__close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
}

.ed-image-lightbox__close:hover {
  background: #fff;
}
.ed-info-meta-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; font-size: 11px; color: var(--text-dim);
}
.ed-info-meta-label { color: var(--text-muted); }

.ed-stab-content[data-tab="metas"] textarea {
  min-height: 116px;
  resize: vertical;
}

/* === Stats tab (GSC) === */
.ed-stats-loading { text-align: center; padding: 32px 0; }
.ed-stats-empty {
  text-align: center; padding: 24px 8px; color: var(--text-muted);
}
.ed-stats-empty i { font-size: 28px; display: block; margin-bottom: 8px; opacity: 0.4; }
.ed-stats-empty p { font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 4px; }
.ed-stats-empty span { font-size: 11px; line-height: 1.4; }

.ed-maillage-summary {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 14px;
}
.ed-maillage-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
}
.ed-maillage-stat strong {
  font-size: 18px;
  line-height: 1;
  color: var(--heading);
}
.ed-maillage-stat span {
  margin-top: 3px;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ed-maillage-section {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 14px;
}
.ed-maillage-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.ed-maillage-section__head strong {
  font-size: 13px;
  color: var(--heading);
}
.ed-maillage-section__head span {
  font-size: 11px;
  color: var(--text-muted);
}
.ed-maillage-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ed-maillage-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 11px;
}
.ed-maillage-table th,
.ed-maillage-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}
.ed-maillage-table th {
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ed-maillage-table tr:last-child td { border-bottom: 0; }
.ed-maillage-title {
  max-width: 260px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.ed-maillage-title a {
  color: var(--accent);
  text-decoration: none;
}
.ed-maillage-title a:hover { text-decoration: underline; }
.ed-maillage-anchor {
  max-width: 180px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.ed-maillage-meta {
  max-width: 280px;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.ed-maillage-empty {
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface2);
}

.ed-stats-overview {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px;
}
.ed-stat-card {
  background: var(--surface2); border-radius: 6px; padding: 10px 8px; text-align: center;
}
.ed-stat-value { font-size: 16px; font-weight: 700; color: var(--text); }
.ed-stat-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }

.ed-stats-queries-title {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text-muted); margin-bottom: 6px;
}
.ed-stats-queries { display: flex; flex-direction: column; gap: 1px; }
.ed-stats-query-row {
  display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 4px;
  font-size: 11px; transition: background 0.1s;
}
.ed-stats-query-row:hover { background: var(--surface2); }
.ed-stats-query-text {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text);
}
.ed-stats-query-clicks {
  font-weight: 600; color: var(--accent); font-size: 11px; min-width: 24px; text-align: right;
}
.ed-stats-query-pos {
  color: var(--text-muted); font-size: 10px; min-width: 32px; text-align: right;
}
.ed-stats-index-row {
  display: flex; align-items: center; gap: 6px; padding: 8px 6px;
  font-size: 12px; border-top: 1px solid var(--border); margin: 8px 0;
}
.ed-history-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ed-history-item {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 10px;
  padding: 12px;
  background: var(--surface);
}
.ed-history-item--accent { border-left-color: var(--accent); }
.ed-history-item--blue { border-left-color: var(--blue); }
.ed-history-item--green { border-left-color: var(--green); }
.ed-history-item--purple { border-left-color: var(--accent2); }
.ed-history-item--orange { border-left-color: var(--orange); }
.ed-history-item--red { border-left-color: var(--red); }
.ed-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.ed-history-date {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.ed-history-summary {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
}
.ed-history-meta {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-dim);
}

/* AI meta generation button */
.ed-ai-btn {
  background: none; border: none; color: var(--accent); cursor: pointer;
  padding: 0 2px; font-size: 12px; vertical-align: middle; opacity: 0.7;
  transition: opacity 0.15s;
}
.ed-ai-btn:hover { opacity: 1; }

/* AI suggestions picker */
.ed-ai-loading { text-align: center; padding: 24px 0; color: var(--text-dim); font-size: 13px; }
.ed-ai-suggestion {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px;
  margin-bottom: 8px; transition: border-color 0.15s;
}
.ed-ai-suggestion:hover { border-color: var(--accent); }
.ed-ai-suggestion-text { font-size: 13px; line-height: 1.4; color: var(--text); margin-bottom: 6px; }
.ed-ai-suggestion-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.ed-ai-over { color: var(--red) !important; }

/* Slug locked (published post) */
.ed-slug-locked {
  background: var(--surface2) !important; color: var(--text-dim) !important;
  cursor: not-allowed; opacity: 0.7;
}

/* Badge variants */
.badge-dim { background: var(--surface2); color: var(--text-muted); }

/* === Badges (generic) === */
.badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-block;
}
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-blue { background: rgba(59,130,246,0.12); color: var(--blue); }
.badge-green { background: rgba(16,185,129,0.12); color: var(--green); }
.badge-red { background: rgba(239,68,68,0.12); color: var(--red); }
.badge-purple { background: rgba(99,102,241,0.12); color: var(--accent2); }
.badge-orange { background: rgba(249,115,22,0.15); color: var(--orange); }
.badge-cyan { background: rgba(34,211,238,0.15); color: var(--cyan); }
.badge-gray { background: var(--surface2); color: var(--text-dim); }
.badge-soft { background: #eef4ff; color: #3159b6; }
.badge-muted { background: var(--surface2); color: var(--text-dim); }

/* === Cost === */
.cost-value { color: var(--green); font-weight: 600; }
.cost-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(16,185,129,0.12);
  color: var(--green);
  font-weight: 600;
}

/* === Page header === */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--heading);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.modal-overlay.visible { opacity: 1; visibility: visible; }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  margin: 24px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
}
.modal-overlay.modal-wide .modal-box {
  max-width: 95vw;
  max-height: 90vh;
  margin-top: 2vh;
}

.modal-overlay.modal-xwide .modal-box {
  width: min(1480px, calc(100vw - 32px));
  max-width: none;
  max-height: 92vh;
  margin-top: 2vh;
}

.modal-overlay.modal-full .modal-box {
  width: calc(100vw - 28px);
  height: calc(100vh - 28px);
  max-width: none;
  max-height: none;
  display: flex;
  flex-direction: column;
  margin: 14px;
}

.modal-overlay.modal-full .modal-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 14px; font-weight: 700; color: var(--heading); }
.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 20px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

/* === Toast === */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  min-width: 240px;
  max-width: 380px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: toast-in 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.toast-out { animation: toast-out 0.25s ease forwards; }
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }
.toast-info { background: var(--blue); }
.toast-warning { background: var(--yellow); color: #000; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(10px); }
}

/* === Niche cards === */
.niche-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.niche-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.niche-card:hover { border-color: var(--border2); }
.niche-card h3 { font-size: 14px; font-weight: 700; color: var(--heading); margin-bottom: 8px; }
.niche-card .niche-meta { font-size: 11px; color: var(--text-dim); display: flex; gap: 12px; }

/* === Log entries === */
.log-entry {
  margin-bottom: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  font-size: 12px;
}
.log-entry.level-error { border-left-color: var(--red); }
.log-entry.level-warn { border-left-color: var(--yellow); }
.log-entry.level-info { border-left-color: var(--blue); }
.log-entry .log-header {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 4px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.log-entry .log-msg { color: var(--text); line-height: 1.5; }

/* === Steps timeline === */
.steps-list { display: flex; gap: 6px; margin: 12px 0; flex-wrap: wrap; }
.step-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface2);
  color: var(--text-dim);
}
.step-badge.running { background: rgba(59,130,246,0.12); color: var(--blue); animation: pulse 1.5s infinite; }
.step-badge.completed { background: rgba(16,185,129,0.12); color: var(--green); }
.step-badge.failed { background: rgba(239,68,68,0.12); color: var(--red); }
.step-badge .step-cost { font-size: 10px; color: var(--green); margin-left: 4px; }

/* === Server-side paginated table === */
.ss-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ss-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.analytics-sort-btn {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.analytics-sort-btn:hover { color: var(--accent2); }
.analytics-compact-table th,
.analytics-compact-table td {
  font-size: 11px;
  vertical-align: middle;
  padding: 7px 8px;
  white-space: nowrap;
}
.analytics-compact-table .post-row-title {
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
}
.analytics-compact-table .badge {
  line-height: 1.1;
}
.analytics-compact-table th:nth-child(1),
.analytics-compact-table td:nth-child(1) {
  width: 72px;
  min-width: 72px;
}
.analytics-compact-table th:nth-child(3),
.analytics-compact-table td:nth-child(3) {
  width: 44px;
  min-width: 44px;
  text-align: center;
}
.analytics-compact-table th:nth-child(4),
.analytics-compact-table td:nth-child(4),
.analytics-compact-table th:nth-child(8),
.analytics-compact-table td:nth-child(8) {
  width: 88px;
  min-width: 88px;
}
.analytics-metric-cell {
  display: grid;
  gap: 2px;
  justify-items: start;
}
.analytics-metric-cell strong {
  font-size: 12px;
  color: var(--heading);
}
.analytics-compact-table .text-center {
  text-align: center;
}
.analytics-compact-table th,
.analytics-compact-table td {
  border-right: 1px solid rgba(148, 163, 184, 0.22);
}
.analytics-compact-table th:last-child,
.analytics-compact-table td:last-child {
  border-right: 0;
}
.analytics-compact-table th:nth-child(4),
.analytics-compact-table td:nth-child(4),
.analytics-compact-table th:nth-child(8),
.analytics-compact-table td:nth-child(8) {
  border-left: 1px solid rgba(148, 163, 184, 0.35);
}
.analytics-diff-badge {
  font-size: 10px !important;
  padding: 2px 6px !important;
}
.analytics-index-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid transparent;
}
.analytics-index-dot--ok {
  background: rgba(34, 197, 94, 0.15);
  color: #166534;
  border-color: rgba(22, 163, 74, 0.35);
}
.analytics-index-dot--ko {
  background: rgba(239, 68, 68, 0.14);
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.35);
}
.analytics-index-dot--na {
  background: rgba(148, 163, 184, 0.14);
  color: #475569;
  border-color: rgba(148, 163, 184, 0.35);
}
.manager-info-toggle,
.analytics-info-toggle {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.manager-info-toggle summary,
.analytics-info-toggle summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--heading);
  text-decoration: none;
}
.manager-info-toggle summary::-webkit-details-marker,
.analytics-info-toggle summary::-webkit-details-marker { display: none; }
.manager-info-grid,
.analytics-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
}
.manager-info-grid > div,
.analytics-info-grid > div {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  display: grid;
  gap: 3px;
}
.manager-info-grid strong,
.analytics-info-grid strong {
  font-size: 11px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.manager-info-grid span,
.analytics-info-grid span {
  font-size: 12px;
  color: var(--heading);
  font-weight: 600;
}
.manager-info-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 12px;
}
.analytics-tab-btn,
.analytics-tab-btn:hover,
.analytics-tab-btn:focus,
.analytics-tab-btn:active,
.analytics-tab-btn:visited {
  text-decoration: none !important;
}
.posts-type-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.posts-filter-toolbar {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.posts-type-static {
  display: flex;
  flex-direction: row;
  gap: 0;
  align-items: flex-end;
}
.posts-view-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.posts-type-toggle .btn.is-active {
  background: var(--accent);
  border-color: rgba(245, 158, 11, 0.32);
  color: #1b1300;
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.16);
}
.ss-search {
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  min-width: 220px;
}
.ss-search:focus { outline: none; border-color: var(--accent); }
.ss-search::placeholder { color: var(--text-muted); }
.ss-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.3;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.ss-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}
.ss-input::placeholder { color: var(--text-muted); }
.ss-select {
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.ss-select:focus { outline: none; border-color: var(--accent); }

.tools-discover-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
}
.tools-discover-modal__box {
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
  padding: 22px;
}
.tools-discover-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.tools-discover-modal__header h3 {
  margin: 0;
  color: var(--heading);
  font-size: 20px;
  font-weight: 800;
}
.tools-discover-modal__header p {
  margin: 6px 0 0;
}
.tools-discover-modal__body {
  display: grid;
  gap: 14px;
}
.tools-discover-modal__field {
  display: grid;
  gap: 6px;
}
.tools-discover-modal__field > span {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}
.tools-discover-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.ss-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.ss-table th {
  background: var(--surface2);
  color: var(--text-dim);
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.ss-table th:first-child { border-radius: 8px 0 0 0; }
.ss-table th:last-child { border-radius: 0 8px 0 0; }
.ss-table th:hover { color: var(--heading); }
.ss-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.ss-table tbody tr { cursor: pointer; transition: background 0.1s; }
.ss-table tbody tr:hover td { background: #f8fafc; }

/* === Writer supervisor === */
.wsv-kpis {
  margin-top: 14px;
}

.wsv-table-shell {
  margin-top: 14px;
}

.wsv-table th,
.wsv-table td {
  vertical-align: top;
}

.wsv-table td {
  padding-top: 8px;
  padding-bottom: 8px;
}

.wsv-reason {
  max-width: 260px;
}

.wsv-switch {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--text-dim);
  font-size: 12px;
}

.wsv-switch input {
  accent-color: var(--accent);
}

.wsv-agent-name,
.wsv-prompt-field,
.wsv-schedule-row label {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 11px;
}

.wsv-agent-name span,
.wsv-prompt-field span,
.wsv-schedule-row label span {
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
}

.wsv-agent-name input {
  width: 190px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: 7px 9px;
}

.wsv-config-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.wsv-config-head .wsv-switch {
  margin: 0;
}

.wsv-agent-form {
  display: grid;
  grid-template-columns: 190px minmax(360px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.wsv-inline-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  min-width: 170px;
}

.wsv-inline-fields label {
  display: grid;
  gap: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.wsv-inline-fields label span {
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
}

.wsv-inline-fields label small {
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.25;
}

.wsv-inline-fields input,
.wsv-default-prompt,
.wsv-schedule-row input,
.wsv-schedule-row textarea,
.wsv-schedule-row select,
.wsv-mode-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.wsv-inline-fields input {
  padding: 7px 8px;
}

.wsv-mode-select {
  padding: 8px 9px;
  min-width: 190px;
}

.wsv-default-prompt {
  min-width: 320px;
  max-width: 520px;
  min-height: 112px;
  padding: 8px 10px;
  resize: vertical;
  line-height: 1.35;
}

.wsv-schedules {
  min-width: 680px;
  margin-top: 10px;
}

.wsv-config-panel.is-collapsed,
.wsv-actions .is-hidden,
.wsv-loop-prompt.is-hidden,
.wsv-schedules.is-hidden {
  display: none;
}

.wsv-config-summary {
  max-width: 760px;
}

.wsv-section-label {
  margin: 2px 0 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.wsv-summary-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-height: 28px;
}

.wsv-summary-line .text-muted {
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wsv-schedule-summary-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.wsv-schedule-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 360px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-muted);
  font-size: 11px;
}

.wsv-schedule-summary strong {
  color: var(--heading);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wsv-schedule-summary em {
  color: var(--accent);
  font-style: normal;
  font-weight: 800;
}

.wsv-schedule-summary small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.wsv-config-panel {
  margin-top: 9px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.wsv-schedule-list {
  display: grid;
  gap: 9px;
  margin-bottom: 9px;
}

.wsv-schedule-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.wsv-schedule-top {
  display: grid;
  grid-template-columns: 70px minmax(150px, 0.8fr) minmax(210px, 0.9fr) 110px 38px;
  gap: 9px;
  align-items: end;
}

.wsv-schedule-row input,
.wsv-schedule-row textarea,
.wsv-schedule-row select {
  padding: 7px 8px;
  font-size: 12px;
}

.wsv-schedule-row textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.35;
}

.wsv-schedule-enabled {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  margin: 0;
  align-self: end;
  min-height: 36px;
}

.wsv-schedule-enabled input {
  width: auto;
  margin: 0;
}

.wsv-schedule-enabled span {
  line-height: 1;
}

.wsv-frequency-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 7px;
}

.wsv-schedule-prompt textarea {
  min-height: 108px;
}

.wsv-schedule-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.wsv-empty-schedules {
  padding: 9px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fff;
}

.wsv-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 118px;
}

.wsv-log-card {
  margin-top: 16px;
}

.wsv-log-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

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

.wsv-log-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
}

.wsv-log-item code {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px 6px;
  color: var(--heading);
}

.wsv-log-item--post {
  align-items: flex-start;
  display: grid;
  gap: 8px;
}

.wsv-log-main,
.wsv-log-post__links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wsv-log-post {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.wsv-log-post__title {
  color: var(--heading);
  font-weight: 700;
  text-decoration: none;
}

.wsv-log-post__title:hover {
  color: var(--primary);
}

.wsv-log-post__links {
  font-size: 12px;
}

.wsv-log-post__links a {
  color: var(--text-dim);
  max-width: min(720px, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wsv-log-pagination {
  margin-top: 12px;
}

.posts-surface-table tbody tr:last-child td { border-bottom: 0; }

.ss-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-dim);
}
.ss-pagination-btns {
  display: flex;
  gap: 4px;
  align-items: center;
}
.ss-pagination .btn { padding: 6px 12px; }
.posts-date-cell {
  display: grid;
  gap: 2px;
  min-width: 92px;
}
.posts-date-cell__value {
  font-size: 12px;
  font-weight: 800;
  color: var(--heading);
  line-height: 1.2;
}
.posts-date-cell__meta {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* === Post row with thumbnail === */
.post-row-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.post-thumb {
  width: 90px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface2);
}
.post-thumb-placeholder {
  width: 90px;
  height: 60px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--surface2);
}
.post-thumb-wrap {
  width: 90px;
  height: 60px;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-muted);
}
.post-thumb-wrap::after {
  content: attr(data-letter);
}
.post-thumb-wrap:has(img) { background: none; }
.post-thumb-wrap:has(img)::after { display: none; }
.post-row-text { min-width: 0; }
.post-row-title {
  font-weight: 700;
  color: var(--heading);
  font-size: 14px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 680px;
}
.post-row-sub {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.post-row-keyword {
  color: var(--accent);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-row-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* === Project overview stats === */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.overview-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.overview-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.overview-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--heading);
}
.overview-stat-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* === Info grid (project detail, post detail) === */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.info-item {}
.info-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.info-value { font-size: 14px; color: var(--heading); font-weight: 500; }

/* === Editor enhancements === */
.editor-toolbar .sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}
.editor-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.editor-status-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  font-size: 11px;
  color: var(--text-dim);
}
.editor-body {
  min-height: 500px;
}

/* === Chip multi-select === */
.chip-select {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  max-height: 160px;
  overflow-y: auto;
}
.chip-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
  background: var(--surface2);
  color: var(--text-dim);
  border: 1px solid var(--border);
  transition: all 0.15s;
  white-space: nowrap;
}
.chip-option:hover { border-color: var(--accent); color: var(--text); }
.chip-option.selected {
  background: var(--accent);
  color: #1b1300;
  border-color: var(--accent);
}

/* === Authors table + detail === */
.author-thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface2);
}
.author-thumb-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--surface2);
}

/* Author detail panel */
.author-detail-card { padding: 24px; margin-top: 16px; }
.author-detail-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.author-detail-avatar-wrap { flex-shrink: 0; text-align: center; }
.author-detail-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border2);
}
.author-detail-avatar-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 40px;
}
.author-detail-avatar-actions { margin-top: 10px; }
.author-detail-info { flex: 1; min-width: 0; }
.author-detail-section { margin-top: 20px; }
.author-detail-section > textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  line-height: 1.5;
}
.author-detail-section > textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.author-detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.author-detail-section-header label {
  font-weight: 700;
  color: var(--text);
}
.btn-accent {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.btn-accent:hover {
  background: rgba(245, 158, 11, 0.15);
}
@media (max-width: 768px) {
  .author-detail-header { flex-direction: column; align-items: center; }
}
.mt-8 { margin-top: 8px; }
.badge-green { background: var(--green); color: #fff; }
.badge-red { background: var(--red); color: #fff; }
.text-right { text-align: right; }
.tree-indent { color: var(--text-muted); font-family: monospace; white-space: pre; font-size: 12px; }

/* === Loading / Empty === */
.loading { text-align: center; padding: 40px; color: var(--text-dim); font-size: 13px; }
.empty { text-align: center; padding: 40px; color: var(--text-muted); font-size: 13px; }

/* === Inbound forms === */
.inbound-forms-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.inbound-kpi {
  margin-bottom: 0;
  padding: 16px 18px;
}

.inbound-kpi__label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.inbound-kpi__value {
  display: block;
  font-size: 28px;
  line-height: 1;
  color: var(--heading);
}

.inbound-link {
  word-break: break-word;
}

.inbound-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.inbound-detail-card,
.inbound-detail-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcfe;
}

.inbound-detail-card {
  padding: 14px;
}

.inbound-detail-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148,163,184,0.18);
}

.inbound-detail-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.inbound-detail-row span {
  color: var(--text-dim);
  font-size: 12px;
  flex: 0 0 110px;
}

.inbound-detail-row strong {
  flex: 1;
  text-align: right;
  word-break: break-word;
}

.inbound-detail-block {
  padding: 14px;
  margin-bottom: 14px;
}

.planning-kpi-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.planning-feed-log-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 14px;
}

.planning-feed-log-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.planning-feed-log-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--heading);
}

.planning-feed-log-card__sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

.planning-feed-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.planning-feed-log-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
}

.planning-feed-log-item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.planning-feed-log-item__keyword {
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.4;
}

.planning-feed-log-item__badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.planning-feed-log-item__bottom {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 12px;
}

.planning-feed-log-item__reason {
  color: var(--text);
  font-weight: 600;
}

.planning-feed-log-item__meta {
  color: var(--text-dim);
}

.planning-item-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.planning-item__grid {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: stretch;
}

.planning-item__thumb {
  display: flex;
  align-items: center;
}

.planning-item__thumb-image,
.planning-item__thumb-fallback {
  width: 130px;
  height: 78px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.planning-item__thumb-image {
  object-fit: cover;
  display: block;
}

.planning-item__thumb-fallback {
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text-dim);
}

.planning-item__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.planning-item__title-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.planning-item__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.35;
}

.planning-item__badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.planning-item__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.inbound-detail-block__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.inbound-detail-message {
  color: var(--text);
  line-height: 1.55;
  white-space: normal;
  word-break: break-word;
}

.inbound-json {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #f6f8fb;
  color: #1f2937;
  border: 1px solid #dbe3ee;
  font-size: 12px;
  line-height: 1.5;
  overflow: auto;
}

/* === Utility === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-white,
.text-strong { color: var(--heading); }
.text-accent { color: var(--accent); }
.text-sm { font-size: 11px; }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clickable { cursor: pointer; }

/* === Mobile === */
.mobile-topbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  margin-right: 12px;
}
.mobile-topbar-toggle svg { width: 20px; height: 20px; }
.mobile-topbar-toggle:hover { color: var(--text); }

.sidebar-overlay { display: none; }

/* === Responsive === */
@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .link-sale-modal-grid { grid-template-columns: 1fr; }
  .link-sale-modal-grid .form-row--span-2,
  .link-sale-modal-grid .form-row--full { grid-column: 1; }
  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .link-sales-grid-2 { grid-template-columns: 1fr; }
  .link-sales-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-container { grid-template-columns: 1fr; }
  .niche-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  html, body { overflow-x: hidden; width: 100%; }
  :root { --sidebar-w: 0px; }
  .sidebar {
    width: 220px;
    min-width: 220px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: none;
    visibility: hidden;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(15,23,42,0.18);
    visibility: visible;
  }
  .sidebar.collapsed {
    width: 220px;
    min-width: 220px;
  }
  .sidebar.collapsed .logo-text { display: inline; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 9px 12px; font-size: 13px; }
  .sidebar.collapsed .nav-icon { font-size: 15px; width: 20px; }
  .sidebar.collapsed .sidebar-section-title { font-size: 10px; padding: 16px 18px 8px; }
  .sidebar.collapsed .sidebar-section-title::after { content: none; }
  .sidebar.collapsed .sidebar-status { display: flex; }
  .sidebar.collapsed .sidebar-header { justify-content: space-between; padding: 0 18px; }
  .sidebar.collapsed .logout-btn { font-size: 12px; justify-content: flex-start; padding: 8px 12px; }

  .main { margin-left: 0 !important; }
  body.sidebar-collapsed .main { margin-left: 0 !important; }

  .mobile-topbar-toggle { display: flex; }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9;
  }

  .content { padding: 12px; }
  .topbar { padding: 0 12px; }
  .link-sales-panel { padding: 16px; }
  .link-sales-panel__head { flex-direction: column; }
  .link-sales-chart-wrap { min-height: 260px; }
  .link-sales-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .link-sales-summary-grid { grid-template-columns: 1fr; }
  .inbound-forms-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inbound-detail-grid { grid-template-columns: 1fr; }
  .inbound-detail-row { flex-direction: column; }
  .inbound-detail-row strong { text-align: left; }
  .planning-feed-log-item__top { flex-direction: column; }
  .planning-feed-log-item__badges { justify-content: flex-start; }
  .planning-item__grid { grid-template-columns: 1fr; }
  .planning-item__thumb { order: 2; }
  .planning-item__actions {
    order: 4;
    justify-content: flex-start;
  }
  .tabs-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab-btn { padding: 8px 10px; font-size: 11px; }
  .niche-grid { grid-template-columns: 1fr; }
  .calendar-grid { font-size: 10px; }
  .calendar-cell { min-height: 60px; }
  .calendar-agenda__item { padding: 10px; }
  .kanban { flex-direction: column; }
  .kanban-column { min-width: 0; }
  .import-grid-responsive { grid-template-columns: 1fr !important; }
}

/* === Clients — Kanban === */
.kanban { display: flex; gap: 12px; overflow-x: auto; }
.kanban-column { flex: 1; min-width: 220px; background: var(--surface); border-radius: 8px; padding: 12px; border: 1px solid var(--border); }
.kanban-column h3 { font-size: 14px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--border); color: var(--heading); font-weight: 700; }
.kanban-card { background: var(--surface2); border-radius: 6px; padding: 10px; margin-bottom: 8px; cursor: pointer; border: 1px solid var(--border); transition: border-color 0.15s, box-shadow 0.15s; }
.kanban-card:hover { border-color: var(--border2); box-shadow: 0 8px 18px rgba(15,23,42,0.08); }
.kanban-card .card-project { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.kanban-card .card-project-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--heading); background: rgba(15,23,42,0.06); padding: 2px 8px; border-radius: 4px; margin-bottom: 4px; letter-spacing: 0.2px; }
.kanban-card .card-subject { font-weight: 600; margin: 4px 0; color: var(--heading); font-size: 13px; }
.kanban-card .card-meta { font-size: 12px; color: var(--text-dim); }
.kanban-card .card-complexity { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.kanban-card .card-complexity.S { background: rgba(16,185,129,0.15); color: var(--green); }
.kanban-card .card-complexity.M { background: rgba(245,158,11,0.15); color: var(--yellow); }
.kanban-card .card-complexity.L { background: rgba(239,68,68,0.15); color: var(--red); }
.kanban-card .card-complexity.XL { background: rgba(99,102,241,0.15); color: var(--accent2); }

/* Kanban column colors */
.kanban-column[data-status="inbox"] h3 { border-bottom-color: #6366f1; color: #818cf8; }
.kanban-column[data-status="analyzed"] h3 { border-bottom-color: #3b82f6; color: #60a5fa; }
.kanban-column[data-status="in_progress"] h3 { border-bottom-color: #f59e0b; color: #fbbf24; }
.kanban-column[data-status="done"] h3 { border-bottom-color: #10b981; color: #34d399; }
.kanban-column[data-status="archived"] h3 { border-bottom-color: #6b7280; color: #9ca3af; }

.kanban-column[data-status="inbox"] { border-top: 3px solid #6366f1; }
.kanban-column[data-status="analyzed"] { border-top: 3px solid #3b82f6; }
.kanban-column[data-status="in_progress"] { border-top: 3px solid #f59e0b; }
.kanban-column[data-status="done"] { border-top: 3px solid #10b981; }
.kanban-column[data-status="archived"] { border-top: 3px solid #6b7280; }

/* === Clients — Tabs === */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab { padding: 10px 20px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; color: var(--text-dim); font-size: 13px; font-weight: 500; transition: color 0.15s, border-color 0.15s; }
.tab:hover { color: var(--heading); }
.tab.active { border-bottom-color: var(--accent); color: var(--heading); font-weight: 600; }

/* === Clients — Import forms === */
.import-form { max-width: 600px; }
.import-form .form-group { margin-bottom: 16px; }
.import-form label { display: block; margin-bottom: 4px; font-weight: 500; font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.3px; }
.import-form input, .import-form select, .import-form textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-family: inherit; font-size: 13px; }
.import-form input:focus, .import-form select:focus, .import-form textarea:focus { outline: none; border-color: var(--accent); }
.import-form textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.import-form button { padding: 8px 20px; }

/* Toggle switch */
.toggle { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-dim); user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track { position: relative; width: 36px; height: 20px; background: var(--border, #333); border-radius: 10px; transition: background 0.2s; flex-shrink: 0; }
.toggle-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform 0.2s; }
.toggle input:checked + .toggle-track { background: var(--accent, #D97706); }
.toggle input:checked + .toggle-track::after { transform: translateX(16px); }
.toggle:hover .toggle-track { background: var(--text-dim, #666); }
.toggle:hover input:checked + .toggle-track { background: var(--accent-hover, #B45309); }

/* === Project cocon map === */
.cocon-map-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.cocon-map-summary .info-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}
.cocon-map-summary .info-label {
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cocon-map-summary .info-value {
  color: var(--heading);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 6px;
}
.cocon-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.cocon-map-subtabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.cocon-map-subtab {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  padding: 8px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.cocon-map-subtab:hover { color: var(--heading); }
.cocon-map-subtab.active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}
.cocon-map-panel { margin-top: 0; }
.cocon-list-layout {
  display: grid;
  gap: 18px;
}
.cocon-list-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.cocon-list-section__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #fbfcff;
}
.cocon-list-table-shell {
  border: 0 !important;
  border-radius: 0 !important;
}
.cocon-list-table {
  margin: 0;
}
.cocon-list-table th {
  background: var(--border);
}
.cocon-list-table .status-published {
  background: rgba(16,185,129,0.12);
  color: var(--green);
}
.cocon-list-table .status-to_write {
  background: rgba(239,68,68,0.12);
  color: var(--red);
}
.cocon-list-row--depth-0 td {
  background: #fffaf2;
}
.cocon-list-row--depth-1 td {
  background: #f8fbff;
}
.cocon-list-row--depth-2 td {
  background: #fff;
}
.cocon-hierarchy-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.cocon-hierarchy-connector {
  width: 16px;
  color: var(--text-dim);
  font-weight: 800;
  line-height: 1.4;
  flex-shrink: 0;
}
.cocon-tree-layout {
  display: grid;
  gap: 16px;
}
.cocon-tree-group {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.04);
}
.cocon-tree-group__header,
.cocon-cluster-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.cocon-tree-group__toggle {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.cocon-tree-group__toggle:hover .cocon-tree-group__title {
  color: var(--accent);
}
.cocon-tree-group.is-collapsed .cocon-flow-table {
  display: none;
}
.cocon-tree-group__eyebrow,
.cocon-cluster-card__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.cocon-tree-group__title,
.cocon-cluster-card__title {
  margin: 0;
  color: var(--heading);
  font-size: 18px;
  line-height: 1.2;
}
.cocon-tree-group__meta,
.cocon-cluster-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-dim);
}
.cocon-tree-group__summary,
.cocon-cluster-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.cocon-tree-group__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--heading);
}
.cocon-flow-table {
  display: grid;
  gap: 14px;
}
.cocon-flow-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(300px, 360px) 34px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}
.cocon-flow-center {
  display: flex;
  align-items: stretch;
}
.cocon-flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  opacity: 0.8;
}
.cocon-flow-arrow i {
  font-size: 18px;
}
.cocon-flow-links {
  min-width: 0;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: #fbfcff;
}
.cocon-flow-links__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.cocon-flow-links__title span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--heading);
  font-size: 10px;
}
.cocon-flow-links__list {
  display: grid;
  gap: 6px;
}
.cocon-flow-links__more {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}
.cocon-flow-links__toggle {
  min-width: 92px;
}
.cocon-flow-links__empty {
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-dim);
  font-size: 11px;
}
.cocon-link-card {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: #fff;
  border-radius: 12px;
  padding: 9px 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.cocon-link-card:hover {
  transform: translateY(-1px);
  border-color: var(--border2);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}
.cocon-link-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.cocon-open-live {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--heading);
  flex-shrink: 0;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.cocon-open-live:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.cocon-open-live i {
  font-size: 12px;
}
.cocon-link-card__title {
  color: var(--heading);
  font-size: 12px;
  line-height: 1.3;
}
.cocon-link-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.cocon-link-card__anchor {
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--heading);
  font-weight: 600;
}
.cocon-tree-group__children {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.cocon-tree-sections {
  display: grid;
  gap: 12px;
}
.cocon-tree-section {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: #fbfcff;
}
.cocon-tree-section__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.cocon-tree-section__title span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--heading);
  font-size: 11px;
}
.cocon-tree-section--published { background: rgba(16, 185, 129, 0.05); }
.cocon-tree-section--planned { background: rgba(59, 130, 246, 0.05); }
.cocon-tree-section--draft { background: rgba(148, 163, 184, 0.08); }
.cocon-tree-group__children--orphans {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.cocon-node-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
  border-radius: 16px;
  padding: 15px 16px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.cocon-node-card:hover {
  transform: translateY(-1px);
  border-color: var(--border2);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}
.cocon-node-card--pillar {
  border-color: rgba(249, 115, 22, 0.2);
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.9) 0%, rgba(255, 255, 255, 1) 100%);
}
.cocon-node-card--state-published {
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.95) 0%, #ffffff 100%);
  border-color: rgba(16, 185, 129, 0.22);
}
.cocon-node-card--state-planned {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.95) 0%, #ffffff 100%);
  border-color: rgba(59, 130, 246, 0.22);
}
.cocon-node-card--state-draft {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, #ffffff 100%);
  border-color: rgba(148, 163, 184, 0.2);
}
.cocon-node-card__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.cocon-node-card__title-wrap {
  min-width: 0;
  display: grid;
  gap: 5px;
}
.cocon-node-card__title {
  display: block;
  color: var(--heading);
  font-size: 14px;
  line-height: 1.35;
}
.cocon-node-card__slug {
  color: var(--text-dim);
  font-size: 11px;
  word-break: break-all;
}
.cocon-node-card__actions {
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.cocon-node-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.cocon-node-card__footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}
.cocon-node-card__date {
  font-size: 12px;
  color: var(--heading);
  font-weight: 600;
}
.cocon-node-card__counts {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 700;
}
.cocon-node-card__date--empty {
  color: var(--text-dim);
  font-weight: 500;
}
.cocon-empty {
  padding: 18px;
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.cocon-rel-layout {
  display: grid;
  gap: 16px;
}
.cocon-rel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.cocon-cluster-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.04);
}
.cocon-cluster-card__nodes {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.cocon-mini-node {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: #fbfcff;
  cursor: pointer;
}
.cocon-mini-node--pillar {
  background: rgba(255, 247, 237, 0.78);
  border-color: rgba(249, 115, 22, 0.18);
}
.cocon-cluster-card__links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.cocon-cluster-card__link-block {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: #fcfcfd;
}
.cocon-cluster-card__link-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.cocon-link-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cocon-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, 0.18);
}
.cocon-link-chip strong { font-weight: 800; }
.cocon-link-chip--out {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
}
.cocon-link-chip--in {
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
}
.cocon-link-chip--internal {
  background: rgba(99, 102, 241, 0.1);
  color: #4338ca;
}
.cocon-link-chip--internal i {
  font-size: 10px;
  opacity: 0.75;
}
.cocon-rel-summary-card { padding: 18px; }
.cocon-rel-link-list {
  display: grid;
  gap: 10px;
}
.cocon-rel-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
}
.cocon-rel-link-row__path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--heading);
}
.cocon-rel-link-row__path i { color: var(--text-dim); }
.cocon-rel-link-row__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 768px) {
  .link-sale-site-row {
    grid-template-columns: 1fr;
  }
  .link-sale-site-row__metrics {
    grid-template-columns: 1fr;
  }
  .link-sale-site-row__top {
    flex-direction: column;
    align-items: stretch;
  }
  .link-sale-site-row__sparklines {
    grid-template-columns: 1fr;
  }
  .link-sales-metric-modal__head {
    grid-template-columns: 1fr;
  }
  .link-sales-metric-modal__chart {
    min-height: 320px;
  }
  .link-sales-expired-modal__hero,
  .link-sales-expired-modal__snapshots {
    grid-template-columns: 1fr;
  }
  .link-sales-expired-modal__hero-side,
  .link-sales-expired-modal__breakdown {
    grid-template-columns: 1fr 1fr;
  }
  .link-sales-expired-modal__ref {
    flex-direction: column;
    align-items: flex-start;
  }
  .link-sales-expired-modal__ref span {
    text-align: left;
  }
  .seo-metrics-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seo-metrics-panel__head { flex-direction: column; }
  .seo-metrics-cards { grid-template-columns: 1fr; }
  .seo-metrics-list-row { grid-template-columns: 1fr; }
  .seo-metrics-list-row__chart { order: 3; }
  .seo-metrics-list-row__stats { gap: 6px; }
  .seo-metrics-mini-stat { min-width: 60px; }
  .seo-metrics-card__body { grid-template-columns: 1fr; }
  .seo-metrics-card__primary { grid-template-columns: 1fr; }
  .cocon-map-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cocon-map-toolbar,
  .cocon-tree-group__header,
  .cocon-cluster-card__head,
  .cocon-rel-link-row { flex-direction: column; align-items: stretch; }
  .cocon-flow-row {
    grid-template-columns: 1fr;
  }
  .cocon-flow-arrow { display: none; }
  .cocon-rel-grid,
  .cocon-tree-group__children,
  .cocon-tree-group__children--orphans { grid-template-columns: 1fr; }
  .cocon-map-subtabs { width: 100%; }
  .cocon-map-subtab { flex: 1; }
}

.topics-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0 0 18px 0;
}

.performance-info-card {
  margin: 0 0 18px;
  border: 1px solid #dbe4ee;
  border-radius: 18px;
  background: #fff;
  padding: 18px;
}
.performance-info-card__header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.performance-info-card__header h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: #0f172a;
}
.performance-info-card__header p {
  margin: 0;
  color: #64748b;
}
.performance-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.performance-info-item {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  padding: 14px;
  display: grid;
  gap: 8px;
  color: #334155;
  line-height: 1.45;
}
.performance-info-item strong {
  color: #0f172a;
}
.performance-info-item p {
  margin: 0;
}

.tools-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(15, 23, 42, .48);
}

.tools-detail-modal__box {
  width: min(1120px, 96vw);
  max-height: 90vh;
  overflow: hidden;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .24);
  display: flex;
  flex-direction: column;
}

.tools-detail-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid #e2e8f0;
}

.tools-detail-modal__head h3 {
  margin: 0 0 4px;
  font-size: 22px;
  color: #0f172a;
}

.tools-detail-modal__head p {
  margin: 0;
}

.tools-detail-modal__body {
  overflow: auto;
  padding: 22px 24px 26px;
}

.tools-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.tools-detail-item,
.tools-detail-block {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
  padding: 14px;
}

.tools-detail-item span,
.tools-detail-block h4 {
  display: block;
  margin: 0 0 7px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #64748b;
}

.tools-detail-item strong {
  color: #0f172a;
}

.tools-detail-block {
  margin-top: 12px;
}

.tools-detail-block p {
  margin: 0;
  color: #334155;
  line-height: 1.55;
}

.tools-detail-block pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #334155;
  font-size: 12px;
}

.btn-outline-danger {
  border: 1px solid rgba(220, 38, 38, .22);
  background: #fff;
  color: #b91c1c;
}

.btn-outline-danger:hover {
  background: #fef2f2;
  color: #991b1b;
}

.analytics-detail-modal {
  display: grid;
  gap: 18px;
}

.analytics-detail-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dbe4ee;
}

.analytics-detail-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}

.analytics-detail-meta,
.analytics-detail-value {
  color: #64748b;
  font-size: 13px;
  margin-top: 4px;
}

.analytics-detail-value a {
  color: #2563eb;
  text-decoration: none;
}

.analytics-detail-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

.analytics-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analytics-detail-section,
.analytics-detail-metric {
  border: 1px solid #dbe4ee;
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}

.analytics-detail-metric {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 8px;
}

.analytics-detail-metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: #64748b;
}

.analytics-detail-metric--green::before { background: #16a34a; }
.analytics-detail-metric--orange::before { background: #f59e0b; }
.analytics-detail-metric--red::before { background: #dc2626; }
.analytics-detail-metric--blue::before { background: #2563eb; }

.analytics-detail-metric__label,
.analytics-detail-sectiontitle {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
  font-weight: 900;
}

.analytics-detail-metric__value {
  color: #0f172a;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}

.analytics-detail-stack {
  display: grid;
  gap: 10px;
  color: #334155;
  line-height: 1.45;
}

.analytics-detail-stack strong {
  color: #0f172a;
}

@media (max-width: 900px) {
  .analytics-detail-hero,
  .analytics-detail-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .analytics-detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
