/* ============================================================
   ADMIN THEME — lớp giao diện mới cho Bizfly Posting Dashboard
   Chỉ nâng cấp phần khung quản trị. Toàn bộ style của editor,
   quick-edit, floating toolbar, link editor... vẫn dùng styles.css.
   ============================================================ */

:root {
  --font-sans: "Be Vietnam Pro", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 26px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --bg: #f3f4fa;
  --panel: #ffffff;
  --text: #0f1e38;
  --muted: #64748b;
  --line: #e5ebf3;
  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --primary-soft: #eaf1fe;
  --navy: #13294b;
  --navy-2: #1b3a67;
  --accent: #1d4ed8;
  --accent-dark: #1e40af;
  --accent-soft: #eaf1fe;
  --cyan: #06b6d4;
  --success: #16a34a;
  --success-soft: #e8f6ee;
  --warning: #d97706;
  --warning-soft: #fdf2e3;
  --danger: #dc2626;
  --danger-soft: #fef0f0;
  --sidebar-bg: #13294b;
  --sidebar-bg-2: #1b3a67;
  --shadow: 0 8px 24px rgba(19, 41, 75, .08);
  --shadow-md: 0 8px 24px rgba(19, 41, 75, .08);
  --shadow-soft: 0 2px 8px rgba(19, 41, 75, .05);
  --shadow-sm: 0 2px 8px rgba(19, 41, 75, .05);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-md: 9px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --z-sticky: 20;
  --z-overlay: 200;
  --z-drawer: 300;
  --z-modal: 500;
  --z-modal-raised: 700;
  --z-toast: 900;
}

body {
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:where(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid rgba(37,99,235, .28);
  outline-offset: 2px;
}

:where(.btn, .icon-btn, .nav-item, .nav-subitem, .cfg-tab, .il-mode-tabs button):focus-visible {
  box-shadow: 0 0 0 4px rgba(37,99,235, .16);
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 262px;
  background: linear-gradient(180deg, var(--sidebar-bg-2) 0%, var(--sidebar-bg) 42%);
  padding: 22px 18px;
  gap: 26px;
  border-right: 1px solid rgba(255, 255, 255, .05);
}
.brand { padding: 4px 6px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 55%, #06b6d4 130%);
  box-shadow: 0 8px 20px rgba(29,78,216, .45);
  font-size: 19px;
}
.brand strong { font-size: 15px; letter-spacing: -.01em; }
.brand span { color: #a49ecf; font-size: 12px; }

.side-nav { display: grid; gap: 4px; }
.nav-label {
  color: #7a74a8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  padding: 2px 12px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #cfcbe9;
  text-align: left;
  padding: 11px 12px;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background .16s ease, color .16s ease;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(29,78,216, .32), rgba(29,78,216, .12));
  color: #fff;
  box-shadow: inset 3px 0 0 #3b82f6;
}
.nav-count {
  margin-left: auto;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, .12);
  color: #e4e1fb;
  border-radius: 999px;
  min-width: 24px;
  text-align: center;
  padding: 2px 7px;
}
.nav-item.active .nav-count { background: rgba(255, 255, 255, .22); }

.side-card {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  padding: 14px;
}
.side-card span { font-size: 11px; }
.side-card strong { font-size: 13px; font-weight: 600; }

/* ---------- Main / Topbar ---------- */
.main { padding: 26px 30px 40px; }
.topbar {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.page-heading h1 { font-size: 26px; font-weight: 700; letter-spacing: -.025em; }
.page-sub { margin-top: 4px; font-size: 13.5px; max-width: 560px; }
.eyebrow { font-size: 11px; letter-spacing: .14em; }

.top-actions { gap: 8px; }
.top-actions .btn svg { width: 15px; height: 15px; }
.export-group {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: #fff;
}
.export-group .btn.ghost {
  border: 0;
  border-radius: 0;
  padding: 9px 13px;
  font-size: 13px;
  color: var(--muted);
}
.export-group .btn.ghost + .btn.ghost { border-left: 1px solid var(--line); }
.export-group .btn.ghost:hover { color: var(--primary); background: var(--primary-soft); box-shadow: none; }

.btn { min-height: 40px; border-radius: 11px; font-weight: 700; font-size: 13.5px; padding: 10px 14px; }
.btn.primary {
  background: linear-gradient(135deg, #2563eb, var(--primary));
  box-shadow: 0 6px 16px rgba(29,78,216, .3);
}
.btn.primary:hover { background: var(--primary-dark); box-shadow: 0 8px 20px rgba(29,78,216, .38); }
.btn.secondary { background: #e5f7fb; color: #0e7490; }
.btn.secondary:hover { background: #cff0f8; }
.btn.ghost { color: #3d4a63; }

/* ---------- Page switching ---------- */
.page { display: block; }
.page.hidden-page { display: none; }

/* ---------- Metric cards ---------- */
.cards {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.metric-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 15px;
  border-radius: 15px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
  transition: transform .16s ease, box-shadow .16s ease;
}
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.metric-icon {
  width: 40px; height: 40px; flex: none;
  border-radius: 12px;
  display: grid; place-items: center;
}
.metric-icon svg { width: 19px; height: 19px; }
.metric-body { min-width: 0; }
.metric-body span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-body strong {
  display: block;
  margin-top: 3px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.tone-ink    .metric-icon { background: #eef1f7; color: #334155; }
.tone-indigo .metric-icon { background: #eef2ff; color: #1e40af; }
.tone-green  .metric-icon { background: #e8f8ee; color: #16a34a; }
.tone-amber  .metric-icon { background: #fdf3e2; color: #d97706; }
.tone-teal   .metric-icon { background: #e3f7f5; color: #0d9488; }
.tone-purple .metric-icon { background: var(--primary-soft); color: var(--primary); }

/* ---------- Quick actions ---------- */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.quick-card {
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 15px;
  padding: 15px;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
  font: inherit;
}
.quick-card:hover {
  border-color: #c9b8f5;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.quick-icon {
  width: 42px; height: 42px; flex: none;
  border-radius: 12px;
  display: grid; place-items: center;
  color: #fff;
}
.quick-icon svg { width: 20px; height: 20px; }
.qi-purple { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.qi-cyan   { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.qi-green  { background: linear-gradient(135deg, #4ade80, #16a34a); }
.qi-amber  { background: linear-gradient(135deg, #fbbf24, #d97706); }
.quick-card strong { display: block; font-size: 14px; color: var(--text); }
.quick-card span { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.45; }

/* ---------- Flow strip (luồng xử lý) ---------- */
.flow-strip {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 18px 20px 22px;
  overflow-x: auto;
}
.flow-step {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 190px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fafbff);
  border-radius: 13px;
  padding: 13px 14px;
}
.flow-step b {
  width: 28px; height: 28px; flex: none;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid; place-items: center;
  font-size: 13px;
}
.flow-step strong { display: block; font-size: 13.5px; }
.flow-step span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.flow-arrow { align-self: center; color: #b3bacd; font-weight: 700; flex: none; }

/* ---------- Panels & tables ---------- */
.panel { border-radius: var(--radius); box-shadow: var(--shadow-soft); overflow: hidden; }
.panel-head { padding: 18px 20px; }
.panel-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.panel-head p { font-size: 13px; }

.search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.search-box svg {
  position: absolute;
  left: 11px;
  width: 15px; height: 15px;
  color: #94a3b8;
  pointer-events: none;
}
.search-box input { padding-left: 34px; min-width: 250px; }
.filters input, .filters select { border-radius: 11px; font-size: 13.5px; }

th {
  background: #f7f8fc;
  font-size: 11px;
  letter-spacing: .07em;
  color: #7a869e;
  border-bottom: 1px solid var(--line);
  z-index: 1;
}
td { font-size: 13.5px; }
tbody tr { transition: background .12s ease; }
tbody tr:hover > td { background: #fafbff; }
.title-cell strong { font-weight: 700; color: var(--text); }
.badge { font-size: 11.5px; padding: 4px 10px; }
.actions .btn.small { border-radius: 9px; }

/* ---------- Import form ---------- */
.file-pick {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px dashed #c3cadd;
  border-radius: 11px;
  padding: 9px 14px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  background: #fbfcff;
  transition: border-color .15s ease, color .15s ease;
}
.file-pick:hover { border-color: #93c5fd; color: var(--primary); }
.file-pick.has-file { border-style: solid; border-color: #93c5fd; color: var(--primary); background: var(--primary-soft); }
.file-pick svg { width: 16px; height: 16px; flex: none; }
.file-pick input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Logs ---------- */
.logs { padding: 14px 20px 20px; }
.log-item {
  background: #fff;
  border-radius: 12px;
  border-left: 3px solid #c9b8f5;
  padding: 12px 14px;
}
.log-item strong { font-size: 13.5px; }

/* ---------- Sync ---------- */
.sync-stat { border-radius: 12px; background: #fbfcff; }
.sync-stat strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.sync-changes { border-radius: 12px; }

/* ---------- Toast / boot ---------- */
.toast, .boot-status { border-radius: 12px; font-size: 13.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 1500px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .sidebar { position: static; height: auto; width: 100%; }
  .side-nav { display: flex; flex-wrap: wrap; }
  .nav-item { width: auto; }
  .nav-label { width: 100%; }
  .main { padding: 20px; }
}
@media (max-width: 760px) {
  .cards, .quick-grid { grid-template-columns: 1fr; }
  .search-box input { min-width: 100%; }
  .flow-strip { flex-direction: column; }
  .flow-arrow { display: none; }
  .top-actions { width: 100%; }
}

/* ---------- Module Link nội bộ ---------- */
.inlink-check { padding: 16px 20px 20px; }
.inlink-check-row { display: flex; gap: 10px; align-items: center; }
.search-box.grow { flex: 1; }
.search-box.grow input { width: 100%; min-width: 0; }
.inlink-hint { margin-top: 10px; }

.inlink-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.matched-url { font-size: 12.5px; word-break: break-all; }
.matched-url a { color: var(--primary); }

.pct-wrap { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.pct-bar {
  flex: 1;
  height: 8px;
  background: #eef0f7;
  border-radius: 999px;
  overflow: hidden;
}
.pct-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}
.pct-wrap b { font-size: 12.5px; font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.anchor-cell strong { font-weight: 700; color: var(--text); word-break: break-word; }
.sample-cell a, .src-cell a { color: #2563eb; font-size: 12px; }
.mini { font-weight: 700; font-variant-numeric: tabular-nums; }
.mini.follow { color: #16a34a; }
.mini.nofollow { color: #b45309; }

.inlink-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 20px 18px;
}

.inlink-empty { padding: 0; }
.inlink-empty-inner {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.inlink-empty-inner svg { width: 42px; height: 42px; color: #c9b8f5; margin-bottom: 4px; }
.inlink-empty-inner strong { font-size: 15px; color: var(--text); }
.inlink-empty-inner span { font-size: 13px; max-width: 480px; word-break: break-all; }

@media (max-width: 900px) {
  .inlink-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inlink-check-row { flex-direction: column; align-items: stretch; }
}

/* ---------- Mindmap liên kết nội bộ ---------- */
.viz-wrap { position: relative; padding: 12px 16px 18px; }
.viz-canvas.mm-scroll {
  position: relative;
  width: 100%;
  height: 640px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 20% 30%, rgba(29,78,216, .05), transparent 55%),
    #fbfbfe;
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
.viz-canvas.mm-scroll.panning { cursor: grabbing; }
.viz-blank {
  display: grid; place-items: center; height: 100%;
  color: var(--muted); font-size: 14px;
}
.mm-inner { position: relative; transform-origin: 0 0; user-select: none; -webkit-user-select: none; }
.mm-links { position: absolute; inset: 0; pointer-events: none; }

.viz-zoom {
  position: absolute;
  top: 22px;
  right: 28px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 3px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  box-shadow: var(--shadow-soft);
}
.viz-zoom button {
  border: 0;
  background: transparent;
  color: #3d4a63;
  font-weight: 700;
  font-size: 14px;
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}
.viz-zoom button:hover { background: var(--primary-soft); color: var(--primary); }
.viz-zoom #inlinkZoomLabel {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  min-width: 46px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.mm-node {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: 12px;
  background: #fff;
  border: 2px solid var(--line);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.3;
  box-shadow: 0 3px 10px rgba(20, 16, 52, .06);
  transition: box-shadow .14s ease, transform .14s ease;
  z-index: 2;
}
.mm-node:hover { box-shadow: 0 8px 22px rgba(20, 16, 52, .16); transform: translateY(-1px); z-index: 5; }

.mm-pillar {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  background: linear-gradient(135deg, #1b3a67, #13294b);
  border-color: #13294b;
  color: #fff;
  z-index: 4;
}
.mm-pillar-eyebrow { font-size: 10px; letter-spacing: .16em; color: #a5b4fc; font-weight: 700; }
.mm-pillar-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }

.mm-source { justify-content: space-between; font-weight: 600; color: var(--text); }
.mm-node.has-flag { box-shadow: 0 0 0 1px rgba(220,38,38,.15), 0 3px 10px rgba(20,16,52,.06); }
.mm-flags { display: inline-flex; gap: 3px; margin-right: 4px; flex: none; }
.mm-flag { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.tt-flags { margin-top: 5px; display: grid; gap: 2px; }
.tt-flags span { font-size: 11.5px; }

/* Bảng sức khỏe cụm link */
.second-source { border-top: 1px dashed var(--line); }
.tag-optional {
  font-size: 10.5px; font-weight: 700; vertical-align: middle;
  background: #eef0f7; color: #7a869e; border-radius: 999px; padding: 2px 8px; margin-left: 6px;
}
.health-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.health-chip {
  border: 1px solid var(--line); background: #fff; color: #475569;
  font-size: 12px; font-weight: 600; border-radius: 999px; padding: 5px 11px; cursor: pointer;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.health-chip:hover { border-color: #c9b8f5; }
.health-chip.active { background: var(--primary-soft); border-color: #c9b8f5; color: var(--primary); }
.health-chip[style*="--chip"].active { background: var(--chip); border-color: var(--chip); color: #fff; }
.flag-tag {
  display: inline-block; color: #fff; font-size: 10.5px; font-weight: 700;
  border-radius: 6px; padding: 2px 7px; margin: 1px 2px 1px 0; white-space: nowrap;
}
.pill-ok { color: #16a34a; font-weight: 700; font-size: 12px; }
.pill-bad { color: #dc2626; font-weight: 700; font-size: 12px; }

/* Điểm nền (lexical) */
.mm-score {
  flex: none;
  display: inline-grid; place-items: center;
  min-width: 26px; height: 20px;
  border-radius: 6px;
  font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-right: 2px;
}
.sc-good { background: #dcfce7; color: #15803d; }
.sc-mid  { background: #fef3c7; color: #a16207; }
.sc-bad  { background: #fee2e2; color: #b91c1c; }
.score-cell {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 24px; border-radius: 7px;
  font-weight: 700; font-variant-numeric: tabular-nums; font-size: 12.5px;
}
.tt-reason { margin-top: 6px; color: #cbd3ea; font-size: 11.5px; line-height: 1.45; }

/* Verdict AI */
.verdict {
  display: inline-block; color: #fff; font-weight: 700; font-size: 11px;
  border-radius: 7px; padding: 3px 8px; white-space: nowrap; cursor: default;
}
.v-keep { background: #16a34a; }
.v-opt { background: #d97706; }
.v-remove { background: #dc2626; }
#deepScoreState { margin: 4px 0 0; font-size: 12.5px; }
#deepScoreState:empty { display: none; }

/* Ô hành động trong bảng health */
.act-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.act-select { border: 1px solid var(--line); border-radius: 8px; font-size: 12px; padding: 4px 6px; }
.act-extra { display: inline-flex; gap: 5px; align-items: center; }
.act-input { border: 1px solid var(--line); border-radius: 8px; font-size: 12px; padding: 4px 7px; min-width: 130px; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.act-inbasket { color: #16a34a; font-weight: 700; font-size: 11.5px; }

.anchor-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; max-width: 260px; }
.anchor-more { background: #eef0f7; color: #64748b; font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 6px; cursor: help; }
.nofollow-tag { background: #fef3c7; color: #a16207; font-size: 10px; font-weight: 700; border-radius: 5px; padding: 1px 5px; }
.icon-btn.sm { width: 26px; height: 26px; font-size: 15px; }

#basketPushNote { margin: 4px 0 0; font-size: 12.5px; }

/* Push preview / diff */
.push-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.push-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; }
.diff-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; margin: 3px 0; }
.diff-old { background: #fee2e2; color: #991b1b; padding: 2px 7px; border-radius: 6px; text-decoration: line-through; }
.diff-arrow { color: var(--muted); }
.diff-new { background: #dcfce7; color: #166534; padding: 2px 7px; border-radius: 6px; }
.diff-warn { color: #b45309; font-size: 12px; margin-top: 4px; }
.push-confirm { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.push-confirm input { width: 16px; height: 16px; }

.cms-test-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cms-test-row input { flex: 1; min-width: 240px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; }
.cms-test-result { margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.6; border: 1px solid var(--line); background: #fafbff; }
.cms-test-result.ok { border-color: #86efac; background: #f0fdf4; }
.cms-test-result.bad { border-color: #fca5a5; background: #fef2f2; }
.cms-test-result .tiny { font-size: 11px; word-break: break-all; }

.ai-form select, .ai-form input { border-radius: 10px; font-size: 13px; }
.ai-form { flex-wrap: wrap; gap: 8px; }

/* Modal prompt hand-off */
.prompt-modal {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(20, 16, 52, .5);
  display: grid; place-items: center;
  padding: 24px;
}
.prompt-modal[hidden] { display: none; }
.prompt-modal-card {
  background: #fff; border-radius: 16px;
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(20, 16, 52, .4);
  overflow: hidden;
}
.prompt-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.prompt-modal-head h3 { font-size: 17px; font-weight: 700; }
.prompt-modal-head p { font-size: 12.5px; color: var(--muted); margin-top: 3px; max-width: 600px; }
.prompt-modal-body { padding: 16px 20px; overflow: auto; display: grid; gap: 16px; min-height: 0; }
.prompt-step-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.prompt-step-head strong { font-size: 13.5px; }
.prompt-actions { display: inline-flex; gap: 6px; }
.prompt-textarea {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 11px;
  padding: 11px 13px; font-size: 12.5px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  line-height: 1.5; resize: vertical; background: #fbfcff;
}
.prompt-modal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-top: 1px solid var(--line);
}
.icon-btn {
  border: 0; background: #f1f2f7; color: #475569;
  width: 40px; height: 40px; border-radius: 10px; font-size: 20px; cursor: pointer; flex: none;
}
.icon-btn:hover { background: #e5e7ef; }

.mm-anchor {
  justify-content: space-between;
  font-weight: 700;
  color: var(--text);
  background: #fff;
}
.mm-anchor-title {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12.5px;
}
.mm-anchor .anchor-badge { color: #fff; }
.mm-source-title {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mm-badge {
  flex: none;
  border: 0;
  cursor: pointer;
  background: #13294b;
  color: #fff;
  font-weight: 700;
  font-size: 11.5px;
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
  transition: background .14s ease;
}
.mm-badge:hover { background: #1d4ed8; }
.mm-badge.zero { background: #eef0f7; color: #9aa3b8; cursor: default; }

.mm-child {
  font-size: 12.5px;
  color: #334155;
  font-weight: 500;
}
.mm-child-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-more {
  position: absolute;
  box-sizing: border-box;
  padding: 4px 12px;
  font-size: 11.5px;
  color: var(--muted);
  font-style: italic;
  z-index: 2;
}
.mm-source-more { margin-top: 10px; font-size: 12.5px; color: var(--muted); }

.viz-tooltip {
  position: absolute;
  z-index: 30;
  max-width: 280px;
  background: #13294b;
  color: #fff;
  border-radius: 11px;
  padding: 10px 12px;
  box-shadow: 0 14px 34px rgba(20, 16, 52, .35);
  pointer-events: none;
  font-size: 12.5px;
  line-height: 1.5;
}
.viz-tooltip .tt-title { font-weight: 700; margin-bottom: 5px; word-break: break-word; }
.viz-tooltip .tt-row { color: #d7d3f7; word-break: break-word; }
.viz-tooltip .tt-url { margin-top: 6px; color: #8b93b8; font-size: 11px; word-break: break-all; }

.viz-legend {
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center;
  margin-top: 12px; font-size: 12.5px; color: var(--muted);
}
.viz-legend .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.viz-legend .dot.pillar { background: linear-gradient(135deg, #1b3a67, #13294b); }
.viz-legend .dot.anchor { background: #ef4444; }
.viz-legend .dot.follow { background: #3b82f6; }
.viz-legend .dot.support { background: #22c55e; }
.mm-badge-legend { display: inline-flex; align-items: center; gap: 6px; }
.mm-badge-mini {
  display: inline-grid; place-items: center;
  background: #13294b; color: #fff; font-style: normal; font-weight: 700;
  font-size: 10.5px; border-radius: 999px; padding: 2px 7px;
}
.viz-legend .viz-note { margin-left: auto; font-style: italic; }

@media (max-width: 760px) {
  .viz-canvas.mm-scroll { height: 520px; }
  .viz-legend .viz-note { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ===== Thanh trạng thái cấu hình ===== */
.config-statusbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 20px; }
.cfg-status-list { display: flex; gap: 26px; flex-wrap: wrap; }
.cfg-status { display: flex; align-items: center; gap: 9px; }
.cfg-status > div { display: flex; flex-direction: column; line-height: 1.3; }
.cfg-status b { font-size: 12px; color: var(--text); }
.cfg-status span { font-size: 12px; }
.cfg-dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; flex: none; }
.cfg-dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.15); }

/* ===== Drawer cấu hình ===== */
.cfg-drawer { position: fixed; inset: 0; z-index: 300; }
.cfg-drawer[hidden] { display: none; }
.cfg-drawer-overlay { position: absolute; inset: 0; background: rgba(20,16,52,.4); }
.cfg-drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 94vw);
  background: #fff; box-shadow: -12px 0 40px rgba(20,16,52,.25);
  display: flex; flex-direction: column; overflow: hidden;
  animation: cfgSlide .22s ease;
}
@keyframes cfgSlide { from { transform: translateX(30px); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
.cfg-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.cfg-drawer-head h3 { font-size: 17px; font-weight: 700; }
.cfg-tabs { display: flex; gap: 4px; padding: 12px 20px 0; border-bottom: 1px solid var(--line); }
.cfg-tab { border: 0; background: none; padding: 9px 14px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.cfg-tab.active { color: var(--brand, #6366f1); border-bottom-color: var(--brand, #6366f1); }
.cfg-tabpane { padding: 18px 20px; overflow-y: auto; flex: 1; }
.cfg-tabpane.hidden { display: none; }
.cfg-block { margin-bottom: 22px; }
.cfg-block h2 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.cfg-block > p { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; line-height: 1.5; }
.cfg-form { flex-direction: column; align-items: stretch; gap: 9px; }
.cfg-form select, .cfg-form input { width: 100%; box-sizing: border-box; }
.cfg-form-actions { display: flex; gap: 8px; }

/* ===== Phân bố anchor: donut + top ===== */
.anchor-viz { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 16px 20px 20px; }
@media (max-width: 820px) { .anchor-viz { grid-template-columns: 1fr; } }
.anchor-donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-ring { width: 150px; height: 150px; border-radius: 50%; position: relative; flex: none; }
.donut-hole { position: absolute; inset: 26px; background: #fff; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-hole b { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; }
.donut-hole span { font-size: 11px; color: var(--muted); }
.anchor-legend { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 180px; }
.lg-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.lg-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lg-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.lg-val { color: var(--muted); font-variant-numeric: tabular-nums; }
.anchor-top h3 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.anchor-top-list { display: flex; flex-direction: column; gap: 11px; }
.at-row { display: flex; align-items: center; gap: 10px; }
.at-rank { width: 20px; height: 20px; border-radius: 6px; background: #f1f2f7; color: #64748b; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.at-main { flex: 1; min-width: 0; }
.at-label { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 3px; }
.at-bar { height: 7px; background: #eef0f7; border-radius: 999px; overflow: hidden; }
.at-bar span { display: block; height: 100%; border-radius: 999px; }
.at-count { font-size: 12.5px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.at-pct { font-size: 11.5px; color: var(--muted); width: 44px; text-align: right; font-variant-numeric: tabular-nums; }

/* ===== 2 panel anchor cạnh nhau ===== */
.anchor-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .anchor-cols { grid-template-columns: 1fr; } }
.anchor-panel { display: flex; flex-direction: column; }
.anchor-panel-foot { padding: 12px 20px 16px; display: flex; gap: 8px; }
.anchor-top-table th, .anchor-top-table td { padding: 9px 12px; }
.anchor-top-table .at-rank { width: 22px; height: 22px; border-radius: 6px; background: #f1f2f7; color: #64748b; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.anchor-top-table .at-label { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anchor-top-table .at-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.at-pctwrap { display: flex; align-items: center; gap: 8px; }
.at-pctwrap .at-bar { flex: 1; height: 7px; background: #eef0f7; border-radius: 999px; overflow: hidden; min-width: 60px; }
.at-pctwrap .at-bar span { display: block; height: 100%; border-radius: 999px; }
.at-pctwrap b { font-size: 11.5px; color: var(--muted); width: 42px; text-align: right; font-variant-numeric: tabular-nums; }

/* ===== Popup Tất cả Anchor Text ===== */
.anchor-modal-card { width: min(1100px, 96vw); max-height: 92vh; }
.anchor-modal-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 16px 20px 6px; }
@media (max-width: 720px) { .anchor-modal-stats { grid-template-columns: repeat(2, 1fr); } }
.am-stat { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.am-stat span { font-size: 12px; color: var(--muted); }
.am-stat strong { font-size: 21px; font-weight: 700; }
.am-stat.tone-indigo { background: #eef0ff; } .am-stat.tone-green { background: #f0fdf4; }
.am-stat.tone-amber { background: #fffbeb; } .am-stat.tone-teal { background: #f0fdfa; }
.am-stat.tone-gray { background: #f8fafc; }
.anchor-modal-controls { display: flex; gap: 10px; padding: 10px 20px; flex-wrap: wrap; align-items: center; }
.anchor-modal-controls .search-box { flex: 1; min-width: 200px; }
.anchor-modal-controls select { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 13px; }
.anchor-modal-body { overflow: auto; padding: 0 20px; flex: 1; }
.anchor-full-table { width: 100%; }
.anchor-full-table th { position: sticky; top: 0; background: #f8fafc; z-index: 1; }
.anchor-full-table td { padding: 9px 12px; }
.af-anchor { font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-sample a { font-size: 12px; }
.ty-badge { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.ty-exact { background: #dcfce7; color: #15803d; }
.ty-partial { background: #dbeafe; color: #1d4ed8; }
.ty-brand { background: #eaf1fe; color: #1d4ed8; }
.ty-generic { background: #fef3c7; color: #a16207; }
.mini.follow { color: #16a34a; font-weight: 700; } .mini.nofollow { color: #94a3b8; }
.anchor-modal-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; gap: 10px; }
.anchor-pager { display: flex; gap: 4px; align-items: center; }
.pg-btn { min-width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); }
.pg-btn.active { background: var(--brand, #6366f1); color: #fff; border-color: var(--brand, #6366f1); }
.pg-btn:disabled { opacity: .4; cursor: default; }
.pg-dots { padding: 0 4px; color: var(--muted); }

/* ============================================================
   UI REFINE 2026-07 — Anchor distribution, Top anchor, All anchor modal
   Chỉ thay đổi giao diện; không đụng tới dữ liệu/logic JS.
   ============================================================ */
:root {
  --anchor-purple: #1d4ed8;
  --anchor-purple-2: #3b82f6;
  --anchor-purple-soft: #eaf1fe;
  --anchor-cyan-soft: #e9fbff;
  --anchor-green: #16a34a;
  --anchor-green-soft: #ecfdf3;
  --anchor-orange: #f97316;
  --anchor-orange-soft: #fff7ed;
  --anchor-card-line: #e8ebf5;
}

/* Hai khối anchor chính */
.anchor-cols {
  grid-template-columns: minmax(360px, .92fr) minmax(460px, 1.08fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}
.anchor-panel {
  position: relative;
  min-height: 332px;
  border: 1px solid var(--anchor-card-line);
  background:
    radial-gradient(520px 180px at 12% 0%, rgba(29,78,216,.07), transparent 62%),
    linear-gradient(180deg, #fff 0%, #fcfdff 100%);
  box-shadow: 0 16px 42px rgba(20,16,52,.06);
}
.anchor-panel .panel-head {
  padding: 18px 20px 8px;
  border-bottom: 0;
}
.anchor-panel .panel-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}
.anchor-panel .panel-head h2::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--anchor-purple), var(--anchor-purple-2));
  box-shadow: 0 0 0 5px rgba(29,78,216,.08);
}
.anchor-panel .matched-url {
  margin-top: 5px;
  max-width: 100%;
  color: #64708a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.anchor-panel-foot {
  margin-top: auto;
  padding: 12px 20px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid rgba(230,233,242,.72);
  background: linear-gradient(180deg, rgba(255,255,255,.45), rgba(248,250,255,.9));
}
.anchor-panel-foot .btn {
  min-height: 36px;
  border-color: #dbeafe;
  color: var(--anchor-purple);
  background: #fff;
  box-shadow: 0 4px 12px rgba(29,78,216,.07);
}
.anchor-panel-foot .btn:hover {
  background: var(--anchor-purple-soft);
  border-color: #bfdbfe;
  transform: translateY(-1px);
}

/* Donut + legend */
.anchor-donut-wrap {
  padding: 6px 20px 18px;
  min-height: 204px;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}
.donut-ring {
  width: 164px;
  height: 164px;
  margin: 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.75), 0 18px 34px rgba(29,78,216,.13);
}
.donut-hole {
  inset: 34px;
  background: rgba(255,255,255,.96);
  box-shadow: inset 0 0 0 1px #eef0f7, 0 6px 18px rgba(20,16,52,.06);
}
.donut-hole b {
  font-size: 30px;
  letter-spacing: -.04em;
}
.donut-hole span {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 700;
  color: #7a869e;
}
.anchor-legend {
  gap: 8px;
  min-width: 0;
}
.lg-item {
  min-height: 32px;
  padding: 7px 9px;
  border: 1px solid #edf0f7;
  border-radius: 11px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 4px 10px rgba(20,16,52,.025);
}
.lg-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(99,102,241,.08);
}
.lg-label {
  font-weight: 700;
  color: #1f2937;
}
.lg-val {
  font-size: 12px;
  font-weight: 700;
  color: #5b6478;
}

/* Top anchor table */
.anchor-panel .table-wrap {
  margin: 0 18px 12px;
  border: 1px solid #edf0f7;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.anchor-top-table {
  min-width: 0 !important;
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
.anchor-top-table thead th {
  position: static;
  padding: 11px 12px;
  background: linear-gradient(180deg, #f9faff, #f5f7fc);
  color: #7a869e;
  font-size: 11px;
  letter-spacing: .08em;
}
.anchor-top-table th:nth-child(1), .anchor-top-table td:nth-child(1) { width: 48px; text-align: center; }
.anchor-top-table th:nth-child(3), .anchor-top-table td:nth-child(3) { width: 86px; }
.anchor-top-table th:nth-child(4), .anchor-top-table td:nth-child(4) { width: 170px; }
.anchor-top-table td {
  padding: 12px;
  vertical-align: middle;
  border-bottom: 1px solid #edf0f7;
}
.anchor-top-table tbody tr:last-child td { border-bottom: 0; }
.anchor-top-table tbody tr:hover td { background: #fbfaff; }
.anchor-top-table .at-rank {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  color: #1e40af;
  background: linear-gradient(135deg, #eaf1fe, #f8f5ff);
  border: 1px solid #dbeafe;
}
.anchor-top-table .at-label {
  max-width: 100%;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #182033;
}
.anchor-top-table .at-count {
  font-size: 13px;
  color: #111827;
}
.at-pctwrap .at-bar {
  height: 8px;
  background: #eef1f8;
}
.at-pctwrap .at-bar span {
  background: linear-gradient(90deg, var(--anchor-purple), var(--anchor-purple-2)) !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,.25) inset;
}
.at-pctwrap b {
  width: 48px;
  color: #64708a;
  font-weight: 700;
}

/* Popup: Tất cả Anchor Text */
#anchorModal.prompt-modal {
  z-index: 360;
  padding: 28px;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(7px);
}
#anchorModal .anchor-modal-card {
  width: min(1220px, calc(100vw - 56px));
  max-height: min(88vh, 820px);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.72);
  background:
    radial-gradient(620px 180px at 15% -10%, rgba(29,78,216,.08), transparent 62%),
    #fff;
  box-shadow: 0 34px 90px rgba(15,23,42,.34);
}
#anchorModal .prompt-modal-head {
  padding: 22px 26px 16px;
  border-bottom: 0;
}
#anchorModal .prompt-modal-head h3 {
  font-size: 22px;
  letter-spacing: -.035em;
}
#anchorModal .prompt-modal-head .matched-url {
  margin-top: 6px;
  color: #526078;
  font-size: 13px;
}
#anchorModal .icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #f8fafc;
  color: #1f2937;
  border: 1px solid #e6e9f2;
}
#anchorModal .icon-btn:hover {
  background: var(--anchor-purple-soft);
  color: var(--anchor-purple);
}
#anchorModal .anchor-modal-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  padding: 0 26px 16px;
}
#anchorModal .am-stat {
  position: relative;
  min-height: 62px;
  padding: 14px 15px 14px 62px;
  justify-content: center;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(20,16,52,.045);
}
#anchorModal .am-stat::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--anchor-purple-soft);
  box-shadow: inset 0 0 0 1px rgba(29,78,216,.08);
}
#anchorModal .am-stat::after {
  position: absolute;
  left: 25px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  font-weight: 700;
}
#anchorModal .am-stat:nth-child(1)::after { content: "↗"; color: var(--anchor-purple); }
#anchorModal .am-stat:nth-child(2)::after { content: "◎"; color: var(--anchor-purple); }
#anchorModal .am-stat:nth-child(3)::after { content: "!"; color: var(--anchor-orange); }
#anchorModal .am-stat:nth-child(4)::after { content: "✓"; color: var(--anchor-green); }
#anchorModal .am-stat:nth-child(5)::after { content: "○"; color: #64748b; }
#anchorModal .am-stat.tone-indigo { background: #fff; }
#anchorModal .am-stat.tone-green { background: #fff; }
#anchorModal .am-stat.tone-amber { background: #fff; }
#anchorModal .am-stat.tone-teal { background: #fff; }
#anchorModal .am-stat.tone-gray { background: #fff; }
#anchorModal .am-stat.tone-green::before { background: #f4efff; }
#anchorModal .am-stat.tone-amber::before { background: var(--anchor-orange-soft); }
#anchorModal .am-stat.tone-teal::before { background: var(--anchor-green-soft); }
#anchorModal .am-stat.tone-gray::before { background: #f3f6fb; }
#anchorModal .am-stat span {
  font-size: 12px;
  font-weight: 700;
  color: #667085;
}
#anchorModal .am-stat strong {
  margin-top: 2px;
  font-size: 25px;
  color: #111827;
  letter-spacing: -.04em;
}
#anchorModal .anchor-modal-controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 210px 260px;
  gap: 12px;
  padding: 0 26px 18px;
  align-items: center;
}
#anchorModal .anchor-modal-controls .search-box {
  width: 100%;
  min-width: 0;
}
#anchorModal .anchor-modal-controls .search-box input,
#anchorModal .anchor-modal-controls select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #e3e7f2;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(20,16,52,.025);
}
#anchorModal .anchor-modal-controls .search-box input:focus,
#anchorModal .anchor-modal-controls select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37,99,235,.08);
}
#anchorModal .anchor-modal-body {
  margin: 0 26px;
  padding: 0;
  border: 1px solid #e7eaf3;
  border-radius: 15px;
  background: #fff;
  overflow: auto;
}
#anchorModal .anchor-full-table {
  min-width: 1050px;
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
#anchorModal .anchor-full-table thead th {
  top: 0;
  padding: 12px 14px;
  background: linear-gradient(180deg, #f8faff, #f3f6fb);
  color: #7a869e;
  border-bottom: 1px solid #e7eaf3;
  white-space: nowrap;
}
#anchorModal .anchor-full-table th:nth-child(1),
#anchorModal .anchor-full-table td:nth-child(1) { width: 48px; text-align: center; }
#anchorModal .anchor-full-table th:nth-child(2),
#anchorModal .anchor-full-table td:nth-child(2) { width: 220px; }
#anchorModal .anchor-full-table th:nth-child(3),
#anchorModal .anchor-full-table td:nth-child(3) { width: 80px; }
#anchorModal .anchor-full-table th:nth-child(4),
#anchorModal .anchor-full-table td:nth-child(4) { width: 170px; }
#anchorModal .anchor-full-table th:nth-child(5),
#anchorModal .anchor-full-table td:nth-child(5) { width: 142px; }
#anchorModal .anchor-full-table th:nth-child(7),
#anchorModal .anchor-full-table td:nth-child(7) { width: 122px; }
#anchorModal .anchor-full-table td {
  padding: 12px 14px;
  vertical-align: middle;
  background: #fff;
  border-bottom: 1px solid #edf0f7;
}
#anchorModal .anchor-full-table tbody tr:last-child td { border-bottom: 0; }
#anchorModal .anchor-full-table tbody tr:hover td { background: #fbfaff; }
#anchorModal .af-anchor {
  display: block;
  max-width: 100%;
  font-weight: 850;
  color: #172033;
}
#anchorModal .af-sample {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#anchorModal .af-sample a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #e5e7f0;
  border-radius: 9px;
  color: #46546f;
  background: #fbfcff;
  text-decoration: none;
  font-weight: 700;
}
#anchorModal .af-sample a:hover {
  color: var(--anchor-purple);
  border-color: #dbeafe;
  background: var(--anchor-purple-soft);
}
#anchorModal .ty-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
}
#anchorModal .ty-exact { background: #eaf1fe; color: #1e40af; }
#anchorModal .ty-partial { background: #dbeafe; color: #1d4ed8; }
#anchorModal .ty-brand { background: #dcfce7; color: #15803d; }
#anchorModal .ty-generic { background: #ffedd5; color: #c2410c; }
#anchorModal .mini.follow,
#anchorModal .mini.nofollow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
}
#anchorModal .mini.follow { background: #ecfdf3; color: #15803d; }
#anchorModal .mini.nofollow { background: #f1f5f9; color: #64748b; }
#anchorModal .anchor-modal-foot {
  padding: 16px 26px 22px;
  border-top: 0;
}
#anchorModal .anchor-modal-foot .muted {
  font-weight: 700;
  color: #667085;
}
#anchorModal .anchor-pager {
  gap: 6px;
}
#anchorModal .pg-btn {
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 3px 9px rgba(20,16,52,.035);
}
#anchorModal .pg-btn.active {
  background: linear-gradient(135deg, var(--anchor-purple-2), var(--anchor-purple));
  box-shadow: 0 8px 18px rgba(29,78,216,.22);
}

@media (max-width: 1100px) {
  .anchor-donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .anchor-legend { width: 100%; }
  #anchorModal .anchor-modal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #anchorModal .anchor-modal-controls { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .anchor-cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  #anchorModal.prompt-modal { padding: 12px; }
  #anchorModal .anchor-modal-card { width: calc(100vw - 24px); max-height: 92vh; border-radius: 18px; }
  #anchorModal .prompt-modal-head,
  #anchorModal .anchor-modal-stats,
  #anchorModal .anchor-modal-controls,
  #anchorModal .anchor-modal-foot { padding-left: 16px; padding-right: 16px; }
  #anchorModal .anchor-modal-body { margin-left: 16px; margin-right: 16px; }
  #anchorModal .anchor-modal-stats { grid-template-columns: 1fr; }
}

/* ============================================================
   UI REFINE 2026-07 — Inbound URL checker card
   Chỉ thay đổi giao diện; không đụng tới dữ liệu/logic JS.
   ============================================================ */
.panel:has(.inlink-check) {
  position: relative;
  overflow: visible;
  border: 1px solid rgba(230,233,242,.92);
  border-radius: 18px;
  background:
    radial-gradient(720px 180px at 4% -24%, rgba(29,78,216,.065), transparent 58%),
    linear-gradient(180deg, #fff 0%, #fcfdff 100%);
  box-shadow: 0 14px 38px rgba(20,16,52,.065);
}
.panel:has(.inlink-check)::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, rgba(29,78,216,.86), rgba(6,182,212,.58), rgba(22,163,74,.42));
  opacity: .68;
}
.panel:has(.inlink-check) .panel-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(230,233,242,.72);
}
.panel:has(.inlink-check) .panel-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  letter-spacing: -.025em;
}
.panel:has(.inlink-check) .panel-head h2::before {
  content: "";
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(29,78,216,.14), rgba(6,182,212,.12)),
    #fff;
  border: 1px solid #e9e4ff;
  box-shadow: 0 8px 18px rgba(29,78,216,.08);
}
.panel:has(.inlink-check) .panel-head h2::after {
  content: "↙";
  width: 34px;
  height: 34px;
  margin-left: -44px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--anchor-purple, #1d4ed8);
  font-size: 17px;
  font-weight: 700;
  pointer-events: none;
}
.panel:has(.inlink-check) .panel-head p {
  margin-top: 6px;
  margin-left: 44px;
  max-width: 760px;
  color: #667085;
  line-height: 1.55;
}
.inlink-check {
  padding: 18px 22px 20px;
  background:
    linear-gradient(180deg, rgba(248,250,255,.76), rgba(255,255,255,.92));
  border-radius: 0 0 18px 18px;
}
.inlink-check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}
.inlink-check .search-box.grow {
  position: relative;
  min-height: 48px;
  border: 1px solid #dfe4f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(20,16,52,.045);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.inlink-check .search-box.grow:hover {
  border-color: #cdd5e6;
}
.inlink-check .search-box.grow:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(29,78,216,.09), 0 10px 26px rgba(20,16,52,.06);
  transform: translateY(-1px);
}
.inlink-check .search-box.grow svg {
  left: 15px;
  width: 18px;
  height: 18px;
  color: #8791a8;
}
.inlink-check .search-box.grow input {
  min-height: 46px;
  width: 100%;
  padding-left: 44px;
  padding-right: 16px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #111827;
  font-size: 14px;
  font-weight: 650;
  outline: none;
}
.inlink-check .search-box.grow input::placeholder {
  color: #9aa4b7;
  font-weight: 600;
}
.inlink-check-row .btn.primary {
  min-width: 108px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.34);
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 72%);
  box-shadow: 0 12px 24px rgba(29,78,216,.28);
  letter-spacing: -.01em;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.inlink-check-row .btn.primary:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow: 0 16px 30px rgba(29,78,216,.34);
}
.inlink-check-row .btn.primary:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(29,78,216,.24);
}
.inlink-hint {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  margin: 12px 0 0;
  padding: 7px 10px 7px 30px;
  border: 1px solid #e9edf6;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: #68758d;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  box-shadow: 0 4px 12px rgba(20,16,52,.025);
}
.inlink-hint::before {
  content: "i";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--anchor-purple, #1d4ed8);
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
}

@media (max-width: 900px) {
  .panel:has(.inlink-check) .panel-head p {
    margin-left: 0;
  }
  .inlink-check-row {
    grid-template-columns: 1fr;
  }
  .inlink-check-row .btn.primary {
    width: 100%;
  }
  .inlink-hint {
    width: 100%;
    border-radius: 12px;
  }
}

/* Correction: icon inside the inbound checker title should not affect title alignment */
.panel:has(.inlink-check) .panel-head h2::before {
  content: "↙";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--anchor-purple, #1d4ed8);
  font-size: 17px;
  font-weight: 700;
}
.panel:has(.inlink-check) .panel-head h2::after {
  content: none;
}

/* ============================================================
   UI REFINE 2026-07-05 — Gộp Phân bổ Anchor + Top Anchor
   Bổ sung khối Chất lượng & Cơ hội tối ưu anchor.
   Chỉ thay đổi giao diện và cách trình bày dữ liệu hiện có.
   ============================================================ */
.anchor-insight-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(520px, 1.12fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}
.anchor-panel-distribution,
.anchor-quality-panel {
  min-height: 420px;
  border: 1px solid #e8ebf5;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(560px 180px at 10% 0%, rgba(29,78,216,.07), transparent 64%),
    linear-gradient(180deg, #fff 0%, #fcfdff 100%);
  box-shadow: 0 16px 42px rgba(20,16,52,.06);
}
.anchor-performance-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 8px 20px 10px;
}
.anchor-donut-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 260px;
}
.anchor-panel-distribution .anchor-donut {
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
}
.anchor-panel-distribution .donut-ring {
  width: 176px;
  height: 176px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.76), 0 20px 34px rgba(29,78,216,.14);
}
.anchor-panel-distribution .donut-hole {
  inset: 38px;
}
.anchor-total-box {
  width: min(190px, 100%);
  border: 1px solid #edf0f7;
  border-radius: 14px;
  padding: 13px 14px;
  text-align: center;
  background: rgba(255,255,255,.88);
  box-shadow: 0 8px 22px rgba(20,16,52,.04);
}
.anchor-total-box span {
  display: block;
  font-size: 12px;
  color: #7a869e;
  font-weight: 700;
  margin-bottom: 2px;
}
.anchor-total-box strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  color: #182033;
  font-weight: 700;
  letter-spacing: -.03em;
}
.anchor-merged-table-wrap {
  border: 1px solid #edf0f7;
  border-radius: 15px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 24px rgba(20,16,52,.035);
}
.anchor-merged-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.anchor-merged-table th {
  padding: 12px 12px;
  background: linear-gradient(180deg, #f9faff, #f5f7fc);
  color: #7a869e;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: 1px solid #edf0f7;
}
.anchor-merged-table th:nth-child(1),
.anchor-merged-table td:nth-child(1) { width: 42px; text-align: center; }
.anchor-merged-table th:nth-child(3),
.anchor-merged-table td:nth-child(3) { width: 92px; text-align: right; }
.anchor-merged-table th:nth-child(4),
.anchor-merged-table td:nth-child(4) { width: 174px; }
.anchor-merged-table td {
  padding: 12px 12px;
  border-bottom: 1px solid #edf0f7;
  vertical-align: middle;
  background: rgba(255,255,255,.94);
}
.anchor-merged-table tr:last-child td { border-bottom: 0; }
.anchor-merged-table tr:hover td { background: #fbfaff; }
.anchor-merged-table .at-rank {
  width: 25px;
  height: 25px;
  border-radius: 9px;
  color: #1e40af;
  background: linear-gradient(135deg, #eaf1fe, #f8f5ff);
  border: 1px solid #dbeafe;
}
.anchor-merged-table .at-label {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  font-size: 13px;
  font-weight: 700;
  color: #182033;
}
.anchor-merged-table .lg-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: none;
  box-shadow: 0 0 0 4px rgba(99,102,241,.08);
}
.anchor-merged-table .at-count {
  font-size: 13px;
  color: #111827;
}
.anchor-merged-table .at-pctwrap .at-bar {
  min-width: 74px;
  height: 8px;
}
.anchor-note-line {
  margin: 0 20px 6px;
  padding-left: 22px;
  position: relative;
  color: #7a869e;
  font-size: 12.5px;
  font-weight: 600;
}
.anchor-note-line::before {
  content: "i";
  position: absolute;
  left: 0;
  top: 1px;
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef0ff;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 700;
}
.anchor-quality-content {
  padding: 8px 20px 10px;
}
.anchor-quality-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.aq-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  min-height: 70px;
  padding: 12px;
  border: 1px solid #edf0f7;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(20,16,52,.035);
}
.aq-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-weight: 700;
  font-size: 18px;
}
.aq-card span {
  display: block;
  color: #64708a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}
.aq-card strong {
  display: block;
  margin-top: 3px;
  color: #182033;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.03em;
}
.aq-pct {
  grid-column: 2;
  color: #64708a;
  font-size: 12px;
  font-weight: 700;
}
.aq-card.aq-exact .aq-icon { background: #ecfdf3; color: #16a34a; }
.aq-card.aq-partial .aq-icon { background: #eff6ff; color: #2563eb; }
.aq-card.aq-generic .aq-icon { background: #fff7ed; color: #f97316; }
.aq-card.aq-brand .aq-icon { background: #eaf1fe; color: #2563eb; }
.aq-card.aq-exact .aq-pct { color: #16a34a; }
.aq-card.aq-partial .aq-pct { color: #2563eb; }
.aq-card.aq-generic .aq-pct { color: #f97316; }
.aq-card.aq-brand .aq-pct { color: #2563eb; }
.anchor-quality-bars {
  padding: 14px 14px 11px;
  border: 1px solid #edf0f7;
  border-radius: 15px;
  background: rgba(255,255,255,.9);
  margin-bottom: 12px;
}
.anchor-quality-bars h3 {
  margin: 0 0 10px;
  color: #182033;
  font-size: 13.5px;
  font-weight: 700;
}
.aq-bar-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 96px;
  align-items: center;
  gap: 12px;
  min-height: 28px;
}
.aq-bar-row span {
  font-size: 12.5px;
  color: #64708a;
  font-weight: 700;
}
.aq-bar-row strong {
  color: #4b5563;
  font-size: 12.5px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.aq-track {
  height: 9px;
  border-radius: 999px;
  background: #eef1f8;
  overflow: hidden;
}
.aq-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
}
.aq-bar-row.aq-exact .aq-track i { background: linear-gradient(90deg, #22c55e, #16a34a); }
.aq-bar-row.aq-partial .aq-track i { background: linear-gradient(90deg, #60a5fa, #2563eb); }
.aq-bar-row.aq-generic .aq-track i { background: linear-gradient(90deg, #fb923c, #f97316); }
.aq-bar-row.aq-brand .aq-track i { background: linear-gradient(90deg, #3b82f6, #1d4ed8); }
.aq-note {
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px dashed #e8ebf5;
  color: #7a869e;
  font-size: 12px;
  font-weight: 600;
}
.anchor-opportunity-wrap {
  border: 1px solid #edf0f7;
  border-radius: 15px;
  overflow: hidden;
  background: #fff;
}
.anchor-opportunity-table,
.anchor-optimize-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.anchor-opportunity-table th,
.anchor-optimize-table th {
  padding: 11px 12px;
  background: linear-gradient(180deg, #f9faff, #f5f7fc);
  color: #7a869e;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: 1px solid #edf0f7;
}
.anchor-opportunity-table td,
.anchor-optimize-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f7;
  color: #475569;
  font-size: 12.5px;
  line-height: 1.45;
}
.anchor-opportunity-table tr:last-child td,
.anchor-optimize-table tr:last-child td { border-bottom: 0; }
.anchor-chip-text {
  display: inline-flex;
  max-width: 190px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f8f5ff;
  border: 1px solid #dbeafe;
  color: #13294b;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.priority-high { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.priority-medium { background: #fff7ed; color: #f97316; border: 1px solid #fed7aa; }
.priority-low { background: #ecfdf3; color: #16a34a; border: 1px solid #bbf7d0; }
.anchor-quality-foot {
  justify-content: flex-end;
}
.anchor-quality-foot .btn.primary {
  min-width: 190px;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 12px 28px rgba(29,78,216,.22);
}
.anchor-quality-foot .btn.primary::after {
  content: "→";
  margin-left: 10px;
  font-weight: 700;
}
.anchor-optimize-modal-card {
  width: min(1180px, calc(100vw - 56px));
  max-height: 92vh;
}
.anchor-optimize-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 16px 20px 8px;
}
.ao-summary-card {
  border: 1px solid #edf0f7;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}
.ao-summary-card span {
  display: block;
  color: #64708a;
  font-size: 12px;
  font-weight: 700;
}
.ao-summary-card strong {
  display: block;
  margin-top: 4px;
  color: #182033;
  font-size: 24px;
  font-weight: 700;
}
.ao-summary-card.high { background: #fff5f5; }
.ao-summary-card.medium { background: #fff7ed; }
.ao-summary-card.low { background: #ecfdf3; }
.anchor-optimize-body {
  padding-top: 8px;
}
.anchor-optimize-table th:nth-child(1),
.anchor-optimize-table td:nth-child(1) { width: 46px; text-align: center; }
.anchor-optimize-table th:nth-child(5),
.anchor-optimize-table td:nth-child(5) { width: 104px; }
.anchor-optimize-table th:nth-child(6),
.anchor-optimize-table td:nth-child(6) { width: 130px; }
.anchor-optimize-table a { color: #1d4ed8; font-weight: 700; text-decoration: none; }

@media (max-width: 1280px) {
  .anchor-insight-grid { grid-template-columns: 1fr; }
  .anchor-panel-distribution, .anchor-quality-panel { min-height: auto; }
}
@media (max-width: 840px) {
  .anchor-performance-layout { grid-template-columns: 1fr; }
  .anchor-donut-area { min-height: auto; }
  .anchor-quality-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aq-bar-row { grid-template-columns: 110px minmax(0, 1fr); }
  .aq-bar-row strong { grid-column: 2; text-align: left; }
  .anchor-merged-table th:nth-child(4), .anchor-merged-table td:nth-child(4) { width: 138px; }
}
@media (max-width: 620px) {
  .anchor-quality-cards,
  .anchor-optimize-summary { grid-template-columns: 1fr; }
  .anchor-opportunity-wrap,
  .anchor-merged-table-wrap,
  .anchor-optimize-body { overflow-x: auto; }
  .anchor-merged-table,
  .anchor-opportunity-table,
  .anchor-optimize-table { min-width: 680px; }
}


/* ============================================================
   PATCH 2026-07-05 — Fix cột Ưu tiên + đổi popup gợi ý tối ưu
   thành sidebar/drawer bên phải. Không thay đổi dữ liệu gốc.
   ============================================================ */
.anchor-opportunity-wrap {
  overflow: visible;
}
.anchor-opportunity-table {
  table-layout: fixed;
  width: 100%;
}
.anchor-opportunity-table th:nth-child(1),
.anchor-opportunity-table td:nth-child(1) { width: 24%; }
.anchor-opportunity-table th:nth-child(2),
.anchor-opportunity-table td:nth-child(2) { width: 31%; }
.anchor-opportunity-table th:nth-child(3),
.anchor-opportunity-table td:nth-child(3) { width: auto; }
.anchor-opportunity-table th:nth-child(4),
.anchor-opportunity-table td:nth-child(4) {
  width: 112px;
  min-width: 112px;
  text-align: center;
  padding-left: 10px;
  padding-right: 14px;
  overflow: visible;
}
.anchor-opportunity-table td {
  overflow-wrap: anywhere;
  word-break: normal;
}
.anchor-opportunity-table .anchor-chip-text {
  max-width: 100%;
  box-sizing: border-box;
}
.anchor-opportunity-table .priority-badge,
.anchor-optimize-drawer .priority-badge {
  min-width: 78px;
  max-width: 100%;
  box-sizing: border-box;
  padding-left: 10px;
  padding-right: 10px;
}

#anchorOptimizeModal.anchor-optimize-drawer {
  position: fixed;
  inset: 0;
  z-index: 230;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
  background: rgba(15, 23, 42, .26);
  backdrop-filter: blur(3px);
}
#anchorOptimizeModal.anchor-optimize-drawer[hidden] { display: none; }
#anchorOptimizeModal .anchor-optimize-modal-card {
  width: min(520px, 100vw);
  max-width: 100vw;
  height: 100vh;
  max-height: none;
  border-radius: 24px 0 0 24px;
  box-shadow: -22px 0 60px rgba(15, 23, 42, .18);
  border-left: 1px solid #e8ebf5;
  animation: anchorDrawerIn .18s ease-out both;
}
@keyframes anchorDrawerIn {
  from { transform: translateX(28px); opacity: .72; }
  to { transform: translateX(0); opacity: 1; }
}
.anchor-optimize-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  padding: 20px 22px 16px;
}
.drawer-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.drawer-eyebrow::before {
  content: "✦";
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  background: #eaf1fe;
}
#anchorOptimizeModal .prompt-modal-head h3 {
  font-size: 20px;
  letter-spacing: -.02em;
  color: #111827;
}
#anchorOptimizeModal .prompt-modal-head .matched-url {
  max-width: 390px;
  word-break: break-all;
}
#anchorOptimizeModal .anchor-optimize-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 22px 10px;
}
#anchorOptimizeModal .ao-summary-card {
  padding: 12px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(20,16,52,.04);
}
#anchorOptimizeModal .ao-summary-card strong {
  font-size: 22px;
}
#anchorOptimizeModal .anchor-optimize-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 22px 18px;
}
.anchor-optimize-list {
  display: grid;
  gap: 12px;
}
.ao-suggestion-card {
  position: relative;
  border: 1px solid #e8ebf5;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #fcfdff 100%);
  box-shadow: 0 10px 28px rgba(20,16,52,.055);
  padding: 14px;
}
.ao-suggestion-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: #3b82f6;
}
.ao-suggestion-card.ao-high::before { background: #ef4444; }
.ao-suggestion-card.ao-medium::before { background: #f97316; }
.ao-suggestion-card.ao-low::before { background: #16a34a; }
.ao-suggestion-top {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}
.ao-index {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: #eaf1fe;
  border: 1px solid #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 12px;
}
.ao-suggestion-card .anchor-chip-text {
  max-width: 100%;
}
.ao-suggestion-section {
  padding: 10px 11px;
  border: 1px solid #f0f2f8;
  border-radius: 14px;
  background: #fff;
  margin-top: 8px;
}
.ao-suggestion-section span {
  display: block;
  margin-bottom: 5px;
  color: #7a869e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.ao-suggestion-section p {
  margin: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 650;
}
.ao-recommend {
  background: #fbfaff;
  border-color: #e9ddff;
}
.ao-suggestion-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 11px;
}
.ao-source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 11px;
  background: #fff;
  border: 1px solid #dbeafe;
  color: #1d4ed8;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
}
.ao-source-link:hover { background: #f8f5ff; }
#anchorOptimizeModal .anchor-optimize-foot {
  position: sticky;
  bottom: 0;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  padding: 14px 22px 18px;
  align-items: stretch;
  flex-direction: column;
}
#anchorOptimizeModal .anchor-optimize-foot .muted {
  line-height: 1.45;
}
#anchorOptimizeModal .anchor-optimize-foot .btn {
  width: 100%;
  justify-content: center;
}

@media (max-width: 620px) {
  .anchor-opportunity-wrap { overflow-x: auto; }
  .anchor-opportunity-table { min-width: 720px; }
  #anchorOptimizeModal .anchor-optimize-modal-card {
    width: 100vw;
    border-radius: 0;
  }
  #anchorOptimizeModal .anchor-optimize-summary { grid-template-columns: 1fr; }
  .ao-suggestion-top { grid-template-columns: 28px minmax(0, 1fr); }
  .ao-suggestion-top .priority-badge { grid-column: 2; justify-self: start; }
}

/* ============================================================
   PATCH 2026-07-05 — Fix opportunity table overflow + source preview
   ============================================================ */
.anchor-quality-panel,
.anchor-quality-content {
  min-width: 0;
  overflow: hidden;
}
.anchor-opportunity-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden !important;
  box-sizing: border-box;
}
.anchor-opportunity-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  box-sizing: border-box;
}
.anchor-opportunity-table th,
.anchor-opportunity-table td {
  box-sizing: border-box;
  min-width: 0;
  vertical-align: middle;
}
.anchor-opportunity-table th:nth-child(1),
.anchor-opportunity-table td:nth-child(1) { width: 24%; }
.anchor-opportunity-table th:nth-child(2),
.anchor-opportunity-table td:nth-child(2) { width: 30%; }
.anchor-opportunity-table th:nth-child(3),
.anchor-opportunity-table td:nth-child(3) { width: 33%; }
.anchor-opportunity-table th:nth-child(4),
.anchor-opportunity-table td:nth-child(4) {
  width: 13%;
  min-width: 104px;
  max-width: none;
  overflow: visible;
  text-align: center;
  white-space: nowrap;
}
.anchor-opportunity-table .anchor-chip-text {
  max-width: 100%;
}
.anchor-opportunity-table .priority-badge {
  min-width: 86px;
  max-width: none;
  white-space: nowrap;
}
.anchor-opportunity-table td:nth-child(2),
.anchor-opportunity-table td:nth-child(3) {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ao-suggestion-actions {
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.ao-add-optimize,
.ao-source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.ao-add-optimize {
  border: 1px solid #bfdbfe;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 8px 18px rgba(29,78,216,.16);
}
.ao-add-optimize:hover { filter: brightness(.98); transform: translateY(-1px); }
.ao-add-optimize:disabled,
.ao-source-link:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.ao-source-link {
  background: #fff;
  border: 1px solid #dbeafe;
  color: #1d4ed8;
}
.ao-source-link:hover { background: #f8f5ff; }

.anchor-source-preview {
  position: fixed;
  top: 28px;
  right: min(540px, 100vw);
  width: min(720px, calc(100vw - 590px));
  max-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  z-index: 235;
  border: 1px solid #e6e9f3;
  border-radius: 24px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 28px 80px rgba(15,23,42,.22);
  overflow: hidden;
  animation: anchorPreviewIn .18s ease-out both;
}
.anchor-source-preview[hidden] { display: none !important; }
@keyframes anchorPreviewIn {
  from { opacity: 0; transform: translateX(18px) scale(.985); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
.anchor-source-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #edf0f7;
  background: linear-gradient(180deg, #fff, #fbfcff);
}
.anchor-source-preview-head h3 {
  margin: 0;
  color: #101828;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.02em;
}
.anchor-source-preview-head .matched-url {
  max-width: 560px;
  margin-top: 7px;
  color: #667085;
  font-size: 12.5px;
  word-break: break-all;
}
.anchor-source-preview-body {
  flex: 1;
  overflow: auto;
  padding: 18px 20px 20px;
  background: #f8f9fe;
}
.preview-loading,
.preview-error {
  border: 1px solid #e8ebf5;
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  color: #667085;
  font-weight: 700;
}
.preview-error b,
.preview-error span { display: block; }
.preview-error b { color: #b91c1c; margin-bottom: 6px; }
.preview-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.preview-meta-row a {
  color: #1d4ed8;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
}
.preview-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.preview-status.ok { color: #15803d; background: #dcfce7; border: 1px solid #bbf7d0; }
.preview-status.warn { color: #b45309; background: #fffbeb; border: 1px solid #fde68a; }
.source-preview-content {
  border: 1px solid #e8ebf5;
  border-radius: 18px;
  background: #fff;
  padding: 22px;
  color: #334155;
  font-size: 14px;
  line-height: 1.8;
  box-shadow: 0 16px 38px rgba(15,23,42,.06);
}
.source-preview-content p {
  margin: 0 0 14px;
}
.source-preview-content .preview-ellipsis {
  display: inline-block;
  color: #94a3b8;
  font-weight: 700;
  margin: 0 4px;
}
.source-preview-content .link-highlight {
  display: inline;
  padding: 3px 7px;
  border-radius: 9px;
  color: #13294b;
  font-weight: 700;
  background: linear-gradient(180deg, #eaf1fe, #dbeafe);
  outline: 2px solid rgba(37,99,235,.20);
  box-shadow: 0 0 0 4px rgba(37,99,235,.06);
}
.source-preview-content .link-highlight::after {
  content: "  ↗";
  color: #2563eb;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .anchor-source-preview {
    left: 18px;
    right: 540px;
    width: auto;
  }
}
@media (max-width: 940px) {
  .anchor-source-preview {
    top: 18px;
    left: 18px;
    right: 18px;
    width: auto;
    max-height: 48vh;
    z-index: 245;
  }
  #anchorOptimizeModal .anchor-optimize-modal-card {
    width: min(520px, 100vw);
  }
}
@media (max-width: 620px) {
  .anchor-opportunity-wrap { overflow-x: auto !important; }
  .anchor-opportunity-table { min-width: 720px !important; }
  .anchor-source-preview {
    inset: 0;
    width: 100vw;
    max-height: 55vh;
    border-radius: 0 0 22px 22px;
  }
}

/* ============================================================
   PATCH 2026-07-05 — CMS-like source preview and exact anchor region
   ============================================================ */
.anchor-source-preview {
  width: min(760px, calc(100vw - 610px));
}
.preview-meta-row {
  align-items: center;
  flex-wrap: wrap;
}
.preview-source-type {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #475467;
  background: #f8fafc;
  border: 1px solid #e6e9f3;
  font-size: 12px;
  font-weight: 700;
}
.source-preview-content.cms-preview-content {
  font-size: 15px;
  line-height: 1.72;
  color: #26324d;
}
.source-preview-content.cms-preview-content h1,
.source-preview-content.cms-preview-content h2,
.source-preview-content.cms-preview-content h3,
.source-preview-content.cms-preview-content h4 {
  color: #191b45;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 12px;
}
.source-preview-content.cms-preview-content h1 { font-size: 26px; }
.source-preview-content.cms-preview-content h2 { font-size: 22px; margin-top: 4px; }
.source-preview-content.cms-preview-content h3 { font-size: 18px; margin-top: 4px; }
.source-preview-content.cms-preview-content h4 { font-size: 16px; margin-top: 4px; }
.source-preview-content.cms-preview-content p {
  margin: 0 0 14px;
}
.source-preview-content.cms-preview-content ul,
.source-preview-content.cms-preview-content ol {
  margin: 8px 0 16px 22px;
  padding: 0;
}
.source-preview-content.cms-preview-content li {
  margin: 6px 0;
  padding-left: 4px;
}
.source-preview-content.cms-preview-content blockquote {
  margin: 12px 0 16px;
  padding: 12px 16px;
  border-left: 4px solid #3b82f6;
  border-radius: 12px;
  background: #f8f5ff;
  color: #3f3b73;
}
.source-preview-content.cms-preview-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 12px 0 16px;
  overflow: hidden;
  border: 1px solid #e8ebf5;
  border-radius: 14px;
}
.source-preview-content.cms-preview-content th,
.source-preview-content.cms-preview-content td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f7;
  vertical-align: top;
}
.source-preview-content.cms-preview-content th {
  background: #f8f9fe;
  font-size: 12px;
  color: #667085;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.source-preview-content.cms-preview-content a:not(.link-highlight) {
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
}
.source-preview-content.cms-preview-content a:not(.link-highlight):hover {
  text-decoration: underline;
}
.source-preview-content.cms-preview-content .link-highlight {
  position: relative;
  display: inline;
  padding: 3px 8px;
  border-radius: 9px;
  color: #13294b;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(180deg, #f3e8ff, #dbeafe);
  outline: 2px solid rgba(37,99,235,.26);
  box-shadow: 0 0 0 5px rgba(37,99,235,.08), 0 8px 18px rgba(37,99,235,.14);
}
.source-preview-content.cms-preview-content .link-highlight::after {
  content: "  link nội bộ";
  display: inline-flex;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #fff;
  border: 1px solid #dbeafe;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

/* Strong final guard: keep the opportunity table inside its card */
.anchor-quality-panel,
.anchor-quality-content,
.anchor-opportunity-wrap {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.anchor-opportunity-wrap {
  overflow: hidden !important;
}
.anchor-opportunity-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}
.anchor-opportunity-table th,
.anchor-opportunity-table td {
  min-width: 0 !important;
  box-sizing: border-box !important;
}
.anchor-opportunity-table th:nth-child(1),
.anchor-opportunity-table td:nth-child(1) { width: 24% !important; }
.anchor-opportunity-table th:nth-child(2),
.anchor-opportunity-table td:nth-child(2) { width: 30% !important; }
.anchor-opportunity-table th:nth-child(3),
.anchor-opportunity-table td:nth-child(3) { width: 33% !important; }
.anchor-opportunity-table th:nth-child(4),
.anchor-opportunity-table td:nth-child(4) {
  width: 13% !important;
  min-width: 112px !important;
  overflow: visible !important;
  white-space: nowrap !important;
  text-align: center !important;
}
.anchor-opportunity-table td:nth-child(2),
.anchor-opportunity-table td:nth-child(3) {
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}
.anchor-opportunity-table .priority-badge {
  min-width: 86px !important;
  white-space: nowrap !important;
}


/* ============================================================
   FIX 2026-07-05 — Popup "Tất cả Anchor Text"
   - Tăng không gian cho cột Anchor Text
   - Thu gọn cột Trang nguồn ví dụ
   - Giữ chiều cao hàng đồng nhất
   - Tooltip bằng title khi anchor bị rút gọn
   ============================================================ */
#anchorModal .anchor-modal-card {
  width: min(1260px, calc(100vw - 48px));
}
#anchorModal .anchor-modal-body {
  overflow-x: auto;
  overflow-y: auto;
}
#anchorModal .anchor-full-table {
  width: 100%;
  min-width: 1040px;
  table-layout: fixed;
}
#anchorModal .anchor-full-table th:nth-child(1),
#anchorModal .anchor-full-table td:nth-child(1) { width: 48px; text-align: center; }
#anchorModal .anchor-full-table th:nth-child(2),
#anchorModal .anchor-full-table td:nth-child(2) { width: 34%; min-width: 280px; }
#anchorModal .anchor-full-table th:nth-child(3),
#anchorModal .anchor-full-table td:nth-child(3) { width: 84px; }
#anchorModal .anchor-full-table th:nth-child(4),
#anchorModal .anchor-full-table td:nth-child(4) { width: 190px; }
#anchorModal .anchor-full-table th:nth-child(5),
#anchorModal .anchor-full-table td:nth-child(5) { width: 152px; }
#anchorModal .anchor-full-table th:nth-child(6),
#anchorModal .anchor-full-table td:nth-child(6) { width: 150px; }
#anchorModal .anchor-full-table th:nth-child(7),
#anchorModal .anchor-full-table td:nth-child(7) { width: 124px; }
#anchorModal .anchor-full-table td {
  height: 54px;
  box-sizing: border-box;
}
#anchorModal .anchor-full-table td.af-anchor {
  display: table-cell;
  max-width: none;
  overflow: visible;
  text-overflow: initial;
  white-space: normal;
  line-height: 1.35;
  vertical-align: middle;
}
#anchorModal .af-anchor-text {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
  color: #172033;
}
#anchorModal .af-anchor:hover .af-anchor-text {
  color: var(--anchor-purple);
}
#anchorModal .af-sample {
  max-width: 150px;
}
#anchorModal .af-sample a {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 900px) {
  #anchorModal .anchor-full-table {
    min-width: 980px;
  }
  #anchorModal .anchor-full-table th:nth-child(2),
  #anchorModal .anchor-full-table td:nth-child(2) { width: 300px; min-width: 300px; }
}

/* ---------- Sidebar 2 cấp: Link nội bộ ---------- */
.nav-group {
  display: grid;
  gap: 4px;
}
.nav-parent span {
  min-width: 0;
  flex: 1;
}
.nav-caret {
  width: 14px !important;
  height: 14px !important;
  margin-left: auto;
  opacity: .7;
  transition: transform .16s ease, opacity .16s ease;
}
.nav-group.active .nav-caret { opacity: .95; }
.nav-submenu {
  display: grid;
  gap: 4px;
  margin: -1px 0 4px 29px;
  padding-left: 13px;
  border-left: 1px solid rgba(255, 255, 255, .12);
}
.nav-subitem {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #bdb7df;
  text-align: left;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-subitem:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
}
.nav-subitem.active {
  background: rgba(29,78,216, .18);
  color: #fff;
  box-shadow: inset 2px 0 0 #3b82f6;
}
.sub-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(196, 181, 253, .55);
  box-shadow: 0 0 0 3px rgba(29,78,216, .08);
  flex: none;
}
.nav-subitem.active .sub-dot {
  background: #93c5fd;
  box-shadow: 0 0 0 4px rgba(29,78,216, .18);
}
.link-automation-placeholder {
  min-height: 180px;
}

@media (max-width: 1100px) {
  .nav-group { display: flex; align-items: center; gap: 6px; }
  .nav-submenu {
    display: flex;
    margin: 0;
    padding-left: 0;
    border-left: 0;
  }
  .nav-subitem { width: auto; white-space: nowrap; }
}

/* ===== Anchor AI Review Modal ===== */
.anchor-modal-foot-extended{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.anchor-modal-foot-left{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.anchor-review-modal-card{width:min(1460px,96vw);max-height:92vh;padding:24px 24px 18px;display:flex;flex-direction:column;gap:18px}
.anchor-review-head{align-items:flex-start}
.anchor-review-head .muted{max-width:920px;line-height:1.55}
.anchor-review-loading{display:flex;align-items:center;justify-content:center;gap:16px;padding:48px 20px;border:1px dashed var(--line);border-radius:22px;background:rgba(99,102,241,.03)}
.loading-spinner{width:42px;height:42px;border-radius:50%;border:4px solid rgba(99,102,241,.14);border-top-color:#1d4ed8;animation:spinDash 1s linear infinite}
@keyframes spinDash{to{transform:rotate(360deg)}}
.anchor-review-content{display:flex;flex-direction:column;gap:18px;min-height:0}
.anchor-review-stats{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:14px}
.anchor-review-stat{border:1px solid var(--line);border-radius:18px;padding:16px 18px;background:#fff;display:flex;align-items:center;gap:14px;min-height:92px}
.anchor-review-stat .stat-icon{width:44px;height:44px;border-radius:14px;display:inline-flex;align-items:center;justify-content:center;font-size:18px;font-weight: 700;flex:0 0 auto}
.anchor-review-stat .stat-text{display:flex;flex-direction:column;gap:4px}
.anchor-review-stat .stat-text span{font-size:13px;color:var(--muted)}
.anchor-review-stat .stat-text strong{font-size:18px;line-height:1.1;color:var(--text)}
.anchor-review-stat .stat-text em{font-style:normal;font-size:12px;color:var(--muted)}
.anchor-review-stat.tone-indigo .stat-icon{background:#eaf1fe;color:#1d4ed8}
.anchor-review-stat.tone-green .stat-icon{background:#dcfce7;color:#16a34a}
.anchor-review-stat.tone-emerald .stat-icon{background:#d1fae5;color:#059669}
.anchor-review-stat.tone-amber .stat-icon{background:#fef3c7;color:#d97706}
.anchor-review-stat.tone-rose .stat-icon{background:#ffe4e6;color:#e11d48}
.anchor-review-layout{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(340px,.95fr);gap:18px;min-height:0}
.panel-lite{border:1px solid var(--line);border-radius:24px;background:#fff;box-shadow:0 12px 32px rgba(15,23,42,.05);padding:18px}
.anchor-review-main,.anchor-review-side{min-height:0}
.anchor-review-section-head{display:flex;justify-content:space-between;gap:12px;margin-bottom:14px}
.anchor-review-section-head h4,.anchor-review-side-block h4{margin:0 0 4px;font-size:16px;color:var(--text)}
.anchor-review-section-head p,.anchor-review-side-block p{margin:0;color:var(--muted);font-size:13px;line-height:1.55}
.anchor-review-controls{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.anchor-review-controls .grow{flex:1 1 260px}
.anchor-review-controls select,.anchor-review-controls input{height:48px}
.anchor-review-table-wrap{border:1px solid var(--line);border-radius:18px;overflow:auto;max-height:56vh}
.anchor-review-table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed;min-width:880px}
.anchor-review-table thead th{position:sticky;top:0;background:#f8fafc;z-index:1;border-bottom:1px solid var(--line);padding:13px 12px;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:#64748b;text-align:left;white-space:nowrap}
.anchor-review-table tbody td{padding:14px 12px;border-bottom:1px solid #edf2f7;vertical-align:middle}
.anchor-review-table tbody tr:hover{background:#faf8ff}
.anchor-review-table th:nth-child(1),.anchor-review-table td:nth-child(1){width:48px}
.anchor-review-table th:nth-child(2),.anchor-review-table td:nth-child(2){width:34%}
.anchor-review-table th:nth-child(3),.anchor-review-table td:nth-child(3){width:80px}
.anchor-review-table th:nth-child(4),.anchor-review-table td:nth-child(4){width:110px}
.anchor-review-table th:nth-child(5),.anchor-review-table td:nth-child(5){width:92px}
.anchor-review-table th:nth-child(6),.anchor-review-table td:nth-child(6){width:132px}
.anchor-review-table th:nth-child(7),.anchor-review-table td:nth-child(7){width:122px}
.anchor-review-anchor{display:flex;align-items:flex-start;gap:10px;min-width:0}
.anchor-review-anchor .dot{width:10px;height:10px;border-radius:50%;margin-top:7px;flex:0 0 auto}
.anchor-review-anchor .text{font-weight:700;color:#0f172a;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.anchor-review-anchor .sub{display:block;font-size:12px;color:#64748b;margin-top:4px;font-weight:500}
.anchor-review-percent{display:flex;align-items:center;gap:8px}
.anchor-review-percent .mini-bar{flex:1 1 auto;min-width:70px;height:8px;border-radius:999px;background:#eceff5;overflow:hidden}
.anchor-review-percent .mini-bar span{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#2563eb,#3b82f6)}
.anchor-review-percent b{font-size:13px;color:#475569;white-space:nowrap}
.ai-score{font-weight: 700}
.ai-score.good{color:#16a34a}.ai-score.review{color:#d97706}.ai-score.bad{color:#ef4444}
.status-badge{display:inline-flex;align-items:center;justify-content:center;padding:7px 12px;border-radius:999px;font-weight:700;font-size:12px;white-space:nowrap}
.status-badge.excellent{background:#dcfce7;color:#15803d}
.status-badge.good{background:#e6f7ec;color:#16a34a}
.status-badge.review{background:#fff4e5;color:#d97706}
.status-badge.remove{background:#ffe7e7;color:#dc2626}
.row-action-btn{display:inline-flex;align-items:center;justify-content:center;min-width:96px;height:38px;border-radius:12px;border:1px solid #d8def0;background:#fff;color:#475569;font-weight:700;cursor:pointer}
.row-action-btn.primary{background:#eaf1fe;border-color:#d6bcfa;color:#1d4ed8}
.row-action-btn.success{background:#eefbf3;border-color:#ccebd8;color:#16a34a}
.row-action-btn:hover{transform:translateY(-1px);box-shadow:0 8px 18px rgba(99,102,241,.08)}
.anchor-review-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:14px}
.anchor-review-side{display:flex;flex-direction:column;gap:14px;overflow:auto;max-height:73vh}
.anchor-review-side-block{border:1px solid #eef2f7;border-radius:18px;padding:16px;background:#fff}
.anchor-review-context{display:grid;grid-template-columns:130px 1fr;gap:10px 14px;font-size:13px;color:#334155}
.anchor-review-context dt{font-weight:700;color:#334155}.anchor-review-context dd{margin:0;line-height:1.55;color:#1e293b}
.anchor-review-side-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:6px}
.source-chip{display:inline-flex;align-items:center;justify-content:center;padding:6px 10px;border-radius:999px;background:#eaf1fe;color:#1d4ed8;font-size:12px;font-weight:700}
.anchor-review-summary-box{padding:14px 16px;border-radius:16px;background:linear-gradient(180deg,#f5f8fc 0%,#f6f8ff 100%);border:1px solid #e8e5ff}
.anchor-review-summary-box ul{margin:0;padding-left:18px}.anchor-review-summary-box li{margin:0 0 8px;color:#374151;line-height:1.55}.anchor-review-summary-box li:last-child{margin-bottom:0}
.anchor-chip-grid{display:flex;flex-wrap:wrap;gap:10px}
.anchor-chip-card{display:flex;flex-direction:column;gap:6px;border:1px solid #d7f0df;background:#f6fffa;padding:10px 12px;border-radius:14px;min-width:140px;max-width:100%}
.anchor-chip-card strong{font-size:13px;color:#14532d;line-height:1.35}.anchor-chip-card span{font-size:12px;color:#16a34a}
.anchor-chip-card em{font-style:normal;font-size:11px;color:#4b5563}
.anchor-chip-grid-danger .anchor-chip-card{border-color:#ffd6d6;background:#fff7f7}
.anchor-chip-grid-danger .anchor-chip-card strong{color:#b91c1c}.anchor-chip-grid-danger .anchor-chip-card span{color:#ef4444}
.anchor-review-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.anchor-review-actions .btn:last-child{grid-column:1 / -1}
.review-empty{padding:24px;text-align:center;color:#64748b}
@media (max-width: 1280px){.anchor-review-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.anchor-review-layout{grid-template-columns:1fr}.anchor-review-side{max-height:none}}
@media (max-width: 760px){.anchor-review-modal-card{width:min(100vw,100vw);height:100vh;max-height:100vh;border-radius:0;padding:18px}.anchor-review-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.anchor-review-actions{grid-template-columns:1fr}.anchor-review-actions .btn:last-child{grid-column:auto}.anchor-review-context{grid-template-columns:1fr}}

/* ===== Anchor AI Review: selection + detail drawer ===== */
.anchor-review-table th:nth-child(1),.anchor-review-table td:nth-child(1){width:44px;text-align:center}
.anchor-review-table th:nth-child(2),.anchor-review-table td:nth-child(2){width:48px}
.anchor-review-table th:nth-child(3),.anchor-review-table td:nth-child(3){width:32%}
.anchor-review-table th:nth-child(4),.anchor-review-table td:nth-child(4){width:78px}
.anchor-review-table th:nth-child(5),.anchor-review-table td:nth-child(5){width:108px}
.anchor-review-table th:nth-child(6),.anchor-review-table td:nth-child(6){width:90px}
.anchor-review-table th:nth-child(7),.anchor-review-table td:nth-child(7){width:124px}
.anchor-review-table th:nth-child(8),.anchor-review-table td:nth-child(8){width:130px}
.anchor-review-table input[type="checkbox"],#anchorReviewSelectAll{width:18px;height:18px;accent-color:#1d4ed8;cursor:pointer}
.anchor-review-table tbody tr.is-selected{background:#f5f0ff}
.anchor-review-table tbody tr.is-selected:hover{background:#efe7ff}
.anchor-review-detail-drawer{position:absolute;top:0;right:0;width:min(460px,92vw);height:100%;z-index:6;background:#fff;border-left:1px solid var(--line);box-shadow:-28px 0 60px rgba(15,23,42,.16);display:flex;flex-direction:column;border-radius:0 24px 24px 0;overflow:hidden}
.anchor-review-detail-head{padding:22px 24px;border-bottom:1px solid var(--line);display:flex;align-items:flex-start;justify-content:space-between;gap:14px;background:linear-gradient(180deg,#ffffff,#fbfaff)}
.anchor-review-detail-head h3{margin:6px 0 4px;font-size:21px;line-height:1.2;color:var(--text)}
.anchor-review-detail-body{padding:18px 22px;overflow:auto;display:flex;flex-direction:column;gap:14px;min-height:0}
.anchor-review-detail-card{border:1px solid #edf2f7;border-radius:18px;padding:15px;background:#fff;box-shadow:0 8px 24px rgba(15,23,42,.04)}
.anchor-review-detail-card h4{margin:0 0 10px;font-size:14px;color:#0f172a}
.anchor-review-detail-card p{margin:0;color:#334155;line-height:1.58;font-size:14px}
.anchor-review-detail-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.anchor-review-detail-kpi{border:1px solid #e8edf6;border-radius:16px;padding:12px;background:#fafcff}
.anchor-review-detail-kpi span{display:block;font-size:12px;color:#64748b;font-weight:700;margin-bottom:5px}.anchor-review-detail-kpi strong{font-size:20px;color:#0f172a}
.anchor-review-detail-input{width:100%;min-height:44px;border:1px solid #d9e1ee;border-radius:13px;padding:10px 12px;font-weight:700;color:#0f172a;background:#fff}
.anchor-review-detail-list{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}.anchor-review-detail-list li{display:flex;gap:8px;align-items:flex-start;color:#334155;font-size:14px;line-height:1.5}.anchor-review-detail-list li:before{content:'•';color:#1d4ed8;font-weight: 700}
.anchor-review-detail-sources{display:flex;flex-direction:column;gap:8px}.anchor-review-detail-sources a{display:block;padding:10px 12px;border:1px solid #e5eaf4;border-radius:13px;color:#1e40af;font-weight:700;background:#fbfaff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.anchor-review-detail-foot{margin-top:auto;padding:16px 22px;border-top:1px solid var(--line);display:flex;gap:10px;background:#fff}.anchor-review-detail-foot .btn{flex:1}
.anchor-review-detail-toast{border:1px solid #93c5fd;background:#faf5ff;color:#13294b;border-radius:14px;padding:10px 12px;font-weight:700;font-size:13px}
.anchor-review-modal-card{position:relative;overflow:hidden}
@media (max-width: 980px){.anchor-review-detail-drawer{width:100%;border-radius:0}.anchor-review-detail-kpis{grid-template-columns:1fr}}

/* ===== Fix modal layering + review error state ===== */
#anchorReviewModal{z-index:9999}
#anchorModal[hidden] + #anchorReviewModal:not([hidden]){display:flex}
.anchor-review-loading.is-error{background:#fff7f7;border-color:#fecaca;color:#991b1b}
.loading-error-icon{width:42px;height:42px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#fee2e2;color:#dc2626;font-weight: 700;font-size:22px;flex:0 0 auto}
.anchor-review-detail-drawer[hidden]{display:none!important}


/* ===== Fix Anchor AI Review UI layout ===== */
#anchorReviewModal{z-index:10020!important;align-items:center!important;justify-content:center!important;padding:22px!important}
#anchorOptimizeModal{z-index:10010!important}
#anchorReviewLoading[hidden],
#anchorReviewContent[hidden],
#anchorReviewDetailDrawer[hidden]{display:none!important}
.anchor-review-modal-card{width:min(1440px,94vw)!important;max-height:90vh!important;height:auto!important;padding:22px!important;gap:14px!important;overflow:hidden!important;border-radius:26px!important;position:relative!important}
.anchor-review-head{padding-bottom:14px!important;border-bottom:1px solid #e9edf5!important;flex:0 0 auto!important}
.anchor-review-loading{min-height:150px!important;margin:0!important}
.anchor-review-content{min-height:0!important;overflow:auto!important;padding:0 4px 2px 0!important;scrollbar-gutter:stable!important}
.anchor-review-stats{grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:12px!important;margin-bottom:14px!important}
.anchor-review-stat{min-height:76px!important;padding:12px 14px!important;border-radius:16px!important}
.anchor-review-stat .stat-icon{width:38px!important;height:38px!important;border-radius:12px!important}
.anchor-review-stat .stat-text span{font-size:12px!important}.anchor-review-stat .stat-text strong{font-size:18px!important}.anchor-review-stat .stat-text em{font-size:11px!important;line-height:1.25!important}
.anchor-review-layout{grid-template-columns:minmax(0,1.45fr) minmax(360px,.9fr)!important;gap:16px!important;align-items:start!important}
.anchor-review-main.panel-lite,.anchor-review-side.panel-lite{padding:16px!important;border-radius:20px!important}
.anchor-review-side{max-height:calc(90vh - 210px)!important;overflow:auto!important}
.anchor-review-controls{display:grid!important;grid-template-columns:minmax(260px,1fr) 170px 170px 220px!important;gap:10px!important;align-items:center!important}
.anchor-review-controls .grow{min-width:0!important;flex:initial!important}.anchor-review-controls select,.anchor-review-controls input{height:42px!important;font-size:14px!important}
.anchor-review-table-wrap{max-height:calc(90vh - 420px)!important;min-height:240px!important;overflow:auto!important;border-radius:16px!important}
.anchor-review-table{min-width:820px!important;table-layout:fixed!important}
.anchor-review-table thead th{padding:11px 10px!important;font-size:11px!important}.anchor-review-table tbody td{padding:12px 10px!important}
.anchor-review-table th:nth-child(1),.anchor-review-table td:nth-child(1){width:40px!important;text-align:center!important}
.anchor-review-table th:nth-child(2),.anchor-review-table td:nth-child(2){width:44px!important;text-align:center!important}
.anchor-review-table th:nth-child(3),.anchor-review-table td:nth-child(3){width:31%!important}
.anchor-review-table th:nth-child(4),.anchor-review-table td:nth-child(4){width:72px!important}
.anchor-review-table th:nth-child(5),.anchor-review-table td:nth-child(5){width:120px!important}
.anchor-review-table th:nth-child(6),.anchor-review-table td:nth-child(6){width:80px!important}
.anchor-review-table th:nth-child(7),.anchor-review-table td:nth-child(7){width:118px!important}
.anchor-review-table th:nth-child(8),.anchor-review-table td:nth-child(8){width:118px!important}
.anchor-review-anchor .text{-webkit-line-clamp:2!important;word-break:break-word!important}.anchor-review-anchor .sub{font-size:11px!important}
.anchor-review-foot{padding-top:12px!important}.anchor-review-side-block{padding:14px!important;border-radius:16px!important}.anchor-review-actions{grid-template-columns:1fr!important}.anchor-review-actions .btn{width:100%!important}.anchor-review-actions .btn:last-child{grid-column:auto!important}
.anchor-review-summary-box{padding:12px 14px!important}.anchor-chip-card{min-width:130px!important;padding:9px 10px!important}
.anchor-review-detail-drawer{z-index:40!important;width:min(430px,92vw)!important}.anchor-review-detail-head{padding:20px!important}.anchor-review-detail-body{padding:16px 20px!important}.anchor-review-detail-foot{padding:14px 20px!important}
@media (max-width:1360px){.anchor-review-stats{grid-template-columns:repeat(3,minmax(0,1fr))!important}.anchor-review-layout{grid-template-columns:1fr!important}.anchor-review-side{max-height:none!important}.anchor-review-table-wrap{max-height:420px!important}.anchor-review-controls{grid-template-columns:minmax(240px,1fr) 160px 160px!important}.anchor-review-controls select:last-child{grid-column:1 / -1}}
@media (max-width:760px){#anchorReviewModal{padding:0!important}.anchor-review-modal-card{width:100vw!important;max-height:100vh!important;height:100vh!important;border-radius:0!important}.anchor-review-stats{grid-template-columns:1fr 1fr!important}.anchor-review-controls{grid-template-columns:1fr!important}.anchor-review-table{min-width:760px!important}}

/* ===== Final polish: Anchor AI Review modal layout ===== */
#anchorReviewModal.prompt-modal{
  z-index: 9998 !important;
  padding: 22px !important;
  align-items: center !important;
  justify-content: center !important;
}
#anchorReviewModal .anchor-review-modal-card{
  width: min(1360px, calc(100vw - 44px)) !important;
  height: min(88vh, 820px) !important;
  max-height: min(88vh, 820px) !important;
  padding: 22px !important;
  border-radius: 24px !important;
  overflow: hidden !important;
  background: #fff !important;
  box-shadow: 0 34px 100px rgba(15, 23, 42, .22) !important;
}
#anchorReviewModal .anchor-review-head{
  padding: 0 0 14px !important;
  margin: 0 !important;
  border-bottom: 1px solid #e8edf6 !important;
}
#anchorReviewModal .anchor-review-head h3{
  font-size: 20px !important;
  line-height: 1.25 !important;
  margin: 0 0 10px !important;
}
#anchorReviewModal .anchor-review-head .muted,
#anchorReviewModal .anchor-review-head .matched-url{
  font-size: 13px !important;
  line-height: 1.45 !important;
  margin: 0 !important;
}
#anchorReviewModal .icon-btn{
  width: 38px !important;
  height: 38px !important;
  border-radius: 12px !important;
  background: #f4f6fb !important;
  border: 1px solid #e6ebf4 !important;
  color: #334155 !important;
  font-size: 18px !important;
  font-weight: 700 !important;
}
#anchorReviewModal .icon-btn:hover{
  background: #eef2ff !important;
  color: #1d4ed8 !important;
}
#anchorReviewModal .anchor-review-content{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
}
#anchorReviewModal .anchor-review-loading[hidden],
#anchorReviewModal .anchor-review-content[hidden],
#anchorReviewModal [hidden]{
  display: none !important;
}
#anchorReviewModal .anchor-review-loading{
  min-height: 180px !important;
  margin: 0 !important;
}
#anchorReviewModal .anchor-review-stats{
  flex: 0 0 auto !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin: 0 !important;
}
#anchorReviewModal .anchor-review-stat{
  min-height: 68px !important;
  padding: 11px 12px !important;
  border-radius: 15px !important;
  box-shadow: none !important;
}
#anchorReviewModal .anchor-review-stat .stat-icon{
  width: 34px !important;
  height: 34px !important;
  border-radius: 11px !important;
  font-size: 15px !important;
}
#anchorReviewModal .anchor-review-stat .stat-text{
  min-width: 0 !important;
  gap: 2px !important;
}
#anchorReviewModal .anchor-review-stat .stat-text span{
  font-size: 11px !important;
  line-height: 1.2 !important;
}
#anchorReviewModal .anchor-review-stat .stat-text strong{
  font-size: 17px !important;
  line-height: 1.1 !important;
}
#anchorReviewModal .anchor-review-stat .stat-text em{
  font-size: 10.5px !important;
  line-height: 1.2 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
#anchorReviewModal .anchor-review-layout{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, .88fr) !important;
  gap: 16px !important;
  align-items: stretch !important;
}
#anchorReviewModal .panel-lite{
  min-width: 0 !important;
  min-height: 0 !important;
  border-radius: 20px !important;
  border-color: #e7edf6 !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .045) !important;
}
#anchorReviewModal .anchor-review-main.panel-lite{
  padding: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
#anchorReviewModal .anchor-review-side.panel-lite{
  padding: 16px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: none !important;
  scrollbar-gutter: stable !important;
}
#anchorReviewModal .anchor-review-section-head{
  flex: 0 0 auto !important;
  margin-bottom: 12px !important;
}
#anchorReviewModal .anchor-review-section-head h4,
#anchorReviewModal .anchor-review-side-block h4{
  font-size: 15px !important;
  line-height: 1.25 !important;
}
#anchorReviewModal .anchor-review-section-head p,
#anchorReviewModal .anchor-review-side-block p{
  font-size: 12.5px !important;
}
#anchorReviewModal .anchor-review-controls{
  flex: 0 0 auto !important;
  display: grid !important;
  grid-template-columns: minmax(220px, 1fr) 150px 150px 190px !important;
  gap: 10px !important;
  align-items: center !important;
  margin-bottom: 12px !important;
}
#anchorReviewModal .anchor-review-controls .search-box{
  min-width: 0 !important;
  height: 40px !important;
  border-radius: 13px !important;
  border: 1px solid #dbe3f0 !important;
  background: #fff !important;
  box-shadow: 0 1px 0 rgba(15,23,42,.02) !important;
}
#anchorReviewModal .anchor-review-controls .search-box svg{
  width: 17px !important;
  height: 17px !important;
  color: #94a3b8 !important;
}
#anchorReviewModal .anchor-review-controls input,
#anchorReviewModal .anchor-review-controls select{
  width: 100% !important;
  height: 40px !important;
  border: 1px solid #dbe3f0 !important;
  border-radius: 13px !important;
  background: #fff !important;
  padding: 0 13px !important;
  color: #0f172a !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  outline: none !important;
  box-shadow: 0 1px 0 rgba(15,23,42,.02) !important;
}
#anchorReviewModal .anchor-review-controls select{
  appearance: none !important;
  -webkit-appearance: none !important;
  padding-right: 34px !important;
  background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%) !important;
  background-position: calc(100% - 18px) 17px, calc(100% - 12px) 17px !important;
  background-size: 6px 6px, 6px 6px !important;
  background-repeat: no-repeat !important;
}
#anchorReviewModal .anchor-review-controls input:focus,
#anchorReviewModal .anchor-review-controls select:focus{
  border-color: #9b7cff !important;
  box-shadow: 0 0 0 4px rgba(29,78,216,.10) !important;
}
#anchorReviewModal .anchor-review-table-wrap{
  flex: 1 1 auto !important;
  min-height: 260px !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  border-radius: 16px !important;
  border: 1px solid #e4eaf4 !important;
}
#anchorReviewModal .anchor-review-table{
  min-width: 0 !important;
  width: 100% !important;
  table-layout: fixed !important;
}
#anchorReviewModal .anchor-review-table thead th{
  padding: 11px 8px !important;
  font-size: 10.5px !important;
  letter-spacing: .035em !important;
  background: #f7f9fd !important;
  color: #64748b !important;
}
#anchorReviewModal .anchor-review-table tbody td{
  padding: 11px 8px !important;
  font-size: 13px !important;
}
#anchorReviewModal .anchor-review-table th:nth-child(1),
#anchorReviewModal .anchor-review-table td:nth-child(1){width:34px !important;text-align:center !important;}
#anchorReviewModal .anchor-review-table th:nth-child(2),
#anchorReviewModal .anchor-review-table td:nth-child(2){width:34px !important;text-align:center !important;}
#anchorReviewModal .anchor-review-table th:nth-child(3),
#anchorReviewModal .anchor-review-table td:nth-child(3){width:30% !important;}
#anchorReviewModal .anchor-review-table th:nth-child(4),
#anchorReviewModal .anchor-review-table td:nth-child(4){width:58px !important;}
#anchorReviewModal .anchor-review-table th:nth-child(5),
#anchorReviewModal .anchor-review-table td:nth-child(5){width:98px !important;}
#anchorReviewModal .anchor-review-table th:nth-child(6),
#anchorReviewModal .anchor-review-table td:nth-child(6){width:66px !important;}
#anchorReviewModal .anchor-review-table th:nth-child(7),
#anchorReviewModal .anchor-review-table td:nth-child(7){width:104px !important;}
#anchorReviewModal .anchor-review-table th:nth-child(8),
#anchorReviewModal .anchor-review-table td:nth-child(8){width:86px !important;}
#anchorReviewModal .anchor-review-table input[type="checkbox"],
#anchorReviewModal #anchorReviewSelectAll{
  width: 16px !important;
  height: 16px !important;
}
#anchorReviewModal .anchor-review-anchor{
  gap: 8px !important;
  align-items: flex-start !important;
}
#anchorReviewModal .anchor-review-anchor .dot{
  width: 9px !important;
  height: 9px !important;
  margin-top: 6px !important;
}
#anchorReviewModal .anchor-review-anchor .text{
  font-size: 13px !important;
  line-height: 1.35 !important;
  -webkit-line-clamp: 2 !important;
  word-break: break-word !important;
}
#anchorReviewModal .anchor-review-anchor .sub{
  margin-top: 3px !important;
  font-size: 10.5px !important;
  line-height: 1.2 !important;
}
#anchorReviewModal .anchor-review-percent{
  gap: 6px !important;
}
#anchorReviewModal .anchor-review-percent .mini-bar{
  min-width: 38px !important;
  height: 7px !important;
}
#anchorReviewModal .anchor-review-percent b{
  font-size: 12px !important;
}
#anchorReviewModal .ai-score{
  font-size: 13px !important;
  display: inline-flex !important;
  min-width: 32px !important;
}
#anchorReviewModal .status-badge{
  min-width: 0 !important;
  height: 30px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  font-size: 11.5px !important;
  white-space: nowrap !important;
}
#anchorReviewModal .row-action-btn{
  width: 76px !important;
  min-width: 76px !important;
  max-width: 76px !important;
  height: 34px !important;
  padding: 0 !important;
  border-radius: 12px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  border-color: #dbe3f0 !important;
  background: #fff !important;
  color: #475569 !important;
  box-shadow: 0 4px 10px rgba(15,23,42,.04) !important;
}
#anchorReviewModal .row-action-btn.success{
  background: #ecfdf3 !important;
  color: #128a47 !important;
  border-color: #c6f0d6 !important;
}
#anchorReviewModal .row-action-btn.primary{
  background: #f5f0ff !important;
  color: #1d4ed8 !important;
  border-color: #d7c8ff !important;
}
#anchorReviewModal .row-action-btn:hover{
  transform: translateY(-1px) !important;
  box-shadow: 0 10px 22px rgba(29,78,216,.12) !important;
}
#anchorReviewModal .anchor-review-foot{
  flex: 0 0 auto !important;
  padding-top: 11px !important;
}
#anchorReviewModal .anchor-review-side-block{
  padding: 14px !important;
  border-radius: 17px !important;
  background: #fff !important;
  overflow-wrap: anywhere !important;
}
#anchorReviewModal .anchor-review-context{
  grid-template-columns: 116px minmax(0,1fr) !important;
  gap: 10px 12px !important;
  font-size: 12.5px !important;
}
#anchorReviewModal .anchor-review-context dt{
  color: #1e293b !important;
}
#anchorReviewModal .anchor-review-context dd{
  line-height: 1.5 !important;
  overflow-wrap: anywhere !important;
}
#anchorReviewModal .anchor-review-summary-box{
  max-height: 210px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 13px 15px !important;
  border-radius: 16px !important;
}
#anchorReviewModal .anchor-review-summary-box li{
  font-size: 13px !important;
  line-height: 1.55 !important;
}
#anchorReviewModal .anchor-chip-grid{
  gap: 8px !important;
}
#anchorReviewModal .anchor-chip-card{
  min-width: 0 !important;
  width: 100% !important;
  padding: 10px 11px !important;
  border-radius: 14px !important;
}
#anchorReviewModal .anchor-chip-card strong{
  font-size: 12.5px !important;
}
#anchorReviewModal .anchor-review-actions{
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 9px !important;
}
#anchorReviewModal .anchor-review-actions .btn{
  width: 100% !important;
  height: 42px !important;
  border-radius: 14px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}
#anchorReviewModal .anchor-review-actions .btn.primary{
  background: linear-gradient(135deg,#2563eb,#1d4ed8) !important;
  box-shadow: 0 12px 24px rgba(29,78,216,.22) !important;
}
#anchorReviewModal .anchor-review-detail-drawer{
  z-index: 10010 !important;
  border-radius: 0 24px 24px 0 !important;
}
@media (max-width: 1320px){
  #anchorReviewModal .anchor-review-stats{grid-template-columns: repeat(3,minmax(0,1fr)) !important;}
  #anchorReviewModal .anchor-review-layout{grid-template-columns: 1fr !important;overflow-y:auto !important;}
  #anchorReviewModal .anchor-review-main.panel-lite{min-height: 520px !important;}
  #anchorReviewModal .anchor-review-side.panel-lite{max-height:none !important;}
  #anchorReviewModal .anchor-review-controls{grid-template-columns:minmax(240px,1fr) 160px 160px !important;}
  #anchorReviewModal .anchor-review-controls select:last-child{grid-column:1 / -1 !important;}
}
@media (max-width: 760px){
  #anchorReviewModal.prompt-modal{padding:0 !important;}
  #anchorReviewModal .anchor-review-modal-card{width:100vw !important;height:100vh !important;max-height:100vh !important;border-radius:0 !important;padding:16px !important;}
  #anchorReviewModal .anchor-review-stats{grid-template-columns:1fr 1fr !important;}
  #anchorReviewModal .anchor-review-controls{grid-template-columns:1fr !important;}
  #anchorReviewModal .anchor-review-table-wrap{overflow-x:auto !important;}
  #anchorReviewModal .anchor-review-table{min-width:760px !important;}
}

/* ===== Anchor Review History & State ===== */
.anchor-review-footer-wrap{display:flex;align-items:center;gap:12px;flex-wrap:wrap;min-width:0}
.anchor-review-actionbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.anchor-review-statebar{display:flex;align-items:center;gap:10px;min-width:280px;max-width:520px;padding:9px 12px;border:1px solid #dcfce7;background:linear-gradient(135deg,#f0fdf4,#f8fffb);border-radius:16px;color:#14532d;box-shadow:0 10px 22px rgba(22,163,74,.06)}
.anchor-review-statebar .review-status-dot{width:10px;height:10px;border-radius:999px;background:#22c55e;box-shadow:0 0 0 5px rgba(34,197,94,.12);flex:0 0 auto}
.anchor-review-statebar div{display:flex;flex-direction:column;gap:2px;min-width:0}
.anchor-review-statebar strong{font-size:12px;font-weight: 700;line-height:1.1;color:#166534}
.anchor-review-statebar em{font-style:normal;font-size:12px;color:#4b5563;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.btn.danger{background:#fff;border:1px solid #fecdd3;color:#e11d48;box-shadow:none}
.btn.danger:hover{background:#fff1f2;border-color:#fb7185;color:#be123c;box-shadow:0 10px 22px rgba(225,29,72,.12)}
.anchor-review-history-modal{z-index:8800}
.anchor-review-history-card{width:min(980px,94vw);max-height:88vh;display:flex;flex-direction:column;gap:18px;padding:26px;border-radius:28px;overflow:hidden}
.anchor-review-history-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px;border:1px solid #e8edf6;background:linear-gradient(135deg,#fbfdff,#f8f5ff);border-radius:20px}
.anchor-review-history-note{display:flex;flex-direction:column;gap:3px;min-width:0}
.anchor-review-history-note strong{font-size:14px;color:#0f172a}
.anchor-review-history-note span{font-size:13px;color:#64748b;line-height:1.45}
.anchor-review-history-list{display:flex;flex-direction:column;gap:12px;overflow:auto;padding-right:4px;min-height:180px;max-height:58vh}
.review-history-item{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(280px,.9fr) auto;gap:16px;align-items:center;padding:16px;border:1px solid #e8edf6;border-radius:20px;background:#fff;box-shadow:0 10px 28px rgba(15,23,42,.04)}
.review-history-item:hover{border-color:#d8ccff;box-shadow:0 16px 34px rgba(29,78,216,.08);transform:translateY(-1px)}
.review-history-main{display:flex;gap:12px;align-items:flex-start;min-width:0}
.history-index{width:36px;height:36px;border-radius:12px;background:#f4f0ff;color:#1d4ed8;display:inline-flex;align-items:center;justify-content:center;font-weight: 700;flex:0 0 auto}
.review-history-main div{min-width:0}.review-history-main strong{display:block;color:#111827;font-size:15px;margin-bottom:4px}.review-history-main p{margin:0 0 4px;color:#475569;font-size:13px;line-height:1.45}.review-history-main em{font-style:normal;display:inline-flex;padding:5px 9px;border-radius:999px;background:#eaf1fe;color:#1d4ed8;font-size:12px;font-weight:700}
.review-history-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.review-history-kpis span{display:flex;flex-direction:column;gap:2px;align-items:center;justify-content:center;padding:10px 8px;border-radius:14px;background:#f8fafc;border:1px solid #edf2f7;color:#64748b;font-size:11px;font-weight:700;text-align:center;white-space:nowrap}
.review-history-kpis b{font-size:16px;color:#0f172a;line-height:1}
.review-history-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:38px 16px;border:1px dashed #d8def0;border-radius:20px;background:#fafbff;text-align:center;color:#64748b}
.review-history-empty strong{font-size:16px;color:#0f172a}.review-history-empty span{font-size:13px;line-height:1.5}
@media (max-width:980px){.review-history-item{grid-template-columns:1fr}.review-history-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.anchor-review-history-toolbar{align-items:flex-start;flex-direction:column}.anchor-review-statebar{max-width:100%;width:100%}}

/* ===== Keyword Analysis ===== */
.keyword-panel{padding:0;overflow:hidden;background:linear-gradient(180deg,#fff 0%,#fbfcff 100%)}
.kw-hero{display:grid;grid-template-columns:1fr 300px;gap:22px;padding:28px;border-bottom:1px solid #e9edf5;background:radial-gradient(circle at 0 0,rgba(37,99,235,.09),transparent 32%),#fff}
.kw-eyebrow{display:inline-flex;margin-bottom:8px;color:#1d4ed8;font-size:12px;font-weight: 700;text-transform:uppercase;letter-spacing:.08em}
.kw-hero h2{margin:0 0 8px;font-size:28px;line-height:1.2;color:#101828}
.kw-hero p{margin:0;max-width:900px;color:#667085;line-height:1.65;font-size:14px}
.kw-hero-card{border:1px solid #e5e7f1;border-radius:20px;padding:18px;background:#fff;box-shadow:0 12px 28px rgba(16,24,40,.06);display:flex;flex-direction:column;gap:6px}
.kw-hero-card span{font-size:12px;text-transform:uppercase;letter-spacing:.05em;color:#7a85a1;font-weight: 700}
.kw-hero-card strong{font-size:18px;color:#101828}.kw-hero-card small{color:#667085;line-height:1.45}
.kw-search-card{padding:24px 28px;border-bottom:1px solid #eef2f7;background:#fff}
.kw-input-label{display:block;margin-bottom:10px;color:#344054;font-weight: 700}
.kw-search-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.kw-input-wrap{height:52px;display:flex;align-items:center;gap:10px;flex:1 1 480px;min-width:280px;border:1px solid #dce3f0;border-radius:16px;padding:0 15px;background:#fff;box-shadow:0 8px 20px rgba(16,24,40,.04)}
.kw-input-wrap svg{width:20px;height:20px;color:#8a94ad;flex:0 0 auto}.kw-input-wrap input{border:0;outline:0;width:100%;height:100%;font:inherit;color:#101828;background:transparent;font-weight:600}
.kw-input-wrap:focus-within{border-color:#3b82f6;box-shadow:0 0 0 4px rgba(29,78,216,.12)}
.kw-ai-toggle{height:52px;display:flex;align-items:center;gap:9px;border:1px solid #e1e6f2;border-radius:16px;padding:0 16px;background:#f8fbff;color:#344054;font-weight:700;white-space:nowrap}
.kw-ai-toggle input{accent-color:#2563eb;width:16px;height:16px}.kw-hint{margin:10px 0 0;color:#7a85a1;font-size:13px}
.kw-result{padding:24px 28px 30px}.kw-stat-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin-bottom:18px}
.kw-stat-card{border:1px solid #e5e9f4;border-radius:18px;padding:16px;background:#fff;display:flex;align-items:center;gap:12px;box-shadow:0 10px 24px rgba(16,24,40,.045)}
.kw-stat-card .kw-stat-icon{width:42px;height:42px;border-radius:14px;display:flex;align-items:center;justify-content:center;font-weight: 700}.kw-stat-card span{display:block;color:#667085;font-size:12px;font-weight: 700}.kw-stat-card strong{font-size:24px;color:#101828;line-height:1}
.kw-stat-card.purple .kw-stat-icon{background:#eaf1fe;color:#1d4ed8}.kw-stat-card.red .kw-stat-icon{background:#fee4e2;color:#d92d20}.kw-stat-card.orange .kw-stat-icon{background:#fff2d6;color:#dc6803}.kw-stat-card.blue .kw-stat-icon{background:#e8f1ff;color:#2563eb}.kw-stat-card.green .kw-stat-icon{background:#dcfae6;color:#079455}
.kw-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:18px}.kw-table-panel,.kw-insight-panel{border:1px solid #e5e9f4;border-radius:22px;background:#fff;box-shadow:0 12px 28px rgba(16,24,40,.05)}
.kw-table-panel{overflow:hidden}.kw-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:18px 20px;border-bottom:1px solid #edf1f7}.kw-panel-head h3,.kw-insight-panel h3{margin:0 0 5px;font-size:18px;color:#101828}.kw-panel-head p{margin:0;color:#667085;font-size:13px}
.kw-controls{display:flex;gap:10px;flex-wrap:wrap}.kw-controls select{height:42px;border:1px solid #dce3f0;border-radius:12px;padding:0 12px;background:#fff;color:#344054;font-weight:700}
.kw-table-wrap{overflow:auto;max-height:62vh}.kw-table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed;min-width:980px}.kw-table th{position:sticky;top:0;background:#f8fafc;z-index:1;padding:13px 14px;border-bottom:1px solid #e8edf5;color:#667085;font-size:12px;text-transform:uppercase;letter-spacing:.04em;text-align:left}.kw-table td{padding:15px 14px;border-bottom:1px solid #eef2f7;vertical-align:top;color:#344054}.kw-table tr:hover td{background:#fbf8ff}
.kw-table th:nth-child(1),.kw-table td:nth-child(1){width:46px}.kw-table th:nth-child(2),.kw-table td:nth-child(2){width:31%}.kw-table th:nth-child(3),.kw-table td:nth-child(3){width:24%}.kw-table th:nth-child(4),.kw-table td:nth-child(4){width:92px}.kw-table th:nth-child(5),.kw-table td:nth-child(5){width:150px}.kw-table th:nth-child(6),.kw-table td:nth-child(6){width:220px}
.kw-title-cell{display:flex;flex-direction:column;gap:7px}.kw-title-cell a{font-weight: 700;color:#101828;text-decoration:none;line-height:1.4}.kw-title-cell a:hover{color:#1d4ed8}.kw-title-cell small{color:#667085;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.kw-url{color:#1d4ed8;font-size:12px;word-break:break-all}.kw-match-list{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}.kw-match-chip{display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;background:#eaf1fe;color:#1d4ed8;font-size:12px;font-weight: 700}.kw-meta-preview{font-size:13px;color:#667085;line-height:1.5;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.kw-score{font-weight: 700;color:#101828}.kw-score-bar{height:8px;margin-top:8px;border-radius:999px;background:#eef2f7;overflow:hidden}.kw-score-bar span{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#2563eb,#3b82f6)}
.kw-badge{display:inline-flex;align-items:center;justify-content:center;padding:7px 10px;border-radius:999px;font-size:12px;font-weight: 700;white-space:nowrap}.kw-badge.duplicate{background:#fee4e2;color:#d92d20}.kw-badge.possible{background:#fff3d6;color:#dc6803}.kw-badge.related{background:#e8f1ff;color:#2563eb}.kw-badge.none{background:#eef2f7;color:#667085}.kw-ai-note{display:block;margin-top:8px;font-size:12px;color:#667085;line-height:1.45}.kw-reco{font-size:13px;line-height:1.5;color:#344054}.kw-reco strong{color:#101828}
.kw-insight-panel{padding:20px;align-self:start;position:sticky;top:18px}.kw-summary-box{padding:16px;border-radius:18px;background:linear-gradient(180deg,#f5f8fc 0%,#f7f9ff 100%);border:1px solid #e6e0ff;color:#344054;line-height:1.6}.kw-summary-box ul{margin:0;padding-left:18px}.kw-summary-box li{margin-bottom:8px}.kw-guide-box{margin-top:16px;padding:16px;border-radius:18px;border:1px solid #edf1f7;background:#fff}.kw-guide-box h4{margin:0 0 10px;color:#101828}.kw-guide-box ul{margin:0;padding-left:18px;color:#667085;line-height:1.6;font-size:13px}.kw-empty{margin:28px;border:1px dashed #d8def0;border-radius:22px;min-height:220px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;color:#667085;background:#fbfcff}.kw-empty-icon{width:54px;height:54px;border-radius:18px;background:#eaf1fe;color:#1d4ed8;display:flex;align-items:center;justify-content:center;font-size:28px;font-weight: 700}.kw-empty strong{font-size:17px;color:#101828}.kw-loading-row{text-align:center;color:#667085;padding:30px!important}.kw-error-box{padding:14px 16px;border-radius:14px;border:1px solid #fecaca;background:#fff1f2;color:#b42318;font-weight:700}
@media (max-width: 1280px){.kw-hero{grid-template-columns:1fr}.kw-layout{grid-template-columns:1fr}.kw-insight-panel{position:static}.kw-stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width: 780px){.kw-hero,.kw-search-card,.kw-result{padding:20px}.kw-stat-grid{grid-template-columns:1fr}.kw-search-row{align-items:stretch}.kw-ai-toggle,.kw-search-row .btn{width:100%;justify-content:center}.kw-panel-head{flex-direction:column}.kw-controls select{width:100%}}

/* ===== Keyword Analysis: AI intent classification polish ===== */
.kw-stat-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
.kw-stat-card.gray .kw-stat-icon{background:#eef2f7;color:#475569}
.kw-badge.not_ai{background:#f1f5f9;color:#64748b}
.kw-row-duplicate td{background:#fff7f7!important;border-bottom-color:#ffd6d6!important}
.kw-row-duplicate td:first-child{box-shadow:inset 4px 0 0 #ef4444}
.kw-row-possible td{background:#fffaf0!important;border-bottom-color:#ffe7bd!important}
.kw-row-possible td:first-child{box-shadow:inset 4px 0 0 #f59e0b}
.kw-row-none td{background:#fbfffc!important}.kw-row-none td:first-child{box-shadow:inset 4px 0 0 #22c55e}
.kw-row-related td:first-child{box-shadow:inset 4px 0 0 #3b82f6}
.kw-intent-overlap{display:block;margin-top:8px;padding:6px 8px;border-radius:10px;background:#f8fafc;border:1px solid #e6ebf3;color:#475569;font-size:12px;line-height:1.45;font-weight:700}
.kw-intent-box{padding:14px 16px;margin-bottom:14px;border-radius:16px;background:linear-gradient(180deg,#fff7ed 0%,#fff 100%);border:1px solid #fed7aa;color:#344054}
.kw-intent-box span{display:inline-flex;margin-bottom:6px;color:#c2410c;font-weight: 700;text-transform:uppercase;letter-spacing:.05em;font-size:11px}
.kw-intent-box strong{display:block;color:#101828;font-size:15px;margin-bottom:8px;line-height:1.45}
.kw-intent-box p{margin:6px 0 0!important;font-size:13px;line-height:1.55;color:#475569}
.kw-intent-box b{color:#111827}
.kw-table tr.kw-row-duplicate:hover td{background:#fff1f1!important}
.kw-table tr.kw-row-possible:hover td{background:#fff7e6!important}
@media (max-width: 1280px){.kw-stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width: 780px){.kw-stat-grid{grid-template-columns:1fr}}

/* Keyword analysis: heading + keywords + evidence */
.kw-headings{margin-top:8px;padding:8px 10px;background:#f8fafc;border:1px solid #eef0f7;border-radius:8px;font-size:12px;line-height:1.6;color:#475569}
.kw-headings b{color:#101828}
.kw-keywords{margin-top:6px;font-size:12px;color:#475569;line-height:1.5}
.kw-keywords b{color:#101828}
.kw-meta-preview b{color:#101828}
.kw-ai-evidence{display:block;margin-top:6px;font-size:11.5px;color:#1d4ed8;background:#eaf1fe;border-radius:6px;padding:5px 8px;line-height:1.45}
.kw-needs{margin:4px 0 8px 18px;font-size:12.5px;line-height:1.6}
.kw-needs li{list-style:disc}

/* ===== Keyword analysis v4 polished ===== */
.keyword-panel{overflow:hidden}
.keyword-panel .kw-stat-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:16px}
.keyword-panel .kw-stat-card{padding:18px;border-radius:20px;align-items:flex-start}
.keyword-panel .kw-stat-card > div{display:flex;flex-direction:column;gap:4px}
.keyword-panel .kw-stat-card strong{font-size:32px;line-height:1.05;letter-spacing:-.02em}
.keyword-panel .kw-stat-card small{color:#7a85a1;font-size:12px;line-height:1.45}
.keyword-panel .kw-overview-grid{display:grid;grid-template-columns:minmax(0,1.2fr) 360px;gap:18px;margin-bottom:18px}
.keyword-panel .kw-intent-panel,.keyword-panel .kw-side-card{border:1px solid #e7ebf4;border-radius:22px;background:#fff;box-shadow:0 14px 30px rgba(16,24,40,.05)}
.keyword-panel .kw-intent-panel{padding:20px}
.keyword-panel .kw-overview-side{display:flex;flex-direction:column;gap:18px}
.keyword-panel .kw-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:16px}
.keyword-panel .kw-section-head h3,.keyword-panel .kw-side-card h3{margin:0 0 6px;font-size:20px;color:#101828}
.keyword-panel .kw-section-head p,.keyword-panel .kw-side-card p{margin:0;color:#667085;font-size:13px;line-height:1.55}
.keyword-panel .kw-panel-pill{display:inline-flex;align-items:center;justify-content:center;padding:8px 12px;border-radius:999px;background:#eaf1fe;color:#1d4ed8;font-size:12px;font-weight: 700;white-space:nowrap}
.keyword-panel .kw-intent-panel-body{display:flex;flex-direction:column;gap:14px}
.keyword-panel .kw-intent-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.keyword-panel .kw-intent-card{border:1px solid #eceff5;border-radius:18px;padding:16px;background:linear-gradient(180deg,#fcfcff 0%,#f8faff 100%)}
.keyword-panel .kw-intent-card span{display:block;margin-bottom:8px;color:#7a85a1;font-size:12px;font-weight: 700;text-transform:uppercase;letter-spacing:.04em}
.keyword-panel .kw-intent-card strong{display:block;margin-bottom:8px;color:#101828;font-size:18px;line-height:1.35}
.keyword-panel .kw-intent-card p{margin:0;color:#475467;font-size:13px;line-height:1.6}
.keyword-panel .kw-intent-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.keyword-panel .kw-intent-list{border:1px solid #eceff5;border-radius:18px;padding:16px;background:#fff}
.keyword-panel .kw-intent-list h4{margin:0 0 10px;font-size:15px;color:#111827}
.keyword-panel .kw-intent-list p{margin:0;color:#667085;font-size:13px;line-height:1.6}
.keyword-panel .kw-intent-list ul{margin:0;padding-left:18px;color:#475467;font-size:13px;line-height:1.7}
.keyword-panel .kw-intent-list li{margin-bottom:6px}
.keyword-panel .kw-entity-list{display:flex;flex-wrap:wrap;gap:8px}
.keyword-panel .kw-entity-chip{display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;background:#eaf1fe;color:#1d4ed8;font-size:12px;font-weight: 700}
.keyword-panel .kw-intent-empty{padding:24px;border:1px dashed #d8def0;border-radius:18px;background:#fbfcff;text-align:center}
.keyword-panel .kw-intent-empty strong{display:block;font-size:16px;color:#101828;margin-bottom:8px}
.keyword-panel .kw-intent-empty p{margin:0;color:#667085;line-height:1.6}
.keyword-panel .kw-side-card{padding:18px 18px 16px}
.keyword-panel .kw-summary-box{padding:16px;border-radius:18px;background:linear-gradient(180deg,#f5f8fc 0%,#f7f9ff 100%);border:1px solid #e6e0ff;color:#344054;line-height:1.65}
.keyword-panel .kw-summary-box p{margin:0 0 12px}
.keyword-panel .kw-summary-box ul{margin:0;padding-left:18px}
.keyword-panel .kw-summary-box li{margin-bottom:8px}
.keyword-panel .kw-summary-mini{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:12px 0 14px}
.keyword-panel .kw-summary-mini div{border:1px solid #e7ebf4;border-radius:14px;padding:12px;background:#fff;text-align:center}
.keyword-panel .kw-summary-mini b{display:block;font-size:22px;color:#111827}
.keyword-panel .kw-summary-mini span{display:block;margin-top:4px;color:#667085;font-size:12px;font-weight:700}
.keyword-panel .kw-priority-box ol{margin:0;padding-left:18px;color:#475467;font-size:13px;line-height:1.65}
.keyword-panel .kw-priority-box li{margin-bottom:8px}
.keyword-panel .kw-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:18px}
.keyword-panel .kw-panel-head-stack{display:flex;flex-direction:column;align-items:stretch;gap:14px}
.keyword-panel .kw-filter-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.keyword-panel .kw-mini-search{height:44px;display:flex;align-items:center;gap:10px;min-width:280px;flex:1 1 320px;border:1px solid #dce3f0;border-radius:14px;padding:0 14px;background:#fff}
.keyword-panel .kw-mini-search svg{width:18px;height:18px;color:#98a2b3;flex:0 0 auto}
.keyword-panel .kw-mini-search input{border:0;outline:0;background:transparent;width:100%;height:100%;font:inherit;color:#101828}
.keyword-panel .kw-mini-search:focus-within{border-color:#3b82f6;box-shadow:0 0 0 4px rgba(29,78,216,.12)}
.keyword-panel .kw-controls{display:flex;gap:10px;flex-wrap:wrap}
.keyword-panel .kw-controls select{height:44px;min-width:210px;border:1px solid #dce3f0;border-radius:14px;padding:0 14px;background:#fff;color:#344054;font-weight:700;box-shadow:0 4px 12px rgba(16,24,40,.03)}
.keyword-panel .kw-filter-chips{display:flex;gap:10px;flex-wrap:wrap}
.keyword-panel .kw-chip{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:999px;border:1px solid #dce3f0;background:#fff;color:#344054;font-size:13px;font-weight: 700;cursor:pointer;transition:.2s ease}
.keyword-panel .kw-chip span{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 8px;border-radius:999px;background:#f4f4f5;color:#475467;font-size:12px;font-weight: 700}
.keyword-panel .kw-chip:hover{border-color:#bfdbfe;background:#f5f8fc;color:#1d4ed8}
.keyword-panel .kw-chip.active{border-color:#bfdbfe;background:#eaf1fe;color:#1d4ed8;box-shadow:0 8px 18px rgba(29,78,216,.12)}
.keyword-panel .kw-chip.active span{background:#fff;color:#1d4ed8}
.keyword-panel .kw-table-wrap{overflow:auto;max-height:68vh}
.keyword-panel .kw-table{min-width:1100px}
.keyword-panel .kw-table td{padding:16px 14px}
.keyword-panel .kw-title-cell{gap:8px}
.keyword-panel .kw-title-cell a{font-size:17px;line-height:1.4}
.keyword-panel .kw-title-cell small{font-size:13px;line-height:1.55}
.keyword-panel .kw-headings{margin-top:10px;padding:10px 12px;border-radius:12px;background:#f8fafc;border:1px solid #edf1f7;font-size:12px;line-height:1.65}
.keyword-panel .kw-keywords{margin-top:8px;font-size:12px;line-height:1.6}
.keyword-panel .kw-score-stack{display:flex;flex-direction:column;gap:8px}
.keyword-panel .kw-score-sub{font-size:12px;color:#7a85a1;font-weight:700}
.keyword-panel .kw-status-col{display:flex;flex-direction:column;gap:8px}
.keyword-panel .kw-source-note{display:inline-flex;align-items:center;align-self:flex-start;padding:4px 8px;border-radius:999px;background:#f8fafc;border:1px solid #edf1f7;color:#667085;font-size:11px;font-weight: 700}
.keyword-panel .kw-ai-note{margin-top:0;font-size:12px;line-height:1.55}
.keyword-panel .kw-ai-evidence{margin-top:0;padding:8px 10px;border-radius:10px;background:#eaf1fe;color:#1d4ed8;font-size:11.5px;line-height:1.5}
.keyword-panel .kw-intent-overlap{margin-top:0;padding:7px 9px;border-radius:10px;background:#fffaf0;border:1px solid #fde7b1;color:#b45309;font-size:12px;line-height:1.45;font-weight:700}
.keyword-panel .kw-reco strong{display:block;margin-bottom:6px}
.keyword-panel .kw-reco p{margin:0;color:#475467;line-height:1.55}
.keyword-panel .kw-insight-panel{padding:20px;align-self:start;position:sticky;top:18px}
.keyword-panel .kw-guide-box-static{margin-top:0;background:#fff}
.keyword-panel .kw-guide-box-static ul{margin:0;padding-left:18px;line-height:1.75}
.keyword-panel .kw-guide-box-static li{margin-bottom:8px}
.keyword-panel .kw-row-duplicate td{background:#fff6f6!important;border-bottom-color:#ffd9d9!important}
.keyword-panel .kw-row-duplicate td:first-child{box-shadow:inset 4px 0 0 #ef4444}
.keyword-panel .kw-row-possible td{background:#fffaf2!important;border-bottom-color:#ffe5ba!important}
.keyword-panel .kw-row-possible td:first-child{box-shadow:inset 4px 0 0 #f59e0b}
.keyword-panel .kw-row-related td{background:#f8fbff!important}
.keyword-panel .kw-row-related td:first-child{box-shadow:inset 4px 0 0 #3b82f6}
.keyword-panel .kw-row-none td{background:#f9fffb!important}
.keyword-panel .kw-row-none td:first-child{box-shadow:inset 4px 0 0 #22c55e}
.keyword-panel .kw-row-not_ai td:first-child{box-shadow:inset 4px 0 0 #94a3b8}
@media (max-width: 1360px){
  .keyword-panel .kw-stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .keyword-panel .kw-overview-grid{grid-template-columns:1fr}
  .keyword-panel .kw-layout{grid-template-columns:1fr}
  .keyword-panel .kw-insight-panel{position:static}
}
@media (max-width: 860px){
  .keyword-panel .kw-stat-grid{grid-template-columns:1fr}
  .keyword-panel .kw-intent-grid,.keyword-panel .kw-intent-columns,.keyword-panel .kw-summary-mini{grid-template-columns:1fr}
  .keyword-panel .kw-filter-bar{flex-direction:column;align-items:stretch}
  .keyword-panel .kw-controls{width:100%}
  .keyword-panel .kw-controls select{width:100%;min-width:0}
}

/* ===== Keyword Analysis V5 - match requested UI ===== */
.kw-page-v5{padding:0 0 24px;background:transparent;color:#101828}
.kw-page-v5 *{box-sizing:border-box}
.kw-v5-searchbar{display:grid;grid-template-columns:minmax(420px,1fr) auto auto;align-items:center;gap:16px;margin:0 0 8px}
.kw-v5-searchbox{height:54px;display:flex;align-items:center;gap:12px;border:1px solid #d8e0ee;border-radius:16px;background:#fff;padding:0 18px;box-shadow:0 10px 22px rgba(16,24,40,.035)}
.kw-v5-searchbox svg{width:21px;height:21px;color:#7a85a1;flex:0 0 auto}.kw-v5-searchbox input{border:0;outline:0;background:transparent;width:100%;height:100%;font:inherit;font-size:15px;font-weight:700;color:#111827}
.kw-v5-searchbox:focus-within{border-color:#3b82f6;box-shadow:0 0 0 4px rgba(29,78,216,.12),0 10px 22px rgba(16,24,40,.035)}
.kw-v5-ai-toggle{height:54px;display:flex;align-items:center;gap:10px;padding:0 18px;border-radius:15px;border:1px solid #d8e0ee;background:#fff;color:#344054;font-size:14px;font-weight: 700;white-space:nowrap;box-shadow:0 10px 22px rgba(16,24,40,.035)}
.kw-v5-ai-toggle input{width:17px;height:17px;accent-color:#2563eb}.kw-v5-primary{height:54px;display:inline-flex;align-items:center;justify-content:center;gap:10px;padding:0 22px;border:0;border-radius:15px;background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff;font-size:14px;font-weight: 700;cursor:pointer;box-shadow:0 14px 28px rgba(37,99,235,.25);white-space:nowrap}.kw-v5-primary:hover{transform:translateY(-1px);box-shadow:0 16px 32px rgba(37,99,235,.3)}.kw-v5-primary:disabled{opacity:.65;cursor:not-allowed;transform:none}
.kw-v5-hint,.kw-v5-source{margin:0;color:#667085;font-size:13px;line-height:1.5}.kw-v5-source{margin-top:4px}.kw-v5-source strong{color:#1d4ed8}.kw-v5-result{margin-top:24px}.kw-v5-stats{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:16px;margin-bottom:18px}
.kw-v5-stat{height:96px;display:flex;align-items:center;gap:14px;border:1px solid #e5e9f4;border-radius:18px;background:#fff;padding:16px 18px;box-shadow:0 10px 24px rgba(16,24,40,.045)}
.kw-v5-stat-icon{width:46px;height:46px;border-radius:16px;display:flex;align-items:center;justify-content:center;font-weight: 700;font-size:16px;flex:0 0 auto}.kw-v5-stat div{min-width:0}.kw-v5-stat span:not(.kw-v5-stat-icon){display:block;color:#667085;font-size:12px;font-weight: 700;line-height:1.25}.kw-v5-stat strong{display:block;margin-top:3px;color:#101828;font-size:28px;line-height:1;font-weight: 700;letter-spacing:-.03em}.kw-v5-stat em{display:block;margin-top:5px;font-style:normal;font-size:12px;font-weight: 700}.kw-v5-stat-total .kw-v5-stat-icon,.kw-v5-stat-ai .kw-v5-stat-icon{background:#eaf1fe;color:#1d4ed8}.kw-v5-stat-duplicate .kw-v5-stat-icon{background:#fee4e2;color:#d92d20}.kw-v5-stat-possible .kw-v5-stat-icon{background:#fff3d6;color:#dc6803}.kw-v5-stat-related .kw-v5-stat-icon{background:#e8f1ff;color:#2563eb}.kw-v5-stat-none .kw-v5-stat-icon{background:#dcfae6;color:#079455}.kw-v5-stat-total em,.kw-v5-stat-ai em{color:#1d4ed8}.kw-v5-stat-duplicate em{color:#d92d20}.kw-v5-stat-possible em{color:#dc6803}.kw-v5-stat-related em{color:#2563eb}.kw-v5-stat-none em{color:#079455}
.kw-v5-topgrid{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:18px;margin-bottom:18px}.kw-v5-intent-card,.kw-v5-side-card,.kw-v5-table-card{border:1px solid #e5e9f4;border-radius:20px;background:#fff;box-shadow:0 12px 28px rgba(16,24,40,.045)}.kw-v5-intent-card{padding:20px 20px 18px;min-height:214px}.kw-v5-card-title{display:flex;align-items:center;gap:10px;margin-bottom:12px}.kw-v5-card-title h3{margin:0;color:#101828;font-size:16px;font-weight: 700;line-height:1.2}.kw-v5-icon{width:24px;height:24px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;font-weight: 700;flex:0 0 auto}.kw-v5-icon.purple{background:#eaf1fe;color:#1d4ed8}.kw-v5-mini-badge{margin-left:4px;padding:5px 9px;border-radius:999px;background:#eaf1fe;color:#1d4ed8;font-size:11px;font-weight: 700}.kw-v5-card-desc{margin:0 0 16px;color:#667085;font-size:12.5px;line-height:1.45}.kw-v5-intent-columns{display:grid;grid-template-columns:1.1fr 1.25fr 1.15fr 1.2fr;gap:28px}.kw-v5-intent-col{min-width:0}.kw-v5-intent-col > span{display:block;margin-bottom:9px;color:#1e40af;font-size:12px;font-weight: 700}.kw-v5-intent-col strong{display:block;margin-bottom:8px;color:#1f2937;font-size:14px;font-weight: 700;line-height:1.4}.kw-v5-intent-col p{margin:0;color:#475467;font-size:13px;line-height:1.65}.kw-v5-intent-col ul{margin:0;padding-left:18px;color:#1f2937;font-size:13px;line-height:1.75}.kw-v5-intent-col li{margin-bottom:4px}.kw-v5-entity-list{display:flex;flex-wrap:wrap;gap:8px}.kw-v5-entity-list em{display:inline-flex;padding:7px 11px;border-radius:999px;background:#eaf1fe;color:#1d4ed8;font-style:normal;font-size:12px;font-weight: 700}.kw-v5-intent-empty{height:120px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;border:1px dashed #d8def0;border-radius:16px;background:#fbfcff;text-align:center}.kw-v5-intent-empty strong{color:#101828}.kw-v5-intent-empty p{margin:0;color:#667085;max-width:560px;line-height:1.55}
.kw-v5-side-card{padding:20px}.kw-v5-summary-card{align-self:stretch}.kw-v5-summary-body{font-size:14px;color:#344054;line-height:1.65}.kw-v5-summary-body p{margin:0 0 12px}.kw-v5-summary-body ul{margin:0;padding-left:18px}.kw-v5-summary-body li{margin-bottom:8px}.kw-v5-ai-summary-text{margin-top:12px!important;padding-top:12px;border-top:1px solid #edf1f7;color:#667085!important;font-size:13px}.kw-v5-contentgrid{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:18px}.kw-v5-table-card{overflow:hidden}.kw-v5-table-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px 12px;border-bottom:1px solid #edf1f7}.kw-v5-filter-left{display:flex;align-items:center;gap:12px;min-width:0;flex:1}.kw-v5-filter-label{color:#667085;font-size:13px;font-weight: 700;white-space:nowrap}.kw-v5-chips{display:flex;gap:9px;flex-wrap:wrap}.kw-v5-chip{height:38px;border:1px solid #dfe5f1;background:#fff;color:#344054;border-radius:12px;padding:0 14px;font-size:12px;font-weight: 700;cursor:pointer;transition:.18s ease;white-space:nowrap}.kw-v5-chip span{color:#667085}.kw-v5-chip:hover{border-color:#bfdbfe;color:#1d4ed8;background:#f5f8fc}.kw-v5-chip.active{border-color:#bfdbfe;background:#eaf1fe;color:#1d4ed8;box-shadow:0 8px 18px rgba(29,78,216,.12)}.kw-v5-chip.active span{color:#1d4ed8}.kw-v5-filter-right{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}.kw-v5-row-search{width:235px;height:38px;display:flex;align-items:center;gap:8px;padding:0 11px;border:1px solid #dfe5f1;border-radius:12px;background:#fff}.kw-v5-row-search svg{width:16px;height:16px;color:#98a2b3}.kw-v5-row-search input{width:100%;height:100%;border:0;outline:0;background:transparent;font-size:12px;color:#344054}.kw-v5-filter-right > span{font-size:12px;color:#667085;font-weight: 700}.kw-v5-filter-right select{height:38px;border:1px solid #dfe5f1;border-radius:12px;background:#fff;padding:0 12px;font-size:12px;font-weight: 700;color:#344054;min-width:172px}.kw-v5-hidden-select{display:none!important}.kw-v5-icon-btn{width:38px;height:38px;border:1px solid #dfe5f1;border-radius:12px;background:#fff;color:#667085;font-weight: 700;cursor:pointer}.kw-v5-table-note{margin:0;padding:0 20px 12px;color:#667085;font-size:12.5px}.kw-v5-table-wrap{overflow:auto;max-height:64vh}.kw-v5-table{width:100%;min-width:1180px;border-collapse:separate;border-spacing:0;table-layout:fixed}.kw-v5-table thead th{position:sticky;top:0;z-index:1;background:#f8fafc;padding:13px 14px;border-bottom:1px solid #e8edf5;color:#667085;font-size:12px;text-transform:none;letter-spacing:0;text-align:left;font-weight: 700}.kw-v5-table tbody td{padding:17px 14px;border-bottom:1px solid #eef2f7;vertical-align:top;color:#344054}.kw-v5-table th:nth-child(1),.kw-v5-table td:nth-child(1){width:46px}.kw-v5-table th:nth-child(2),.kw-v5-table td:nth-child(2){width:23%}.kw-v5-table th:nth-child(3),.kw-v5-table td:nth-child(3){width:18%}.kw-v5-table th:nth-child(4),.kw-v5-table td:nth-child(4){width:90px}.kw-v5-table th:nth-child(5),.kw-v5-table td:nth-child(5){width:140px}.kw-v5-table th:nth-child(6),.kw-v5-table td:nth-child(6){width:19%}.kw-v5-table th:nth-child(7),.kw-v5-table td:nth-child(7){width:15%}.kw-v5-article-cell{display:flex;flex-direction:column;gap:8px}.kw-v5-article-cell a{color:#101828;text-decoration:none;font-size:14px;font-weight: 700;line-height:1.42}.kw-v5-article-cell a:hover{color:#1d4ed8}.kw-v5-article-cell span{color:#1e40af;font-size:12px;line-height:1.4;word-break:break-all}.kw-v5-match-cell{display:flex;flex-direction:column;gap:8px}.kw-v5-match-chips{display:flex;gap:6px;flex-wrap:wrap}.kw-v5-match-chips span{display:inline-flex;align-items:center;padding:5px 8px;border-radius:999px;background:#fff0f0;color:#e11d48;font-size:11px;font-weight: 700}.kw-v5-match-cell p{margin:0;color:#667085;font-size:12px;line-height:1.55;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.kw-v5-match-cell small{display:block;color:#7a85a1;font-size:11.5px;line-height:1.5}.kw-v5-score strong{display:block;margin-bottom:8px;color:#111827;font-size:13px;font-weight: 700}.kw-v5-score div{height:7px;border-radius:999px;background:#edf1f7;overflow:hidden}.kw-v5-score div span{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#2563eb,#3b82f6)}.kw-v5-status{display:inline-flex;align-items:center;justify-content:center;padding:8px 12px;border-radius:999px;font-size:12px;font-weight: 700;white-space:nowrap}.kw-v5-status-duplicate{background:#ffe2e4;color:#dc2626}.kw-v5-status-possible{background:#fff0d8;color:#d97706}.kw-v5-status-related{background:#e8f1ff;color:#2563eb}.kw-v5-status-none{background:#dcfae6;color:#079455}.kw-v5-status-not_ai{background:#f1f5f9;color:#64748b}.kw-v5-ai-cell p{margin:0;color:#344054;font-size:12px;line-height:1.65}.kw-v5-ai-cell em{display:block;margin-top:8px;padding:7px 9px;border-radius:10px;background:#eaf1fe;color:#1d4ed8;font-style:normal;font-size:11.5px;line-height:1.45}.kw-v5-reco{position:relative;padding-right:26px;color:#b42318;font-size:12px;line-height:1.55}.kw-v5-reco strong{display:block;margin-bottom:5px;color:#b42318}.kw-v5-reco p{margin:0}.kw-v5-reco button{position:absolute;right:0;top:0;border:0;background:transparent;color:#b42318;font-size:20px;cursor:pointer;line-height:1}.kw-v5-row-duplicate td{background:#fff6f6!important;border-bottom-color:#ffdada!important}.kw-v5-row-possible td{background:#fffaf0!important;border-bottom-color:#ffe6b7!important}.kw-v5-row-related td{background:#fbfdff!important}.kw-v5-row-none td{background:#fbfffc!important}.kw-v5-row-duplicate td:first-child{box-shadow:inset 4px 0 0 #ef4444}.kw-v5-row-possible td:first-child{box-shadow:inset 4px 0 0 #f59e0b}.kw-v5-row-related td:first-child{box-shadow:inset 4px 0 0 #3b82f6}.kw-v5-row-none td:first-child{box-shadow:inset 4px 0 0 #22c55e}.kw-v5-empty-row{text-align:center!important;padding:34px!important;color:#667085!important}.kw-v5-rightstack{display:flex;flex-direction:column;gap:18px}.kw-v5-priority-box ol,.kw-v5-tip-list{margin:0;padding-left:18px;color:#344054;font-size:13px;line-height:1.75}.kw-v5-priority-box li,.kw-v5-tip-list li{margin-bottom:8px}.kw-v5-history-title button{margin-left:auto;border:0;background:transparent;color:#1d4ed8;font-size:12px;font-weight: 700;cursor:pointer}.kw-v5-history-list{display:flex;flex-direction:column;gap:10px}.kw-v5-history-item{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;border:0;background:#fff;border-radius:12px;padding:10px 0;text-align:left;cursor:pointer}.kw-v5-history-item span{display:flex;flex-direction:column;gap:4px}.kw-v5-history-item b{color:#101828;font-size:13px}.kw-v5-history-item small{color:#667085;font-size:12px}.kw-v5-history-item em{font-style:normal;border-radius:999px;background:#dcfae6;color:#079455;font-size:11px;font-weight: 700;padding:5px 8px;white-space:nowrap}.kw-v5-muted{margin:0;color:#667085;font-size:13px}.kw-v5-empty{min-height:240px;margin-top:24px;border:1px dashed #d8def0;border-radius:22px;background:#fbfcff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;text-align:center;color:#667085}.kw-v5-empty-icon{width:58px;height:58px;border-radius:18px;background:#eaf1fe;color:#1d4ed8;display:flex;align-items:center;justify-content:center;font-size:30px;font-weight: 700}.kw-v5-empty strong{color:#101828;font-size:17px}.kw-v5-empty span{max-width:520px;line-height:1.55}.kw-error-box{padding:14px 16px;border-radius:14px;border:1px solid #fecaca;background:#fff1f2;color:#b42318;font-weight: 700}
@media (max-width:1500px){.kw-v5-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.kw-v5-topgrid,.kw-v5-contentgrid{grid-template-columns:1fr}.kw-v5-rightstack{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.kw-v5-intent-columns{grid-template-columns:repeat(2,minmax(0,1fr))}.kw-v5-table-head{align-items:flex-start;flex-direction:column}.kw-v5-filter-right{width:100%;justify-content:flex-start}}
@media (max-width:980px){.kw-v5-searchbar{grid-template-columns:1fr}.kw-v5-ai-toggle,.kw-v5-primary{width:100%;justify-content:center}.kw-v5-stats,.kw-v5-rightstack{grid-template-columns:1fr}.kw-v5-intent-columns{grid-template-columns:1fr}.kw-v5-row-search{width:100%}.kw-v5-filter-right select{width:100%}}


/* --- Bổ sung: khóa sơ đồ liên kết nội bộ --- */
#inlinkVizLockBtn.active{
  background: var(--primary-soft);
  border-color: #c9b8f5;
  color: var(--primary);
}
.viz-canvas.mm-scroll.is-locked{
  cursor: default;
}
.viz-canvas.mm-scroll.is-locked .mm-node{
  cursor: default;
}
.viz-canvas.mm-scroll.is-locked .mm-node:hover{
  box-shadow: 0 3px 10px rgba(20,16,52,.06);
  transform: none;
}
.viz-canvas.mm-scroll.is-locked::after{
  content: 'Sơ đồ đang khóa · bấm “Mở khóa sơ đồ” để thao tác';
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 12;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(17,24,39,.78);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

/* --- Bổ sung: bảng Sức khỏe link cuộn độc lập --- */
#healthPanel .health-table-wrap{
  max-height: 560px;
  overflow: auto;
}
#healthPanel .health-table-wrap table{
  min-width: 1280px;
}
#healthPanel .health-table-wrap thead th{
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fafafa;
}


/* --- Bổ sung: cảnh báo bài có nhiều anchor cùng trỏ về một pillar --- */
#healthPanel .health-row-warning td{
  background: #fff5f5 !important;
  border-bottom-color: #fecaca !important;
}
#healthPanel .health-row-warning td:first-child{
  box-shadow: inset 4px 0 0 #ef4444;
}
#healthPanel .anchor-more.warn{
  background: #fee2e2;
  color: #b42318;
  border-color: #fecaca;
}
#healthPanel .pillar-total{
  display:inline-block;
  margin-left:3px;
  color:#b42318;
  font-size:11px;
  font-weight: 700;
}

/* Draft list: rows saved for later automation */
.health-draft-summary{
  display:flex;
  align-items:center;
  gap:12px;
  margin:0 16px 12px;
  padding:11px 13px;
  border:1px solid #e2e8f0;
  border-radius:10px;
  background:#fbfcff;
  color:#667085;
  font-size:12px;
}
.health-draft-summary[hidden]{display:none!important}
.health-draft-summary strong{color:#344054;font-size:12.5px}
.health-draft-summary .btn{margin-left:auto;white-space:nowrap}
.health-draft-col{width:92px;text-align:center!important}
.health-check-label{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;cursor:pointer}
.health-draft-check,#healthDraftSelectAll{
  width:16px;
  height:16px;
  margin:0;
  accent-color:#2563eb;
  cursor:pointer;
}
#healthPanel .health-row-marked td{
  background:#fffaf0!important;
  border-bottom-color:#fde7b0!important;
}
#healthPanel .health-row-marked td:first-child{box-shadow:inset 4px 0 0 #f59e0b}
@media(max-width:720px){
  .health-draft-summary{align-items:flex-start;flex-wrap:wrap}
  .health-draft-summary .btn{width:100%;margin-left:0}
}

/* --- Nút hành động tài khoản --- */
.ws-add{
  width:34px;
  height:36px;
  border:1px solid #dfe5f1;
  border-radius:11px;
  background:#fff;
  color:#1d4ed8;
  font-size:18px;
  font-weight: 700;
  cursor:pointer;
}
.ws-add:hover{background:var(--primary-soft);border-color:#c9b8f5;}

/* ---------- Đăng nhập và quản lý tài khoản ---------- */
.login-overlay{
  position:fixed; inset:0; z-index:99999; display:flex; align-items:center; justify-content:center;
  background:radial-gradient(900px 360px at 80% 0%, rgba(29,78,216,.18), transparent 55%), rgba(15,23,42,.62);
  backdrop-filter: blur(8px);
  padding:24px;
}
.login-card{
  width:min(430px, 100%); background:#fff; border:1px solid var(--line); border-radius:24px;
  box-shadow:0 24px 70px rgba(17,24,39,.28); padding:28px; display:grid; gap:14px;
}
.login-logo{width:52px;height:52px;border-radius:16px;background:linear-gradient(135deg,#3b82f6,#06b6d4);color:#fff;display:flex;align-items:center;justify-content:center;font-size:24px;font-weight: 700;box-shadow:0 12px 28px rgba(29,78,216,.28)}
.login-card h2{margin:4px 0 0;color:#101828;font-size:22px;letter-spacing:-.02em}.login-card p{margin:0;color:#667085;font-size:13px;line-height:1.55}.login-card label{display:grid;gap:7px;color:#344054;font-size:13px;font-weight: 700}.login-card input{height:42px;border:1px solid #dfe5f1;border-radius:12px;padding:0 13px;font-size:14px;outline:none}.login-card input:focus{border-color:#93c5fd;box-shadow:0 0 0 4px rgba(37,99,235,.08)}.login-card .btn{height:44px;justify-content:center}.login-card small{color:#667085;font-size:12px;line-height:1.5}.login-error{padding:10px 12px;border-radius:12px;background:#fff1f2;border:1px solid #fecaca;color:#b42318;font-size:13px;font-weight:700;line-height:1.45}
.auth-userbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.auth-user-name{display:inline-flex;align-items:center;height:38px;padding:0 12px;border-radius:12px;background:#fff;border:1px solid var(--line);color:#344054;font-size:12px;font-weight: 700}.ws-wide{width:auto!important;padding:0 10px!important;font-size:12px!important}.ws-add.danger{color:#b42318;border-color:#fecaca;background:#fff7f7}.ws-add.danger:hover{background:#fff1f2;color:#dc2626}.member-modal{position:fixed;inset:0;z-index:99998;background:rgba(15,23,42,.48);backdrop-filter:blur(5px);display:flex;align-items:center;justify-content:center;padding:22px}.member-card{width:min(860px,calc(100vw - 32px));max-height:88vh;overflow:auto;background:#fff;border:1px solid var(--line);border-radius:22px;box-shadow:0 24px 70px rgba(17,24,39,.25)}.member-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:22px 24px;border-bottom:1px solid var(--line)}.member-head h3{margin:0;color:#101828;font-size:20px}.member-head p{margin:5px 0 0;color:#667085;font-size:13px;line-height:1.5}.member-body{padding:22px 24px;display:grid;gap:18px}.member-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.member-box{border:1px solid #edf1f7;border-radius:16px;padding:16px;background:#fbfcff;display:grid;gap:10px}.member-box h4,.member-body h4{margin:0;color:#101828}.member-box input,.member-box select{height:40px;border:1px solid #dfe5f1;border-radius:12px;background:#fff;padding:0 12px;outline:none}.member-list{display:grid;gap:8px}.member-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #edf1f7;border-radius:14px;padding:12px;background:#fff}.member-row div{display:flex;flex-direction:column;gap:3px;min-width:0}.member-row b{color:#101828;font-size:14px}.member-row span{color:#667085;font-size:12px}.member-row em{font-style:normal;border-radius:999px;background:#eaf1fe;color:#1d4ed8;font-size:12px;font-weight: 700;padding:6px 10px;text-transform:uppercase}.member-row .ws-add{flex:none}
@media(max-width:900px){.member-grid{grid-template-columns:1fr}.auth-userbar{width:100%}.member-row{align-items:flex-start;flex-direction:column}}

/* ============================================================
   ACCOUNT-BASED STORAGE — không hiển thị Workspace / Project
   ============================================================ */
.account-admin-nav{
  margin-top:8px;
  border-top:1px solid rgba(255,255,255,.08);
  border-radius:0 0 11px 11px;
  padding-top:14px;
}
.account-userbar{
  margin-left:auto;
  padding:6px 8px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,.82);
  box-shadow:var(--shadow-soft);
}
.account-user-summary{display:flex;align-items:center;gap:9px;padding-right:4px}
.account-user-summary>div{display:flex;flex-direction:column;gap:2px;min-width:0}
.account-user-summary strong{font-size:12px;color:#101828;white-space:nowrap}
.account-user-summary small{font-size:10.5px;color:#667085;white-space:nowrap}
.account-avatar{
  width:34px;height:34px;border-radius:11px;display:inline-flex;align-items:center;justify-content:center;
  flex:none;background:linear-gradient(135deg,#2563eb,#06b6d4);color:#fff;font-weight: 700;font-size:14px;
  box-shadow:0 7px 16px rgba(29,78,216,.22)
}
.account-avatar.sm{width:32px;height:32px;border-radius:10px;font-size:13px;box-shadow:none}
.account-manager-card{width:min(1180px,calc(100vw - 32px));max-height:92vh}
.account-create-section,.account-list-section{display:grid;gap:14px}
.account-create-section{padding:16px;border:1px solid #e8e1ff;border-radius:18px;background:linear-gradient(135deg,#fbf9ff,#f7fbff)}
.account-section-title{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.account-section-title h4{margin:0;color:#101828;font-size:15px}
.account-section-title p{margin:5px 0 0;color:#667085;font-size:12.5px;line-height:1.5}
.account-create-form{display:grid;grid-template-columns:1.2fr 1fr 1fr 150px auto;gap:10px;align-items:end}
.account-create-form label{display:grid;gap:6px;color:#344054;font-size:11px;font-weight: 700}
.account-create-form input,.account-create-form select,.account-table input,.account-table select{
  height:40px;border:1px solid #dfe5f1;border-radius:11px;background:#fff;color:#101828;padding:0 11px;outline:none;font-size:12px
}
.account-create-form input:focus,.account-create-form select:focus,.account-table input:focus,.account-table select:focus{
  border-color:#93c5fd;box-shadow:0 0 0 4px rgba(37,99,235,.08)
}
.account-create-form .btn{height:40px;white-space:nowrap}
.account-role-note{color:#667085;font-size:11.5px;line-height:1.6}
.account-table-wrap{border:1px solid #e8edf5;border-radius:16px;overflow:auto;max-height:52vh}
.account-table{min-width:1040px;table-layout:fixed}
.account-table th{position:sticky;top:0;z-index:2;background:#f8fafc;text-transform:none;letter-spacing:0;font-size:11px}
.account-table th:nth-child(1){width:230px}.account-table th:nth-child(2){width:115px}.account-table th:nth-child(3){width:105px}.account-table th:nth-child(4){width:190px}.account-table th:nth-child(5){width:165px}.account-table th:nth-child(6){width:260px}
.account-table td{vertical-align:middle;padding:12px 10px}
.account-identity{display:flex;align-items:center;gap:9px;min-width:0}
.account-identity>div{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}
.account-identity input{width:100%;height:34px;font-weight: 700;padding:0 8px}
.account-identity input[readonly]{border-color:transparent;background:transparent;padding:0;height:auto}
.account-identity small{color:#667085;font-size:10.5px}
.account-role{width:100%;height:34px!important}
.account-status{display:inline-flex;align-items:center;justify-content:center;padding:6px 9px;border-radius:999px;font-size:10.5px;font-weight: 700;white-space:nowrap}
.account-status.on{background:#dcfae6;color:#067647}.account-status.off{background:#fee2e2;color:#b42318}
.account-data-stats{display:flex;gap:5px;flex-wrap:wrap}
.account-data-stats span{padding:5px 7px;border-radius:8px;background:#f3f4f8;color:#475467;font-size:10.5px;font-weight:700}
.account-actions{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.account-actions .btn{padding:7px 9px;font-size:10.5px;min-height:32px}
.account-row-locked td{background:#fff8f8!important;color:#667085}
body.role-viewer #newPostBtn,
body.role-viewer #newUpdateBtn,
body.role-viewer #syncSheetTopBtn,
body.role-viewer #bulkRunBtn,
body.role-viewer #bulkUpdateRunBtn,
body.role-viewer #inlinksImportForm button[type="submit"],
body.role-viewer #pagesImportForm button[type="submit"]{
  opacity:.48;pointer-events:none;filter:grayscale(.3)
}
@media(max-width:1380px){
  .topbar{flex-wrap:wrap}.account-userbar{margin-left:0}.top-actions{margin-left:auto}
  .account-create-form{grid-template-columns:repeat(2,minmax(0,1fr))}.account-create-form .btn{grid-column:1/-1}
}
@media(max-width:760px){
  .account-userbar{width:100%;justify-content:space-between}.account-user-summary{flex:1}
  .account-create-form{grid-template-columns:1fr}.account-create-form .btn{grid-column:auto}
  .account-manager-modal{padding:0}.account-manager-card{width:100vw;max-height:100vh;height:100vh;border-radius:0}
}

/* ============================================================
   ACCOUNT CENTER V2 — tự quản lý cho mọi tài khoản + quyền CMS
   ============================================================ */
#authUserBar{display:none!important}
.account-self-section{
  display:flex;align-items:center;justify-content:space-between;gap:18px;
  padding:18px;border:1px solid #e6e9f2;border-radius:18px;background:linear-gradient(135deg,#fbf9ff,#f7fbff)
}
.account-self-main{display:flex;align-items:center;gap:14px;min-width:0}
.account-avatar-lg{width:48px;height:48px;border-radius:15px;font-size:18px}
.account-self-info{display:flex;flex-direction:column;gap:4px;min-width:0}
.account-self-info h4{margin:0;color:#101828;font-size:16px}
.account-self-info p{margin:0;color:#667085;font-size:12px}
.account-self-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.account-cms-badge{display:inline-flex;align-items:center;width:max-content;padding:6px 9px;border-radius:999px;font-size:10.5px;font-weight: 700}
.account-cms-badge.on{background:#dcfae6;color:#067647}
.account-cms-badge.off{background:#f1f5f9;color:#667085}
.account-checkbox{display:flex;align-items:center;gap:7px;height:40px;padding:0 11px;border:1px solid #dfe5f1;border-radius:11px;background:#fff;color:#344054;font-size:11.5px;font-weight:700}
.account-checkbox input{width:16px;height:16px;margin:0;accent-color:#1d4ed8}
.account-cms-create{min-width:160px}
.account-cms-switch{display:flex;align-items:center;gap:7px;color:#344054;font-size:10.5px;font-weight: 700;white-space:nowrap}
.account-cms-switch input{width:16px;height:16px;accent-color:#1d4ed8}
.account-table-cms{min-width:1180px}
.account-table-cms th:nth-child(1){width:220px}
.account-table-cms th:nth-child(2){width:105px}
.account-table-cms th:nth-child(3){width:150px}
.account-table-cms th:nth-child(4){width:100px}
.account-table-cms th:nth-child(5){width:190px}
.account-table-cms th:nth-child(6){width:160px}
.account-table-cms th:nth-child(7){width:250px}
.account-create-form.has-cms-option{grid-template-columns:1.15fr .9fr .95fr 135px 170px auto}
@media(max-width:1380px){.account-create-form.has-cms-option{grid-template-columns:repeat(3,minmax(0,1fr))}.account-create-form.has-cms-option .btn{grid-column:auto}}
@media(max-width:760px){.account-self-section{align-items:flex-start;flex-direction:column}.account-self-actions{width:100%}.account-self-actions .btn{flex:1}.account-create-form.has-cms-option{grid-template-columns:1fr}}


/* AUTH FIX V3: form đăng nhập luôn tồn tại trong HTML */
.login-overlay[hidden]{display:none!important}
.login-checking{padding:9px 11px;border-radius:11px;background:#eaf1fe;color:#1d4ed8;font-size:12px;font-weight:700}
.login-checking[hidden],.login-error[hidden]{display:none!important}
body.auth-pending .shell,body.is-unauthenticated .shell{visibility:hidden;pointer-events:none;user-select:none}
body.is-authenticated .shell{visibility:visible}
body.auth-pending .login-overlay,body.is-unauthenticated .login-overlay{display:flex}
body.is-authenticated .login-overlay{display:none!important}


/* AUTH FIX V4: bắt buộc xác thực + luôn hiển thị mục quản lý tài khoản sau đăng nhập */
body.auth-pending .shell,
body.is-unauthenticated .shell{
  display:none!important;
}
body.is-authenticated .shell{
  display:flex!important;
  visibility:visible!important;
}
body.auth-pending #accountManagementBtn,
body.is-unauthenticated #accountManagementBtn{
  display:none!important;
}
body.is-authenticated #accountManagementBtn{
  display:flex!important;
  visibility:visible!important;
}
#accountManagementBtn[hidden]{display:none!important}
body.is-authenticated #accountManagementBtn:not([hidden]){display:flex!important}

/* ============================================================
   INTERNAL LINK INSIGHTS — Vị trí/ngữ cảnh + Cơ hội thêm link
   ============================================================ */
.link-insight-panel .panel-head{align-items:flex-start}
.link-insight-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.link-insight-actions .search-box{min-width:290px}
.link-insight-actions select{min-width:170px}
.link-insight-status{margin:0;padding:13px 20px;border-bottom:1px solid var(--line);background:#fbfcff;color:#667085;font-size:13px}
.link-insight-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:16px 20px;border-bottom:1px solid var(--line)}
.link-insight-stat{padding:14px 16px;border:1px solid #e6e9f2;border-radius:14px;background:linear-gradient(180deg,#fff,#fafbff)}
.link-insight-stat span{display:block;color:#667085;font-size:12px;font-weight: 700}
.link-insight-stat strong{display:block;margin-top:5px;color:#101828;font-size:22px;line-height:1.2}
.link-insight-stat em{display:block;margin-top:5px;color:#8a94a8;font-size:11.5px;font-style:normal;line-height:1.4}
.link-insight-table-wrap{max-height:560px;overflow:auto}
.link-insight-table{min-width:1500px;table-layout:fixed}
.link-insight-table thead th{position:sticky;top:0;z-index:3;background:#f8fafc}
.link-insight-table th:nth-child(1),.link-insight-table td:nth-child(1){width:48px}
.link-insight-table th:nth-child(2),.link-insight-table td:nth-child(2){width:260px}
.link-insight-table th:nth-child(3),.link-insight-table td:nth-child(3){width:180px}
.link-insight-table th:nth-child(4),.link-insight-table td:nth-child(4){width:140px}
.link-insight-table th:nth-child(5),.link-insight-table td:nth-child(5){width:220px}
.link-insight-table th:nth-child(6),.link-insight-table td:nth-child(6){width:auto}
.link-insight-table th:nth-child(7),.link-insight-table td:nth-child(7){width:100px}
.link-insight-table th:nth-child(8),.link-insight-table td:nth-child(8){width:220px}
.link-insight-table td{vertical-align:middle}
.link-insight-table .src-cell a{display:block;color:#172033;font-weight: 700;text-decoration:none;line-height:1.42}
.link-insight-table .src-cell a:hover{color:#1d4ed8}
.link-insight-table .src-cell span{display:block;margin-top:4px;color:#8a94a8;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.context-anchor,.suggested-anchor{color:#172033;font-size:13px;line-height:1.5}
.suggested-anchor{color:#1d4ed8}
.insight-warning{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin-left:7px;border-radius:50%;background:#fee2e2;color:#dc2626;font-size:11px;font-weight: 700}
.location-pill{display:inline-flex;align-items:center;padding:6px 9px;border-radius:999px;background:#eef2ff;color:#1e40af;font-size:11.5px;font-weight: 700}
.link-insight-table td small{display:block;margin-top:5px;color:#8a94a8;font-size:10.5px;line-height:1.35}
.insight-clamp{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;color:#344054;font-size:12px;line-height:1.55}
.context-sentence mark,.link-detail-context mark,.link-detail-preview mark{padding:1px 4px;border-radius:5px;background:#fff1a8;color:#5f4500;font-weight: 700}
.insight-score-wrap{display:flex;flex-direction:column;align-items:flex-start}
.insight-score{display:inline-flex;align-items:center;justify-content:center;min-width:42px;height:30px;border-radius:9px;font-size:13px;font-weight: 700}
.insight-score-good{background:#dcfae6;color:#079455}
.insight-score-review{background:#fff0d8;color:#d97706}
.insight-score-bad{background:#ffe4e6;color:#e11d48}
.opportunity-table{min-width:1320px}
.opportunity-table th:nth-child(1),.opportunity-table td:nth-child(1){width:48px}
.opportunity-table th:nth-child(2),.opportunity-table td:nth-child(2){width:265px}
.opportunity-table th:nth-child(3),.opportunity-table td:nth-child(3){width:150px}
.opportunity-table th:nth-child(4),.opportunity-table td:nth-child(4){width:210px}
.opportunity-table th:nth-child(5),.opportunity-table td:nth-child(5){width:170px}
.opportunity-table th:nth-child(6),.opportunity-table td:nth-child(6){width:auto}
.opportunity-table th:nth-child(7),.opportunity-table td:nth-child(7){width:190px}
.opportunity-score strong{font-size:15px;color:#111827}
.opportunity-score>div{height:7px;margin-top:7px;border-radius:999px;background:#edf1f7;overflow:hidden}
.opportunity-score>div span{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#2563eb,#06b6d4)}
.opportunity-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.link-insight-modal{z-index:10080!important}
.link-insight-modal-card{width:min(860px,calc(100vw - 32px));max-height:90vh;overflow:hidden}
.link-insight-modal-body{overflow:auto;max-height:calc(90vh - 170px)}
.link-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:16px}
.link-detail-grid>div{padding:13px 14px;border:1px solid #e5e7ef;border-radius:13px;background:#fafbff}
.link-detail-grid .span-2{grid-column:span 2}
.link-detail-grid span{display:block;color:#7a85a1;font-size:11px;font-weight: 700;text-transform:uppercase;letter-spacing:.04em}
.link-detail-grid strong{display:block;margin-top:6px;color:#101828;font-size:13px;line-height:1.55}
.link-detail-context,.link-detail-preview{margin-top:14px;padding:16px;border:1px solid #e7eaf2;border-radius:15px;background:#fff}
.link-detail-preview{background:#f5f8fc;border-color:#c7d6f5}
.link-detail-context h4,.link-detail-preview h4{margin:0 0 9px;color:#172033;font-size:13px}
.link-detail-context p,.link-detail-preview p{margin:0;color:#344054;font-size:13px;line-height:1.75}
.preview-arrow{margin-top:12px;padding-top:11px;border-top:1px dashed #cfc7f7;color:#667085;font-size:12px;word-break:break-all}

@media (max-width:1200px){
  .link-insight-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .link-insight-actions{justify-content:flex-start;width:100%}
  .link-insight-panel .panel-head{flex-direction:column}
}
@media (max-width:720px){
  .link-insight-summary{grid-template-columns:1fr}
  .link-insight-actions .search-box,.link-insight-actions select,.link-insight-actions .btn{width:100%;min-width:0}
  .link-detail-grid{grid-template-columns:1fr}
  .link-detail-grid .span-2{grid-column:auto}
  .link-insight-modal-card{width:100vw;height:100vh;max-height:100vh;border-radius:0}
  .link-insight-modal-body{max-height:calc(100vh - 170px)}
}


/* INTERNAL LINK CHANGE EDITOR V8 */
.basket-actions{display:flex;align-items:center;gap:7px;justify-content:flex-end;white-space:nowrap;max-width:100%}
.basket-actions .btn{padding:7px 10px}
.link-change-editor-modal{z-index:10120!important}
.link-change-editor-card{width:min(820px,calc(100vw - 32px));max-height:92vh;overflow:hidden}
.link-change-editor-body{overflow:auto;max-height:calc(92vh - 170px)}
.link-change-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
.link-change-form label{display:grid;gap:7px;color:#344054;font-size:12px;font-weight: 700}
.link-change-form .span-2{grid-column:span 2}
.link-change-form input,.link-change-form select,.link-change-form textarea,.link-change-ai-box textarea{width:100%;box-sizing:border-box;border:1px solid #dfe5f1;border-radius:12px;background:#fff;color:#101828;padding:11px 12px;outline:none;font:inherit}
.link-change-form input,.link-change-form select{height:42px;padding-top:0;padding-bottom:0}
.link-change-form textarea,.link-change-ai-box textarea{resize:vertical;line-height:1.55}
.link-change-form input:focus,.link-change-form select:focus,.link-change-ai-box textarea:focus{border-color:#93c5fd;box-shadow:0 0 0 4px rgba(37,99,235,.08)}
.link-change-form input[readonly],.link-change-form textarea[readonly]{background:#f8fafc;color:#667085}
.link-change-ai-box{margin-top:18px;padding:16px;border:1px solid #ded7ff;border-radius:16px;background:linear-gradient(135deg,#fbf9ff,#f7fbff)}
.link-change-ai-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:12px}
.link-change-ai-head strong{display:block;color:#101828;font-size:14px}.link-change-ai-head p{margin:5px 0 0;color:#667085;font-size:12px;line-height:1.5}
.link-change-ai-head .btn{flex:none}
@media(max-width:720px){.link-change-form{grid-template-columns:1fr}.link-change-form .span-2{grid-column:auto}.link-change-ai-head{flex-direction:column}.link-change-ai-head .btn{width:100%}.link-change-editor-card{width:100vw;height:100vh;max-height:100vh;border-radius:0}.link-change-editor-body{max-height:calc(100vh - 170px)}}

/* INTERNAL LINK CONTEXT EDITOR V9 */
.link-change-form-v9{grid-template-columns:minmax(230px,.75fr) minmax(0,1.25fr)}
.link-change-current-value{display:flex;flex-direction:column;gap:7px;min-width:0}
.link-change-current-value>span,.link-change-field-label{color:#344054;font-size:12px;font-weight: 700}
.link-change-current-value>strong{display:flex;align-items:center;min-height:42px;padding:10px 12px;border:1px solid #dfe5f1;border-radius:12px;background:#f8fafc;color:#101828;font-size:13px;line-height:1.45;word-break:break-word}
.link-change-context-block{display:grid;gap:8px}
.link-change-original-context,.link-change-editable-context{min-height:104px;padding:16px 18px;border:1px solid #dfe5f1;border-radius:15px;background:#f8fafc;color:#344054;font-size:14px;line-height:1.75;white-space:pre-wrap;word-break:break-word}
.link-change-original-context mark{background:#fde68a;color:#713f12;border-radius:4px;padding:1px 3px;font-weight: 700}
.link-change-edit-block{margin-top:4px;padding:16px;border:1px solid #ded7ff;border-radius:18px;background:linear-gradient(135deg,#fcfbff,#f8fbff)}
.link-change-edit-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.link-change-edit-head>div{min-width:0}.link-change-edit-head p{margin:5px 0 0;color:#667085;font-size:12px;line-height:1.55}
.link-change-edit-head .btn{flex:none}
.link-change-editable-context{min-height:150px;background:#fff;outline:none;cursor:text;white-space:normal}
.link-change-editable-context:focus{border-color:#93c5fd;box-shadow:0 0 0 4px rgba(37,99,235,.08)}
.link-change-editable-context a{display:inline;border-radius:4px;background:#fff1a8;color:#684300;text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:2px;font-weight: 700;cursor:pointer;padding:1px 3px}
.link-change-editable-context a:hover{background:#fde68a;box-shadow:0 0 0 3px rgba(245,158,11,.13)}
.link-change-inline-editor{display:grid;grid-template-columns:minmax(0,.75fr) minmax(0,1.25fr) auto;gap:10px;align-items:end;margin-top:12px;padding:12px;border:1px solid #d8cfff;border-radius:14px;background:#fff}
.link-change-inline-editor[hidden]{display:none!important}
.link-change-inline-editor label{display:grid;gap:6px;color:#475467;font-size:11px;font-weight: 700}
.link-change-inline-editor input{width:100%;height:40px;box-sizing:border-box;border:1px solid #dfe5f1;border-radius:10px;padding:0 11px;color:#101828;outline:none}
.link-change-inline-editor input:focus{border-color:#93c5fd;box-shadow:0 0 0 3px rgba(37,99,235,.08)}
.link-change-inline-actions{display:flex;gap:7px;align-items:center}
.link-change-ai-state{min-height:18px;margin:10px 2px 0!important;line-height:1.5}
@media(max-width:720px){
  .link-change-form-v9{grid-template-columns:1fr}
  .link-change-form-v9 .span-2{grid-column:auto}
  .link-change-edit-head{flex-direction:column}.link-change-edit-head .btn{width:100%}
  .link-change-inline-editor{grid-template-columns:1fr}.link-change-inline-actions{justify-content:flex-end}
}

/* INTERNAL LINK EDITOR MODAL — scoped v10 */
.il-editor-modal{
  background:rgba(28,32,58,.58);
  backdrop-filter:blur(5px);
}
.il-editor-card{
  width:min(1420px,calc(100vw - 64px));
  max-height:calc(100vh - 48px);
  border-radius:18px;
  overflow:hidden;
  border:1px solid rgba(215,220,235,.95);
  box-shadow:0 24px 70px rgba(24,28,50,.26);
}
.il-editor-head{
  padding:24px 28px 12px;
  border-bottom:0;
  position:relative;
}
.il-editor-head .icon-btn{
  position:absolute;
  top:20px;
  right:24px;
  width:38px;
  height:38px;
}
.il-editor-head .drawer-eyebrow{
  display:inline-flex;
  align-items:center;
  gap:7px;
  width:max-content;
  padding:6px 12px;
  border:1px solid #e4d8ff;
  border-radius:999px;
  background:#fbf8ff;
  color:#1d4ed8;
  font-size:12px;
  font-weight: 700;
  letter-spacing:.03em;
  text-transform:uppercase;
}
.il-editor-head h3{
  margin-top:12px;
  font-size:28px;
  line-height:1.18;
  letter-spacing:0;
}
.il-editor-head .matched-url{
  margin-top:9px;
  color:#5b6478;
  font-size:13.5px;
}
.il-editor-body{
  max-height:calc(100vh - 210px);
  padding:0 28px 22px;
  overflow:auto;
}
.il-editor-layout{
  display:grid;
  grid-template-columns:minmax(0,1.9fr) minmax(360px,.9fr);
  gap:26px;
  align-items:start;
}
.il-editor-main,.il-editor-sidebar{
  display:grid;
  gap:18px;
  min-width:0;
}
.il-editor-main{overflow:hidden}
.il-editor-sidebar{position:sticky;top:0}
.il-source-meta{display:grid;gap:7px;color:#64708a;font-size:13px}
.il-source-meta p{margin:0;color:#18223a;font-size:14px}
.il-source-meta p strong{font-weight: 700}
.il-source-meta a{color:#1e40af;font-weight: 700;text-decoration:none}
.il-source-meta a:after{content:"↗";margin-left:7px;font-size:12px}
.il-source-meta .matched-url{color:#5b6478;font-size:13px;word-break:break-word}
.il-original-block,.il-content-editor,.il-anchor-panel,.il-ai-panel{
  border:1px solid #dde4f2;
  border-radius:12px;
  background:#fff;
}
.il-original-block,.il-content-editor{
  padding:0;
  border:0;
  background:transparent;
}
.il-original-block h4,.il-content-editor h4,.il-anchor-panel h4,.il-ai-panel h4{
  margin:0 0 12px;
  font-size:15px;
  color:#18223a;
  font-weight: 700;
  letter-spacing:0;
}
.il-original-block .link-change-original-context{
  min-height:96px;
  padding:18px 20px;
  border:1px solid #dbe3f1;
  border-radius:12px;
  background:#fff;
  color:#24304a;
  font-size:15px;
  line-height:1.8;
  box-shadow:0 1px 1px rgba(16,24,40,.02);
}
.il-original-block .link-change-original-context mark{
  background:#fde9a8;
  color:#5f4308;
  border-radius:5px;
  padding:1px 5px;
  font-weight: 700;
}
.il-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:12px;
}
.il-editor-toolbar{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:4px;
  border:1px solid #e2e8f4;
  border-radius:10px;
  background:#fff;
}
.il-editor-toolbar button{
  min-width:32px;
  height:30px;
  display:grid;
  place-items:center;
  border:0;
  border-radius:7px;
  background:transparent;
  color:#24304a;
  cursor:pointer;
  font:inherit;
}
.il-editor-toolbar button:hover{background:#f3f0ff;color:#1d4ed8}
.il-content-editor .link-change-editable-context{
  min-height:220px;
  max-height:360px;
  padding:20px 22px;
  border:1px solid #dbe3f1;
  border-radius:12px;
  background:#fff;
  color:#18223a;
  font-size:15px;
  line-height:1.85;
  outline:none;
  white-space:normal;
  max-width:100%;
  overflow:auto;
  overscroll-behavior:contain;
  box-shadow:0 1px 1px rgba(16,24,40,.02);
}
.il-content-editor .link-change-editable-context table{
  max-width:none;
}
.il-content-editor .link-change-editable-context:focus{
  border-color:#93c5fd;
  box-shadow:0 0 0 4px rgba(37,99,235,.08);
}
.il-content-editor .link-change-editable-context a,
.il-editor-link{
  display:inline;
  border:1px solid #93c5fd;
  border-radius:6px;
  background:#fbf8ff;
  color:#1d4ed8;
  padding:2px 6px;
  font-weight: 700;
  text-decoration:none;
  cursor:pointer;
}
.il-content-editor .link-change-editable-context a:after,
.il-editor-link:after{content:"↗";font-size:.78em;margin-left:3px}
.il-content-editor .link-change-editable-context a:hover,
.il-content-editor .link-change-editable-context a.is-selected,
.il-editor-link.is-selected{
  background:#f1eaff;
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(29,78,216,.18);
}
.il-editor-hint{
  margin:10px 2px 0;
  color:#667085;
  font-size:12.5px;
  line-height:1.5;
}
.il-anchor-panel,.il-ai-panel{
  padding:16px;
  box-shadow:0 6px 18px rgba(16,24,40,.04);
}
.il-mode-tabs{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:0;
  padding:4px;
  margin-bottom:16px;
  border-radius:10px;
  background:#f1f3f8;
}
.il-mode-tabs button{
  min-height:38px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:#344054;
  font:inherit;
  font-size:13px;
  font-weight: 700;
  cursor:pointer;
}
.il-mode-tabs button.active{
  background:#fff;
  color:#1d4ed8;
  box-shadow:0 2px 7px rgba(29,78,216,.2);
}
.il-anchor-panel label{
  position:relative;
  display:grid;
  gap:7px;
  margin-top:12px;
  color:#18223a;
  font-size:12.5px;
  font-weight: 700;
}
.il-anchor-panel input{
  width:100%;
  height:42px;
  box-sizing:border-box;
  border:1px solid #dbe3f1;
  border-radius:9px;
  background:#fff;
  color:#18223a;
  padding:0 12px;
  outline:none;
  font:inherit;
}
.il-anchor-panel input:focus{
  border-color:#93c5fd;
  box-shadow:0 0 0 3px rgba(37,99,235,.08);
}
.il-anchor-panel input:disabled{
  background:#f6f7fb;
  color:#98a2b3;
}
.il-count{
  position:absolute;
  right:2px;
  top:0;
  color:#667085;
  font-size:12px;
  font-weight:600;
}
.il-mode-help{
  margin:12px 0 0;
  color:#667085;
  font-size:12px;
  line-height:1.55;
}
.il-anchor-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  margin:14px 0 14px;
  padding:0;
  border:0;
  background:transparent;
}
.il-anchor-actions[hidden]{display:flex!important}
.il-anchor-actions .btn{min-height:38px}
.il-anchor-actions .il-clear-anchor{
  padding:6px 2px;
  min-height:auto;
  border:0;
  background:transparent;
  box-shadow:none;
  color:#667085;
}
.il-anchor-actions .il-clear-anchor:hover{color:#1d4ed8;background:transparent}
.il-anchor-panel .link-change-current-value{
  margin-top:10px;
}
.il-anchor-panel .link-change-current-value>strong{
  min-height:38px;
  border-radius:9px;
  background:#f8fafc;
  color:#344054;
  font-size:12.5px;
}
.il-ai-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}
.il-ai-head h4{margin:0}
.il-ai-head .btn{white-space:nowrap}
.il-ai-suggestions{
  display:grid;
  gap:9px;
  margin-top:10px;
}
.link-change-ai-state{
  min-height:22px;
  color:#667085;
  font-size:12.5px;
}
.il-spinner{
  display:inline-block;
  width:13px;
  height:13px;
  margin-right:7px;
  border:2px solid #d8c9ff;
  border-top-color:#1d4ed8;
  border-radius:50%;
  vertical-align:-2px;
  animation:ilspin .8s linear infinite;
}
@keyframes ilspin{to{transform:rotate(360deg)}}
.il-ai-error{color:#dc2626;font-weight:700}
.il-ai-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  padding:12px;
  border:1px solid #e4e9f3;
  border-radius:10px;
  background:#fbfcff;
}
.il-ai-card strong{
  display:block;
  color:#18223a;
  font-size:12.5px;
}
.il-ai-card p{
  margin:4px 0 7px;
  color:#475467;
  font-size:12px;
  line-height:1.45;
}
.il-ai-card small{
  display:block;
  color:#667085;
  font-size:11.5px;
  line-height:1.45;
  word-break:break-word;
}
.il-ai-card em{
  display:block;
  margin-top:5px;
  color:#667085;
  font-size:11.5px;
  font-style:normal;
}
.il-editor-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:18px 28px;
  border-top:1px solid #e5e9f3;
  background:#fff;
  position:sticky;
  bottom:0;
  z-index:2;
}
.il-editor-footer #linkChangeEditorCancel{margin-right:auto}
.il-editor-footer .btn{
  min-height:42px;
  border-radius:9px;
}
@media(max-width:1050px){
  .il-editor-card{width:100vw;height:100vh;max-height:100vh;border-radius:0}
  .il-editor-body{max-height:calc(100vh - 156px);padding:0 18px 18px}
  .il-editor-head{padding:20px 18px 12px}
  .il-editor-layout{grid-template-columns:1fr;gap:18px}
  .il-editor-footer{padding:14px 18px;flex-wrap:wrap}
  .il-editor-footer .btn{flex:1}
  .il-editor-footer #linkChangeEditorCancel{flex:0 0 auto}
}
@media(max-width:560px){
  .il-mode-tabs{grid-template-columns:1fr}
  .il-ai-card{grid-template-columns:1fr}
  .il-editor-head h3{font-size:23px}
}

/* Internal link insight draft sync */
.il-insight-status-row{display:flex;gap:10px;justify-content:flex-end;align-items:center;flex-wrap:wrap;margin:0 0 12px}
.il-insight-sync-badge,.il-insight-draft-badge{
  display:inline-flex;align-items:center;gap:7px;min-height:34px;padding:0 12px;border-radius:9px;
  border:1px solid #bbf7d0;background:#f0fdf4;color:#15803d;font-size:12px;font-weight: 700
}
.il-insight-sync-badge:before{content:"↻";font-weight: 700}
.il-insight-draft-badge{border-color:#d8c7ff;background:#f5f0ff;color:#1d4ed8}
.il-insight-draft-badge:before{content:"⟳";font-weight: 700}
.il-insight-sync-badge.is-cms{background:#ecfdf3;border-color:#a7f3d0;color:#047857}
.il-change-summary{
  margin:14px 0;padding:14px 16px;border:1px solid #e2e8f4;border-radius:12px;background:#fbfcff
}
.il-change-summary h4{
  margin:0 0 10px;color:#667085;font-size:12px;font-weight: 700;letter-spacing:.04em;text-transform:uppercase
}
.il-change-summary>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.il-change-chip{
  display:inline-flex;align-items:center;justify-content:center;min-height:30px;padding:0 10px;border-radius:8px;
  border:1px solid #e0d2ff;background:#f8f4ff;color:#1d4ed8;font-size:12px;font-weight: 700
}
.il-change-chip.old{background:#fff7d6;border-color:#fde68a;color:#854d0e}
.il-change-chip.new{background:#f4edff;border-color:#93c5fd;color:#1d4ed8}
.il-change-chip.danger{background:#fff1f2;border-color:#fecdd3;color:#be123c}
.il-before-after-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:12px 0}
.il-before-card,.il-after-card,.il-updated-paragraph{
  border:1px solid #e2e8f4;border-radius:12px;background:#fff;padding:16px 18px
}
.il-before-card h4,.il-after-card h4,.il-updated-paragraph h4{
  margin:0 0 10px;color:#172033;font-size:15px;font-weight: 700
}
.il-before-card p,.il-after-card p,.il-updated-paragraph p{
  margin:0;color:#344054;font-size:14px;line-height:1.7
}
.il-old-anchor{background:#fde68a;color:#713f12;border-radius:5px;padding:1px 4px;font-weight: 700}
.il-new-anchor{background:#f1e8ff;color:#1d4ed8;border-radius:5px;padding:1px 4px;font-weight: 700}
.il-updated-paragraph{margin-top:12px}
.il-sync-note{
  margin-top:12px;padding:9px 12px;border:1px solid #bbf7d0;border-radius:8px;background:#f0fdf4;color:#15803d;font-size:12.5px;font-weight:700
}
.il-sync-footnote{
  margin:12px 0 0;padding:10px 12px;border-radius:9px;background:#f8fafc;color:#667085;font-size:12px
}
@media(max-width:760px){
  .il-change-summary>div,.il-before-after-grid{grid-template-columns:1fr}
  .il-insight-status-row{justify-content:flex-start}
}

/* ============================================================
   TOPIC CLUSTER ANALYSIS
   ============================================================ */
.tc-control-panel{overflow:hidden}.tc-control-head{align-items:flex-start}.tc-control-head h2{margin:3px 0 6px;font-size:22px}.tc-control-head p{margin:0;color:var(--muted);max-width:760px;line-height:1.55}.tc-eyebrow{display:block;color:#1d4ed8;font-size:11px;font-weight: 700;letter-spacing:.13em;text-transform:uppercase}.tc-source-badges{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.tc-source-badge{display:inline-flex;align-items:center;min-height:34px;padding:0 11px;border-radius:999px;border:1px solid #e2e8f0;background:#f8fafc;color:#64748b;font-size:12px;font-weight: 700;white-space:nowrap}.tc-source-badge.is-ok{background:#ecfdf3;border-color:#b7ebcb;color:#087443}.tc-source-badge.is-missing{background:#fff4ed;border-color:#ffd0b5;color:#c2410c}.tc-source-badge.is-ai{background:#f3edff;border-color:#d8c8ff;color:#1d4ed8}.tc-analyze-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px;align-items:end;padding:20px}.tc-url-field{display:grid;gap:8px}.tc-url-field label{font-size:13px;font-weight: 700;color:#344054}.tc-url-input-wrap{height:50px;border:1px solid #d8dfec;border-radius:14px;background:#fff;display:flex;align-items:center;gap:10px;padding:0 14px;box-shadow:0 1px 2px rgba(16,24,40,.02)}.tc-url-input-wrap:focus-within{border-color:#9d7cff;box-shadow:0 0 0 4px rgba(29,78,216,.08)}.tc-url-input-wrap svg{width:18px;color:#7c8aa5}.tc-url-input-wrap input{border:0!important;box-shadow:none!important;padding:0!important;min-width:0!important;width:100%;height:100%;font-size:14px;font-weight:700}.tc-form-actions{display:flex;gap:10px}.tc-form-actions .btn{height:50px;padding:0 18px;white-space:nowrap}.tc-ai-btn{background:#e9f8fc!important;color:#087a98!important;border-color:#cceff7!important}.tc-control-note{margin:0;padding:0 20px 18px;color:#667085;font-size:12.5px}.tc-empty{min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:30px}.tc-empty-icon{width:62px;height:62px;border-radius:20px;display:grid;place-items:center;background:#eaf1fe;color:#1d4ed8;font-size:34px;font-weight: 700}.tc-empty h3{margin:14px 0 6px;font-size:18px}.tc-empty p{max-width:620px;margin:0;color:#667085;line-height:1.6}.tc-stats{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-bottom:18px}.tc-stat{min-height:118px;background:#fff;border:1px solid var(--line);border-radius:18px;padding:16px;display:flex;align-items:flex-start;gap:12px;box-shadow:var(--shadow-soft)}.tc-stat-icon{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;flex:none;font-size:19px;font-weight: 700;background:#eaf1fe;color:#1d4ed8}.tc-stat>div{min-width:0}.tc-stat div>span{display:block;color:#667085;font-size:12px;font-weight: 700}.tc-stat strong{display:block;margin-top:5px;color:#101828;font-size:25px;line-height:1}.tc-stat em{display:block;margin-top:8px;color:#7a85a1;font-style:normal;font-size:11px;line-height:1.4}.tc-stat.tone-green .tc-stat-icon{background:#dcfae6;color:#079455}.tc-stat.tone-cyan .tc-stat-icon{background:#e4f8fc;color:#0891b2}.tc-stat.tone-violet .tc-stat-icon{background:#eaf1fe;color:#2563eb}.tc-stat.tone-amber .tc-stat-icon{background:#fff2d9;color:#d97706}.tc-stat.tone-rose .tc-stat-icon{background:#ffe4e8;color:#e11d48}.tc-overview-grid{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:18px;margin-bottom:18px}.tc-score-card,.tc-ai-card{padding:20px}.tc-card-title{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.tc-card-title h3{margin:3px 0 0;font-size:18px}.tc-health-badge,.tc-ai-state{display:inline-flex;align-items:center;padding:7px 10px;border-radius:999px;background:#f1f5f9;color:#64748b;font-size:11px;font-weight: 700;white-space:nowrap}.tc-health-badge.excellent,.tc-health-badge.good,.tc-ai-state.is-done{background:#dcfae6;color:#087443}.tc-health-badge.review{background:#fff2d9;color:#b45309}.tc-health-badge.poor{background:#ffe4e8;color:#be123c}.tc-score-body{display:grid;grid-template-columns:150px minmax(0,1fr);gap:24px;align-items:center;margin-top:20px}.tc-score-ring{--score:0;width:138px;height:138px;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;background:conic-gradient(#2563eb calc(var(--score)*1%),#eceef5 0)}.tc-score-ring:before{content:"";position:absolute;inset:11px;border-radius:50%;background:#fff}.tc-score-ring strong,.tc-score-ring span{position:relative;z-index:1}.tc-score-ring strong{font-size:37px;line-height:1;color:#101828}.tc-score-ring span{font-size:12px;color:#667085;font-weight: 700;margin-top:4px}.tc-score-ring.score-excellent{background:conic-gradient(#10b981 calc(var(--score)*1%),#eceef5 0)}.tc-score-ring.score-good{background:conic-gradient(#22c55e calc(var(--score)*1%),#eceef5 0)}.tc-score-ring.score-review{background:conic-gradient(#f59e0b calc(var(--score)*1%),#eceef5 0)}.tc-score-ring.score-poor{background:conic-gradient(#ef4444 calc(var(--score)*1%),#eceef5 0)}.tc-score-components{display:grid;gap:11px}.tc-component>div:first-child{display:flex;justify-content:space-between;gap:12px;font-size:12px}.tc-component span{color:#667085;font-weight:700}.tc-component b{color:#344054}.tc-component-bar{height:7px;border-radius:999px;background:#edf1f7;overflow:hidden;margin-top:6px}.tc-component-bar i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#1d4ed8,#3b82f6)}.tc-cluster-summary{margin-top:18px;padding-top:16px;border-top:1px solid #edf1f7}.tc-cluster-summary>strong{display:block;font-size:14px}.tc-cluster-summary p{margin:7px 0;color:#667085;font-size:12.5px;line-height:1.55}.tc-topics{display:flex;flex-wrap:wrap;gap:6px}.tc-topics span{padding:5px 8px;border-radius:999px;background:#f3f0ff;color:#1d4ed8;font-size:11px;font-weight: 700}.tc-ai-content{margin-top:18px;min-height:220px;border:1px dashed #d8c9ff;border-radius:16px;padding:18px;background:linear-gradient(145deg,#fcfbff,#f7f4ff)}.tc-ai-summary strong{display:block;font-size:16px;color:#101828}.tc-ai-summary p{margin:8px 0 0;color:#475467;line-height:1.65;font-size:13px}.tc-ai-meta{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:16px 0}.tc-ai-meta div{padding:11px;border-radius:12px;background:#fff;border:1px solid #e9e3ff}.tc-ai-meta dt{font-size:10px;color:#7a6ca8;font-weight: 700;text-transform:uppercase}.tc-ai-meta dd{margin:5px 0 0;font-size:12px;font-weight: 700;color:#3b2a68}.tc-ai-risks{padding-top:13px;border-top:1px solid #e7e0fa}.tc-ai-risks b{font-size:12px}.tc-ai-risks ul{margin:8px 0 0;padding-left:18px;color:#667085;font-size:12px;line-height:1.55}.tc-issues-panel{overflow:hidden}.tc-issue-count{padding:8px 12px;border-radius:999px;background:#fff4ed;color:#c2410c;font-size:12px;font-weight: 700}.tc-issues{display:grid}.tc-issue{display:grid;grid-template-columns:42px minmax(0,1fr) minmax(180px,280px);gap:14px;align-items:center;padding:16px 20px;border-bottom:1px solid #edf1f7}.tc-issue:last-child{border-bottom:0}.tc-issue.priority-high{background:#fff8f8}.tc-issue.priority-medium{background:#fffdf8}.tc-issue-icon{width:38px;height:38px;border-radius:12px;background:#fff0f1;color:#e11d48;display:grid;place-items:center;font-size:19px;font-weight: 700}.tc-issue.priority-medium .tc-issue-icon{background:#fff3dc;color:#d97706}.tc-issue-main>div{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.tc-issue-main strong{font-size:13px}.tc-issue-main>div span{padding:4px 7px;border-radius:999px;background:#fee2e2;color:#b91c1c;font-size:10px;font-weight: 700}.tc-issue-main p{margin:5px 0;color:#667085;font-size:12px;line-height:1.5}.tc-issue-main a{font-size:11px;color:#1e40af;text-decoration:none}.tc-issue-action{font-size:12px;line-height:1.5;color:#344054;font-weight:700}.tc-no-issue{padding:26px;text-align:center;color:#087443;font-weight: 700}.tc-pages-panel{overflow:hidden}.tc-table-head{align-items:flex-start}.tc-filters{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.tc-filters .search-box input{min-width:210px}.tc-filters select{min-width:160px}.tc-table-wrap{overflow:auto;max-height:650px}.tc-table{min-width:1420px;table-layout:fixed}.tc-table th{position:sticky;top:0;z-index:2;background:#f8fafc;text-transform:none;letter-spacing:0;font-weight: 700}.tc-table th:nth-child(1){width:45px}.tc-table th:nth-child(2){width:105px}.tc-table th:nth-child(3){width:320px}.tc-table th:nth-child(4){width:105px}.tc-table th:nth-child(5),.tc-table th:nth-child(6){width:135px}.tc-table th:nth-child(7){width:145px}.tc-table th:nth-child(8){width:270px}.tc-table th:nth-child(9){width:85px}.tc-row td{vertical-align:middle}.tc-row-technical td,.tc-row-isolated td{background:#fff8f8}.tc-row-missing_to_pillar td,.tc-row-missing_from_pillar td{background:#fffcf5}.tc-role{display:inline-flex;padding:6px 8px;border-radius:999px;font-size:10px;font-weight: 700;background:#e8f1ff;color:#2563eb}.tc-role.pillar{background:#eaf1fe;color:#1d4ed8}.tc-role.subpillar{background:#e4f8fc;color:#0891b2}.tc-page-cell{display:flex;flex-direction:column;gap:5px}.tc-page-cell>a{color:#101828;text-decoration:none;font-size:13px;font-weight: 700;line-height:1.45}.tc-page-cell>a:hover{color:#1d4ed8}.tc-page-cell>span{font-size:10.5px;color:#667085;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tc-flag{display:inline-flex;width:max-content;padding:3px 6px;border-radius:999px;background:#ffe4e8;color:#be123c;font-size:9px;font-weight: 700}.tc-semantic{display:flex;align-items:center;gap:9px}.tc-semantic strong{font-size:13px}.tc-semantic>div{width:48px;height:6px;background:#edf1f7;border-radius:999px;overflow:hidden}.tc-semantic i{display:block;height:100%;background:#2563eb;border-radius:999px}.tc-link-count{display:inline-flex;align-items:center;justify-content:center;min-width:30px;height:28px;border-radius:9px;font-size:12px}.tc-link-count.has{background:#dcfae6;color:#087443}.tc-link-count.missing{background:#ffe4e8;color:#be123c}.tc-table td small{display:block;margin-top:5px;max-width:120px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#667085;font-size:9.5px}.tc-row-status{display:inline-flex;padding:7px 9px;border-radius:999px;font-size:10px;font-weight: 700}.tc-row-status.status-healthy{background:#dcfae6;color:#087443}.tc-row-status.status-missing_to_pillar,.tc-row-status.status-missing_from_pillar{background:#fff2d9;color:#b45309}.tc-row-status.status-isolated,.tc-row-status.status-technical{background:#ffe4e8;color:#be123c}.tc-row-status.status-weak{background:#eef2f6;color:#475467}.tc-recommendation{margin:0;color:#475467;font-size:11px;line-height:1.5}.tc-row-action{border:1px solid #d9e0ec;background:#fff;color:#1e40af;border-radius:9px;padding:7px 9px;font-size:10px;font-weight: 700;cursor:pointer}.tc-row-action:hover{border-color:#9d7cff;background:#f6f2ff}.tc-table-footer{display:flex;align-items:center;justify-content:space-between;padding:13px 18px;border-top:1px solid #edf1f7;color:#667085;font-size:12px}.tc-ai-details{overflow:hidden}.tc-ai-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px;padding:20px}.tc-ai-detail-grid h3{margin:0 0 12px;font-size:14px}.tc-detail-list{display:grid;gap:10px}.tc-detail-list article{border:1px solid #e5e9f2;border-radius:13px;padding:13px;background:#fbfcff}.tc-detail-list article strong{display:block;font-size:12px}.tc-detail-list article>span{display:inline-flex;margin-top:6px;padding:4px 7px;border-radius:999px;background:#eaf1fe;color:#1d4ed8;font-size:9.5px;font-weight: 700}.tc-detail-list article p{margin:7px 0 0;color:#667085;font-size:11px;line-height:1.5}.tc-detail-list article em{display:block;margin-top:7px;color:#1d4ed8;font-style:normal;font-size:10px;font-weight: 700}.tc-detail-list article:has(.tc-action-number){display:flex;gap:10px}.tc-action-number{width:27px;height:27px;border-radius:9px;background:#1d4ed8!important;color:#fff!important;display:grid!important;place-items:center!important;margin:0!important;flex:none}
@media (max-width:1450px){.tc-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.tc-overview-grid{grid-template-columns:1fr}.tc-source-badges{justify-content:flex-start}.tc-control-head{flex-direction:column}.tc-table-head{flex-direction:column}.tc-filters{width:100%;justify-content:flex-start}}
@media (max-width:900px){.tc-analyze-form{grid-template-columns:1fr}.tc-form-actions{flex-direction:column}.tc-form-actions .btn{width:100%}.tc-stats{grid-template-columns:1fr 1fr}.tc-score-body{grid-template-columns:1fr;justify-items:center}.tc-score-components{width:100%}.tc-issue{grid-template-columns:40px 1fr}.tc-issue-action{grid-column:2}.tc-ai-detail-grid{grid-template-columns:1fr}.tc-ai-meta{grid-template-columns:1fr}}

/* ===== Topic Cluster Dashboard v12 ===== */
.tc-dashboard-shell{overflow:visible}
.tc-analyze-form-wide{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:end}
.tc-analyze-form-wide .tc-form-actions{display:flex;gap:14px;align-items:end}
.tc-analyze-form-wide .btn{min-width:180px;height:48px;border-radius:16px;font-weight: 700}
.tc-kpi-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:16px;margin:18px 0}
.tc-kpi-card{display:flex;align-items:center;gap:16px;background:#fff;border:1px solid #edf1f7;border-radius:20px;padding:18px 20px;box-shadow:0 12px 24px rgba(16,24,40,.04)}
.tc-kpi-card.active{border-color:#3b82f6;box-shadow:0 10px 24px rgba(37,99,235,.12)}
.tc-kpi-card .tc-kpi-icon{width:50px;height:50px;border-radius:16px;display:grid;place-items:center;font-size:22px;background:#f3f0ff;color:#1d4ed8;flex:none}
.tc-kpi-card.supporting .tc-kpi-icon{background:#e9f9ef;color:#16a34a}
.tc-kpi-card.isolated .tc-kpi-icon{background:#fff3e6;color:#ea580c}
.tc-kpi-card.warning .tc-kpi-icon{background:#ffeaea;color:#dc2626}
.tc-kpi-card.score .tc-kpi-icon{background:#eaf1ff;color:#2563eb}
.tc-kpi-copy{display:flex;flex-direction:column;gap:4px;min-width:0}
.tc-kpi-copy span{font-size:13px;font-weight: 700;color:#667085}
.tc-kpi-copy strong{font-size:18px;line-height:1;color:#101828;display:flex;align-items:flex-end;gap:4px}
.tc-kpi-copy strong em{font-style:normal;font-size:12px;color:#98a2b3;font-weight:700}
.tc-kpi-copy small{font-size:11px;color:#98a2b3}
.tc-kpi-scorebar{width:100%;height:6px;background:#edf1f7;border-radius:999px;overflow:hidden;margin-top:2px}.tc-kpi-scorebar i{display:block;height:100%;background:linear-gradient(90deg,#1e40af,#3b82f6);border-radius:999px}
.tc-main-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr);gap:18px}
.tc-left-col,.tc-right-col{display:grid;gap:18px;align-content:start}
.tc-side-panel{padding:18px 20px}.tc-side-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}.tc-side-kicker{font-size:12px;font-weight: 700;color:#1d4ed8}.tc-side-card-head h3{margin:0;font-size:20px;line-height:1.2}.tc-side-desc{margin:0;color:#667085;font-size:13px;line-height:1.6}.tc-bullet-list{margin:12px 0 0;padding-left:18px;color:#344054;font-size:13px;line-height:1.6}.tc-bullet-list li+li{margin-top:6px}.tc-priority-stack{display:grid;gap:8px;margin-top:16px}.tc-priority-stack span{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:12px;font-size:12px;font-weight: 700}.tc-priority-stack em{font-style:normal;font-weight:700;color:#667085}.tc-priority-stack .p1{background:#fff1f2;color:#be123c}.tc-priority-stack .p2{background:#fff7ed;color:#c2410c}.tc-priority-stack .p3{background:#eff6ff;color:#2563eb}
.tc-count-badge{display:inline-flex;min-width:28px;height:28px;border-radius:999px;align-items:center;justify-content:center;background:#eef2ff;color:#1e40af;font-size:12px;font-weight: 700}.tc-count-badge.alert{background:#fff1f2;color:#dc2626}
.tc-gap-list,.tc-warning-list{display:grid;gap:10px;margin-top:12px}.tc-gap-list article,.tc-warning-list article{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid #edf1f7;border-radius:14px;padding:12px 14px;background:#fff}.tc-gap-list article>div:first-child,.tc-warning-list article>div:first-child{display:flex;align-items:center;gap:10px}.tc-gap-list i,.tc-warning-list i{width:8px;height:8px;border-radius:50%;background:#22c55e;display:inline-block;flex:none}.tc-warning-list i{background:#ef4444}.tc-gap-list b,.tc-warning-list span{font-size:13px;color:#344054}.tc-gap-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.tc-gap-meta .role,.tc-gap-meta .prio{padding:5px 8px;border-radius:999px;font-size:10px;font-weight: 700}.tc-gap-meta .role.sub{background:#eaf1fe;color:#1d4ed8}.tc-gap-meta .role.sup{background:#e8f7ee;color:#15803d}.tc-gap-meta .prio.p1{background:#fff1f2;color:#be123c}.tc-gap-meta .prio.p2{background:#fff7ed;color:#c2410c}.tc-gap-meta .prio.p3{background:#eff6ff;color:#2563eb}.tc-text-action{background:none;border:none;color:#1e40af;font-size:12px;font-weight: 700;cursor:pointer}
.tc-map-card{padding:14px 16px 18px}.tc-diagram-wrap{display:grid;gap:12px}.tc-legend{display:flex;gap:16px;flex-wrap:wrap;font-size:12px;color:#667085}.tc-legend span{display:flex;align-items:center;gap:6px}.tc-legend .dot{width:10px;height:10px;border-radius:50%;display:inline-block}.tc-legend .dot.pillar{background:#1e40af}.tc-legend .dot.subpillar{background:#6366f1}.tc-legend .dot.supporting{background:#22c55e}
.tc-map{background:#fbfcff;border:1px solid #edf1f7;border-radius:18px;padding:22px;display:grid;gap:22px}
.tc-pillar-main{justify-self:center;min-width:260px;max-width:420px;background:linear-gradient(135deg,#312e81,#1e40af);color:#fff;border-radius:16px;padding:14px 18px;box-shadow:0 12px 24px rgba(79,70,229,.18);text-align:center}.tc-pillar-main .node-label,.tc-branch-head .node-label{display:block;font-size:11px;font-weight: 700;opacity:.88;margin-bottom:4px}.tc-pillar-main b,.tc-branch-head b{font-size:15px;line-height:1.35}
.tc-branches{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;align-items:start}.tc-branch{position:relative;display:grid;gap:10px}.tc-branch:before{content:"";position:absolute;top:-24px;left:50%;width:1px;height:20px;background:#d9dcf5}.tc-branch-head{background:linear-gradient(135deg,#5b5ce9,#1d4ed8);color:#fff;border-radius:14px;padding:12px 12px;text-align:center;min-height:68px;display:grid;place-items:center;box-shadow:0 10px 18px rgba(99,102,241,.14)}
.tc-branch-children{display:grid;grid-template-columns:1fr 1fr;gap:8px}.tc-support-node{display:flex;align-items:center;justify-content:center;text-align:center;min-height:48px;padding:8px 10px;border-radius:12px;border:1px solid #b8e5c5;background:#f1fdf5;color:#166534;font-size:11px;font-weight:700;line-height:1.35}.tc-support-node.empty{border-style:dashed;color:#98a2b3;background:#fff}
.tc-diagram-tools{display:flex;justify-content:flex-end;gap:8px}.icon-lite{border:1px solid #d9e0ec;background:#fff;border-radius:10px;min-width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;color:#1e40af;cursor:pointer;padding:0 10px}.tc-diagram-wrap.is-fullscreen,.tc-diagram-wrap.is-fullscreen .tc-map{position:relative;z-index:20}
.tc-dashboard-table{min-width:980px}.tc-dashboard-table th:nth-child(1){width:44px}.tc-dashboard-table th:nth-child(2){width:310px}.tc-dashboard-table th:nth-child(3){width:110px}.tc-dashboard-table th:nth-child(4),.tc-dashboard-table th:nth-child(5),.tc-dashboard-table th:nth-child(6){width:120px}.tc-dashboard-table th:nth-child(7){width:130px}.tc-dashboard-table th:nth-child(8){width:100px}
.tc-dashboard-table .tc-semantic strong{font-size:14px;font-weight: 700;color:#101828}.tc-inline-check{min-width:32px;height:32px;padding:0}
@media (max-width: 1400px){.tc-kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.tc-main-grid{grid-template-columns:1fr}.tc-branches{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width: 900px){.tc-analyze-form-wide{grid-template-columns:1fr}.tc-analyze-form-wide .tc-form-actions{flex-direction:column}.tc-kpi-grid{grid-template-columns:1fr 1fr}.tc-branches{grid-template-columns:1fr}.tc-branch-children{grid-template-columns:1fr}.tc-gap-list article,.tc-warning-list article{flex-direction:column;align-items:flex-start}}

/* ===== Topic Cluster v13 adjustments ===== */
.tc-analyze-form-v2{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:end}
.tc-form-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(260px,1fr);gap:16px;align-items:end}
.tc-keyword-field{display:grid;gap:8px}.tc-keyword-field label{font-size:13px;font-weight: 700;color:#344054}.tc-keyword-field input{height:52px;border:1px solid #d7dcea;border-radius:16px;padding:0 16px;font-size:15px;font-weight:700;background:#fff}
.tc-url-field label{font-size:13px;font-weight: 700;color:#344054}
.tc-row .tc-page-cell{display:grid;gap:4px}.tc-row .tc-page-cell small{font-size:12px;color:#667085;font-weight:700}
.tc-map{min-height:430px}
.tc-diagram-wrap .tc-empty-mini{display:grid;place-items:center;min-height:220px;color:#98a2b3;font-weight:700}
@media (max-width: 1100px){.tc-analyze-form-v2{grid-template-columns:1fr}.tc-form-grid{grid-template-columns:1fr}}

/* ===== Topic Cluster v14 diagram + layout ===== */
.tc-diagram-wrap{display:grid;gap:12px}
.tc-map-viewport{position:relative;overflow:hidden;min-height:420px;border:1px solid #edf1f7;border-radius:18px;background:#fbfcff;cursor:grab}
.tc-map-viewport.is-dragging{cursor:grabbing}
.tc-map-canvas{position:relative;min-height:420px;padding:24px}
.tc-map-canvas-inner{position:relative;transform-origin:top left;will-change:transform;min-width:980px;padding:8px 4px 10px}
.tc-map-root{position:relative;display:flex;justify-content:center;padding-bottom:48px}
.tc-map-root:after{content:"";position:absolute;left:50%;top:100%;height:32px;width:2px;background:#cfd6ff;transform:translateX(-50%)}
.tc-pillar-main{justify-self:center;min-width:300px;max-width:420px;background:linear-gradient(135deg,#312e81,#1e40af);color:#fff;border-radius:18px;padding:16px 22px;box-shadow:0 16px 28px rgba(79,70,229,.18);text-align:center}
.tc-pillar-main .node-label,.tc-branch-head .node-label{display:block;font-size:11px;font-weight: 700;opacity:.88;margin-bottom:4px}
.tc-pillar-main b,.tc-branch-head b{font-size:16px;line-height:1.35}
.tc-branches{position:relative;display:grid;grid-template-columns:repeat(4,minmax(200px,1fr));gap:18px;align-items:start;padding-top:38px}
.tc-branches:before{content:"";position:absolute;top:8px;left:10%;right:10%;height:2px;background:#cfd6ff}
.tc-branch{position:relative;display:grid;gap:12px;align-content:start}
.tc-branch:before{content:"";position:absolute;top:-30px;left:50%;width:2px;height:30px;background:#cfd6ff;transform:translateX(-50%)}
.tc-branch-head{background:linear-gradient(135deg,#5b5ce9,#1d4ed8);color:#fff;border-radius:16px;padding:12px 14px;text-align:center;min-height:88px;display:grid;place-items:center;box-shadow:0 12px 20px rgba(99,102,241,.14)}
.tc-branch-children{position:relative;display:grid;grid-template-columns:1fr 1fr;gap:10px;padding-top:16px}
.tc-branch-children:before{content:"";position:absolute;left:12%;right:12%;top:4px;height:2px;background:#bde7c7}
.tc-branch-children.single:before{left:50%;right:auto;width:2px;height:12px;top:0;transform:translateX(-50%)}
.tc-support-node{position:relative;display:flex;align-items:center;justify-content:center;text-align:center;min-height:70px;padding:10px 12px;border-radius:14px;border:1px solid #b8e5c5;background:#f1fdf5;color:#166534;font-size:12px;font-weight:700;line-height:1.35;box-shadow:0 2px 0 rgba(22,101,52,.04)}
.tc-support-node:before{content:"";position:absolute;left:50%;top:-14px;width:2px;height:14px;background:#bde7c7;transform:translateX(-50%)}
.tc-support-node.weak{border-style:dashed;background:#fff8ed;color:#b45309;border-color:#f6c178}
.tc-support-node.empty{border-style:dashed;color:#98a2b3;background:#fff}
.tc-diagram-tools{display:flex;justify-content:flex-end;gap:8px}
.tc-diagram-tools .icon-lite{min-width:40px;height:40px;font-size:18px;font-weight: 700}
.tc-map-card:fullscreen,.tc-map-card:-webkit-full-screen{background:#fff;padding:20px}
.tc-map-card:fullscreen .tc-map-viewport,.tc-map-card:-webkit-full-screen .tc-map-viewport{min-height:calc(100vh - 180px)}
.tc-dashboard-table .tc-semantic strong{font-size:14px;font-weight: 700;color:#101828}.tc-inline-check,.tc-inline-open{min-width:32px;height:32px;padding:0}
@media (max-width: 1400px){.tc-branches{grid-template-columns:repeat(2,minmax(220px,1fr))}.tc-map-canvas-inner{min-width:760px}}
@media (max-width: 900px){.tc-map-canvas-inner{min-width:620px}.tc-branch-children{grid-template-columns:1fr}.tc-branch-children:before{left:50%;right:auto;width:2px;height:12px;top:0;transform:translateX(-50%)}}

/* ===== Topic Cluster diagram: theo mẫu thiết kế ===== */
.tc-branches:before{background:none;border-top:2px dashed #c7cdf8}
.tc-branch:before{background:none;border-left:2px dashed #c7cdf8;width:0}
.tc-branch-children:before{background:none;border-top:2px dashed #d6dcf9}
.tc-branch-children.single:before{border-top:none;border-left:2px dashed #d6dcf9;width:0}
.tc-support-node:before{background:none;border-left:2px dashed #d6dcf9;width:0}
.tc-support-node{border:1px solid #e2e6f3;background:#fff;color:#3f4658;font-weight:600;box-shadow:0 2px 6px rgba(30,32,66,.05)}
.tc-support-node.linked{border-color:#b8e5c5;box-shadow:inset 3px 0 0 #22c55e,0 2px 6px rgba(30,32,66,.05)}
.tc-support-node.weak{border-style:dashed;color:#98a2b3}
.tc-support-node .nolink{font-style:normal;margin-right:5px;color:#d97706;font-size:11px}
.tc-branch-head b{display:flex;align-items:center;gap:6px;justify-content:center;font-size:13.5px}
.tc-legend-ai{background:#eaf1fe;color:#1d4ed8;border-radius:999px;padding:3px 10px;font-weight:700;font-size:11px}
.tc-diagram-tools .icon-lite{font-size:13px}

/* Topic Cluster: khối định nghĩa nhánh (AI bước 0) + nhánh trống */
.tc-branchdef{background:#faf9ff;border:1px solid #ece9fb;border-radius:12px;padding:12px 14px;margin-bottom:12px}
.tc-branchdef-kicker{display:block;font-size:12px;font-weight: 700;color:#1d4ed8;margin-bottom:8px}
.tc-branchdef-list{display:flex;flex-wrap:wrap;gap:8px}
.tc-branchdef-item{display:flex;flex-direction:column;gap:2px;background:#fff;border:1px solid #e6e2f7;border-radius:9px;padding:6px 10px;min-width:120px}
.tc-branchdef-item b{font-size:12.5px;color:#312e81}
.tc-branchdef-item small{font-size:11px;color:#667085}
.tc-branchdef-item i{font-size:10.5px;font-style:normal;font-weight:700;margin-top:2px}
.tc-branchdef-item.ok i{color:#16a34a}
.tc-branchdef-item.warn i{color:#d97706}
.tc-branchdef-item.gap{border-style:dashed;border-color:#f0b8b8;background:#fff8f8}
.tc-branchdef-item.gap i{color:#dc2626}
.tc-branch.is-gap .tc-branch-head{background:#fff;border:2px dashed #e2b7b7;color:#b91c1c;box-shadow:none}
.tc-gap-head{display:flex;flex-direction:column;gap:2px;color:#b91c1c}
.tc-gap-head em{font-style:normal;font-size:10.5px;font-weight:700;opacity:.85}

/* ===== Topic Cluster v18 — chỉ xác định Pillar phụ ===== */
.tc-flow-note{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px;padding-top:14px;border-top:1px solid #eceef5}.tc-flow-note span{display:inline-flex;align-items:center;gap:7px;padding:8px 11px;border-radius:999px;background:#f7f5ff;color:#1e40af;font-size:11.5px}.tc-flow-note b{color:#312e81}
.tc-kpi-grid{grid-template-columns:repeat(6,minmax(0,1fr))}.tc-kpi-link .tc-kpi-icon,.tc-kpi-inlinks .tc-kpi-icon{background:#eef2ff;color:#1e40af}.tc-kpi-pages .tc-kpi-icon{background:#ecfeff;color:#0891b2}.tc-kpi-total .tc-kpi-icon{background:#f8fafc;color:#475467}.tc-kpi-strong .tc-kpi-icon{background:#eaf1fe;color:#2563eb}.tc-kpi-ai .tc-kpi-icon{background:#f0fdf4;color:#16a34a}
.tc-subpillar-legend{display:flex;align-items:center;gap:16px;flex-wrap:wrap;color:#667085;font-size:12px}.tc-subpillar-legend span{display:flex;align-items:center;gap:6px}.tc-subpillar-legend i{display:inline-block;width:10px;height:10px;border-radius:50%}.tc-subpillar-legend i.main{background:#312e81}.tc-subpillar-legend i.sub{background:#2563eb}.tc-subpillar-legend em{margin-left:auto;padding:5px 9px;border-radius:999px;background:#f4f0ff;color:#1d4ed8;font-style:normal;font-weight: 700}
.tc-subpillar-viewport{position:relative;min-height:430px;overflow:hidden;border:1px solid #edf0f7;border-radius:18px;background:linear-gradient(180deg,#fbfcff,#f8f9ff);cursor:grab}.tc-subpillar-viewport.is-dragging{cursor:grabbing}.tc-subpillar-canvas{position:relative;min-height:430px;padding:24px}.tc-subpillar-canvas-inner{position:relative;min-height:360px;transform-origin:top left;will-change:transform;padding:4px 10px 26px}.tc-subpillar-root{position:relative;z-index:3;width:330px;margin:0 auto;padding:16px 22px;border-radius:18px;background:linear-gradient(135deg,#312e81,#1e40af);color:#fff;text-align:center;box-shadow:0 16px 30px rgba(49,46,129,.2)}.tc-subpillar-root span,.tc-subpillar-node span{display:block;margin-bottom:5px;font-size:10px;font-weight: 700;text-transform:uppercase;letter-spacing:.05em;opacity:.82}.tc-subpillar-root b{font-size:16px;line-height:1.4}.tc-subpillar-root:after{content:"";position:absolute;left:50%;top:100%;width:2px;height:42px;background:#c9cff8;transform:translateX(-50%)}
.tc-subpillar-rail{position:relative;height:42px;margin:0 110px;border-bottom:2px solid #c9cff8}.tc-subpillar-nodes{position:relative;display:grid;gap:24px;justify-content:center;padding:34px 0 0}.tc-subpillar-nodes:before{content:"";position:absolute;top:0;left:110px;right:110px;height:2px;background:#c9cff8}.tc-subpillar-node{position:relative;min-height:142px;padding:16px 15px 14px;border:1px solid #d9d5ff;border-radius:16px;background:#fff;text-align:center;box-shadow:0 10px 22px rgba(50,45,120,.07);display:flex;flex-direction:column;align-items:center;justify-content:center}.tc-subpillar-node:before{content:"";position:absolute;left:50%;bottom:100%;width:2px;height:34px;background:#c9cff8;transform:translateX(-50%)}.tc-subpillar-node b{display:block;color:#3b2a68;font-size:14px;line-height:1.42}.tc-subpillar-node small{display:block;margin-top:8px;color:#2563eb;font-size:11px;font-weight: 700}.tc-subpillar-node a{display:inline-flex;margin-top:10px;color:#1e40af;font-size:11px;font-weight: 700;text-decoration:none}.tc-subpillar-node:hover{border-color:#93c5fd;box-shadow:0 14px 28px rgba(29,78,216,.12)}
.tc-map-card:fullscreen,.tc-map-card:-webkit-full-screen{background:#fff;padding:20px}.tc-map-card:fullscreen .tc-subpillar-viewport,.tc-map-card:-webkit-full-screen .tc-subpillar-viewport{min-height:calc(100vh - 170px)}
.tc-subpillar-table{min-width:1660px;table-layout:fixed}.tc-subpillar-table th:nth-child(1){width:48px}.tc-subpillar-table th:nth-child(2){width:340px}.tc-subpillar-table th:nth-child(3){width:135px}.tc-subpillar-table th:nth-child(4),.tc-subpillar-table th:nth-child(5){width:95px}.tc-subpillar-table th:nth-child(6){width:130px}.tc-subpillar-table th:nth-child(7){width:105px}.tc-subpillar-table th:nth-child(8){width:145px}.tc-subpillar-table th:nth-child(9){width:250px}.tc-subpillar-table th:nth-child(10){width:90px}.tc-subpillar-table .tc-row.is-selected td{background:#f5fff8}.tc-source-kind{display:inline-flex;padding:6px 9px;border-radius:999px;font-size:10px;font-weight: 700}.tc-source-kind.inlinks{background:#eef2ff;color:#1e40af}.tc-source-kind.pages{background:#ecfeff;color:#0e7490}.tc-candidate-status{display:inline-flex;padding:7px 9px;border-radius:999px;font-size:10px;font-weight: 700}.tc-candidate-status.strong{background:#eaf1fe;color:#1d4ed8}.tc-candidate-status.review{background:#fff7ed;color:#c2410c}.tc-candidate-status.weak{background:#f2f4f7;color:#667085}.tc-candidate-status.selected,.tc-candidate-status.ai_selected{background:#dcfce7;color:#15803d}.tc-score-mini{display:grid;gap:6px}.tc-score-mini strong{font-size:13px;color:#312e81}.tc-score-mini i{display:block;height:6px;border-radius:999px;background:linear-gradient(90deg,#3b82f6,#1e40af)}.tc-ai-cell{display:grid;gap:4px}.tc-ai-cell b{color:#312e81;font-size:11px}.tc-ai-cell em{font-style:normal;color:#16a34a;font-size:10px;font-weight: 700}.tc-ai-cell small{display:block;color:#667085;font-size:10px;line-height:1.4;white-space:normal}.tc-ai-run-meta{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px 0}.tc-ai-run-meta div{padding:10px;border:1px solid #ece8fb;border-radius:12px;background:#faf9ff}.tc-ai-run-meta dt{font-size:10px;color:#7c6da8;font-weight: 700;text-transform:uppercase}.tc-ai-run-meta dd{margin:5px 0 0;color:#312e81;font-size:15px;font-weight: 700}.tc-ai-selected-list{display:grid;gap:8px}.tc-ai-selected-list article{position:relative;padding:10px 42px 10px 12px;border:1px solid #e8e3fb;border-radius:12px;background:#fff}.tc-ai-selected-list b{display:block;color:#3b2a68;font-size:12px}.tc-ai-selected-list span{display:block;margin-top:3px;color:#667085;font-size:10.5px}.tc-ai-selected-list em{position:absolute;right:10px;top:10px;color:#16a34a;font-size:10px;font-style:normal;font-weight: 700}.tc-gap-list article p{margin:7px 0 0;color:#667085;font-size:11px;line-height:1.45}
@media (max-width:1450px){.tc-kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.tc-main-grid{grid-template-columns:1fr}.tc-subpillar-canvas-inner{min-width:900px}}
@media (max-width:900px){.tc-kpi-grid{grid-template-columns:1fr 1fr}.tc-subpillar-canvas-inner{min-width:760px}.tc-flow-note{flex-direction:column;align-items:flex-start}}

/* ===== Topic Cluster v19 — canonical progress + branch-first ===== */
.tc-progress{margin:0 20px 18px;padding:16px;border:1px solid #ded8ff;border-radius:16px;background:linear-gradient(135deg,#fbfaff,#f7fbff)}
.tc-progress[hidden]{display:none!important}.tc-progress-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.tc-progress-head strong{font-size:13px;color:#312e81}.tc-progress-head span{font-size:10px;font-weight: 700;color:#2563eb;text-transform:uppercase;letter-spacing:.05em}.tc-progress-track{height:8px;border-radius:999px;background:#e9e7f6;overflow:hidden}.tc-progress-track i{display:block;height:100%;width:2%;border-radius:999px;background:linear-gradient(90deg,#2563eb,#06b6d4);transition:width .3s ease}.tc-progress-steps{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-top:12px}.tc-progress-step{display:grid;grid-template-columns:18px minmax(0,1fr);grid-template-areas:"dot label" "dot meta";column-gap:7px;padding:8px 9px;border:1px solid #e9e7f3;border-radius:11px;background:#fff}.tc-progress-step i{grid-area:dot;width:10px;height:10px;border-radius:50%;margin-top:3px;background:#d5d9e5;box-shadow:0 0 0 4px #f5f6f9}.tc-progress-step span{grid-area:label;font-size:10.5px;font-weight: 700;color:#475467}.tc-progress-step small{grid-area:meta;font-size:9.5px;color:#98a2b3}.tc-progress-step.is-active{border-color:#bca7ff;background:#faf8ff}.tc-progress-step.is-active i{background:#2563eb;box-shadow:0 0 0 4px #eaf1fe}.tc-progress-step.is-done i{background:#16a34a;box-shadow:0 0 0 4px #dcfce7}.tc-progress-step.is-done small{color:#15803d}
.tc-kpi-raw .tc-kpi-icon{background:#fff7ed;color:#c2410c}.tc-kpi-canonical .tc-kpi-icon{background:#ecfdf3;color:#15803d}.tc-kpi-branches .tc-kpi-icon{background:#eaf1fe;color:#2563eb}
.tc-subpillar-table{min-width:1880px}.tc-subpillar-table th:nth-child(1){width:48px}.tc-subpillar-table th:nth-child(2){width:330px}.tc-subpillar-table th:nth-child(3){width:135px}.tc-subpillar-table th:nth-child(4){width:170px}.tc-subpillar-table th:nth-child(5),.tc-subpillar-table th:nth-child(6){width:88px}.tc-subpillar-table th:nth-child(7){width:125px}.tc-subpillar-table th:nth-child(8){width:100px}.tc-subpillar-table th:nth-child(9){width:145px}.tc-subpillar-table th:nth-child(10){width:285px}.tc-subpillar-table th:nth-child(11){width:92px}
.tc-source-pill{display:inline-flex;padding:6px 9px;border-radius:999px;font-size:10px;font-weight: 700}.tc-source-pill.source-inlinks{background:#eef2ff;color:#1e40af}.tc-source-pill.source-internal_all{background:#ecfeff;color:#0e7490}.tc-ai-eval{display:block;color:#312e81;font-size:10.5px;font-weight: 700}.tc-subpillar-table td>small{display:block;margin-top:5px;color:#667085;font-size:10px;white-space:normal;line-height:1.4}.tc-row-status.status-preliminary{background:#eaf1fe;color:#1d4ed8}.tc-row-status.status-candidate{background:#f2f4f7;color:#667085}.tc-row-status.status-ai_selected{background:#dcfce7;color:#15803d}.tc-selected-list{display:grid;gap:8px;margin-top:12px}.tc-selected-list article{padding:11px 12px;border:1px solid #e8e3fb;border-radius:12px;background:#fff}.tc-selected-list b{display:block;color:#3b2a68;font-size:12px}.tc-selected-list span{display:block;margin-top:4px;color:#475467;font-size:11px}.tc-selected-list small{display:block;margin-top:5px;color:#667085;font-size:10px}.tc-gap-list article{display:block}.tc-gap-list article small{display:block;margin-top:5px;color:#667085;font-size:10px;line-height:1.45}.tc-warning-list article{align-items:flex-start}.tc-warning-list article>small{max-width:48%;color:#667085;font-size:10px;line-height:1.4;text-align:right}
@media(max-width:900px){.tc-progress-steps{grid-template-columns:1fr 1fr}.tc-progress-head{align-items:flex-start;flex-direction:column}}

/* ===== Topic Cluster v20 — Cluster article filter MVP ===== */
.tc-v20-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:end;padding-top:18px}
.tc-v20-inputs{display:grid;grid-template-columns:minmax(360px,1.45fr) minmax(220px,.75fr) minmax(210px,.6fr);gap:14px;align-items:start}
.tc-v20-inputs label{display:block;margin-bottom:8px;font-size:12px;font-weight: 700;color:#344054}
.tc-mode-field select,.tc-keyword-field input{width:100%;height:52px;border:1px solid #d9dfeb;border-radius:16px;background:#fff;padding:0 15px;font-size:14px;font-weight:750;color:#101828;outline:none}
.tc-mode-field small{display:block;margin-top:6px;color:#667085;font-size:10px;line-height:1.35}
.tc-v20-flow{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}.tc-v20-flow span{padding:8px 11px;border-radius:999px;background:#f6f3ff;color:#1e40af;font-size:11px}.tc-v20-flow b{margin-right:4px}
.tc-v20-summary-grid{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(280px,.65fr);gap:18px;margin-bottom:18px}
.tc-v20-overview,.tc-v20-mode-summary{padding:18px 20px}
.tc-v20-overview-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.tc-v20-overview-card{border:1px solid #e6e9f2;border-radius:16px;background:#fff;padding:14px;text-align:left;cursor:pointer;transition:.18s ease}.tc-v20-overview-card:hover{transform:translateY(-2px);box-shadow:0 10px 22px rgba(22,30,64,.08)}.tc-v20-overview-card span{display:block;font-size:12px;font-weight: 700;color:#475467}.tc-v20-overview-card strong{display:block;margin-top:8px;font-size:24px;color:#101828}.tc-v20-overview-card div{height:7px;margin-top:10px;background:#eef1f6;border-radius:999px;overflow:hidden}.tc-v20-overview-card i{display:block;height:100%;border-radius:999px}.tc-v20-overview-card small{display:block;margin-top:7px;color:#98a2b3;font-size:10px}.tc-v20-overview-card.fit i{background:#22c55e}.tc-v20-overview-card.potential i{background:#f59e0b}.tc-v20-overview-card.duplicate i{background:#ef4444}.tc-v20-overview-card.outside i{background:#94a3b8}
.tc-v20-mode-summary b{display:block;color:#312e81;font-size:16px}.tc-v20-mode-summary p{margin:8px 0 14px;color:#667085;font-size:12px;line-height:1.55}.tc-v20-mode-summary dl{display:grid;gap:10px}.tc-v20-mode-summary dl div{display:flex;justify-content:space-between;gap:12px;padding-top:9px;border-top:1px solid #eef1f6}.tc-v20-mode-summary dt{color:#667085;font-size:11px}.tc-v20-mode-summary dd{margin:0;color:#344054;font-size:11px;font-weight: 700;text-align:right}
.tc-v20-main-grid{grid-template-columns:minmax(0,1.65fr) minmax(310px,.55fr)}
.tc-v20-table-wrap{max-height:760px;overflow:auto}.tc-v20-table{min-width:2400px;table-layout:fixed}.tc-v20-table th:nth-child(1){width:48px}.tc-v20-table th:nth-child(2){width:330px}.tc-v20-table th:nth-child(3){width:190px}.tc-v20-table th:nth-child(4){width:160px}.tc-v20-table th:nth-child(5),.tc-v20-table th:nth-child(6),.tc-v20-table th:nth-child(8),.tc-v20-table th:nth-child(9){width:110px}.tc-v20-table th:nth-child(7){width:140px}.tc-v20-table th:nth-child(10),.tc-v20-table th:nth-child(11){width:320px}.tc-v20-table th:nth-child(12){width:210px}.tc-v20-table th:nth-child(13){width:250px}.tc-v20-table th:nth-child(14){width:100px}
.tc-v20-table thead th{position:sticky;top:0;z-index:3;background:#f7f8fc}.tc-v20-row.group-fit td{background:#fbfffc}.tc-v20-row.group-potential td{background:#fffdf7}.tc-v20-row.group-duplicate td{background:#fffafa}.tc-v20-group{display:inline-flex;padding:6px 9px;border-radius:999px;font-size:10px;font-weight: 700}.tc-v20-group.fit{background:#dcfce7;color:#15803d}.tc-v20-group.potential{background:#fef3c7;color:#b45309}.tc-v20-group.duplicate{background:#fee2e2;color:#b91c1c}.tc-v20-group.outside{background:#f1f5f9;color:#64748b}.tc-v20-source{display:block;margin-top:6px;color:#667085;font-size:9px}
.tc-v20-score{display:grid;gap:6px}.tc-v20-score strong{font-size:12px}.tc-v20-score i{display:block;width:100%;height:6px;background:#edf1f6;border-radius:999px;overflow:hidden}.tc-v20-score i b{display:block;height:100%;border-radius:999px}.tc-v20-score.good strong{color:#15803d}.tc-v20-score.good i b{background:#22c55e}.tc-v20-score.mid strong{color:#b45309}.tc-v20-score.mid i b{background:#f59e0b}.tc-v20-score.bad strong{color:#b91c1c}.tc-v20-score.bad i b{background:#ef4444}.tc-v20-intent{display:inline-flex;margin-bottom:7px;padding:5px 8px;border-radius:999px;background:#eef2ff;color:#1e40af;font-size:9px;font-weight: 700}.tc-v20-long{font-size:10.5px;line-height:1.45;color:#475467;white-space:normal}
.tc-v20-risk-list{display:grid;gap:9px;margin-top:10px}.tc-v20-risk-list article{padding:11px 12px;border:1px solid #fee2e2;border-radius:12px;background:#fffafa}.tc-v20-risk-list.potential article{border-color:#fde68a;background:#fffdf5}.tc-v20-risk-list a{display:block;color:#344054;font-size:11px;font-weight: 700;text-decoration:none}.tc-v20-risk-list span{display:inline-flex;margin-top:6px;padding:4px 7px;border-radius:999px;background:#fee2e2;color:#b91c1c;font-size:9px;font-weight: 700}.tc-v20-risk-list.potential span{background:#fef3c7;color:#b45309}.tc-v20-risk-list small{display:block;margin-top:6px;color:#667085;font-size:10px;line-height:1.45}
.tc-v20-pagination{display:flex;align-items:center;gap:8px}.tc-v20-pagination button{width:34px;height:34px;border:1px solid #dce2ec;border-radius:10px;background:#fff;color:#1e40af;font-size:18px;cursor:pointer}.tc-v20-pagination button:disabled{opacity:.4;cursor:not-allowed}.tc-v20-pagination span{font-size:11px;color:#667085;font-weight: 700}
.tc-v20-kpi-fit .tc-kpi-icon{background:#dcfce7;color:#15803d}.tc-v20-kpi-potential .tc-kpi-icon{background:#fef3c7;color:#b45309}.tc-v20-kpi-duplicate .tc-kpi-icon{background:#fee2e2;color:#b91c1c}.tc-v20-kpi-outside .tc-kpi-icon{background:#f1f5f9;color:#64748b}.tc-v20-kpi-ai .tc-kpi-icon{background:#eaf1fe;color:#1d4ed8}
@media (max-width:1450px){.tc-v20-form{grid-template-columns:1fr}.tc-v20-inputs{grid-template-columns:1fr 1fr}.tc-mode-field{grid-column:1/-1}.tc-v20-main-grid{grid-template-columns:1fr}.tc-v20-summary-grid{grid-template-columns:1fr}}
@media (max-width:900px){.tc-v20-inputs,.tc-v20-overview-grid{grid-template-columns:1fr}.tc-form-actions{flex-direction:column}.tc-form-actions .btn{width:100%}}

/* ===== Topic Cluster v21 — Pillar Blueprint + Global Selection ===== */
.tc-v21-flow{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:16px}
.tc-v21-flow span{display:block;padding:11px 13px;border:1px solid #e9e4ff;border-radius:14px;background:#faf8ff;color:#1e40af;font-size:11px;line-height:1.45}
.tc-v21-flow b{display:block;margin-bottom:3px;color:#312e81}
.tc-progress-steps>span{display:grid;grid-template-columns:14px minmax(0,1fr);grid-template-areas:"dot label" "dot meta";gap:2px 7px;padding:8px 9px;border:1px solid #e9e7f3;border-radius:11px;background:#fff;color:#667085;font-size:10px;font-weight: 700}
.tc-progress-steps>span i{grid-area:dot;width:10px;height:10px;border-radius:50%;margin-top:2px;background:#d5d9e5;box-shadow:0 0 0 4px #f5f6f9}
.tc-progress-steps>span em{grid-area:meta;font-style:normal;font-size:9px;color:#98a2b3}
.tc-progress-steps>span.is-active{border-color:#bca7ff;background:#faf8ff;color:#1e40af}.tc-progress-steps>span.is-active i{background:#2563eb;box-shadow:0 0 0 4px #eaf1fe}
.tc-progress-steps>span.is-done{color:#15803d}.tc-progress-steps>span.is-done i{background:#16a34a;box-shadow:0 0 0 4px #dcfce7}
.tc-v21-blueprint-panel,.tc-v21-selected-panel{margin-bottom:18px;padding:18px 20px}
.tc-v21-blueprint-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.tc-v21-blueprint-card{display:grid;grid-template-columns:48px minmax(0,1fr) minmax(190px,.65fr);gap:14px;align-items:center;padding:14px;border:1px solid #e5e7eb;border-radius:16px;background:#fff}
.tc-v21-blueprint-card.has-selected{border-color:#bfdbfe;background:linear-gradient(135deg,#fff,#faf8ff)}
.tc-v21-blueprint-card.is-missing{border-style:dashed;background:#fffdf7}
.tc-v21-blueprint-index{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;background:#eaf1fe;color:#1d4ed8;font-size:12px;font-weight: 700}
.tc-v21-blueprint-copy strong{display:block;color:#101828;font-size:13px}.tc-v21-blueprint-copy p{margin:5px 0;color:#667085;font-size:10.5px;line-height:1.45}.tc-v21-blueprint-copy small{color:#2563eb;font-size:9.5px;font-weight: 700}
.tc-v21-blueprint-result{display:grid;gap:5px;justify-items:start}.tc-v21-blueprint-result span{display:inline-flex;padding:5px 8px;border-radius:999px;font-size:9px;font-weight: 700}.tc-v21-blueprint-result .selected{background:#dcfce7;color:#15803d}.tc-v21-blueprint-result .missing{background:#fef3c7;color:#b45309}.tc-v21-blueprint-result a{color:#1e40af;font-size:10.5px;font-weight: 700;text-decoration:none;line-height:1.4}.tc-v21-blueprint-result em{font-style:normal;color:#667085;font-size:9.5px;line-height:1.4}
.tc-v21-selected-table{min-width:1500px;table-layout:fixed}.tc-v21-selected-table th:nth-child(1){width:50px}.tc-v21-selected-table th:nth-child(2){width:230px}.tc-v21-selected-table th:nth-child(3){width:360px}.tc-v21-selected-table th:nth-child(4){width:110px}.tc-v21-selected-table th:nth-child(5){width:150px}.tc-v21-selected-table th:nth-child(6){width:90px}.tc-v21-selected-table th:nth-child(7),.tc-v21-selected-table th:nth-child(8){width:300px}.tc-v21-selected-table th:nth-child(9){width:220px}
.tc-v21-selected-table td a{display:block;color:#1e40af;font-weight: 700;text-decoration:none}.tc-v21-selected-table td small{display:block;margin-top:5px;color:#667085}
.tc-v21-all-table{min-width:2550px;table-layout:fixed}.tc-v21-all-table th:nth-child(1){width:48px}.tc-v21-all-table th:nth-child(2){width:330px}.tc-v21-all-table th:nth-child(3){width:180px}.tc-v21-all-table th:nth-child(4){width:250px}.tc-v21-all-table th:nth-child(5){width:145px}.tc-v21-all-table th:nth-child(6),.tc-v21-all-table th:nth-child(7),.tc-v21-all-table th:nth-child(9),.tc-v21-all-table th:nth-child(10),.tc-v21-all-table th:nth-child(11){width:110px}.tc-v21-all-table th:nth-child(8){width:150px}.tc-v21-all-table th:nth-child(12),.tc-v21-all-table th:nth-child(13){width:320px}.tc-v21-all-table th:nth-child(14){width:210px}.tc-v21-all-table th:nth-child(15){width:100px}
.tc-v21-selected-row td{background:#f7fff9!important;border-top-color:#bbf7d0;border-bottom-color:#bbf7d0}
.tc-v21-missing-list{display:grid;gap:9px}.tc-v21-missing-list article{padding:11px 12px;border:1px dashed #f5c76b;border-radius:12px;background:#fffdf6}.tc-v21-missing-list strong{font-size:11px;color:#92400e}.tc-v21-missing-list p{margin:5px 0;color:#667085;font-size:10px;line-height:1.45}.tc-v21-missing-list small{color:#b45309;font-size:9.5px}
.tc-v21-kpi-blueprint .tc-kpi-icon{background:#eaf1fe;color:#1d4ed8}.tc-v21-kpi-fit .tc-kpi-icon{background:#dcfce7;color:#15803d}.tc-v21-kpi-potential .tc-kpi-icon{background:#fef3c7;color:#b45309}.tc-v21-kpi-duplicate .tc-kpi-icon{background:#fee2e2;color:#b91c1c}.tc-v21-kpi-outside .tc-kpi-icon{background:#f1f5f9;color:#64748b}.tc-v21-kpi-ai .tc-kpi-icon{background:#e0f2fe;color:#0369a1}
@media(max-width:1450px){.tc-v21-flow{grid-template-columns:1fr 1fr}.tc-v21-blueprint-list{grid-template-columns:1fr}.tc-v21-blueprint-card{grid-template-columns:48px minmax(0,1fr)}}
@media(max-width:900px){.tc-v21-flow{grid-template-columns:1fr}.tc-v21-blueprint-card{grid-template-columns:1fr}.tc-v21-blueprint-result{justify-items:start}}

/* UI audit normalization patch */
@media (max-width: 1024px) {
  .topbar {
    gap: var(--space-4);
  }
  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .top-actions .btn,
  .top-actions .export-group {
    min-height: 40px;
  }
  .prompt-modal {
    padding: var(--space-4);
  }
}

@media (max-width: 768px) {
  .main {
    padding: var(--space-4);
  }
  .sidebar {
    padding: var(--space-4);
  }
  .side-nav {
    gap: var(--space-2);
  }
  .nav-item,
  .nav-subitem {
    min-height: 42px;
  }
  .top-actions,
  .filters,
  .import-form {
    align-items: stretch;
    width: 100%;
  }
  .top-actions > *,
  .filters > *,
  .import-form > *,
  .filters .search-box,
  .filters .search-box input {
    width: 100%;
    min-width: 0;
  }
  .table-wrap,
  .tc-table-wrap,
  .kw-v5-table-wrap,
  .anchor-review-table-wrap {
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
  }
  th,
  td {
    padding: 12px 10px;
  }
  .prompt-modal {
    padding: 0;
  }
  .prompt-modal-card {
    width: 100vw;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }
  .prompt-modal-head,
  .prompt-modal-foot {
    flex: 0 0 auto;
  }
  .prompt-modal-foot {
    align-items: stretch;
    flex-wrap: wrap;
  }
  .prompt-modal-foot .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 560px) {
  .page-heading h1 {
    font-size: 22px;
    line-height: 1.25;
  }
  .page-sub {
    font-size: var(--fs-sm);
  }
  .export-group {
    width: 100%;
  }
  .export-group .btn.ghost {
    flex: 1;
  }
  .tc-v21-selected-table,
  .tc-v21-all-table,
  .tc-v20-table {
    min-width: 980px;
  }
}

/* Global white sidebar */
:root {
  --sidebar-expanded-width: 242px;
  --sidebar-collapsed-width: 72px;
  --sidebar-width-expanded: var(--sidebar-expanded-width);
  --sidebar-width-collapsed: var(--sidebar-collapsed-width);
  --sidebar-current-width: var(--sidebar-width-expanded);
  --app-sidebar-accent: #1d4ed8;
  --app-sidebar-accent-soft: rgba(255,255,255,.06);
  --app-sidebar-text: #bccce3;
  --app-sidebar-muted: #8ea8cc;
  --app-sidebar-line: rgba(255,255,255,.12);
  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 15px;
  --text-lg: 18px;
  --title-section: clamp(20px, 1.5vw, 26px);
  --title-page: clamp(26px, 2vw, 34px);
}

body.sidebar-collapsed {
  --sidebar-current-width: var(--sidebar-width-collapsed);
}

.shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  background: #f7f8fb;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex: 0 0 var(--sidebar-current-width);
  width: var(--sidebar-current-width);
  height: 100vh;
  padding: 20px 14px;
  flex-direction: column;
  gap: 16px;
  overflow: visible;
  color: var(--app-sidebar-text);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--app-sidebar-line);
  box-shadow: 18px 0 45px rgba(16, 24, 40, .06);
  transition: width .22s ease, flex-basis .22s ease, padding .22s ease;
}

.app-sidebar__header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
}

.app-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 6px;
  border-radius: 18px;
  text-align: left;
  cursor: pointer;
}

.app-sidebar__brand:hover,
.app-sidebar__account:hover,
.app-sidebar__help:hover {
  background: rgba(255,255,255,.07);
}

.app-sidebar__brand-mark,
.app-sidebar__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 14px;
  color: #fff;
  font-weight: 700;
  font-size: 24px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 58%, #1d9bf0 100%);
  box-shadow: 0 12px 22px rgba(29,78,216, .2);
}

.app-sidebar__brand-text,
.app-sidebar__account-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.app-sidebar__brand-text strong,
.app-sidebar__account-text strong {
  overflow: hidden;
  color: #ffffff;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar__brand-text span,
.app-sidebar__account-text span,
.app-sidebar__meta {
  overflow: hidden;
  color: var(--app-sidebar-muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar__toggle {
  position: absolute;
  right: -34px;
  top: 50%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #cfe0f7;
  background: rgba(255,255,255,.08);
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform .18s ease, color .18s ease, border-color .18s ease;
}

.app-sidebar__toggle svg {
  width: 18px;
  height: 18px;
  transition: transform .2s ease;
}

.app-sidebar__toggle:hover {
  color: var(--app-sidebar-accent);
  border-color: var(--app-sidebar-accent);
}

.app-sidebar__nav {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: thin;
}

.app-sidebar .nav-label {
  display: none;
}

.app-sidebar__group {
  display: grid;
  gap: 4px;
}

.app-sidebar__item,
.app-sidebar__subitem,
.app-sidebar__help,
.app-sidebar__account {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  color: var(--app-sidebar-text);
  background: transparent;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.app-sidebar__item {
  padding: 0 12px;
}

.app-sidebar__subitem {
  min-height: 42px;
  padding: 0 10px 0 38px;
  color: #a9bcd8;
  font-size: 12.5px;
  font-weight: 500;
}

.app-sidebar__item svg,
.app-sidebar__subitem svg,
.app-sidebar__help svg {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  color: currentColor;
}

.app-sidebar__item:hover,
.app-sidebar__subitem:hover {
  color: #ffffff;
  background: rgba(255,255,255,.07);
}

.app-sidebar__item--active,
.app-sidebar__item.active,
.app-sidebar__subitem--active,
.app-sidebar__subitem.active {
  color: #ffffff !important;
  background: var(--app-sidebar-accent) !important;
  box-shadow: none;
}
.app-sidebar__item--active .app-sidebar__icon,
.app-sidebar__item.active .app-sidebar__icon,
.app-sidebar__item--active svg,
.app-sidebar__item.active svg,
.app-sidebar__subitem--active svg,
.app-sidebar__subitem.active svg {
  color: #ffffff;
}

.app-sidebar__item--disabled {
  cursor: default;
}

.app-sidebar__item--disabled:hover {
  color: var(--app-sidebar-text);
  background: transparent;
}

.app-sidebar__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 22px;
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #cfe0f7;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
}

.app-sidebar__badge--muted {
  background: rgba(255,255,255,.08);
  color: #8ea8cc;
}

.app-sidebar__chevron,
.app-sidebar__account-caret {
  margin-left: auto;
  color: #8ea8cc;
  transition: transform .18s ease;
}

.app-sidebar__account-caret {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.app-sidebar__group.is-open > .app-sidebar__group-trigger .app-sidebar__chevron {
  transform: rotate(180deg);
}

.app-sidebar__submenu {
  position: relative;
  display: grid;
  gap: 4px;
  margin: 4px 0 6px 22px;
  padding-left: 12px;
}

.app-sidebar__submenu[hidden] {
  display: none;
}

.app-sidebar__submenu::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  bottom: 8px;
  width: 1px;
  background: rgba(255,255,255,.12);
}

.app-sidebar__dot {
  width: 10px;
  height: 10px;
  margin-left: 5px;
  flex: 0 0 10px;
  border-radius: 999px;
  background: var(--app-sidebar-accent);
  box-shadow: 0 0 0 5px rgba(29,78,216, .09);
}

.app-sidebar__footer {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--app-sidebar-line);
}

.app-sidebar__help,
.app-sidebar__account {
  padding: 8px 10px;
}

.app-sidebar__avatar {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  font-size: 15px;
}

.app-sidebar__mobile-toggle,
.app-sidebar__overlay {
  display: none;
}

.app-sidebar--collapsed {
  padding-inline: 12px;
}

.app-sidebar--collapsed .app-sidebar__toggle svg {
  transform: rotate(180deg);
}

.app-sidebar--collapsed .app-sidebar__brand {
  justify-content: center;
  padding-inline: 0;
}

.app-sidebar--collapsed .app-sidebar__brand-text,
.app-sidebar--collapsed .app-sidebar__label,
.app-sidebar--collapsed .app-sidebar__badge,
.app-sidebar--collapsed .app-sidebar__chevron,
.app-sidebar--collapsed .app-sidebar__account-text,
.app-sidebar--collapsed .app-sidebar__account-caret,
.app-sidebar--collapsed .app-sidebar__meta,
.app-sidebar--collapsed .app-sidebar__submenu {
  display: none;
}

.app-sidebar--collapsed .app-sidebar__item,
.app-sidebar--collapsed .app-sidebar__subitem,
.app-sidebar--collapsed .app-sidebar__help,
.app-sidebar--collapsed .app-sidebar__account {
  justify-content: center;
  padding-inline: 0;
}

.app-sidebar--collapsed .app-sidebar__subitem {
  margin-left: 0;
}

.app-sidebar--collapsed .app-sidebar__item--active,
.app-sidebar--collapsed .app-sidebar__item.active,
.app-sidebar--collapsed .app-sidebar__subitem--active,
.app-sidebar--collapsed .app-sidebar__subitem.active {
  box-shadow: none;
}

.app-sidebar--collapsed [data-sidebar-tooltip]:hover::after,
.app-sidebar--collapsed [data-sidebar-tooltip]:focus-visible::after {
  content: attr(data-sidebar-tooltip);
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  z-index: 200;
  padding: 8px 10px;
  border-radius: 10px;
  color: #fff;
  background: var(--navy-2);
  box-shadow: 0 12px 26px rgba(16, 24, 40, .18);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transform: translateY(-50%);
  pointer-events: none;
}

@media (max-width: 1199px) and (min-width: 768px) {
  .app-sidebar {
    --sidebar-current-width: var(--sidebar-width-collapsed);
  }

  body:not(.sidebar-collapsed) .app-sidebar {
    --sidebar-current-width: var(--sidebar-width-expanded);
  }
}

@media (max-width: 767px) {
  .shell {
    display: block;
  }

  .app-main,
  .main {
    width: 100%;
    padding: 18px;
  }

  .topbar {
    display: flex;
    align-items: flex-start;
    gap: 12px;
  }

  .app-sidebar__mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid #e5e9f2;
    border-radius: 13px;
    color: #344054;
    background: #fff;
    box-shadow: 0 10px 22px rgba(16, 24, 40, .08);
    cursor: pointer;
  }

  .app-sidebar__mobile-toggle svg {
    width: 20px;
    height: 20px;
  }

  .app-sidebar {
    position: fixed !important;
    inset: 0 auto 0 0;
    z-index: 120;
    width: min(288px, calc(100vw - 48px)) !important;
    height: 100dvh !important;
    flex-basis: auto !important;
    transform: translateX(-105%);
    transition: transform .24s ease;
  }

  .app-sidebar--collapsed .app-sidebar__brand-text,
  .app-sidebar--collapsed .app-sidebar__label,
  .app-sidebar--collapsed .app-sidebar__badge,
  .app-sidebar--collapsed .app-sidebar__chevron,
  .app-sidebar--collapsed .app-sidebar__account-text,
  .app-sidebar--collapsed .app-sidebar__account-caret,
  .app-sidebar--collapsed .app-sidebar__meta {
    display: initial;
  }

  .app-sidebar--collapsed .app-sidebar__brand-text,
  .app-sidebar--collapsed .app-sidebar__account-text {
    display: grid;
  }

  .app-sidebar--collapsed .app-sidebar__submenu {
    display: grid;
  }

  .app-sidebar--collapsed .app-sidebar__item,
  .app-sidebar--collapsed .app-sidebar__subitem,
  .app-sidebar--collapsed .app-sidebar__help,
  .app-sidebar--collapsed .app-sidebar__account {
    justify-content: flex-start;
    padding-inline: 12px;
  }

  .app-sidebar--collapsed .app-sidebar__subitem {
    padding-left: 38px;
  }

  .app-sidebar__toggle {
    display: none;
  }

  body.sidebar-mobile-open .app-sidebar {
    transform: translateX(0);
  }

  .app-sidebar__overlay {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: block;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(2px);
  }

  .app-sidebar__overlay[hidden] {
    display: none;
  }
}

/* Desktop and large-screen responsive guardrails */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

.app-main {
  padding: 0 !important;
}

.app-main__inner {
  box-sizing: border-box;
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  padding: 26px clamp(20px, 2vw, 40px) 40px;
}

.app-main__inner--wide {
  max-width: 1920px;
}

.page-heading h1 {
  font-size: var(--title-page);
}

.panel-head h2,
.tc-control-head h2,
.kw-v5-card-title h3 {
  font-size: var(--title-section);
}

.app-sidebar {
  width: var(--sidebar-current-width) !important;
  flex: 0 0 var(--sidebar-current-width) !important;
  min-width: var(--sidebar-current-width);
  max-width: var(--sidebar-current-width);
}

@media (min-width: 768px) {
  .shell {
    display: block;
    min-width: 0;
    max-width: 100%;
  }

  .sidebar.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    width: var(--sidebar-current-width) !important;
    min-width: var(--sidebar-current-width);
    max-width: var(--sidebar-current-width);
    height: 100dvh;
    flex: none !important;
    box-sizing: border-box;
    overflow: visible;
    transform: none;
  }

  .main.app-main {
    width: auto;
    min-width: 0;
    max-width: 100%;
    margin-left: var(--sidebar-current-width);
    box-sizing: border-box;
    transition: margin-left .22s ease;
  }

  .app-main__inner {
    min-width: 0;
    max-width: min(1720px, 100%);
  }

  .app-main__inner--wide {
    max-width: min(1920px, 100%);
  }

  .app-sidebar__toggle {
    top: 64px;
    right: -19px;
    z-index: 101;
    transform: none;
  }
}

.app-sidebar__item {
  font-size: 15px;
}

.app-sidebar__subitem {
  font-size: 14px;
}

.app-sidebar__brand-text strong,
.app-sidebar__account-text strong {
  font-size: 15px;
}

.app-sidebar__brand-text span,
.app-sidebar__account-text span {
  font-size: 12px;
}

.app-sidebar__item svg,
.app-sidebar__subitem svg,
.app-sidebar__help svg {
  width: 21px;
  height: 21px;
}

.cards,
.quick-grid,
.inlink-metrics,
.kw-v5-stats,
.tc-stats,
.tc-kpi-grid,
.tc-v20-overview-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.metric-card,
.quick-card,
.tc-stat,
.tc-kpi,
.kw-v5-stat {
  min-width: 0;
}

.anchor-review-layout,
.tc-main-grid,
.tc-v20-main-grid,
.kw-v5-contentgrid,
.kw-v5-topgrid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
}

.table-wrap,
.tc-table-wrap,
.kw-v5-table-wrap,
.anchor-review-table-wrap,
.anchor-merged-table-wrap,
.health-table-wrap,
.link-insight-table-wrap {
  max-width: 100%;
  overflow: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.table-wrap table,
.tc-table,
.kw-v5-table,
.anchor-review-table,
.anchor-full-table,
.anchor-merged-table {
  font-size: 13px;
}

.article-cell a,
.kw-v5-article-cell a,
.tc-page-cell > a,
.anchor-current-url,
.matched-url,
.tc-row .tc-page-cell small,
.kw-v5-ai-cell p,
.tc-v20-long {
  overflow: hidden;
  text-overflow: ellipsis;
}

.kw-v5-article-cell a,
.tc-page-cell > a,
.article-cell a {
  display: -webkit-box;
  max-width: 380px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.kw-v5-ai-cell p,
.tc-v20-long,
.anchor-review-table td p {
  display: -webkit-box;
  max-width: 460px;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.prompt-modal-card {
  width: min(920px, calc(100vw - 48px));
}

.anchor-modal-card,
.anchor-review-modal-card,
.link-insight-modal-card,
.link-change-editor-card {
  width: min(1420px, calc(100vw - 64px));
}

.cfg-drawer-panel {
  width: min(480px, 100vw);
}

.anchor-review-detail-drawer {
  width: min(480px, 92vw) !important;
}

#anchorOptimizeModal .anchor-optimize-modal-card {
  width: min(520px, 100vw) !important;
}

@media (min-width: 1920px) {
  .app-main__inner {
    padding-inline: 40px;
  }

  .cfg-drawer-panel,
  .anchor-review-detail-drawer {
    width: min(520px, 100vw) !important;
  }

  .tc-map-canvas-inner,
  .tc-subpillar-canvas-inner {
    max-width: 100%;
  }
}

@media (min-width: 2560px) {
  .app-main__inner {
    max-width: 1720px;
  }

  .app-main__inner--wide {
    max-width: 1920px;
  }
}

@media (max-width: 1439px) {
  .app-main__inner {
    max-width: none;
    padding-inline: clamp(20px, 2.2vw, 32px);
  }

  .cards,
  .quick-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }
}

@media (max-width: 1279px) {
  .anchor-review-layout,
  .tc-main-grid,
  .tc-v20-main-grid,
  .kw-v5-contentgrid,
  .kw-v5-topgrid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  html,
  body {
    overflow-x: hidden;
  }

  .app-main__inner {
    max-width: none;
    padding: 18px;
  }

  .prompt-modal-card,
  .anchor-modal-card,
  .anchor-review-modal-card,
  .link-insight-modal-card,
  .link-change-editor-card {
    width: 100vw;
  }
}

/* Sidebar fix: override legacy .sidebar nav grid rules */
.sidebar.app-sidebar .app-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: flex-start;
  align-content: stretch;
}

.sidebar.app-sidebar .app-sidebar__item,
.sidebar.app-sidebar .app-sidebar__subitem,
.sidebar.app-sidebar .app-sidebar__help,
.sidebar.app-sidebar .app-sidebar__account,
.sidebar.app-sidebar .app-sidebar__group {
  flex: 0 0 auto;
}

.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__item,
.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__subitem,
.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__help,
.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__account,
.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__group {
  min-height: 46px;
}

.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__submenu {
  display: none;
}

/* Typography normalization */
:root {
  --font-family-ui:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  --font-sans: var(--font-family-ui);
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 20px;
  --text-page-title: 30px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --line-tight: 1.2;
  --line-snug: 1.35;
  --line-normal: 1.5;
  --line-relaxed: 1.6;
  --title-page: var(--text-page-title);
  --title-section: var(--text-2xl);
}

html,
body {
  font-family: var(--font-family-ui);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--line-normal);
  color: #101828;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
}

button,
input,
textarea,
select {
  font-family: var(--font-family-ui);
}

strong,
b {
  font-weight: var(--weight-semibold);
}

.page-heading h1 {
  font-size: var(--text-page-title);
  line-height: var(--line-tight);
  font-weight: var(--weight-bold);
  letter-spacing: -.025em;
}

.eyebrow {
  font-size: var(--text-xs);
  line-height: 1.3;
  font-weight: var(--weight-bold);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.page-sub {
  max-width: 720px;
  color: #667085;
  font-size: var(--text-base);
  line-height: var(--line-normal);
  font-weight: var(--weight-regular);
}

.app-sidebar__brand-text strong {
  font-size: var(--text-lg);
  line-height: 1.3;
  font-weight: var(--weight-semibold);
  letter-spacing: -.01em;
}

.app-sidebar__brand-text span {
  color: #667085;
  font-size: var(--text-sm);
  line-height: 1.4;
  font-weight: var(--weight-regular);
}

.app-sidebar__item,
.app-sidebar__help {
  font-size: var(--text-md);
  line-height: 1.4;
  font-weight: var(--weight-medium);
}

.app-sidebar__item--active,
.app-sidebar__item.active {
  font-weight: var(--weight-semibold);
}

.app-sidebar__subitem {
  font-size: var(--text-base);
  line-height: 1.4;
  font-weight: var(--weight-regular);
}

.app-sidebar__subitem--active,
.app-sidebar__subitem.active {
  font-weight: var(--weight-semibold);
}

.app-sidebar__badge {
  font-size: var(--text-xs);
  line-height: 1;
  font-weight: var(--weight-semibold);
}

.app-sidebar__account-text strong {
  font-size: var(--text-base);
  line-height: var(--line-snug);
  font-weight: var(--weight-semibold);
}

.app-sidebar__account-text span,
.app-sidebar__meta {
  color: #667085;
  font-size: var(--text-xs);
  line-height: var(--line-snug);
  font-weight: var(--weight-regular);
}

.app-sidebar__brand-mark,
.app-sidebar__avatar,
.kw-v5-icon,
.kw-v5-empty-icon,
.kw-empty-icon {
  font-weight: var(--weight-bold);
}

.btn,
.kw-v5-primary {
  font-family: var(--font-family-ui);
  font-size: var(--text-base);
  line-height: 1.3;
  font-weight: var(--weight-semibold);
}

.btn.small,
.row-action-btn,
.icon-lite {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.filters input,
.filters select,
.search-box input,
.kw-input-wrap input,
.kw-v5-searchbox input,
.kw-v5-row-search input,
.keyword-panel .kw-mini-search input {
  font-family: var(--font-family-ui);
  font-size: var(--text-md);
  line-height: 1.4;
  font-weight: var(--weight-regular);
}

.filters input::placeholder,
.search-box input::placeholder,
.kw-input-wrap input::placeholder,
.kw-v5-searchbox input::placeholder,
.kw-v5-row-search input::placeholder,
.keyword-panel .kw-mini-search input::placeholder {
  color: #98a2b3;
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
  opacity: 1;
}

.kw-v5-empty strong,
.kw-empty strong,
.kw-v5-intent-empty strong,
.keyword-panel .kw-intent-empty strong,
.inlink-empty-inner strong {
  font-size: 19px;
  line-height: var(--line-snug);
  font-weight: var(--weight-semibold);
  letter-spacing: -.01em;
}

.kw-v5-empty span,
.kw-empty,
.kw-v5-intent-empty p,
.keyword-panel .kw-intent-empty p,
.inlink-empty-inner span {
  color: #667085;
  font-size: var(--text-md);
  line-height: 1.55;
  font-weight: var(--weight-regular);
}

.panel-head h2,
.tc-control-head h2,
.kw-v5-card-title h3,
.keyword-panel .kw-section-head h3,
.keyword-panel .kw-side-card h3,
.kw-panel-head h3,
.kw-insight-panel h3 {
  font-size: var(--text-md);
  line-height: var(--line-snug);
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
}

.panel-head p,
.kw-v5-card-desc,
.keyword-panel .kw-section-head p,
.keyword-panel .kw-side-card p,
.kw-panel-head p,
.card-description,
.helper-text,
.kw-v5-hint,
.kw-v5-source,
.kw-v5-table-note,
.kw-v5-muted {
  color: #667085;
  font-size: var(--text-base);
  line-height: var(--line-normal);
  font-weight: var(--weight-regular);
}

.metric-body span,
.kw-v5-stat span:not(.kw-v5-stat-icon),
.kw-stat-card span,
.tc-kpi-copy span {
  color: #667085;
  font-size: var(--text-sm);
  line-height: var(--line-snug);
  font-weight: var(--weight-medium);
}

.metric-body strong,
.kw-v5-stat strong,
.kw-stat-card strong,
.keyword-panel .kw-stat-card strong,
.tc-kpi-copy strong,
.tc-v20-overview-card strong {
  font-size: 28px;
  line-height: 1.1;
  font-weight: var(--weight-bold);
  letter-spacing: -.02em;
}

th,
.kw-table th,
.kw-v5-table thead th,
.tc-table th,
.anchor-review-table th,
.anchor-full-table th,
.account-table th {
  font-size: var(--text-xs);
  line-height: 1.4;
  font-weight: var(--weight-semibold);
  letter-spacing: .01em;
}

td,
.kw-table td,
.kw-v5-table tbody td,
.tc-table td,
.anchor-review-table td,
.anchor-full-table td,
.account-table td {
  font-size: var(--text-sm);
  line-height: var(--line-normal);
  font-weight: var(--weight-regular);
}

.title-cell strong,
.kw-title-cell a,
.kw-v5-article-cell a,
.tc-page-cell > a,
.article-cell a {
  font-size: var(--text-base);
  line-height: 1.4;
  font-weight: var(--weight-semibold);
}

.title-cell span,
.kw-url,
.kw-v5-article-cell span,
.tc-page-cell > span,
.article-cell span {
  font-size: var(--text-xs);
  line-height: 1.4;
  font-weight: var(--weight-regular);
}

.badge,
.kw-badge,
.kw-v5-status,
.kw-v5-chip,
.kw-v5-match-chips span,
.kw-v5-mini-badge,
.tc-role,
.tc-row-status,
.tc-v20-group,
.account-status,
.account-cms-badge {
  font-size: var(--text-xs);
  line-height: 1.2;
  font-weight: var(--weight-medium);
}

.badge.run,
.badge.posting,
.badge.delay,
.badge.error,
.kw-v5-status-duplicate,
.kw-v5-status-possible,
.kw-v5-status-related,
.kw-v5-status-none,
.kw-v5-status-not_ai {
  font-weight: var(--weight-semibold);
}

.kw-v5-filter-label,
.kw-v5-filter-right > span,
.kw-v5-filter-right select,
.kw-v5-ai-toggle,
.keyword-panel .kw-controls select,
.keyword-panel .kw-chip,
.keyword-panel .kw-chip span {
  font-weight: var(--weight-medium);
}

.kw-v5-score strong,
.ai-score {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

.kw-v5-ai-cell p,
.kw-v5-match-cell p,
.kw-meta-preview,
.kw-reco,
.kw-v5-reco,
.tc-v20-long {
  font-size: var(--text-xs);
  line-height: 1.55;
  font-weight: var(--weight-regular);
}

.app-sidebar--collapsed [data-sidebar-tooltip]:hover::after,
.app-sidebar--collapsed [data-sidebar-tooltip]:focus-visible::after {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
}

@media (max-width: 1024px) {
  .page-heading h1 {
    font-size: 27px;
  }
}

@media (max-width: 767px) {
  .page-heading h1 {
    font-size: 24px;
  }

  input,
  select,
  textarea,
  .filters input,
  .search-box input,
  .kw-input-wrap input,
  .kw-v5-searchbox input,
  .kw-v5-row-search input {
    font-size: 16px;
  }
}

/* ========================================================================== 
   Modern UI refresh — sidebar + global dashboard polish
   Scope: body.modern-ui to avoid affecting authentication and legacy embeds.
   ========================================================================== */
body.modern-ui {
  --ui-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ui-bg: #f6f8fc;
  --ui-surface: #ffffff;
  --ui-surface-muted: #f9fafc;
  --ui-text: #172033;
  --ui-text-soft: #475467;
  --ui-muted: #667085;
  --ui-border: #e6eaf2;
  --ui-border-strong: #d9dfeb;
  --ui-primary: #1d4ed8;
  --ui-primary-hover: #1e40af;
  --ui-primary-soft: #eaf1fe;
  --ui-primary-softer: #f5f8fc;
  --ui-success: #079455;
  --ui-warning: #dc6803;
  --ui-danger: #d92d20;
  --ui-info: #1570ef;
  --ui-radius-sm: 9px;
  --ui-radius-md: 13px;
  --ui-radius-lg: 17px;
  --ui-shadow-sm: 0 1px 2px rgba(16, 24, 40, .03), 0 4px 12px rgba(16, 24, 40, .035);
  --ui-shadow-md: 0 8px 26px rgba(16, 24, 40, .065);
  --sidebar-expanded-width: 242px;
  --sidebar-collapsed-width: 72px;
  --sidebar-width-expanded: var(--sidebar-expanded-width);
  --sidebar-width-collapsed: var(--sidebar-collapsed-width);
  --app-sidebar-accent: var(--ui-primary);
  --app-sidebar-accent-soft: rgba(255,255,255,.06);
  --app-sidebar-text: #bccce3;
  --app-sidebar-muted: #8ea8cc;
  --app-sidebar-line: rgba(255,255,255,.12);
  margin: 0;
  color: var(--ui-text);
  background: var(--ui-bg);
  font-family: var(--ui-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
}

html:has(body.modern-ui),
body.modern-ui {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body.modern-ui *,
body.modern-ui *::before,
body.modern-ui *::after {
  box-sizing: border-box;
}

body.modern-ui button,
body.modern-ui input,
body.modern-ui textarea,
body.modern-ui select {
  font-family: var(--ui-font);
}

body.modern-ui .shell {
  display: block;
  min-width: 0;
  min-height: 100vh;
  max-width: 100%;
  background: var(--ui-bg);
}

/* ---------- Stable desktop sidebar ---------- */
@media (min-width: 768px) {
  body.modern-ui .sidebar.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    display: flex;
    width: var(--sidebar-current-width) !important;
    min-width: var(--sidebar-current-width) !important;
    max-width: var(--sidebar-current-width) !important;
    height: 100dvh;
    padding: 14px 12px 12px;
    flex: none !important;
    flex-direction: column;
    gap: 10px;
    overflow: visible;
    color: var(--app-sidebar-text);
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255,255,255,.1);
    box-shadow: 6px 0 24px rgba(0, 0, 0, .18);
    transform: none !important;
    transition: width .2s ease, min-width .2s ease, max-width .2s ease, padding .2s ease;
  }

  body.modern-ui .main.app-main {
    width: auto !important;
    min-width: 0;
    max-width: none;
    min-height: 100vh;
    margin-left: var(--sidebar-current-width);
    padding: 0 !important;
    overflow-x: visible;
    transition: margin-left .2s ease;
  }
}

body.modern-ui .app-sidebar__header {
  position: relative;
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

body.modern-ui .app-sidebar__brand {
  display: flex;
  min-width: 0;
  height: 56px;
  flex: 1 1 auto;
  align-items: center;
  gap: 11px;
  padding: 6px 8px;
  border: 0;
  border-radius: 15px;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease;
}

body.modern-ui .app-sidebar__brand:hover {
  background: var(--ui-primary-softer);
}

body.modern-ui .app-sidebar__brand-mark,
body.modern-ui .app-sidebar__avatar {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 58%, #2498f2 115%);
  box-shadow: 0 8px 18px rgba(29, 78, 216, .19);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

body.modern-ui .app-sidebar__brand-text,
body.modern-ui .app-sidebar__account-text {
  display: grid;
  min-width: 0;
  gap: 1px;
}

body.modern-ui .app-sidebar__brand-text strong {
  overflow: hidden;
  color: #1d2939;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.modern-ui .app-sidebar__brand-text span {
  overflow: hidden;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.modern-ui .app-sidebar__toggle {
  position: absolute;
  top: 50%;
  right: -31px;
  z-index: 104;
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--ui-border-strong);
  border-radius: 50%;
  color: #475467;
  background: #fff;
  box-shadow: 0 6px 18px rgba(16, 24, 40, .1);
  cursor: pointer;
  transform: translateY(-50%);
  transition: color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

body.modern-ui .app-sidebar__toggle:hover {
  color: var(--ui-primary);
  border-color: #cfc2ff;
  box-shadow: 0 8px 22px rgba(29,78,216, .14);
}

body.modern-ui .app-sidebar__toggle svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

body.modern-ui .app-sidebar__nav,
body.modern-ui .sidebar.app-sidebar .app-sidebar__nav {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: flex-start;
  align-content: stretch;
  gap: 3px;
  padding: 4px 2px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #d8deea transparent;
}

body.modern-ui .app-sidebar__nav::-webkit-scrollbar {
  width: 5px;
}

body.modern-ui .app-sidebar__nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #d8deea;
}

body.modern-ui .app-sidebar__group {
  display: grid;
  min-width: 0;
  gap: 2px;
  flex: 0 0 auto;
}

body.modern-ui .app-sidebar__item,
body.modern-ui .app-sidebar__subitem,
body.modern-ui .app-sidebar__help,
body.modern-ui .app-sidebar__account {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  border: 0;
  color: var(--app-sidebar-text);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}

body.modern-ui .app-sidebar__item {
  min-height: 42px;
  padding: 0 10px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
}

body.modern-ui .app-sidebar__subitem {
  min-height: 37px;
  padding: 0 8px 0 31px;
  border-radius: 10px;
  color: #5b6477;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
}

body.modern-ui .app-sidebar__item svg,
body.modern-ui .app-sidebar__subitem svg,
body.modern-ui .app-sidebar__help svg {
  width: 19px !important;
  height: 19px !important;
  flex: 0 0 19px !important;
  color: currentColor;
}

body.modern-ui .app-sidebar__item:hover,
body.modern-ui .app-sidebar__subitem:hover {
  color: var(--ui-primary);
  background: var(--ui-primary-softer);
}

body.modern-ui .app-sidebar__item--active,
body.modern-ui .app-sidebar__item.active,
body.modern-ui .app-sidebar__subitem--active,
body.modern-ui .app-sidebar__subitem.active {
  color: var(--ui-primary) !important;
  background: var(--ui-primary-soft) !important;
  box-shadow: inset 3px 0 0 var(--ui-primary);
  font-weight: 600;
}

body.modern-ui .app-sidebar__item--disabled,
body.modern-ui .app-sidebar__item--disabled:hover {
  color: #667085;
  background: transparent;
  cursor: default;
}

body.modern-ui .app-sidebar__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.modern-ui .app-sidebar__badge {
  display: inline-flex;
  min-width: 21px;
  min-height: 20px;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--ui-primary);
  background: #eee9ff;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  line-height: 1;
}

body.modern-ui .app-sidebar__badge--muted {
  color: #7f758d;
  background: #f1eff5;
}

body.modern-ui .app-sidebar__chevron,
body.modern-ui .app-sidebar__account-caret {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-left: auto;
  color: #8a92a3;
}

body.modern-ui .app-sidebar__submenu {
  position: relative;
  display: grid;
  gap: 1px;
  margin: 2px 0 5px 19px;
  padding-left: 10px;
}

body.modern-ui .app-sidebar__submenu::before {
  left: 4px;
  top: 4px;
  bottom: 7px;
  background: #e5e9f0;
}

body.modern-ui .app-sidebar__dot {
  width: 8px;
  height: 8px;
  margin-left: 5px;
  flex: 0 0 8px;
  box-shadow: 0 0 0 4px rgba(29,78,216, .09);
}

body.modern-ui .app-sidebar__footer {
  display: grid;
  flex: 0 0 auto;
  gap: 5px;
  padding-top: 9px;
  border-top: 1px solid var(--app-sidebar-line);
}

body.modern-ui .app-sidebar__help,
body.modern-ui .app-sidebar__account {
  min-height: 42px;
  padding: 5px 9px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 500;
}

body.modern-ui .app-sidebar__account {
  min-height: 58px;
}

body.modern-ui .app-sidebar__avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  font-size: 14px;
}

body.modern-ui .app-sidebar__account-text strong {
  overflow: hidden;
  color: #1d2939;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.modern-ui .app-sidebar__account-text span,
body.modern-ui .app-sidebar__meta {
  overflow: hidden;
  color: var(--ui-muted);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.modern-ui .app-sidebar--collapsed {
  padding-inline: 10px;
}

body.modern-ui .app-sidebar--collapsed .app-sidebar__brand {
  justify-content: center;
  padding-inline: 0;
}

body.modern-ui .app-sidebar--collapsed .app-sidebar__item,
body.modern-ui .app-sidebar--collapsed .app-sidebar__subitem,
body.modern-ui .app-sidebar--collapsed .app-sidebar__help,
body.modern-ui .app-sidebar--collapsed .app-sidebar__account {
  min-height: 44px;
  justify-content: center;
  padding-inline: 0;
}

body.modern-ui .app-sidebar--collapsed .app-sidebar__account {
  min-height: 50px;
}

body.modern-ui .app-sidebar--collapsed .app-sidebar__submenu {
  display: none !important;
}

body.modern-ui .app-sidebar--collapsed .app-sidebar__item--active,
body.modern-ui .app-sidebar--collapsed .app-sidebar__item.active,
body.modern-ui .app-sidebar--collapsed .app-sidebar__subitem--active,
body.modern-ui .app-sidebar--collapsed .app-sidebar__subitem.active {
  box-shadow: none;
}

body.modern-ui .app-sidebar--collapsed [data-sidebar-tooltip]:hover::after,
body.modern-ui .app-sidebar--collapsed [data-sidebar-tooltip]:focus-visible::after {
  padding: 7px 9px;
  border-radius: 8px;
  background: #1d2939;
  font-size: 11.5px;
  font-weight: 500;
}

/* ---------- Main layout and typography ---------- */
body.modern-ui .app-main__inner {
  width: 100%;
  max-width: 1740px;
  margin: 0 auto;
  padding: 24px clamp(22px, 2.1vw, 38px) 40px;
}

body.modern-ui .app-main__inner--wide {
  max-width: 1920px;
}

body.modern-ui .topbar {
  display: flex;
  margin-bottom: 20px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

body.modern-ui .page-heading h1 {
  color: #172033;
  font-size: clamp(26px, 1.8vw, 30px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -.025em;
}

body.modern-ui .eyebrow,
body.modern-ui .page-eyebrow {
  margin-bottom: 5px;
  color: var(--ui-primary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .13em;
  text-transform: uppercase;
}

body.modern-ui .page-sub,
body.modern-ui .page-description {
  max-width: 760px;
  margin-top: 5px;
  color: var(--ui-muted);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.5;
}

body.modern-ui h2,
body.modern-ui h3,
body.modern-ui h4 {
  color: #1d2939;
}

body.modern-ui p {
  color: var(--ui-muted);
}

/* ---------- Components ---------- */
body.modern-ui .btn,
body.modern-ui .kw-v5-primary,
body.modern-ui .row-action-btn,
body.modern-ui .tool-btn {
  min-height: 39px;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}

body.modern-ui .btn.primary,
body.modern-ui .kw-v5-primary {
  color: #fff;
  background: linear-gradient(135deg, #7b4cf7, #6434e8);
  box-shadow: 0 8px 18px rgba(29,78,216, .17);
}

body.modern-ui .btn.primary:hover,
body.modern-ui .kw-v5-primary:hover {
  background: linear-gradient(135deg, #7040ef, #5727d6);
  box-shadow: 0 10px 22px rgba(29,78,216, .22);
  transform: translateY(-1px);
}

body.modern-ui .btn.secondary {
  color: #026aa2;
  background: #ecf8ff;
}

body.modern-ui .btn.ghost,
body.modern-ui .tool-btn,
body.modern-ui .icon-btn {
  color: #344054;
  background: #fff;
  border-color: var(--ui-border);
  box-shadow: none;
}

body.modern-ui .btn.ghost:hover,
body.modern-ui .tool-btn:hover,
body.modern-ui .icon-btn:hover {
  color: var(--ui-primary);
  border-color: #d6c9ff;
  background: var(--ui-primary-softer);
}

body.modern-ui input,
body.modern-ui textarea,
body.modern-ui select,
body.modern-ui .filters input,
body.modern-ui .filters select,
body.modern-ui .search-box input,
body.modern-ui .kw-input-wrap input,
body.modern-ui .kw-v5-searchbox input,
body.modern-ui .kw-v5-row-search input {
  color: #344054;
  border-color: var(--ui-border-strong);
  border-radius: 10px;
  background: #fff;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .02);
}

body.modern-ui input::placeholder,
body.modern-ui textarea::placeholder {
  color: #98a2b3;
  font-weight: 400;
  opacity: 1;
}

body.modern-ui input:focus,
body.modern-ui textarea:focus,
body.modern-ui select:focus {
  border-color: #a88cf8;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(29,78,216, .1);
}

body.modern-ui .panel,
body.modern-ui .metric-card,
body.modern-ui .quick-card,
body.modern-ui .kw-v5-card,
body.modern-ui .kw-v5-stat,
body.modern-ui .tc-stat,
body.modern-ui .tc-kpi,
body.modern-ui .tc-v20-overview-card,
body.modern-ui .info-card,
body.modern-ui .side-section {
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

body.modern-ui .panel {
  margin-bottom: 16px;
}

body.modern-ui .panel-head {
  padding: 17px 18px;
  border-bottom-color: var(--ui-border);
}

body.modern-ui .panel-head h2,
body.modern-ui .tc-control-head h2,
body.modern-ui .kw-v5-card-title h3,
body.modern-ui .kw-panel-head h3,
body.modern-ui .kw-insight-panel h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.01em;
}

body.modern-ui .panel-head p,
body.modern-ui .kw-v5-card-desc,
body.modern-ui .helper-text,
body.modern-ui .card-description {
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

body.modern-ui .cards,
body.modern-ui .quick-grid,
body.modern-ui .inlink-metrics,
body.modern-ui .kw-v5-stats,
body.modern-ui .tc-stats,
body.modern-ui .tc-kpi-grid,
body.modern-ui .tc-v20-overview-grid {
  gap: 12px;
}

body.modern-ui .metric-card,
body.modern-ui .quick-card,
body.modern-ui .kw-v5-stat,
body.modern-ui .tc-stat,
body.modern-ui .tc-kpi {
  padding: 15px;
}

body.modern-ui .metric-card span,
body.modern-ui .kw-v5-stat span:not(.kw-v5-stat-icon),
body.modern-ui .metric-body span,
body.modern-ui .tc-kpi-copy span {
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

body.modern-ui .metric-card strong,
body.modern-ui .kw-v5-stat strong,
body.modern-ui .metric-body strong,
body.modern-ui .tc-kpi-copy strong {
  color: #172033;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.025em;
}

/* ---------- Tables ---------- */
body.modern-ui .table-wrap,
body.modern-ui .tc-table-wrap,
body.modern-ui .kw-v5-table-wrap,
body.modern-ui .anchor-review-table-wrap,
body.modern-ui .anchor-merged-table-wrap,
body.modern-ui .health-table-wrap,
body.modern-ui .link-insight-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

body.modern-ui table {
  border-spacing: 0;
}

body.modern-ui th,
body.modern-ui .kw-v5-table thead th,
body.modern-ui .tc-table th,
body.modern-ui .anchor-review-table th,
body.modern-ui .account-table th {
  padding: 11px 12px;
  color: #667085;
  border-bottom-color: var(--ui-border);
  background: #f8fafc;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: .025em;
}

body.modern-ui td,
body.modern-ui .kw-v5-table tbody td,
body.modern-ui .tc-table td,
body.modern-ui .anchor-review-table td,
body.modern-ui .account-table td {
  padding: 12px;
  color: #475467;
  border-bottom-color: #edf0f5;
  background: #fff;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.48;
}

body.modern-ui tbody tr:hover td {
  background: #fbfaff;
}

body.modern-ui .title-cell strong,
body.modern-ui .kw-title-cell a,
body.modern-ui .kw-v5-article-cell a,
body.modern-ui .tc-page-cell > a,
body.modern-ui .article-cell a {
  color: #1d2939;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.38;
}

body.modern-ui .title-cell span,
body.modern-ui .kw-url,
body.modern-ui .kw-v5-article-cell span,
body.modern-ui .tc-page-cell > span,
body.modern-ui .article-cell span {
  color: #7a8295;
  font-size: 11.5px;
  font-weight: 400;
}

body.modern-ui .badge,
body.modern-ui .kw-badge,
body.modern-ui .kw-v5-status,
body.modern-ui .kw-v5-chip,
body.modern-ui .tc-role,
body.modern-ui .account-status,
body.modern-ui .account-cms-badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}

/* ---------- Empty/loading states and overlays ---------- */
body.modern-ui .empty,
body.modern-ui .kw-v5-empty,
body.modern-ui .kw-empty,
body.modern-ui .inlink-empty-inner {
  color: var(--ui-muted);
}

body.modern-ui .kw-v5-empty strong,
body.modern-ui .kw-empty strong,
body.modern-ui .inlink-empty-inner strong {
  color: #1d2939;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
}

body.modern-ui .kw-v5-empty span,
body.modern-ui .kw-empty,
body.modern-ui .inlink-empty-inner span {
  color: var(--ui-muted);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.55;
}

body.modern-ui .dialog,
body.modern-ui .prompt-modal-card,
body.modern-ui .anchor-modal-card,
body.modern-ui .anchor-review-modal-card,
body.modern-ui .link-insight-modal-card,
body.modern-ui .link-change-editor-card {
  border: 1px solid rgba(230, 234, 242, .9);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(16, 24, 40, .16);
}

body.modern-ui .toast {
  border-radius: 11px;
  box-shadow: 0 14px 34px rgba(16, 24, 40, .18);
  font-size: 13px;
}

body.modern-ui :where(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid rgba(29,78,216, .35);
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1199px) and (min-width: 768px) {
  body.modern-ui {
    --sidebar-expanded-width: 242px;
    --sidebar-collapsed-width: 72px;
  }
}

@media (max-width: 767px) {
  body.modern-ui .shell {
    display: block;
  }

  body.modern-ui .main.app-main {
    width: 100%;
    min-width: 0;
    margin-left: 0;
    padding: 0 !important;
  }

  body.modern-ui .app-main__inner {
    max-width: none;
    padding: 17px;
  }

  body.modern-ui .app-sidebar {
    width: min(282px, calc(100vw - 42px)) !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 14px 12px;
    box-shadow: 16px 0 42px rgba(16, 24, 40, .15);
  }

  body.modern-ui .app-sidebar__toggle {
    display: none;
  }

  body.modern-ui .topbar {
    gap: 12px;
  }

  body.modern-ui .page-heading h1 {
    font-size: 24px;
  }

  body.modern-ui .page-sub {
    font-size: 13px;
  }

  body.modern-ui input,
  body.modern-ui textarea,
  body.modern-ui select {
    font-size: 16px;
  }
}

/* Chỉ giữ cụm action header trong nhóm AI Content: Bài viết mới + Cập nhật bài viết. */
body:not([data-active-page="posts"]):not([data-active-page="updates"]) .topbar > .top-actions:not(.top-actions-outline) {
  display: none;
}
body[data-active-page="outline-builder"] .topbar > .top-actions-outline{display:flex}
body:not([data-active-page="outline-builder"]) .topbar > .top-actions-outline{display:none}

/* ============================================================
   V4 SIDEBAR SKIN — giống hệt bizfly-dashboard-redesign-v4-navy.html
   (chỉ hình ảnh; markup + JS điều hướng giữ nguyên)
   ============================================================ */
.sidebar.app-sidebar{padding:16px 12px;gap:2px}

/* --- Header: brand trên, nút thu gọn dưới (v4) --- */
.sidebar.app-sidebar .app-sidebar__header{display:flex;flex-direction:column;align-items:stretch;gap:0;padding:0;border:none;background:none}
.sidebar.app-sidebar .app-sidebar__brand{display:flex;align-items:center;gap:11px;padding:6px 8px 8px;border:none;background:none;box-shadow:none;border-radius:0}
.sidebar.app-sidebar .app-sidebar__brand:hover{background:none}
.sidebar.app-sidebar .app-sidebar__brand-mark{width:36px;height:36px;flex:0 0 36px;border-radius:10px;background:var(--accent);color:#fff;font-size:19px;font-weight:600;box-shadow:none}
.sidebar.app-sidebar .app-sidebar__brand-text strong{color:#fff;font-size:15px;font-weight:600;line-height:1.1}
.sidebar.app-sidebar .app-sidebar__brand-text span{color:#8ea8cc;font-size:11px}
.sidebar.app-sidebar .app-sidebar__toggle{position:static;margin:4px 0 12px auto;width:30px;height:30px;flex:0 0 30px;border-radius:8px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.05);color:#a7bcd9;box-shadow:none;transform:none}
.sidebar.app-sidebar .app-sidebar__toggle:hover{color:#fff;border-color:var(--accent)}
.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__toggle{margin:4px auto 12px}
.sidebar.app-sidebar .app-sidebar__toggle svg{width:16px;height:16px}

/* --- Group trigger -> nhãn nhóm chữ hoa nhỏ (v4 nav-label) --- */
.sidebar.app-sidebar .app-sidebar__group-trigger{padding:12px 12px 5px;min-height:0;background:none!important;color:#6b83a6!important;font-size:10px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;border-radius:0;box-shadow:none!important}
.sidebar.app-sidebar .app-sidebar__group-trigger:hover{color:#9db4d6!important}
.sidebar.app-sidebar .app-sidebar__group-trigger>svg:first-child{display:none}
.sidebar.app-sidebar .app-sidebar__group-trigger .app-sidebar__chevron{width:13px;height:13px;color:#6b83a6}
.sidebar.app-sidebar .app-sidebar__group{border:none;background:none;padding:0;margin:0}

/* --- Item + subitem đồng nhất kiểu v4 --- */
.sidebar.app-sidebar .app-sidebar__item,
.sidebar.app-sidebar .app-sidebar__subitem,
.sidebar.app-sidebar .app-sidebar__help{display:flex;align-items:center;gap:12px;min-height:0;padding:10px 12px;border-radius:9px;color:#bccce3;font-size:12.5px;font-weight:400;line-height:1.3}
.sidebar.app-sidebar .app-sidebar__item svg,
.sidebar.app-sidebar .app-sidebar__subitem svg,
.sidebar.app-sidebar .app-sidebar__help svg{width:18px;height:18px;flex:0 0 18px;color:#8ea8cc}
.sidebar.app-sidebar .app-sidebar__item:hover,
.sidebar.app-sidebar .app-sidebar__subitem:hover,
.sidebar.app-sidebar .app-sidebar__help:hover{background:rgba(255,255,255,.06);color:#fff}
.sidebar.app-sidebar .app-sidebar__item:hover svg,
.sidebar.app-sidebar .app-sidebar__subitem:hover svg{color:#fff}
/* submenu: bỏ thụt + bỏ kẻ dọc */
.sidebar.app-sidebar .app-sidebar__submenu{padding:0;margin:0;border:none}
.sidebar.app-sidebar .app-sidebar__submenu::before{display:none}
.sidebar.app-sidebar .app-sidebar__subitem{padding-left:12px}
.sidebar.app-sidebar .app-sidebar__subitem .app-sidebar__dot{display:none}
/* active: nền xanh chữ trắng (v4) */
.sidebar.app-sidebar .app-sidebar__item--active,
.sidebar.app-sidebar .app-sidebar__item.active,
.sidebar.app-sidebar .app-sidebar__subitem--active,
.sidebar.app-sidebar .app-sidebar__subitem.active{background:var(--accent)!important;color:#fff!important;font-weight:600}
.sidebar.app-sidebar .app-sidebar__item--active svg,
.sidebar.app-sidebar .app-sidebar__subitem--active svg,
.sidebar.app-sidebar .app-sidebar__item.active svg,
.sidebar.app-sidebar .app-sidebar__subitem.active svg{color:#fff!important}
/* badge đếm: mini mờ */
.sidebar.app-sidebar .app-sidebar__badge{padding:1px 7px;border-radius:999px;background:rgba(255,255,255,.12);color:#cfe0f7;font-size:10.5px;font-weight:500}
.sidebar.app-sidebar .app-sidebar__meta{display:none}
.sidebar.app-sidebar .app-sidebar__item--disabled{opacity:.55}

/* --- Footer account kiểu v4 side-user --- */
.sidebar.app-sidebar .app-sidebar__footer{border:none;background:none;padding:0;margin-top:auto;gap:2px}
.sidebar.app-sidebar .app-sidebar__account{display:flex;align-items:center;gap:10px;padding:10px;border-radius:11px;background:rgba(255,255,255,.06);border:none}
.sidebar.app-sidebar .app-sidebar__account:hover{background:rgba(255,255,255,.1)}
.sidebar.app-sidebar .app-sidebar__avatar{width:30px;height:30px;flex:0 0 30px;border-radius:50%;background:var(--accent);color:#fff;font-size:12px;font-weight:600;box-shadow:none}
.sidebar.app-sidebar .app-sidebar__account-text strong{color:#fff;font-size:12px;font-weight:500;line-height:1.2}
.sidebar.app-sidebar .app-sidebar__account-text span{color:#8ea8cc;font-size:10px}
.sidebar.app-sidebar .app-sidebar__account-caret{color:#8ea8cc}

/* --- Collapsed 72px: chỉ icon, căn giữa (v4) --- */
.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__item,
.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__subitem,
.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__help{justify-content:center;padding:10px}
.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__label,
.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__badge,
.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__chevron,
.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__brand-text,
.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__account-text,
.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__account-caret{display:none}
.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__group-trigger{justify-content:center;padding:8px 0}
.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__account{justify-content:center;padding:8px}
.sidebar.app-sidebar.app-sidebar--collapsed .app-sidebar__brand{justify-content:center;padding:6px 0 8px}

/* ===== OVERVIEW V4 (theo ảnh mẫu) ===== */
.ov-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:13px;margin-bottom:14px}
.ov-kpi{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:15px 17px;box-shadow:var(--shadow-sm)}
.ov-kpi-top{display:flex;align-items:center;justify-content:space-between}
.ov-kpi-top span{color:var(--muted);font-size:12px}
.ov-ic{width:33px;height:33px;border-radius:9px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent-dark);flex:0 0 33px}
.ov-ic svg{width:17px;height:17px}
.ov-ic.amber{background:var(--warning-soft);color:var(--warning)}
.ov-ic.green{background:var(--success-soft);color:var(--success)}
.ov-ic.blue{background:#e6f0fd;color:var(--accent)}
.ov-ic.teal{background:#e0f5f3;color:#0d9488}
.ov-ic.red{background:var(--danger-soft);color:var(--danger)}
.ov-kpi>strong{display:block;font-size:26px;font-weight:600;letter-spacing:-.5px;color:var(--navy);margin-top:9px}
.ov-kpi-sub{display:block;font-size:11.5px;color:var(--muted);margin-top:2px}
.ov-kpi-sub.up{color:var(--success)}
.ov-grid2{display:grid;grid-template-columns:1.6fr 1fr;gap:13px;margin-bottom:14px}
.ov-card{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:17px 19px;box-shadow:var(--shadow-sm)}
.ov-card-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:15px;gap:10px;flex-wrap:wrap}
.ov-card-head b{font-size:14.5px;font-weight:600;color:var(--navy)}
.ov-card-head small{color:var(--muted);font-size:11.5px}
.ov-bars{display:flex;align-items:flex-end;gap:11px;height:150px;padding:20px 0 22px}
.ov-bargroup{flex:1;display:flex;flex-direction:column;align-items:center;height:100%;position:relative;justify-content:flex-end}
.ov-bar{width:100%;background:var(--accent-soft);border-radius:6px 6px 0 0;position:relative}
.ov-bar.hl{background:var(--accent)}
.ov-bar span{position:absolute;top:-19px;left:0;right:0;text-align:center;font-size:11px;color:var(--accent-dark);font-weight:600}
.ov-bargroup em{position:absolute;bottom:-20px;font-size:10.5px;color:var(--muted);font-style:normal}
.ov-duo{display:flex;gap:4px;align-items:flex-end;height:100%;width:100%;justify-content:center}
.ov-duo i{width:38%;max-width:16px;border-radius:4px 4px 0 0;display:block}
.ov-duo i.a{background:var(--accent)}
.ov-duo i.b{background:#0d9488}
.ov-legend{display:flex;gap:12px;font-size:11.5px;color:var(--muted)}
.ov-legend i{width:9px;height:9px;border-radius:2px;display:inline-block;margin-right:5px}
.ov-prog{display:flex;flex-direction:column;gap:14px}
.ov-prog .r{display:flex;justify-content:space-between;font-size:12px;margin-bottom:6px}
.ov-prog .r .mut{color:var(--muted)}
.ov-prog .r em{font-style:normal}
.ov-track{height:8px;background:#eef2f8;border-radius:99px;overflow:hidden}
.ov-track i{display:block;height:100%;border-radius:99px;width:0;transition:width .4s ease}
.ov-sechead{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin:22px 0 14px;flex-wrap:wrap}
.ov-eyebrow{color:var(--accent);font-size:10.5px;font-weight:600;letter-spacing:.08em}
.ov-sechead h2{font-size:18px;font-weight:600;color:var(--navy);margin:3px 0 2px}
.ov-sechead p{color:var(--muted);font-size:12.5px;margin:0}
.ov-sec-actions{display:flex;gap:8px;flex-shrink:0}
.ov-tablewrap{overflow-x:auto}
.ov-table{width:100%;border-collapse:collapse;font-size:12.5px}
.ov-table th{text-align:left;font-weight:500;color:var(--muted);font-size:11px;padding:8px 10px 8px 0;white-space:nowrap}
.ov-table td{padding:11px 10px 11px 0;border-top:1px solid var(--line);vertical-align:middle}
.ov-table .ov-src{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ov-table .ov-target{color:var(--muted);max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ov-table .ov-time{color:var(--muted);white-space:nowrap}
.ov-empty{text-align:center;color:var(--muted);padding:18px 0!important}
.ov-pill{display:inline-block;font-size:11px;padding:3px 10px;border-radius:999px;font-weight:500;white-space:nowrap}
.ov-pill.blue{background:var(--accent-soft);color:var(--accent-dark)}
.ov-pill.teal{background:#e0f5f3;color:#0f766e}
.ov-pill.green{background:var(--success-soft);color:#15803d}
.ov-pill.amber{background:var(--warning-soft);color:#b45309}
.ov-pill.red{background:var(--danger-soft);color:#b91c1c}
.ov-pill.mut{background:#eef2f6;color:#475569}
.ov-link{border:none;background:none;color:var(--accent);font-size:12px;font-weight:500;cursor:pointer;font-family:inherit}
@media(max-width:1024px){.ov-kpis{grid-template-columns:repeat(2,1fr)}.ov-grid2{grid-template-columns:1fr}}
@media(max-width:640px){.ov-kpis{grid-template-columns:1fr}}

/* ===== CRAWLER WEBSITE ===== */
.cw-layout{display:grid;grid-template-columns:1fr 300px;gap:14px;align-items:start}
.cw-main{min-width:0}
.cw-main .ov-card{margin-bottom:14px}
.cw-side .ov-card{margin-bottom:14px}
.cw-sub{color:var(--muted);font-size:12px;font-weight:400;margin-top:2px}
.cw-tabs{display:flex;gap:0;border:1px solid var(--line);border-radius:10px;overflow:hidden;margin-bottom:14px;width:fit-content}
.cw-tab{border:none;background:#f7f9fc;padding:9px 16px;font-size:12.5px;font-family:inherit;cursor:pointer;color:var(--muted);border-right:1px solid var(--line)}
.cw-tab:last-child{border-right:none}
.cw-tab.active{background:var(--accent-soft);color:var(--accent-dark);font-weight:600}
.cw-label{display:block;font-size:12px;font-weight:500;color:var(--text);margin-bottom:6px}
.cw-input{width:100%;min-height:39px;border:1px solid var(--line);border-radius:9px;background:#fff;font-size:12.5px;font-family:inherit;padding:8px 12px}
.cw-input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(29,78,216,.1)}
.cw-input.sm{min-height:34px;padding:5px 10px}
textarea.cw-input{resize:vertical}
.cw-hint{color:var(--muted);font-size:11.5px;margin-top:6px}
.cw-check{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--muted);margin-top:8px;cursor:pointer}
.cw-settings{display:grid;grid-template-columns:repeat(3,1fr);gap:12px 16px;margin-bottom:14px}
.cw-set label{display:block;font-size:11.5px;color:var(--muted);margin-bottom:5px}
.cw-set.cw-toggle{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 0}
.cw-set.cw-toggle label{margin:0;color:var(--text);font-size:12px}
.cw-set.cw-toggle input{width:34px;height:18px;accent-color:var(--accent);cursor:pointer}
.cw-controls{display:flex;gap:9px;align-items:center;border-top:1px solid var(--line);padding-top:14px}
.cw-runstate{font-size:12px;color:var(--muted)}
.cw-runstate.err{color:var(--danger)} .cw-runstate.ok{color:var(--success)} .cw-runstate.run{color:var(--accent-dark)}
.cw-progress-head{display:flex;justify-content:space-between;font-size:12.5px;margin-bottom:9px;gap:10px;flex-wrap:wrap}
.cw-progress-head span:first-child{font-weight:600;color:var(--navy)}
.cw-progress-meta{color:var(--muted);font-size:12px}
.cw-hist-action{white-space:nowrap;flex:none}
.cw-kpis{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;margin-top:14px}
.cw-kpi{border:1px solid var(--line);border-radius:10px;padding:10px 12px;text-align:left}
.cw-kpi span{display:block;font-size:11px;color:var(--muted)}
.cw-kpi b{display:block;font-size:19px;font-weight:600;color:var(--navy);margin-top:3px}
.cw-kpi.warn b{color:var(--danger)} .cw-kpi.ok b{color:var(--success)}
.cw-result-tools{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.cw-result-tools .cw-input{width:200px}
.cw-table td{font-size:12px;padding:9px 10px 9px 0}
.cw-table .cw-url{max-width:230px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cw-table .cw-url a{color:var(--accent);text-decoration:none}
.cw-table .cw-cell{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cw-pager{display:flex;justify-content:space-between;align-items:center;margin-top:10px;font-size:12px;color:var(--muted)}
.cw-pager>div{display:flex;gap:6px}
.cw-app{display:flex;gap:11px;padding:11px 0;border-bottom:1px solid var(--line)}
.cw-app:last-child{border-bottom:none}
.cw-app .ov-ic{font-size:15px}
.cw-app b{font-size:12.5px;color:var(--navy);display:block}
.cw-app p{font-size:11.5px;color:var(--muted);margin:3px 0 5px}
.cw-history{display:flex;flex-direction:column}
.cw-hist-row{display:flex;align-items:center;gap:8px;padding:9px 0;border-bottom:1px solid var(--line);cursor:pointer}
.cw-hist-row:last-child{border-bottom:none}
.cw-hist-row:hover .cw-hist-main b{color:var(--accent-dark)}
.cw-hist-main{flex:1;min-width:0}
.cw-hist-main b{display:block;font-size:11.5px;font-weight:500;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cw-hist-main span{font-size:10.5px;color:var(--muted)}
.cw-hist-del{border:none;background:none;color:var(--muted);cursor:pointer;font-size:12px;padding:2px 5px}
.cw-hist-del:hover{color:var(--danger)}
.cw-exclusions{display:flex;flex-direction:column;gap:7px}
.cw-exclusion-row{display:flex;align-items:center;gap:7px;padding:7px 9px;border:1px solid var(--line);border-radius:8px;background:#f7f9fc}
.cw-exclusion-row code{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--accent-dark);font-size:11.5px}
.cw-exclusion-del{border:none;background:none;color:var(--muted);cursor:pointer;padding:1px 4px}
.cw-exclusion-del:hover{color:var(--danger)}
@media(max-width:1100px){.cw-layout{grid-template-columns:1fr}.cw-settings{grid-template-columns:repeat(2,1fr)}.cw-kpis{grid-template-columns:repeat(3,1fr)}}

/* ===== DATABASE MAINTENANCE ===== */
.db-maintenance-panel{padding:22px}
.db-maintenance-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}
.db-maintenance-head h2{margin:0 0 5px;font-size:16px;color:var(--navy)}
.db-maintenance-head p{margin:0;color:var(--muted);font-size:12.5px}
.db-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.db-stat{padding:15px;border:1px solid var(--line);border-radius:11px;background:#f8fafc;min-width:0}
.db-stat span{display:block;font-size:11.5px;color:var(--muted);margin-bottom:6px}
.db-stat b{display:block;font-size:20px;color:var(--navy);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.db-stat small{display:block;margin-top:5px;color:var(--muted);font-size:10.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.db-maintenance-warning{display:flex;flex-direction:column;gap:4px;margin-top:16px;padding:12px 14px;border:1px solid #fde68a;border-radius:10px;background:#fffbeb;color:#92400e;font-size:12px}
.db-backup-option{display:flex;align-items:center;gap:8px;margin-top:15px;font-size:12.5px;color:var(--text);cursor:pointer}
.db-backup-option input{accent-color:var(--accent)}
.db-maintenance-actions{display:flex;align-items:center;gap:12px;margin-top:14px}
.db-maintenance-status{font-size:12px;color:var(--muted)}
.db-maintenance-status.ok{color:var(--success)}.db-maintenance-status.err{color:var(--danger)}.db-maintenance-status.run{color:var(--accent-dark)}
.db-backup-manager{margin-top:20px;padding-top:18px;border-top:1px solid var(--line)}
.db-backup-manager-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:10px}
.db-backup-manager-head>div:first-child{display:flex;flex-direction:column;gap:3px}
.db-backup-manager-head b{font-size:13px;color:var(--navy)}
.db-backup-manager-head span{font-size:11px;color:var(--muted)}
.db-backup-manager-head>div:last-child{display:flex;align-items:center;gap:10px}
.db-backup-manager-head label{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--muted);cursor:pointer}
.db-backup-manager-head input,.db-backup-row input{accent-color:var(--accent)}
.db-backup-list{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.db-backup-row{display:grid;grid-template-columns:24px minmax(0,1fr) 110px 160px;align-items:center;gap:10px;padding:11px 12px;border-top:1px solid var(--line);background:#fff}
.db-backup-row:first-child{border-top:0}
.db-backup-row:hover{background:#f8fafc}
.db-backup-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--text)}
.db-backup-size,.db-backup-date{font-size:11.5px;color:var(--muted);white-space:nowrap}
.db-backup-empty{padding:18px;text-align:center;font-size:12px;color:var(--muted)}
.data-config-statusbar{margin-top:16px}
@media(max-width:900px){.db-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.db-stat-grid{grid-template-columns:1fr}.db-maintenance-head,.db-maintenance-actions,.db-backup-manager-head{align-items:stretch;flex-direction:column}.db-backup-manager-head>div:last-child{justify-content:space-between}.db-backup-row{grid-template-columns:24px minmax(0,1fr) 80px}.db-backup-date{display:none}}

/* Nút kiểm tra regex crawler */
.cw-regex-test{grid-column:1/-1;display:flex;flex-direction:column;gap:8px;align-items:flex-start}
.cw-regex-result{font-size:11.5px;color:var(--text);width:100%}
.cw-regex-result>div{padding:6px 0;border-top:1px solid var(--line)}
.cw-regex-result>div:first-child{border-top:none}
.cw-regex-result ul{margin:4px 0 0 18px;padding:0;color:var(--muted)}
.cw-regex-result li{list-style:disc;font-size:11px}
.cw-regex-result code{background:var(--accent-soft);color:var(--accent-dark);padding:1px 5px;border-radius:4px;font-family:ui-monospace,monospace;font-size:11px}
.cw-regex-result .err{color:var(--danger)}
.cw-regex-result .mut{color:var(--muted)}

/* ===== Crawler Query Builder + Drawer ===== */
.cw-qb{display:flex;flex-direction:column;gap:8px;margin-top:6px}
.cw-qb-row{display:flex;gap:8px;align-items:center}
.cw-qb-row .qb-mode{max-width:110px} .cw-qb-row .qb-field{max-width:150px} .cw-qb-row .qb-op{max-width:130px}
.cw-qb-row .qb-val{flex:1}
.cw-qb-del{border:1px solid var(--line);background:#fff;color:var(--muted);border-radius:7px;width:32px;height:32px;flex:0 0 32px;cursor:pointer}
.cw-qb-del:hover{border-color:var(--danger);color:var(--danger)}
.cw-qb-foot{display:flex;gap:8px;margin-top:8px}
.cw-qb-wrap>label{display:block;font-size:11.5px;color:var(--muted);margin-bottom:5px}
.cw-table-filter{padding:12px;background:#f7f9fc;border:1px solid var(--line);border-radius:10px;margin-bottom:10px}
.cw-tablefilter-foot{display:flex;gap:8px;margin-bottom:12px}
.cw-detail-btn{border:1px solid var(--line);background:#fff;border-radius:7px;padding:3px 8px;cursor:pointer;font-size:13px}
.cw-detail-btn:hover{border-color:var(--accent);background:var(--accent-soft)}
.cw-drawer-overlay{position:fixed;inset:0;background:rgba(15,27,45,.4);z-index:400}
.cw-drawer{position:fixed;top:0;right:0;width:min(980px,96vw);max-width:none;height:100vh;background:#fff;box-shadow:-8px 0 32px rgba(0,0,0,.14);z-index:401;display:flex;flex-direction:column;padding:22px 24px}
.cw-drawer-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:14px}
.cw-drawer-head b{font-size:15px;color:var(--navy)}
.cw-drawer-url{font-size:11.5px;color:var(--muted);word-break:break-all;margin-top:3px;max-width:780px}
.cw-drawer-close{border:none;background:none;font-size:18px;color:var(--muted);cursor:pointer}
.cw-drawer-tabs{display:flex;gap:0;border-bottom:1px solid var(--line);margin-bottom:12px}
.cw-dtab{border:none;background:none;padding:9px 16px;font-size:13px;font-family:inherit;cursor:pointer;color:var(--muted);border-bottom:2px solid transparent;margin-bottom:-1px}
.cw-dtab.active{color:var(--accent-dark);border-bottom-color:var(--accent);font-weight:600}
.cw-dtab span{background:var(--accent-soft);color:var(--accent-dark);border-radius:99px;padding:1px 7px;font-size:11px;margin-left:4px}
.cw-drawer-export-actions{display:flex;gap:6px;align-items:center;margin-left:auto;padding-bottom:5px}
.cw-drawer-export-actions .btn{white-space:nowrap;padding-left:9px;padding-right:9px}
.cw-drawer-limit-note{display:none;margin:-5px 0 10px;padding:7px 10px;border-radius:7px;background:#f8fafc;color:var(--muted);font-size:11.5px}
.cw-target-recrawl{margin:0 0 10px}
.cw-target-recrawl-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.cw-target-recrawl-actions span{font-size:11.5px;color:var(--muted)}
.cw-target-recrawl-actions span.ok{color:var(--success)}.cw-target-recrawl-actions span.err{color:var(--danger)}
.cw-target-recrawl-progress{height:6px;margin-top:8px;border-radius:99px;background:#e8edf5;overflow:hidden}
.cw-target-recrawl-progress i{display:block;width:0;height:100%;border-radius:inherit;background:var(--accent);transition:width .25s ease}
.cw-drawer-body{flex:1;overflow-y:auto;overflow-x:hidden}
.cw-dtable{width:100%;min-width:0!important;table-layout:fixed}
.cw-dtable th:nth-child(1),.cw-dtable td:nth-child(1){width:46%}
.cw-dtable th:nth-child(2),.cw-dtable td:nth-child(2){width:38%}
.cw-dtable th:nth-child(3),.cw-dtable td:nth-child(3){width:16%}
.cw-dtable th,.cw-dtable td{padding-left:10px;padding-right:10px}
.cw-dtable td{font-size:12px;padding-top:8px;padding-bottom:8px}
.cw-dtable .cw-url{max-width:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cw-dtable .cw-url a{color:var(--accent);text-decoration:none}
.cw-source-with-count{display:flex;align-items:center;gap:8px;min-width:0}
.cw-source-with-count a{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cw-anchor-count-badge{flex:none;display:inline-flex;align-items:center;padding:3px 7px;border-radius:99px;background:#fef3c7;color:#92400e;font-size:10px;font-weight:600}
.cw-duplicate-anchor-row td{background:#fffbeb;border-top-color:#fde68a}
.cw-duplicate-anchor-row td:first-child{box-shadow:inset 3px 0 0 #f59e0b}
.cw-duplicate-anchor-row:hover td{background:#fff7d6}
@media(max-width:700px){.cw-drawer{width:100vw;max-width:100vw;padding:16px}.cw-drawer-tabs{flex-wrap:wrap}.cw-drawer-export-actions{width:100%;margin-left:0}.cw-dtable th:nth-child(1),.cw-dtable td:nth-child(1){width:48%}.cw-dtable th:nth-child(2),.cw-dtable td:nth-child(2){width:34%}.cw-dtable th:nth-child(3),.cw-dtable td:nth-child(3){width:18%}}
.cw-regex-result .ok{color:var(--success)}

/* Outline Builder */
.outline-page{display:grid;gap:18px;padding-bottom:32px}
.outline-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.outline-head h2{margin:0;color:#101828;font-size:26px;letter-spacing:0}
.outline-head p{margin:6px 0 0;color:#667085;font-size:14px}
.outline-head-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.outline-stepper{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));border:1px solid #e6ebf3;border-radius:8px;background:#fff;overflow:hidden}
.outline-step{position:relative;display:flex;align-items:center;gap:12px;min-height:74px;padding:14px 16px;color:#667085;background:#fff}
.outline-step:not(:last-child)::after{content:"";position:absolute;right:-10px;top:0;width:20px;height:100%;background:inherit;border-right:1px solid #e6ebf3;border-top:1px solid #e6ebf3;transform:skewX(-18deg);z-index:1}
.outline-step b{position:relative;z-index:2;display:grid;place-items:center;width:28px;height:28px;border-radius:999px;border:1px solid #d8deea;background:#fff;color:#344054;font-size:13px}
.outline-step span{position:relative;z-index:2;display:grid;gap:3px;min-width:0}
.outline-step strong{color:#344054;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.outline-step em{font-style:normal;font-size:11px;line-height:1.35;color:#667085}
.outline-step.is-active{background:#f4f8ff}
.outline-step.is-active b,.outline-step.is-done b{background:#2563eb;border-color:#2563eb;color:#fff}
.outline-step.is-active strong{color:#1d4ed8}
.outline-grid{display:grid;grid-template-columns:minmax(330px,420px) minmax(0,1fr);gap:18px;align-items:start}
.outline-left,.outline-right{display:grid;gap:16px}
.outline-card{border:1px solid #e6ebf3;border-radius:8px;background:#fff;padding:18px;box-shadow:0 8px 24px rgba(15,23,42,.03)}
.outline-card h3{margin:0 0 14px;color:#101828;font-size:15px;letter-spacing:0}
.outline-card h4{margin:16px 0 10px;color:#101828;font-size:14px}
.outline-card label{display:grid;gap:7px;margin-top:12px;color:#344054;font-size:13px;font-weight:700}
.outline-card label strong{color:#e11d48}
.outline-card input,.outline-card select,.outline-card textarea{width:100%;box-sizing:border-box;border:1px solid #dfe5f1;border-radius:8px;background:#fff;color:#101828;padding:11px 12px;outline:none;font:inherit;font-size:13px}
.outline-card input:focus,.outline-card select:focus,.outline-card textarea:focus{border-color:#93c5fd;box-shadow:0 0 0 3px rgba(37,99,235,.08)}
.outline-two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.outline-source-mode{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.outline-source-mode button{min-height:72px;text-align:left;border:1px solid #dfe5f1;border-radius:8px;background:#fff;padding:12px;cursor:pointer;display:grid;grid-template-columns:auto 1fr;column-gap:10px;row-gap:2px;color:#344054}
.outline-source-mode button span{grid-row:1/3;display:grid;place-items:center;width:28px;height:28px;border-radius:999px;background:#eef4ff;color:#1d4ed8;font-weight:800}
.outline-source-mode button strong{font-size:13px;color:#101828}
.outline-source-mode button em{font-style:normal;font-size:11px;color:#667085}
.outline-source-mode button.is-active{border-color:#93c5fd;box-shadow:0 0 0 3px rgba(37,99,235,.07)}
.outline-note{margin:10px 0 0;color:#667085;font-size:12px;line-height:1.5}
.outline-url-list{display:grid;gap:9px}
.outline-url-row{display:grid;grid-template-columns:26px minmax(0,1fr) 34px 34px;gap:8px;align-items:center}
.outline-url-row span{display:grid;place-items:center;height:34px;border-radius:8px;background:#f8fafc;color:#667085;font-size:12px}
.outline-url-row input{height:38px}
.outline-url-row button{height:34px;border:1px solid #dfe5f1;border-radius:8px;background:#fff;color:#667085;cursor:pointer}
.outline-url-row button.is-ok{border-color:#bbf7d0;background:#f0fdf4;color:#059669}
.outline-run-card{display:flex;align-items:center;gap:12px}
.outline-run-card span{color:#667085;font-size:12px}
.outline-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.outline-card-head h3{margin-bottom:4px}
.outline-card-head p{margin:0;color:#667085;font-size:13px}
.outline-card-head strong{color:#101828}
.outline-progress{height:8px;border-radius:999px;background:#edf1f7;overflow:hidden;margin:12px 0 14px}
.outline-progress i{display:block;width:0;height:100%;border-radius:999px;background:#2563eb;transition:width .25s ease}
.outline-source-progress{display:grid;gap:8px}
.outline-source-line{display:grid;grid-template-columns:22px 150px minmax(0,1fr) 100px 70px;gap:8px;align-items:center;border-bottom:1px solid #eef2f7;padding:7px 0;color:#667085;font-size:12px}
.outline-source-line span{display:grid;place-items:center;width:18px;height:18px;border-radius:999px;border:1px solid #cbd5e1}
.outline-source-line b{color:#344054;font-weight:700}
.outline-source-line em{font-style:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.outline-source-line strong{font-weight:700;color:#667085}
.outline-source-line small{text-align:right;color:#667085}
.outline-source-line.ok span{border-color:#10b981;background:#10b981;color:#fff}.outline-source-line.ok strong{color:#059669}
.outline-source-line.err span{border-color:#ef4444;background:#fff1f2;color:#dc2626}.outline-source-line.err strong{color:#dc2626}
.outline-source-line.run span{border-color:#2563eb;color:#2563eb}.outline-source-line.run strong{color:#2563eb}
.outline-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
.outline-kpis div{border:1px solid #edf1f7;border-radius:8px;padding:12px;background:#fff}
.outline-kpis span{display:block;color:#667085;font-size:11px;margin-bottom:8px}
.outline-kpis strong{display:block;color:#101828;font-size:15px;line-height:1.25;word-break:break-word}
.outline-topic-chips{display:flex;gap:8px;flex-wrap:wrap}
.outline-topic-chips span{display:inline-flex;align-items:center;gap:8px;border-radius:8px;background:#f4f8ff;color:#1d4ed8;padding:8px 10px;font-size:12px;font-weight:700}
.outline-topic-chips em{font-style:normal;color:#64748b;font-size:11px;font-weight:600}
.outline-help-grid{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:18px;align-items:center}
.outline-help-grid ul{margin:0;padding-left:18px;color:#667085;font-size:13px;line-height:1.8}
.outline-help-grid aside{border:1px solid #93c5fd;border-radius:8px;background:#f8fbff;padding:14px;color:#344054;font-size:13px}
.outline-help-grid aside p{margin:8px 0}
.outline-result-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(340px,42%);gap:16px}
.outline-tree{border:1px solid #edf1f7;border-radius:8px;padding:18px;min-height:320px;background:#fbfcff}
.outline-tree h1{margin:0 0 14px;color:#101828;font-size:22px;letter-spacing:0}
.outline-tree h2{margin:16px 0 6px;color:#1d4ed8;font-size:16px}
.outline-tree h3{margin:10px 0 5px;color:#344054;font-size:14px}
.outline-tree p{margin:0 0 8px;color:#667085;font-size:13px;line-height:1.55}
.outline-tree-child{padding-left:14px;border-left:2px solid #dbeafe}
#outlineJsonEditor{min-height:420px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px;line-height:1.55}
.outline-history-card{width:min(720px,calc(100vw - 32px))}
.outline-history-list{display:grid;gap:10px;padding:18px}
.outline-history-item{display:grid;grid-template-columns:minmax(0,1fr) 72px;gap:10px;align-items:center;border:1px solid #edf1f7;border-radius:8px;padding:10px}
.outline-history-item button{border:0;background:transparent;text-align:left;cursor:pointer;color:#101828}
.outline-history-item button:last-child{text-align:center;color:#dc2626;font-weight:700}
.outline-history-item strong{display:block;font-size:14px}.outline-history-item span{display:block;margin-top:4px;color:#667085;font-size:12px}
#outlinePromptDialog{width:min(1040px,calc(100vw - 48px));max-width:calc(100vw - 48px);overflow:hidden}
.outline-prompt-card{display:flex;flex-direction:column;width:100%;max-width:100%;max-height:calc(100vh - 48px);overflow:hidden;box-sizing:border-box}
.outline-prompt-card .dialog-head p{margin:5px 0 0;color:#667085;font-size:13px}
.outline-prompt-body{display:block;flex:1 1 auto;padding:14px 18px 0;min-width:0;max-width:100%;overflow-x:hidden;overflow-y:auto}
.outline-prompt-tabs{display:inline-flex;gap:4px;border:1px solid #dbe4f2;border-radius:10px;background:#f8fbff;padding:4px;margin:12px 0 4px}
.outline-prompt-tabs button{border:0;border-radius:8px;background:transparent;color:#667085;font-weight:800;padding:8px 14px;cursor:pointer}
.outline-prompt-tabs button.is-active{background:#fff;color:#1d4ed8;box-shadow:0 2px 8px rgba(15,23,42,.08)}
.outline-prompt-panel{display:none}.outline-prompt-panel.is-active{display:block}
.outline-prompt-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px;min-width:0;max-width:100%}
.outline-prompt-form label{display:grid;gap:7px;color:#344054;font-size:13px;font-weight:800;min-width:0}
.outline-prompt-form label:nth-child(3),.outline-prompt-form label:nth-child(4),.outline-prompt-form label:nth-child(5){grid-column:1/-1}
.outline-prompt-form textarea{display:block;width:100%;max-width:100%;min-width:0;box-sizing:border-box;border:1px solid #dbe4f2;border-radius:10px;background:#fbfcff;padding:10px 12px;color:#172033;font:14px/1.45 inherit;resize:vertical;overflow-wrap:anywhere}
.outline-prompt-checks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px;min-width:0;max-width:100%}
.outline-prompt-checks label{display:flex;align-items:center;gap:8px;min-width:0;border:1px solid #e6ebf3;border-radius:10px;background:#fff;padding:10px 12px;color:#344054;font-size:13px;font-weight:750;overflow-wrap:anywhere}
.outline-prompt-checks input{width:16px;height:16px;accent-color:#6d4df2}
.outline-prompt-preview{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;min-width:0;border:1px solid #dbe4f2;border-radius:10px;background:#f8fbff;margin-top:12px;padding:12px}
.outline-prompt-preview strong{display:block;color:#172033;font-size:14px}.outline-prompt-preview span{display:block;margin-top:4px;color:#667085;font-size:12px}
.outline-prompt-vars{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.outline-prompt-vars span{border:1px solid #dbe4f2;border-radius:999px;background:#f8fbff;color:#1d4ed8;font-size:12px;font-weight:750;padding:6px 10px}
#outlinePromptEditor{display:block;width:100%;max-width:100%;min-height:420px;box-sizing:border-box;border:1px solid #dbe4f2;border-radius:10px;background:#fbfcff;padding:14px;color:#172033;font:13px/1.55 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;resize:vertical}
.outline-prompt-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin-top:12px;padding:12px 18px 18px;border-top:1px solid #edf1f7;background:#fff;min-width:0}
@media (max-width:780px){.outline-prompt-body{padding:12px 12px 0}.outline-prompt-form,.outline-prompt-checks{grid-template-columns:1fr}.outline-prompt-preview{grid-template-columns:1fr}.outline-prompt-preview .btn{width:100%}.outline-prompt-actions{padding:12px}.outline-prompt-actions .btn{flex:1 1 180px}}
@media (max-width:1100px){.outline-stepper{grid-template-columns:1fr}.outline-step:not(:last-child)::after{display:none}.outline-grid,.outline-help-grid,.outline-result-grid{grid-template-columns:1fr}.outline-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.outline-source-line{grid-template-columns:22px minmax(0,1fr);}.outline-source-line em,.outline-source-line strong,.outline-source-line small{grid-column:2}}
@media (max-width:640px){.outline-head{display:grid}.outline-two,.outline-source-mode,.outline-kpis{grid-template-columns:1fr}.outline-url-row{grid-template-columns:22px minmax(0,1fr) 30px 30px}.outline-card{padding:14px}}

.outline-complete{display:grid;gap:14px;padding-bottom:82px}
.outline-page.is-complete .outline-head{display:none}
.outline-complete[hidden],.outline-workspace[hidden]{display:none!important}
.outline-complete-summarybar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;border:1px solid #e6ebf3;border-radius:8px;background:#fff;padding:12px 14px;box-shadow:0 8px 24px rgba(15,23,42,.035);overflow:hidden}
.outline-complete-chips{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;min-width:0}
.outline-complete-chips div{display:grid;grid-template-columns:38px minmax(0,1fr);grid-template-rows:auto auto;column-gap:10px;align-items:center;min-width:0;border-right:1px solid #edf1f7;padding:2px 16px 2px 0}
.outline-complete-chips div:last-child{border-right:0}.outline-complete-chips i{grid-row:1/3;display:grid;place-items:center;width:32px;height:32px;border-radius:999px;background:#f1ecff;color:#6d4df2;font-style:normal;font-weight:800}.outline-complete-chips span{display:block;min-width:0;color:#667085;font-size:12px;font-weight:700}.outline-complete-chips strong{display:block;grid-column:2;min-width:0;color:#101828;font-size:14px;line-height:1.25;overflow-wrap:anywhere}
.outline-summary-actions{display:flex;gap:10px;align-items:center}.outline-summary-actions .btn{height:44px;white-space:nowrap}
.outline-complete-grid{display:grid;grid-template-columns:minmax(0,1.22fr) minmax(340px,.78fr);gap:18px;align-items:start;min-width:0}
.outline-editor-card{min-height:620px;padding:0}.outline-editor-card .outline-card-head{padding:16px 18px;border-bottom:1px solid #edf1f7}.outline-collapse-all{border:0;background:transparent;color:#667085;font-weight:700;cursor:pointer}
.outline-editor-tree{display:grid;padding:0 18px;min-width:0}.outline-editor-tree.is-collapsed .outline-edit-row.level-h3{display:none}
.outline-edit-row{display:grid;grid-template-columns:22px 26px 44px minmax(0,1fr) 108px 30px 30px 30px;gap:8px;align-items:center;min-width:0;border-bottom:1px solid #edf1f7;padding:9px 0}
.outline-edit-row.level-h3{padding-left:52px;grid-template-columns:22px 26px 44px minmax(0,1fr) 108px 30px 30px 30px}.outline-edit-row.level-h1 input{font-weight:800}.outline-edit-row.level-h2 input{font-weight:750}.outline-edit-row.level-h3 input{font-weight:600}
.outline-edit-row.is-selected{background:#f4f8ff;box-shadow:inset 0 0 0 1px #9cc3ff;border-radius:7px;padding-left:8px;padding-right:8px}
.outline-edit-row .drag{color:#98a2b3;font-size:16px}.outline-edit-row .fold,.outline-edit-row button{height:30px;border:0;background:#fff;color:#667085;cursor:pointer}.outline-edit-row b{display:inline-flex;justify-content:center;border-radius:7px;background:#eef4ff;color:#1d4ed8;padding:5px 7px;font-size:12px}.outline-edit-row.level-h1 b{background:#ede9fe;color:#6d28d9}.outline-edit-row.level-h3 b{background:#f0f9ff;color:#0369a1}
.outline-edit-row input{height:32px;border:0!important;box-shadow:none!important;color:#172033;background:transparent;font-size:14px}
.outline-edit-row em{font-style:normal;text-align:center;border-radius:7px;padding:5px 7px;font-size:11px;font-weight:700}.src-competitor{background:#f3e8ff;color:#7c3aed}.src-ai{background:#eaf1fe;color:#2563eb}.src-missing{background:#fff4e5;color:#d97706}
.outline-quick-view{grid-column:4 / -1;display:flex;align-items:center;gap:7px;margin-top:2px;padding:7px 9px;border-radius:6px;background:#fff;color:#667085;font-size:12px}.outline-quick-view button{height:20px!important}.outline-quick-view b{background:transparent!important;color:#344054!important;padding:0!important}
.outline-editor-footer{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}
.outline-heading-detail{display:grid;gap:13px}.outline-heading-detail[hidden]{display:none!important}.heading-detail-head{display:flex;justify-content:space-between;gap:12px}.heading-detail-head h3{margin:0 0 8px}.heading-detail-head strong{display:block;color:#344054;line-height:1.35}.heading-detail-head em{display:inline-flex;margin-left:6px;padding:3px 7px;border-radius:6px;background:#eaf1fe;color:#1d4ed8;font-style:normal;font-size:12px}.heading-detail-head button{border:0;background:transparent;color:#667085;font-size:22px;cursor:pointer}.heading-detail-words span{display:block;color:#667085;font-weight:700;font-size:12px}.heading-detail-words b{display:block;margin-top:4px;color:#0b63ce;font-size:22px}.outline-heading-detail h4{margin:2px 0 0;color:#344054;font-size:13px}.heading-detail-checks,.heading-detail-bullets{margin:0;padding-left:18px;color:#475467;line-height:1.65}.heading-detail-checks li::marker{color:#12a56a}.heading-detail-bullets li::marker{color:#0b63ce}.heading-entities{display:flex;flex-wrap:wrap;gap:8px}.heading-entities span,.heading-entities button{display:inline-flex;align-items:center;gap:6px;border:1px solid #edf1f7;border-radius:7px;background:#fff;padding:6px 9px;color:#344054;font-weight:650;font-size:12px}.heading-entities span button{border:0;padding:0;color:#98a2b3}.heading-seo-note{border:1px solid #ffe4b5;border-radius:8px;background:#fff8e8;padding:10px;color:#8a5a00}.heading-seo-note p{margin:4px 0 0;color:#667085;line-height:1.5}.heading-detail-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.heading-detail-actions .btn:first-child{grid-column:1/-1}.heading-sample{border:1px solid #dbe8ff;border-radius:8px;background:#f8fbff;padding:10px}.heading-sample p{margin:6px 0;color:#344054;line-height:1.6}.heading-sample button{border:0;background:transparent;color:#1d4ed8;font-weight:800;cursor:pointer}
.outline-insight-stack{display:grid;gap:14px;min-width:0}.outline-insight-stack .outline-card{min-width:0;overflow:hidden;font-size:14px}.insight-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,190px);gap:18px;min-width:0}.insight-metrics{min-width:0}.insight-meter{display:grid;grid-template-columns:minmax(96px,132px) minmax(80px,1fr) minmax(44px,58px);gap:10px;align-items:center;min-width:0;margin:9px 0}.insight-meter span,.insight-line span{font-size:1em;font-weight:700;color:#667085}.insight-meter strong,.insight-line strong{font-size:1em}.insight-meter i{height:8px;min-width:0;border-radius:999px;background:#edf1f7;overflow:hidden}.insight-meter b{display:block;height:100%;max-width:100%;background:#6d4df2;border-radius:999px}.insight-meter.green b{background:#22a06b}.insight-line{display:flex;justify-content:space-between;gap:12px;margin:11px 0;color:#667085}
.priority-box{display:grid;gap:8px}.priority-box span{display:grid;grid-template-columns:36px 1fr auto;gap:8px;align-items:center;border-radius:8px;border:1px solid #edf1f7;background:#f8fafc;padding:9px 10px;color:#344054}.priority-box i{display:grid;place-items:center;width:30px;height:30px;border-radius:999px;color:#fff;font-style:normal;font-weight:800}.priority-box b{color:#344054}.priority-box em{font-style:normal;font-size:12px;font-weight:700;color:#667085}.priority-box .p1{border-color:#ded6ff;background:#fbfaff}.priority-box .p1 i{background:#6d4df2}.priority-box .p2 i{background:#3b82f6}.priority-box .p3 i{background:#fb923c}
.missing-row,.suggest-row{display:grid;grid-template-columns:minmax(0,1fr) 142px;gap:10px;align-items:center;border-bottom:1px solid #edf1f7;padding:9px 0}.missing-row span{display:flex;align-items:center;gap:9px;font-weight:650;color:#344054}.missing-row i{display:grid;place-items:center;width:17px;height:17px;border-radius:999px;border:1px solid #fb923c;color:#fb923c;font-style:normal;font-size:11px}.missing-row button,.suggest-row button{height:30px;border:1px solid #d8def0;border-radius:7px;background:#fff;color:#4f46e5;font-weight:700;cursor:pointer;padding:0 10px}.suggest-row{grid-template-columns:32px minmax(0,1fr) 86px}.suggest-icon{display:grid;place-items:center;width:28px;height:28px;border-radius:999px;background:#f1ecff;color:#6d4df2}.suggest-row p{margin:3px 0 0;font-size:12px}
.outline-compare-table{width:100%;min-width:520px;border-collapse:collapse}.outline-compare-table th,.outline-compare-table td{padding:8px 6px!important;text-align:center}.outline-compare-table td:first-child,.outline-compare-table th:first-child{text-align:left}.outline-compare-table-wrap{max-width:100%;overflow-x:auto}.outline-compare-link{color:inherit;text-decoration:none;border-bottom:1px dashed #98a2b3}.outline-compare-link:hover{color:#4f46e5;border-bottom-color:#4f46e5}.tick{display:inline-grid;place-items:center;width:17px;height:17px;border-radius:999px;background:#ecfdf3;color:#12a56a;border:1px solid #12a56a;font-size:12px;font-weight:800}.tick.purple{background:#6d4df2;border-color:#6d4df2;color:#fff}.dash{color:#98a2b3;font-weight:800}
.outline-bottom-bar{position:fixed;left:var(--sidebar-expanded-width,280px);right:0;bottom:0;z-index:30;display:grid;grid-template-columns:1fr 1fr 1.2fr 1.6fr;gap:14px;padding:12px 32px;border-top:1px solid #e6ebf3;background:rgba(255,255,255,.94);backdrop-filter:blur(8px)}
body.sidebar-collapsed .outline-bottom-bar{left:var(--sidebar-collapsed-width,78px)}
@media (max-width:1100px){.outline-complete-grid,.outline-complete-summarybar,.outline-complete-chips,.outline-bottom-bar,.insight-grid{grid-template-columns:1fr}.outline-summary-actions{justify-content:stretch;flex-wrap:wrap}.outline-bottom-bar{position:static;padding:12px 0}.outline-edit-row,.outline-edit-row.level-h3{grid-template-columns:20px 28px 38px minmax(0,1fr) 28px 28px 28px;padding-left:0}.outline-edit-row em{display:none}}
@media (max-width:1500px){.insight-grid{grid-template-columns:1fr}.priority-box{grid-template-columns:repeat(3,minmax(0,1fr))}.priority-box span{grid-template-columns:30px minmax(0,1fr);align-content:start}.priority-box em{grid-column:2}}
@media (max-width:1512px){.outline-insight-stack .outline-card{font-size:12px}.priority-box b,.priority-box em,.missing-row,.suggest-row,.outline-compare-table{font-size:12px}.outline-insight-stack .outline-card h3{font-size:18px}}
@media (max-width:700px){.priority-box,.missing-row,.suggest-row{grid-template-columns:1fr}.missing-row button,.suggest-row button{width:100%}}

/* Auto link */
.autolink-page{display:grid;gap:14px}.autolink-form-panel{padding:20px}.autolink-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px 20px}.autolink-form-grid label,.autolink-settings-grid label{display:grid;gap:7px;color:#182230;font-size:13px;font-weight:700}.autolink-form-grid input,.autolink-form-grid textarea,.autolink-settings-grid input,.autolink-settings-grid select,.al-anchor-input{width:100%;border:1px solid #d0d5dd;border-radius:8px;background:#fff;padding:10px 12px;color:#101828;font:inherit;box-sizing:border-box}.autolink-form-grid input:focus,.autolink-form-grid textarea:focus,.al-anchor-input:focus{border-color:#2e90fa;outline:3px solid #eff8ff}.autolink-sources{grid-column:1/-1}.autolink-settings{margin-top:12px;color:#475467;font-size:13px}.autolink-settings summary{cursor:pointer;font-weight:700}.autolink-settings-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:12px;margin-top:12px}.autolink-form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:14px}.autolink-status{margin:12px 0 0;color:#475467;font-size:13px}.autolink-status.is-error{color:#b42318}.autolink-metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:14px 0}.autolink-metric{padding:16px 20px;border-left:4px solid #84adff}.autolink-metric.done{border-color:#32d583}.autolink-metric.candidate{border-color:#fdb022}.autolink-metric.approved{border-color:#9b8afb}.autolink-metric span{display:block;color:#475467;font-size:13px}.autolink-metric strong{display:block;margin-top:3px;color:#101828;font-size:28px}.autolink-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:14px}.autolink-results{overflow:hidden}.autolink-tabs{display:flex;border-bottom:1px solid #eaecf0;padding:0 18px}.autolink-tabs button{border:0;background:none;padding:15px 18px;color:#667085;font-weight:700;cursor:pointer}.autolink-tabs button.active{color:#155eef;border-bottom:2px solid #155eef}.autolink-table{min-width:920px}.autolink-table td{vertical-align:top}.autolink-table td>a{color:#155eef;font-weight:700}.autolink-table td small{display:block;max-width:230px;margin-top:4px;color:#98a2b3;overflow:hidden;text-overflow:ellipsis}.al-score{display:inline-grid;place-items:center;min-width:31px;height:25px;padding:0 6px;border:1px solid;border-radius:5px;background:#fff;text-align:center;font-size:12px;font-weight:800;line-height:1;box-sizing:border-box}.al-score.high{border-color:#32d583;background:#ecfdf3;color:#027a48}.al-score.medium{border-color:#fdb022;background:#fffaeb;color:#dc6803}.al-score.low,.al-score.empty{border-color:#98a2b3;background:#f9fafb;color:#475467}.al-type{display:inline-grid;place-items:center;min-width:54px;height:25px;border:1px solid transparent;border-radius:5px;padding:0 8px;font-size:11px;font-weight:700;line-height:1;text-transform:capitalize;box-sizing:border-box}.al-type.exact{border-color:#175cd3;background:#175cd3;color:#fff;box-shadow:0 1px 2px rgba(23,92,211,.18)}.al-type.partial{border-color:#b2ddff;background:#d1e9ff;color:#175cd3}.al-type.brand{border-color:#d9d6fe;background:#ebe9fe;color:#6938ef}.al-type.generic{border-color:#d0d5dd;background:#f2f4f7;color:#475467}.al-context{max-width:360px;line-height:1.5}.al-row-warning{color:#b54708!important}.autolink-aside{display:grid;align-content:start;gap:14px}.autolink-aside .panel{padding:18px}.autolink-aside h3{margin:0 0 16px}.al-stat{display:flex;justify-content:space-between;padding:8px 0;color:#475467}.al-stat i{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:8px}.autolink-warning{background:#fffaeb!important;border-color:#fedf89!important;color:#93370d}.autolink-cart-btn{display:block;min-width:420px;margin:20px auto;padding:12px 24px}@media(max-width:1100px){.autolink-layout{grid-template-columns:1fr}.autolink-aside{grid-template-columns:1fr 1fr}.autolink-settings-grid{grid-template-columns:repeat(3,1fr)}}@media(max-width:720px){.autolink-form-grid,.autolink-aside{grid-template-columns:1fr}.autolink-settings-grid{grid-template-columns:repeat(2,1fr)}.autolink-metrics{grid-template-columns:1fr 1fr}.autolink-cart-btn{min-width:0;width:100%}}
.al-anchor-mark{border-radius:4px;background:#d1fadf;color:#05603a;padding:1px 3px;font-weight:800}.al-ai-reason{max-width:360px!important;margin-top:7px!important;color:#667085!important;font-style:italic}
.al-anchor-cell{display:flex;align-items:center;gap:7px;min-height:30px}.al-anchor-text{color:#344054;font-weight:600;line-height:1.45}.al-edit-anchor{display:inline-grid;place-items:center;width:27px;height:27px;flex:0 0 27px;border:0;border-radius:7px;background:transparent;color:#667085;font-size:17px;cursor:pointer}.al-edit-anchor:hover{background:#eef4ff;color:#155eef}.al-empty-value{color:#98a2b3}.al-row-actions{display:flex;align-items:center;gap:6px;white-space:nowrap}.al-row-actions .btn.sm{min-width:auto;height:32px;padding:0 11px;border-radius:8px;box-shadow:none;font-size:12px;line-height:30px}.al-row-actions .btn.primary{background:#155eef;color:#fff;border-color:#155eef}.al-row-actions .btn.ghost{background:#fff;color:#344054;border:1px solid #d0d5dd}.al-row-actions .btn:hover{transform:none;box-shadow:none}.autolink-table th:last-child,.autolink-table td:last-child{min-width:150px}.autolink-table td:first-child{max-width:330px}
.al-provenance{max-width:360px!important;margin-top:6px!important;color:#175cd3!important;font-size:10px!important;font-style:normal!important}
.autolink-input-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:22px;align-items:stretch}.al-pool{display:flex;flex-direction:column;border-left:1px solid #eaecf0;padding-left:22px;min-width:0}.al-pool-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}.al-pool-head h3{margin:0;color:#101828;font-size:15px}.al-pool-head h3 span{color:#6938ef}.al-pool-head p{margin:3px 0 0;color:#98a2b3;font-size:11px}.al-pool-add{display:grid;place-items:center;width:28px;height:28px;border:1px solid #b2ccff;border-radius:8px;background:#eff4ff;color:#155eef;font-size:20px;cursor:pointer}.al-pool-list{display:flex;flex-wrap:wrap;align-content:flex-start;gap:7px;max-height:188px;overflow:auto;padding:2px 2px 8px}.al-pool-empty{margin:8px 0;color:#98a2b3;font-size:12px;line-height:1.5}.al-pool-chip{display:inline-flex;align-items:center;gap:5px;max-width:100%;border:1px solid #e4e7ec;border-radius:18px;background:#f9fafb;padding:4px 5px 4px 10px;color:#344054;font-size:11px;box-shadow:0 1px 2px rgba(16,24,40,.03)}.al-pool-chip.inactive{opacity:.5}.al-pool-text{max-width:155px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.al-pool-text b{color:#667085;font-weight:700}.al-pool-chip .al-type{min-width:43px;height:20px;padding:0 5px;font-size:9px}.al-pool-chip button{display:grid;place-items:center;width:20px;height:20px;border:0;border-radius:50%;background:transparent;color:#667085;cursor:pointer;padding:0}.al-pool-chip button:hover{background:#e4e7ec;color:#101828}.al-pool-warning{display:none;margin-top:5px;border-radius:7px;background:#fffaeb;padding:7px 9px;color:#b54708;font-size:10px;line-height:1.4}.al-pool-warning.show{display:block}.al-pool-warning:not(.show){display:block;background:#ecfdf3;color:#027a48}.al-pool-mode{display:grid;gap:5px;margin:10px 0}.al-pool-mode label{display:flex;align-items:center;gap:6px;color:#475467;font-size:10px;cursor:pointer}.al-pool-mode input{accent-color:#155eef}.al-generate-pool{width:100%;margin-top:auto;justify-content:center;min-height:38px}.autolink-input-layout .autolink-form-grid{height:100%}@media(max-width:1150px){.autolink-input-layout{grid-template-columns:1fr}.al-pool{border-left:0;border-top:1px solid #eaecf0;padding:16px 0 0}.al-pool-list{max-height:none}}
.al-progress{margin-top:12px;border:1px solid #d1e9ff;border-radius:10px;background:#f5faff;padding:10px 12px}.al-progress-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:7px;color:#175cd3;font-size:11px}.al-progress-head strong{font-size:12px}.al-progress-track{height:8px;overflow:hidden;border-radius:999px;background:#d1e9ff}.al-progress-bar{height:100%;width:0;border-radius:inherit;background:linear-gradient(90deg,#2e90fa,#6938ef);transition:width .35s ease;box-shadow:0 0 10px rgba(46,144,250,.3)}.al-bridge-label{display:inline-block;margin:0 0 6px;border-radius:5px;background:#f4ebff;color:#7f56d9;padding:3px 6px;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.03em}
