:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f242e;
  --border: #2b313e;
  --text: #eef1f6;
  --muted: #98a2b3;
  --primary: #5b8cff;
  --primary-hover: #4778eb;
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.12);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.14);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.14);
  --radius: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: #8ab4ff; text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  background: rgba(255,255,255,0.07);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(23, 26, 33, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-switcher-wrap { display: flex; align-items: center; gap: 6px; }
.site-switcher-wrap select { min-width: 180px; font-weight: 600; }
.verify-report {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #0b0d11;
  border: 1px solid var(--border);
  font-size: 12.5px;
}
.site-row-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.site-row-card.is-active { border-color: var(--primary); }

/* Phase 2 Kanban Task Board */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 12px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 6px;
}
@media (max-width: 1260px) { .kanban-board { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .kanban-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .kanban-board { grid-template-columns: 1fr; } }

.kanban-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}
.kanban-col[data-col-status="on_hold"] {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(127, 29, 29, 0.14);
}
.kanban-col[data-col-status="on_hold"] .kanban-col-header {
  background: rgba(239, 68, 68, 0.18);
  border-bottom-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}
.kanban-col[data-col-status="on_hold"] .kanban-col-header .badge {
  background: rgba(239, 68, 68, 0.28);
  color: #fecaca;
}
.kanban-col[data-col-status="on_hold"] .kanban-card {
  border-color: rgba(239, 68, 68, 0.35);
}
.hold-reason-box {
  font-size: 11.5px;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 6px;
  padding: 5px 8px;
  margin-bottom: 6px;
}
.pill-red {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.38);
}
.img-thumb {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #0b0d11;
  flex-shrink: 0;
}
.kanban-col.drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(91, 140, 255, 0.25);
}
.kanban-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  font-weight: 700;
  font-size: 13.5px;
}
.kanban-col-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.kanban-card {
  background: #12151c;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 12px;
  cursor: grab;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.25s ease;
  will-change: transform;
}
.kanban-card:hover { border-color: #465066; }
.kanban-card.is-selected {
  border-color: rgba(91, 140, 255, 0.75);
  box-shadow: 0 0 0 1px rgba(91, 140, 255, 0.35);
}
.kanban-col-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.kanban-card-check {
  display: inline-flex;
  align-items: center;
  margin-right: 2px;
  cursor: pointer;
}
.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
  padding: 12px 14px;
  background: rgba(91, 140, 255, 0.1);
  border: 1px solid rgba(91, 140, 255, 0.35);
  border-radius: 10px;
}
.bulk-bar.hidden { display: none; }
.bulk-bar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bulk-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.bulk-bar-actions select {
  min-height: 32px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  padding: 4px 8px;
}
.reports-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.report-card h3 {
  margin: 8px 0 6px;
  font-size: 15px;
  line-height: 1.35;
}
.report-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.report-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.kanban-card.dragging { opacity: 0.5; }
.kanban-card.flip-moving {
  position: relative;
  z-index: 40;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(91, 140, 255, 0.7);
  pointer-events: none;
}
.kanban-flying-ghost {
  position: fixed !important;
  z-index: 9999 !important;
  margin: 0 !important;
  pointer-events: none !important;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.65), 0 0 0 2px rgba(91, 140, 255, 0.85), 0 0 24px rgba(91, 140, 255, 0.35);
  border-color: var(--primary) !important;
  will-change: transform, opacity;
}
.kanban-card.just-moved {
  animation: kanbanCardArrive 1.15s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes kanbanCardArrive {
  0% { border-color: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.6), 0 8px 20px rgba(74, 222, 128, 0.2); }
  100% { border-color: var(--border); box-shadow: none; }
}
.kanban-col.col-pulse {
  border-color: rgba(91, 140, 255, 0.65);
  box-shadow: 0 0 0 2px rgba(91, 140, 255, 0.18);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.kanban-col.col-pulse .kanban-col-header .badge {
  animation: kanbanBadgePop 0.65s ease;
}
@keyframes kanbanBadgePop {
  0% { transform: scale(1); background: rgba(91, 140, 255, 0.45); }
  45% { transform: scale(1.22); }
  100% { transform: scale(1); }
}
.kanban-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-bottom: 6px;
}
.kanban-card-title {
  font-weight: 650;
  font-size: 13.5px;
  line-height: 1.35;
  margin-bottom: 5px;
}
.kanban-card-summary {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 8px;
  word-break: break-word;
}
.kanban-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.kanban-card-actions select {
  padding: 3px 6px;
  font-size: 11.5px;
}
.prio-high { background: var(--red-bg); color: #fca5a5; border: 1px solid rgba(239,68,68,0.35); font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.prio-medium { background: var(--amber-bg); color: #fcd34d; border: 1px solid rgba(245,158,11,0.35); font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.prio-low { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 5px; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
}
.brand h1 { margin: 0; font-size: 16px; font-weight: 650; }
.brand-byline { font-size: 11px; color: var(--muted); letter-spacing: 0.02em; margin-bottom: 1px; }
.brand-byline a { color: #93c5fd; font-weight: 550; }
.subtitle { font-size: 12px; color: var(--muted); }
.status-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.pill {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}
.pill-green { border-color: rgba(34,197,94,0.4); color: #86efac; background: var(--green-bg); }
.pill-amber { border-color: rgba(245,158,11,0.4); color: #fcd34d; background: var(--amber-bg); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: 0.15s ease;
}
.btn:hover:not(:disabled) { border-color: #465066; background: #262c38; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.is-busy {
  opacity: 1 !important;
  position: relative;
  cursor: wait;
  box-shadow: 0 0 0 2px rgba(91, 140, 255, 0.35);
  animation: busyPulse 1.1s ease-in-out infinite;
}
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
@keyframes busyPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

.activity-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(91, 140, 255, 0.45);
  background: linear-gradient(90deg, rgba(91, 140, 255, 0.16), rgba(34, 197, 94, 0.08));
  font-size: 13.5px;
  font-weight: 600;
}
.activity-banner.hidden { display: none; }
.activity-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #93c5fd;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-panel {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 28px 22px;
  border: 1px dashed rgba(91, 140, 255, 0.45);
  border-radius: 12px;
  background: rgba(91, 140, 255, 0.08);
}
.stats-pulsing .stat-card {
  animation: statsPulse 1.2s ease-in-out infinite;
}
@keyframes statsPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
body.app-busy {
  cursor: progress;
}
.btn-success { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-danger { background: rgba(239,68,68,0.16); border-color: rgba(239,68,68,0.45); color: #fca5a5; }
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,0.28); }
.btn-ghost { background: transparent; border-color: transparent; }

.container { max-width: 1320px; margin: 0 auto; padding: 20px 24px 60px; }

.toast-area {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
}
.toast {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  font-size: 13px;
}
.toast-ok { border-color: rgba(34,197,94,0.5); }
.toast-err { border-color: rgba(239,68,68,0.5); background: #2a1619; color: #fecaca; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 960px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 22px; font-weight: 700; margin-top: 2px; }
.stat-green .stat-value { color: #4ade80; }
.stat-amber .stat-value { color: #fbbf24; }

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--primary); }
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--surface-2);
  color: var(--muted);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.toolbar-filters, .toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

input[type="text"], input[type="password"], input[type="number"], input[type="search"], select, textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}
#filterSearch, #rulesSearch { min-width: 240px; }

.banner {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 13px;
}
.banner-info {
  background: rgba(91, 140, 255, 0.12);
  border: 1px solid rgba(91, 140, 255, 0.35);
  color: #cfe0ff;
}
.banner-muted {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}
.hidden { display: none !important; }

.card, .doc-card, .rule-card, .backup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.card-header, .doc-header, .rule-header, .backup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.doc-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc-title { font-weight: 650; font-size: 15px; }
.type-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.change-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.change-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.change-body { flex: 1; min-width: 0; }
.change-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.tag-insert {
  font-size: 11px; font-weight: 650; padding: 2px 7px; border-radius: 5px;
  background: var(--green-bg); color: #4ade80; border: 1px solid rgba(34,197,94,0.3);
}
.tag-relink {
  font-size: 11px; font-weight: 650; padding: 2px 7px; border-radius: 5px;
  background: var(--amber-bg); color: #fbbf24; border: 1px solid rgba(245,158,11,0.35);
}
.tag-protected {
  font-size: 11px; font-weight: 650; padding: 2px 7px; border-radius: 5px;
  background: var(--red-bg); color: #fca5a5; border: 1px solid rgba(239,68,68,0.35);
}

.snippet-box {
  font-size: 12.5px;
  color: #cbd5e1;
  background: rgba(0,0,0,0.22);
  padding: 6px 10px;
  border-radius: 6px;
  overflow-wrap: anywhere;
}
.snippet-match {
  background: rgba(91, 140, 255, 0.25);
  color: #fff;
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 600;
}

.html-diff {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 900px) { .html-diff { grid-template-columns: 1fr; } }
.html-pane {
  background: #0b0d11;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  max-height: 260px;
  overflow: auto;
}
.html-pane h4 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; color: var(--muted); }
.html-pane pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: #cbd5e1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-span-2 { grid-column: span 2; }
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-span-2 { grid-column: span 1; }
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12px; color: var(--muted); font-weight: 550; }
.checkboxes-inline {
  display: flex;
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.checkboxes-inline label { display: inline-flex; align-items: center; gap: 6px; color: var(--text); cursor: pointer; }
.checkbox-block { display: flex; align-items: center; gap: 8px; margin-top: 8px; cursor: pointer; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }

.kw-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kw-chip {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { font-size: 12px; color: var(--muted); background: var(--surface-2); }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.muted { color: var(--muted); font-size: 12px; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.65); }
.modal-content {
  position: relative;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal-sm { max-width: 560px; }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--border);
}

.fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.fieldset legend { padding: 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.inline-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.setup-help { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.setup-help summary { cursor: pointer; color: #93c5fd; }
.setup-help ol { margin: 8px 0 0; padding-left: 18px; }

/* Keyword Planner */
.cluster-group {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}
.cluster-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-2);
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
}
.cluster-summary::-webkit-details-marker { display: none; }
.cluster-group:not([open]) .cluster-summary { border-bottom: none; }
.cluster-body { padding: 12px 14px 2px; }

.planner-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
}
.planner-card-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  cursor: pointer;
  list-style: none;
}
.planner-card-summary::-webkit-details-marker { display: none; }
.planner-card-body { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.planner-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.planner-title { font-size: 16px; font-weight: 700; }
.signals-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.sig-pill {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.sig-pill.has-hits { color: #dbeafe; border-color: rgba(91,140,255,0.45); background: rgba(91,140,255,0.12); }

.structure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
@media (max-width: 820px) { .structure-grid { grid-template-columns: 1fr; } }
.structure-label { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.04em; }
.structure-val { font-size: 13px; font-weight: 600; margin-top: 2px; word-break: break-word; }

.dos-donts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
@media (max-width: 820px) { .dos-donts-grid { grid-template-columns: 1fr; } }
.box-dos {
  background: rgba(34, 197, 94, 0.07);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 8px;
  padding: 10px 12px;
}
.box-donts {
  background: rgba(239, 68, 68, 0.07);
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 8px;
  padding: 10px 12px;
}
.box-dos h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; color: #4ade80; }
.box-donts h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; color: #fca5a5; }
.box-dos ul, .box-donts ul { margin: 0; padding-left: 18px; font-size: 12.5px; }
.box-dos li, .box-donts li { margin-bottom: 4px; }

.competing-details {
  margin-top: 10px;
  font-size: 12.5px;
}
.competing-details summary { cursor: pointer; color: #93c5fd; }
.competing-list {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
  background: #0b0d11;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.fix-drawer-row td {
  background: #12151c;
  padding: 14px 16px;
  border-bottom: 2px solid var(--primary);
}
.fix-drawer-box {
  background: var(--surface);
  border: 1px solid rgba(91, 140, 255, 0.35);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 10px;
}
.fix-verdict {
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(91, 140, 255, 0.1);
  border: 1px solid rgba(91, 140, 255, 0.3);
  margin-bottom: 12px;
  font-size: 13px;
}
.fix-lists-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
@media (max-width: 900px) { .fix-lists-grid { grid-template-columns: 1fr; } }
.fix-subcard {
  background: #0b0d11;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.fix-subcard h5 {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.fix-page-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
}
.btn-fix {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
}
.btn-fix:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.28);
  border-color: rgba(245, 158, 11, 0.7);
}
.app-footer {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 24px 32px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.brand-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #93c5fd;
  background: rgba(91, 140, 255, 0.14);
  border: 1px solid rgba(91, 140, 255, 0.32);
  padding: 1px 7px;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 6px;
}
.operator-switcher-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.operator-switcher-wrap select {
  min-width: 110px;
  font-weight: 600;
}
.kanban-card-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11.5px;
}
.kanban-assignee-sel {
  padding: 2px 6px;
  font-size: 11.5px;
  max-width: 140px;
}
.completion-banner {
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #0b0d11;
  font-size: 12.5px;
}
.completion-banner.is-done {
  border-color: rgba(34, 197, 94, 0.4);
  background: var(--green-bg);
  color: #86efac;
}
.step-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.step-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.step-row.is-done {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.06);
}
.step-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1;
  cursor: pointer;
}
.step-main input[type="checkbox"] {
  margin-top: 3px;
}
.step-text.is-done {
  text-decoration: line-through;
  color: var(--muted);
}
.step-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 125px;
}
.step-assignee-sel {
  padding: 2px 6px;
  font-size: 11.5px;
}
.step-done-by {
  font-size: 11px;
  color: #86efac;
}
.team-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.team-row.is-active {
  border-color: var(--primary);
}
.aeo-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .aeo-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.aeo-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
}
.aeo-grade-a, .aeo-grade-b {
  background: var(--green-bg);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.38);
}
.aeo-grade-c {
  background: var(--amber-bg);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.38);
}
.aeo-grade-d, .aeo-grade-f {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.38);
}
.aeo-signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.aeo-preview-box {
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #0b0d11;
  border: 1px solid var(--border);
}
.aeo-rendered-preview {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #141821;
  border: 1px solid rgba(91, 140, 255, 0.35);
  max-height: 280px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.5;
}
.aeo-rendered-preview h2, .aeo-rendered-preview h3 {
  margin: 10px 0 4px;
  font-size: 14px;
  color: #e2e8f0;
}
.aeo-rendered-preview table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12.5px;
}
.aeo-rendered-preview th, .aeo-rendered-preview td {
  border: 1px solid var(--border);
  padding: 5px 8px;
  text-align: left;
}






/* GSC Playbook */
.gsc-summary-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
  padding: 12px 14px;
  background: #141821;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.gsc-summary-text {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  min-width: 140px;
}
.gsc-summary-track {
  flex: 1;
  height: 10px;
  background: #0b0d11;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.gsc-summary-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #4c6ef5, #2a9d8f);
  transition: width 0.25s ease;
}
.gsc-app-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gsc-app-phase {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 10px 0 4px;
}
.gsc-app-card {
  background: #141821;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
}
.gsc-app-card.is-done {
  border-color: rgba(42, 157, 143, 0.45);
  background: rgba(42, 157, 143, 0.08);
}
.gsc-app-card.is-done .gsc-app-title {
  text-decoration: line-through;
  color: #94a3b8;
}
.gsc-app-check {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: #2a9d8f;
  cursor: pointer;
}
.gsc-app-title {
  font-size: 14px;
  font-weight: 650;
  margin: 0 0 4px;
}
.gsc-app-detail {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 8px;
  line-height: 1.45;
}
.gsc-app-meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.gsc-app-notes {
  width: 100%;
  min-height: 54px;
  resize: vertical;
  background: #0b0d11;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: inherit;
  padding: 8px 10px;
  font-size: 12.5px;
}
.gsc-app-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Account connection callouts (Shopify / GSC / Ads) */
.account-callout {
  margin: 0 0 16px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #141821;
}
.account-callout-shopify {
  border-color: rgba(149, 191, 71, 0.35);
  background: linear-gradient(135deg, rgba(149, 191, 71, 0.08), #141821 55%);
}
.account-callout-google {
  border-color: rgba(66, 133, 244, 0.35);
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.1), #141821 55%);
}
.account-callout-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 8px;
}
.account-callout-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}
.account-callout-title {
  margin: 0 0 6px;
  font-size: 18px;
}
.account-callout-copy {
  margin: 0;
  color: #cbd5e1;
  font-size: 13.5px;
  max-width: 56ch;
  line-height: 1.45;
}
.account-callout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.account-callout-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  align-items: flex-end;
}
.gsc-advanced {
  margin-top: 12px;
  font-size: 13px;
  color: #94a3b8;
}
.ads-snapshot-panel {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(66, 133, 244, 0.25);
  background: rgba(66, 133, 244, 0.06);
  color: #cbd5e1;
}

/* Settings account tabs */
.settings-account-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 18px 0;
  border-bottom: 1px solid var(--border);
}
.settings-account-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}
.settings-account-tab:hover { color: #e2e8f0; }
.settings-account-tab.active {
  color: #e2e8f0;
  background: #141821;
  border-color: var(--border);
  border-bottom-color: #141821;
}
.settings-pane { display: none; }
.settings-pane.active { display: block; }
