/* ── Reset & Variables ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #FAAC01;
  --primary-dark: #E09600;
  --primary-light: #FFF5E0;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --header-h: 60px;
  --sidebar-w: 320px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow: 0 4px 16px rgba(0,0,0,.10);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.6;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.app-header {
  height: var(--header-h);
  background: #000000;
  border-bottom: 3px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 100;
}
.logo { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.sumax-logo { height: 26px; width: auto; display: block; flex-shrink: 0; filter: invert(1); }
.logo-divider {
  width: 1px; height: 20px;
  background: #444444;
  flex-shrink: 0;
}
.logo-product {
  font-size: 12px; font-weight: 600;
  color: #999999; letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.header-right { display: flex; align-items: center; gap: 10px; }
.btn-history {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  border: 1px solid #333333; background: #1a1a1a;
  color: #aaaaaa; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.btn-history:hover { background: #1a1a1a; border-color: var(--primary); color: var(--primary); }

.badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: #2a2a2a;
  color: #aaaaaa;
}
.badge.running { background: var(--primary); color: #000000; }
.badge.queued { background: #fef3c7; color: #92400e; }
.badge.done { background: var(--success-light); color: #065f46; }
.badge.error { background: var(--danger-light); color: #991b1b; }

/* ── History Drawer ───────────────────────────────────────────────────────── */
.history-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.3);
  z-index: 199; transition: opacity .2s;
}
.history-drawer {
  position: fixed; top: 0; right: 0; height: 100vh;
  width: 360px; background: var(--white);
  border-left: 1px solid var(--gray-200);
  box-shadow: var(--shadow); z-index: 200;
  display: flex; flex-direction: column;
  transition: transform .25s ease;
}
.history-drawer.hidden { display: none; }
.history-overlay.hidden { display: none; }
.history-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.history-drawer-header h3 { font-size: 15px; font-weight: 600; }
.history-close {
  width: 28px; height: 28px; border: none; background: none;
  font-size: 20px; cursor: pointer; color: var(--gray-500);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
}
.history-close:hover { background: var(--gray-100); }
.history-list { flex: 1; overflow-y: auto; padding: 8px; }
.history-empty { padding: 20px; color: var(--gray-400); font-size: 13px; text-align: center; }
.history-item {
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200); margin-bottom: 8px;
  cursor: pointer; transition: all .15s;
}
.history-item:hover { border-color: var(--primary); background: var(--primary-light); }
.history-keyword { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.history-url { font-size: 11px; color: var(--gray-500); margin-bottom: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-meta { display: flex; gap: 8px; font-size: 11px; color: var(--gray-500); }
.history-score { font-weight: 600; }
.history-score.good { color: #065f46; }
.history-score.ok { color: #92400e; }
.history-score.bad { color: #991b1b; }

/* ── Hub & Spoke Diagram ──────────────────────────────────────────────────── */
.hub-spoke-card { overflow-x: auto; }
.hub-spoke-diagram { min-width: 400px; padding: 8px 0 16px; }
.hs-hub-row { display: flex; justify-content: center; margin-bottom: 0; }
.hs-connectors {
  position: relative; height: 40px; margin: 0 40px;
}
.hs-connector-bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: var(--gray-300);
}
.hs-line {
  position: absolute; top: 0; width: 2px; height: 40px;
  background: var(--gray-300); transform: translateX(-50%);
}
.hs-spokes-row {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
}
.hs-node {
  border-radius: var(--radius); padding: 10px 14px;
  text-align: center; border: 2px solid;
  min-width: 130px; max-width: 180px;
}
.hs-hub { font-weight: 700; min-width: 200px; }
.hs-node.exists { border-color: var(--success); background: var(--success-light); }
.hs-node.to-create { border-color: var(--gray-300); background: var(--gray-50); border-style: dashed; }
.hs-node.current-page { border-color: var(--primary); background: var(--primary-light); border-style: solid; }
.hs-node-icon {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 4px; opacity: .7;
}
.hs-node.exists .hs-node-icon { color: #065f46; }
.hs-node.to-create .hs-node-icon { color: var(--gray-500); }
.hs-node.current-page .hs-node-icon { color: var(--primary-dark); }
.hs-node-label { font-size: 12px; font-weight: 600; line-height: 1.3; }
.hs-node-url { font-size: 10px; opacity: .6; margin-top: 3px; }
.hs-priority { font-size: 9px; text-transform: uppercase; opacity: .5; margin-top: 3px; }
.hs-legend {
  display: flex; gap: 16px; justify-content: center;
  margin-top: 12px; font-size: 11px;
}
.hs-legend-item { display: flex; align-items: center; gap: 6px; }
.hs-legend-item::before {
  content: ''; width: 12px; height: 12px; border-radius: 3px; border: 2px solid;
}
.hs-legend-item.exists::before { border-color: var(--success); background: var(--success-light); }
.hs-legend-item.to-create::before { border-color: var(--gray-400); border-style: dashed; }
.hs-legend-item.current-page::before { border-color: var(--primary); background: var(--primary-light); }

/* Spoke detail cards */
.spoke-card.current { border-color: var(--primary); }
.spoke-card-header { display: flex; gap: 8px; margin-bottom: 6px; }
.spoke-status {
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; text-transform: uppercase; letter-spacing: .3px;
}
.spoke-status.exists { background: var(--success-light); color: #065f46; }
.spoke-status.new { background: var(--gray-100); color: var(--gray-600); }
.spoke-current-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; background: var(--primary-light);
  color: var(--primary-dark); text-transform: uppercase;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--white);
  border-right: 2px solid var(--primary);
  overflow-y: auto;
  padding: 20px;
}

.input-form { display: flex; flex-direction: column; gap: 16px; }

.form-section { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}
.form-label.required::after { content: " *"; color: var(--danger); }
.form-hint { font-size: 11px; color: var(--gray-400); }

.form-input, .form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color .15s;
  outline: none;
}
.form-input:focus, .form-select:focus { border-color: var(--primary); }
.form-input::placeholder { color: var(--gray-400); }

.form-row { display: flex; gap: 10px; }
.flex-1 { flex: 1; }

/* Tags Input */
.tags-input-container {
  min-height: 38px;
  padding: 4px 8px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  cursor: text;
}
.tags-input-container:focus-within { border-color: var(--primary); }
.tags-input {
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 13px;
  color: var(--gray-800);
  flex: 1;
  min-width: 100px;
  padding: 2px 4px;
  background: transparent;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.tag-remove {
  cursor: pointer;
  opacity: .6;
  font-size: 14px;
  line-height: 1;
}
.tag-remove:hover { opacity: 1; }

/* Mode Buttons */
.mode-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--gray-600);
  transition: all .15s;
}
.mode-btn:hover { border-color: var(--primary); color: var(--primary); }
.mode-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}
.mode-icon { font-size: 14px; }

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #000000;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  margin-top: 4px;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-icon { font-size: 16px; }

/* ── Main Area ────────────────────────────────────────────────────────────── */
.main-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.hidden { display: none !important; }

/* ── Welcome Screen ───────────────────────────────────────────────────────── */
.welcome-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}
.welcome-content { text-align: center; max-width: 600px; }
.welcome-icon { font-size: 48px; margin-bottom: 16px; }
.welcome-content h2 { font-size: 26px; font-weight: 700; margin-bottom: 8px; color: var(--gray-900); }
.welcome-content h2 span { color: var(--primary); }
.welcome-content p { color: var(--gray-500); margin-bottom: 24px; font-size: 15px; }

/* Workflow Steps */
.workflow-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
  text-align: left;
}
.workflow-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.workflow-step-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.workflow-step-body { display: flex; flex-direction: column; gap: 2px; }
.workflow-step-body strong { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.workflow-step-body span { font-size: 12px; color: var(--gray-500); line-height: 1.4; }

/* Optional label badge */
.form-label-opt {
  font-size: 10px;
  font-weight: 500;
  color: var(--gray-400);
  background: var(--gray-100);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  transition: box-shadow .15s;
}
.feature-card:hover { box-shadow: var(--shadow); }
.feature-icon { font-size: 22px; }
.feature-card strong { font-size: 13px; font-weight: 700; color: var(--gray-900); }
.feature-card span { font-size: 11px; color: var(--gray-500); }

/* ── Progress Screen ──────────────────────────────────────────────────────── */
.progress-screen { display: flex; flex-direction: column; gap: 20px; }

.phases-bar {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 24px;
}
.phase-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.phase-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gray-200);
  border: 2px solid var(--gray-300);
  transition: all .3s;
}
.phase-step span { font-size: 11px; color: var(--gray-400); font-weight: 500; }
.phase-connector { flex: 1; height: 2px; background: var(--gray-200); margin: 0 8px; }

.phase-step.active .phase-dot { background: var(--primary); border-color: var(--primary); animation: pulse 1.5s infinite; }
.phase-step.active span { color: var(--primary); }
.phase-step.done .phase-dot { background: var(--success); border-color: var(--success); }
.phase-step.done span { color: var(--success); }

@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(250,172,1,.5); } 50% { box-shadow: 0 0 0 6px rgba(250,172,1,0); } }

.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.agent-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.agent-card.running { border-color: var(--primary); background: var(--primary-light); }
.agent-card.done { border-color: var(--success); background: var(--success-light); }
.agent-card.error { border-color: var(--danger); background: var(--danger-light); }
.agent-name { font-size: 12px; font-weight: 600; }
.agent-status { font-size: 11px; color: var(--gray-500); }
.agent-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gray-300); flex-shrink: 0;
}
.agent-card.running .agent-dot { background: var(--primary); animation: pulse 1s infinite; }
.agent-card.done .agent-dot { background: var(--success); }
.agent-card.error .agent-dot { background: var(--danger); }
.agent-header { display: flex; align-items: center; gap: 8px; }

/* Log */
.log-container {
  background: var(--gray-900);
  border-radius: var(--radius);
  overflow: hidden;
}
.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--gray-800);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-400);
}
.log-clear-btn {
  background: none; border: none; color: var(--gray-500); cursor: pointer; font-size: 11px;
}
.log-output {
  padding: 12px 16px;
  height: 200px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gray-300);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.log-entry { display: flex; gap: 10px; }
.log-time { color: var(--gray-600); flex-shrink: 0; }
.log-msg.info { color: var(--gray-300); }
.log-msg.success { color: #34d399; }
.log-msg.phase { color: #FAAC01; font-weight: 600; }
.log-msg.error { color: #f87171; }

/* ── Results Screen ───────────────────────────────────────────────────────── */
.results-screen { display: flex; flex-direction: column; gap: 20px; flex: 1; min-width: 0; width: 100%; overflow-y: auto; }

.results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.results-title h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.results-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.meta-chip {
  padding: 3px 10px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.meta-chip-cost {
  background: #d1fae5;
  color: #065f46;
}

/* GSC Row */
.gsc-row { display: flex; gap: 8px; align-items: center; }

/* Cancel Button */
.btn-cancel {
  padding: 6px 16px;
  background: none;
  border: 1.5px solid #ef4444;
  border-radius: var(--radius-sm);
  color: #ef4444;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-cancel:hover { background: #fef2f2; }

/* Score Circle */
.score-circle-container { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.score-circle { position: relative; width: 80px; height: 80px; }
.score-circle svg { width: 80px; height: 80px; }
.score-circle span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}
.score-label { font-size: 11px; color: var(--gray-500); font-weight: 500; }

/* Result Tabs */
.result-tabs {
  display: flex;
  gap: 4px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.result-tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: none;
  white-space: nowrap;
  padding: 8px 12px;
  border: none;
  background: none;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  transition: all .15s;
}
.tab-btn:hover { color: var(--gray-700); background: var(--gray-100); }
.tab-btn.active { background: var(--primary); color: #000000; font-weight: 700; }

/* Tab Panes */
.tab-pane {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 400px;
}

/* Content Tab */
.content-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
}
.view-toggle { display: flex; gap: 4px; }
.view-btn {
  padding: 6px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--gray-600);
  transition: all .15s;
}
.view-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.toolbar-actions { display: flex; gap: 8px; }
.btn-outline {
  padding: 6px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--gray-700);
  transition: all .15s;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* Content Preview Prose */
.content-preview.prose {
  line-height: 1.8;
  color: var(--gray-800);
}
.prose h1 { font-size: 22px; font-weight: 700; margin: 0 0 16px; color: var(--gray-900); }
.prose h2 { font-size: 18px; font-weight: 600; margin: 24px 0 12px; color: var(--gray-900); border-bottom: 1px solid var(--gray-200); padding-bottom: 6px; }
.prose h3 { font-size: 15px; font-weight: 600; margin: 16px 0 8px; color: var(--gray-800); }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 20px; margin: 0 0 12px; }
.prose li { margin-bottom: 4px; }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.prose th { background: var(--gray-100); padding: 10px 12px; text-align: left; font-weight: 600; border: 1px solid var(--gray-200); }
.prose td { padding: 8px 12px; border: 1px solid var(--gray-200); }
.prose nav { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 20px; }
.prose nav a { color: var(--primary); text-decoration: none; display: block; padding: 2px 0; font-size: 13px; }
.prose nav a:hover { text-decoration: underline; }

.code-view {
  width: 100%;
  min-height: 500px;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--gray-900);
  color: #e5e7eb;
  border: none;
  border-radius: var(--radius-sm);
  padding: 16px;
  resize: vertical;
  outline: none;
}

/* Meta Tab */
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.full-width { grid-column: 1 / -1; }
.meta-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
}
.meta-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.meta-card-header h3 { font-size: 13px; font-weight: 600; flex: 1; }
.meta-card-icon { font-size: 16px; }
.copy-btn {
  padding: 3px 10px;
  border: 1.5px solid var(--gray-300);
  border-radius: 4px;
  background: var(--white);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  color: var(--gray-600);
}
.copy-btn:hover { border-color: var(--primary); color: var(--primary); }
.meta-value {
  font-size: 13px;
  color: var(--gray-800);
  line-height: 1.5;
  word-break: break-word;
}
.meta-value.mono { font-family: var(--mono); font-size: 12px; }
.meta-counter { font-size: 11px; color: var(--gray-400); margin-top: 6px; text-align: right; }
.og-tags { display: flex; flex-direction: column; gap: 8px; }
.og-row { display: flex; gap: 8px; font-size: 12px; }
.og-key { font-weight: 600; color: var(--gray-500); min-width: 120px; font-family: var(--mono); }
.og-val { color: var(--gray-800); }
.schema-code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--gray-900);
  color: #e5e7eb;
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow-x: auto;
  white-space: pre;
  max-height: 300px;
  overflow-y: auto;
}

/* Checklist Tab */
.checklist-summary { margin-bottom: 20px; }
.checklist-score-bar {
  height: 10px;
  background: var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}
.score-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--primary), var(--success));
  transition: width 1s ease;
  width: 0%;
}
.checklist-stats { display: flex; gap: 16px; font-size: 13px; color: var(--gray-600); }
.checklist-categories { display: flex; flex-direction: column; gap: 16px; }
.checklist-category { border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--gray-50);
  cursor: pointer;
  user-select: none;
}
.category-header:hover { background: var(--gray-100); }
.category-name { font-size: 13px; font-weight: 600; }
.category-score {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
}
.category-score.high { background: var(--success-light); color: #065f46; }
.category-score.mid { background: var(--warning-light); color: #92400e; }
.category-score.low { background: var(--danger-light); color: #991b1b; }
.category-items { padding: 0 16px 12px; display: none; }
.category-items.open { display: block; }
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}
.checklist-item:last-child { border-bottom: none; }
.check-icon { width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; margin-top: 1px; }
.check-icon.pass { background: var(--success-light); color: var(--success); }
.check-icon.fail { background: var(--danger-light); color: var(--danger); }
.check-text { flex: 1; }
.check-label { font-size: 13px; color: var(--gray-800); }
.check-notes { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.improvement-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--gray-200); }
.improvement-section h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.improvement-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.improvement-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  background: var(--warning-light);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--warning);
  font-size: 13px;
}
.improvement-list li::before { content: "⚠️"; flex-shrink: 0; }
.link-rationale { color: var(--text-secondary); font-size: 12px; }

/* Competitors Tab */
.competitors-container { display: flex; flex-direction: column; gap: 16px; }
.competitor-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}
.competitor-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--gray-50);
}
.competitor-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.competitor-info { flex: 1; }
.competitor-domain { font-size: 13px; font-weight: 600; }
.competitor-url { font-size: 11px; color: var(--gray-400); }
.competitor-words { font-size: 12px; color: var(--gray-500); white-space: nowrap; }
.competitor-body { padding: 12px 16px; }
.competitor-section { margin-bottom: 12px; }
.competitor-section h4 { font-size: 12px; font-weight: 600; color: var(--gray-500); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-small {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  background: var(--gray-100);
  color: var(--gray-700);
}
.tag-small.gap { background: var(--warning-light); color: #92400e; }
.tag-small.strength { background: var(--success-light); color: #065f46; }
.heading-list { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.heading-list li { font-size: 12px; color: var(--gray-600); display: flex; gap: 6px; }
.h-level { font-weight: 600; color: var(--primary); font-family: var(--mono); font-size: 10px; }

/* Strategy Tab */
.strategy-container { display: flex; flex-direction: column; gap: 20px; }
.strategy-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
}
.strategy-card h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.decision-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary-dark);
  margin-bottom: 12px;
}
.outline-tree { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.outline-item { display: flex; gap: 10px; align-items: flex-start; }
.outline-level { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--primary); min-width: 24px; padding-top: 3px; }
.outline-text { font-size: 13px; color: var(--gray-800); }
.outline-notes { font-size: 11px; color: var(--gray-400); }
.spoke-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.spoke-card {
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--gray-50);
}
.spoke-card h4 { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.spoke-meta { font-size: 11px; color: var(--gray-500); margin-bottom: 8px; }
.gap-list { display: flex; flex-direction: column; gap: 4px; }
.gap-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-700);
}
.gap-item::before { content: "→"; color: var(--primary); flex-shrink: 0; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ── Enhancement / Extras Tab ────────────────────────────────────────────── */
.enhancement-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  background: var(--white);
}
.enhancement-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}
.enhancement-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--primary-light);
  color: var(--primary-dark);
}
.enhancement-placement {
  font-size: 11px;
  color: var(--gray-500);
  margin-bottom: 4px;
}
.enhancement-rationale {
  font-size: 12px;
  color: var(--gray-600);
  margin-bottom: 8px;
  padding: 8px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}
.enhancement-preview {
  margin-top: 12px;
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: var(--white);
  overflow-x: auto;
}

/* Image Brief Cards */
.image-briefs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.image-brief-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.image-brief-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--success-light);
  color: #065f46;
  width: fit-content;
}
.image-brief-placement {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
}
.image-brief-section { display: flex; flex-direction: column; gap: 3px; }
.image-brief-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-400);
}
.image-brief-value {
  font-size: 12px;
  color: var(--gray-700);
}
.image-brief-value.mono {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--gray-100);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.image-brief-prompt {
  font-size: 11px;
  color: var(--gray-600);
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 8px;
  border-left: 3px solid var(--warning);
  line-height: 1.5;
}

/* ── NeuronWriter Score ───────────────────────────────────────────────────── */
.scores-container {
  display: flex;
  gap: 16px;
  align-items: center;
}
.nw-score-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.nw-score-circle {
  position: relative;
  width: 72px;
  height: 72px;
}
.nw-score-circle svg {
  width: 100%;
  height: 100%;
}
.nw-score-circle span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
}

/* ── Retry Banner ─────────────────────────────────────────────────────────── */
.queue-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.queue-banner.hidden { display: none; }
.queue-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #f59e0b;
  border-top-color: #92400e;
  border-radius: 50%;
  flex-shrink: 0;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.queue-text { display: flex; flex-direction: column; gap: 2px; }
.queue-text strong { font-size: 13px; color: #92400e; }
.queue-text span { font-size: 12px; color: #78350f; }

.retry-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 12px;
}
.retry-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.retry-icon {
  font-size: 20px;
  flex-shrink: 0;
  color: #92400e;
}
.retry-content strong {
  font-size: 13px;
  color: #92400e;
}
.retry-content p {
  font-size: 12px;
  color: #78350f;
  margin-top: 2px;
}
.btn-retry {
  flex-shrink: 0;
  padding: 8px 16px;
  background: #f59e0b;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-retry:hover { background: #d97706; }

/* ── App Mode Toggle (SEO Artikel / Website Content) ───────────────────────── */
.app-mode-toggle {
  display: flex;
  gap: 0;
  padding: 0;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 16px;
}
.app-mode-btn {
  flex: 1;
  padding: 10px 10px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  border-radius: 0;
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
  transition: all .15s;
  letter-spacing: 0.2px;
}
.app-mode-btn.active {
  background: transparent;
  color: #000000;
  border-bottom-color: var(--primary);
  font-weight: 700;
}
.app-mode-btn:hover:not(.active) {
  background: var(--gray-100);
}

/* ── Website Content Form ──────────────────────────────────────────────────── */
.crawl-row {
  display: flex;
  gap: 8px;
}
.crawl-row .form-input {
  flex: 1;
}
.btn-crawl {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #000000;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.btn-crawl:hover { background: var(--primary-dark); }
.btn-crawl:disabled { opacity: .6; cursor: not-allowed; }

/* Rewrite mode buttons use existing .mode-btn styles */

/* ── Section Cards (Page Content Result) ──────────────────────────────────── */
.section-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-type-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--primary-light);
  color: var(--primary-dark);
}
.section-wc {
  font-size: 11px;
  color: var(--gray-500);
}
.section-heading {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 8px;
}
.section-content {
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.7;
  border-top: 1px solid var(--gray-100);
  padding-top: 10px;
}
.section-content p { margin-bottom: 8px; }
.section-content ul { padding-left: 18px; margin-bottom: 8px; }
.section-content h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }

/* ── URL Checkbox List ─────────────────────────────────────────────────────── */
.url-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.url-list-actions {
  display: flex;
  gap: 8px;
}
.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.url-checkbox-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
}
.url-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background .1s;
}
.url-checkbox-item:last-child { border-bottom: none; }
.url-checkbox-item:hover { background: var(--gray-50); }
.url-checkbox-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  accent-color: var(--primary);
}
.url-checkbox-path {
  font-size: 12px;
  color: var(--gray-700);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.url-checkbox-source {
  font-size: 10px;
  color: var(--gray-400);
  flex-shrink: 0;
}

/* ── Section preview in sidebar ─────────────────────────────────────────────── */
.sections-preview { margin-top: 8px; }
.sections-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .05em;
  cursor: pointer;
  text-align: left;
}
.sections-toggle:hover { background: var(--gray-50); color: var(--gray-300); }
.sections-toggle .meta-chip { margin-left: 2px; }
.sections-toggle-icon { margin-left: auto; font-size: 10px; }
#wc-sections-list:not(.hidden) { margin-top: 6px; }
.btn-picker-toggle {
  margin-top: 8px;
  width: 100%;
  background: none;
  border: 1px dashed var(--primary);
  color: var(--primary);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.btn-picker-toggle:hover { background: var(--primary-light, #eff6ff); }
.picker-wrapper {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.picker-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.picker-hint { color: var(--text-secondary); flex: 1; }
.picker-loading { color: var(--primary); font-size: 12px; }
.picker-frame {
  width: 100%;
  height: 600px;
  border: none;
  display: block;
}
.sections-select-all-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px 8px;
  font-size: 12px;
}
.btn-link-sm {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  text-decoration: underline;
}
.btn-link-sm:hover { color: var(--primary-dark); }
.sections-divider { color: var(--gray-400); }
.wc-section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.wc-section-selectable {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.wc-section-selectable:hover { border-color: var(--primary); }
.wc-section-selectable input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; cursor: pointer; }
.wc-section-selectable:has(input:checked) { border-color: var(--primary); background: var(--primary-light, #eff6ff); }
.wc-section-nav { opacity: 0.6; }
.wc-section-nav:has(input:checked) { opacity: 1; }
.wc-section-card-body { flex: 1; min-width: 0; }
.wc-section-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.wc-section-heading {
  font-size: 11px;
  color: var(--gray-300);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wc-section-preview-text {
  font-size: 11px;
  color: var(--gray-400);
  line-height: 1.4;
}

/* ── Page preview iframe ─────────────────────────────────────────────────────── */
.page-preview-wrapper {
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  height: 700px;
}
.page-preview-frame {
  border: none;
  display: block;
}
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 12px;
}
.preview-hint { font-size: 12px; color: var(--gray-400); }
.preview-loading { font-size: 12px; color: var(--primary); }

/* ── Extras tab ──────────────────────────────────────────────────────────────── */
.extras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.extra-card {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.extra-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.extra-card-title {
  font-size: 12px;
  color: var(--gray-300);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.extra-card-body {
  font-size: 12px;
  color: var(--gray-300);
  line-height: 1.5;
  margin: 0;
}

/* ── Domain Selector ──────────────────────────────────────────────────────────── */
.domain-selector-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.domain-profile-hint {
  font-size: 11px;
  color: var(--gray-500);
  line-height: 1.5;
  padding: 0 2px;
}
.domain-profile-hint:empty { display: none; }

/* ── Sitemap Inline Section ───────────────────────────────────────────────────── */
.sitemap-section {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--gray-50);
}
.sitemap-subsection {
  padding: 10px 12px;
}
.sitemap-subsection + .sitemap-subsection {
  border-top: 1px solid var(--gray-200);
}
.sitemap-sublabel {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gray-500);
  margin-bottom: 6px;
}
.sitemap-or {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  font-size: 10px;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
}
.sitemap-or span {
  white-space: nowrap;
}
.sitemap-or::before, .sitemap-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* ── Advanced Accordion ───────────────────────────────────────────────────────── */
.advanced-section {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.advanced-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-50);
  user-select: none;
  list-style: none;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}
.advanced-toggle::-webkit-details-marker { display: none; }
.advanced-toggle::marker { display: none; }
.advanced-toggle:hover { background: var(--gray-100); color: var(--gray-700); }
details[open] .advanced-toggle {
  border-bottom: 1.5px solid var(--gray-200);
  color: var(--gray-700);
  background: var(--gray-100);
}
.advanced-chevron {
  font-size: 14px;
  color: var(--gray-400);
  transition: transform .2s;
  font-weight: 400;
}
details[open] .advanced-chevron { transform: rotate(180deg); }
.advanced-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 12px;
}

/* ── Sidebar Footer Links ─────────────────────────────────────────────────────── */
.sidebar-footer-links {
  display: flex;
  justify-content: center;
  padding: 4px 0 2px;
}
.wc-mode-link {
  font-size: 11px;
  color: var(--gray-300);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color .15s;
  letter-spacing: 0.1px;
}
.wc-mode-link:hover { color: var(--gray-500); }

/* ── Website Content Back Bar ─────────────────────────────────────────────────── */
.wc-back-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 4px;
}
.wc-back-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-400);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color .15s;
}
.wc-back-link:hover { color: var(--gray-700); }
.wc-mode-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
}

/* ── Domain Overview Modal ────────────────────────────────────────────────── */
.domain-overview-panel {
  width: 900px;
  max-width: 96vw;
  height: 80vh;
  max-height: 700px;
  display: flex;
  flex-direction: column;
}
.domain-overview-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  flex: 1;
  overflow: hidden;
  gap: 0;
}
.domain-list-col {
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.domain-search-row {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-200);
}
.domain-search-row .form-input {
  width: 100%;
  font-size: 12px;
  padding: 6px 10px;
}
.domain-list-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.domain-list-empty {
  padding: 20px 16px;
  font-size: 13px;
  color: var(--gray-400);
}
.domain-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .12s;
  gap: 8px;
}
.domain-list-item:hover { background: var(--gray-50); }
.domain-list-item.active {
  background: #eff6ff;
  border-left-color: #6366f1;
}
.domain-list-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.domain-list-item-count {
  font-size: 11px;
  background: var(--gray-100);
  color: var(--gray-500);
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}
.domain-articles-col {
  overflow-y: auto;
  padding: 16px 20px;
}
.domain-articles-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  color: var(--gray-400);
  font-size: 13px;
  text-align: center;
}

/* Article tree */
.domain-articles-header {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.domain-articles-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: 10px;
}
.domain-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gray-400);
  padding: 12px 0 6px;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 8px;
}
.domain-article-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
}
.domain-article-card.hub-card {
  border-color: #c7d2fe;
  background: #f5f3ff;
}
.domain-article-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}
.domain-article-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}
.domain-article-keyword {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  flex: 1;
}
.domain-article-meta {
  font-size: 11px;
  color: var(--gray-500);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.domain-article-meta span {
  background: var(--gray-100);
  padding: 2px 7px;
  border-radius: 5px;
}
.domain-article-url {
  font-size: 11px;
  color: var(--gray-400);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 10px;
}
.domain-article-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.btn-send-review {
  padding: 6px 14px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.btn-send-review:hover { background: #4f46e5; }
.review-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 10px;
}
.review-status-badge.pending           { background: #fef3c7; color: #92400e; }
.review-status-badge.approved          { background: #d1fae5; color: #065f46; }
.review-status-badge.rejected          { background: #fee2e2; color: #991b1b; }
.review-status-badge.revision_requested{ background: #ede9fe; color: #4c1d95; }

/* Spoke indent */
.domain-spoke-list { padding-left: 20px; margin-top: 8px; }
.domain-spoke-item {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.domain-spoke-item-text { flex: 1; min-width: 0; }
.domain-spoke-keyword { font-size: 13px; font-weight: 500; color: var(--gray-700); }
.domain-spoke-url { font-size: 11px; color: var(--gray-400); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Send Review Modal ────────────────────────────────────────────────────── */
.send-review-panel {
  width: 500px;
  max-width: 96vw;
}
.send-review-result { margin-top: 16px; }
.review-link-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 14px 16px;
}
.review-link-row {
  display: flex;
  gap: 8px;
}
.review-link-row .form-input {
  flex: 1;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--gray-700);
}
.btn-copy-link {
  padding: 8px 14px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 7px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  color: var(--gray-700);
  transition: background .12s;
}
.btn-copy-link:hover { background: var(--gray-200); }

/* ── Generic Modal Overlay ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-panel {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 90vh;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}
.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray-400);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color .12s;
}
.modal-close-btn:hover { color: var(--gray-700); }

/* ═══════════════════════════════════════════════════════════════════════════
   NAV SIDEBAR + APP SHELL (Webapp Redesign)
   ═══════════════════════════════════════════════════════════════════════════ */

:root { --nav-w: 220px; --nav-bg: #0d0d0d; }

/* Shell wraps nav + body */
.app-shell { display: flex; flex: 1; overflow: hidden; }

/* Nav sidebar */
.nav-sidebar {
  width: var(--nav-w);
  flex-shrink: 0;
  background: var(--nav-bg);
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1a1a1a;
  z-index: 50;
}

.nav-section { padding: 8px; flex: 1; overflow-y: auto; }
.nav-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: .6px;
  color: #444; text-transform: uppercase;
  padding: 12px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  cursor: pointer; color: #777; font-size: 13px; font-weight: 500;
  transition: all .12s; text-decoration: none; margin-bottom: 2px;
  background: none; border: none; width: 100%; text-align: left;
  font-family: var(--font);
}
.nav-item:hover { background: #181818; color: #ccc; }
.nav-item.active { background: #1c1c1c; color: var(--primary); }
.nav-item.active .nav-icon { filter: none; }
.nav-icon { font-size: 16px; flex-shrink: 0; width: 22px; text-align: center; line-height: 1; }
.nav-label { flex: 1; }
.nav-count { background: #2a2a2a; color: #888; font-size: 11px; padding: 1px 6px; border-radius: 8px; }
.nav-count.running { background: var(--primary); color: #000; font-weight: 700; }

.nav-bottom { padding: 10px 8px; border-top: 1px solid #1a1a1a; flex-shrink: 0; }
.nav-user-area { display: flex; align-items: center; gap: 9px; padding: 6px 4px; }
.nav-user-info { flex: 1; min-width: 0; }
.nav-user-name {
  color: #ddd; font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -.1px;
}
.nav-user-email {
  color: #666; font-size: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #000;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0; letter-spacing: -.5px;
  background-size: cover; background-position: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .15s;
}
.nav-avatar:hover { transform: scale(1.06); }
.nav-avatar-hover {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  opacity: 0;
  transition: opacity .15s;
}
.nav-avatar:hover .nav-avatar-hover { opacity: 1; }
.nav-avatar-empty { background: #222; color: #555; border: 1px dashed #333; }
.nav-bell-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: 0 0 auto;
  background: transparent; border: none; border-radius: 8px;
  color: #94a3b8; cursor: pointer; transition: all .15s;
}
.nav-bell-btn:hover { background: rgba(148,163,184,.15); color: #FAAC01; }

/* App body (right of nav) */
.app-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

/* Routes — only one visible at a time */
.route { display: none; flex: 1; overflow: hidden; }
.route.active { display: flex; }

/* Route: new article — keeps existing app-layout unchanged */
#route-new { flex-direction: column; }
#route-new .app-layout { flex: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   HISTORY PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

.history-page { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--gray-50); }
.history-page-header {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 24px 12px; background: var(--white);
  border-bottom: 1px solid var(--gray-200); flex-shrink: 0;
}
.history-page-title { font-size: 18px; font-weight: 700; color: var(--gray-900); flex: 1; }

.history-toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 12px 24px; background: var(--white);
  border-bottom: 1px solid var(--gray-200); flex-shrink: 0;
}
.history-search {
  padding: 7px 12px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 13px; min-width: 220px;
  outline: none; transition: border-color .15s;
}
.history-search:focus { border-color: var(--primary); }
.history-filter-select {
  padding: 7px 10px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 12px; background: var(--white);
  outline: none; cursor: pointer; color: var(--gray-700);
}
.history-filter-pills { display: flex; gap: 4px; }
.history-pill {
  padding: 5px 10px; border: 1.5px solid var(--gray-200); border-radius: 20px;
  font-size: 11px; font-weight: 600; cursor: pointer; color: var(--gray-600);
  background: var(--white); transition: all .12s;
}
.history-pill:hover { border-color: var(--primary); color: var(--primary); }
.history-pill.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }

.history-body { flex: 1; overflow-y: auto; padding: 16px 24px; }
.history-table {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); overflow: hidden;
}
.history-table-head {
  display: grid;
  grid-template-columns: 32px minmax(160px,1fr) 120px 100px 80px 70px 70px 80px 36px;
  gap: 0; background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.history-th {
  padding: 10px 12px; font-size: 11px; font-weight: 700;
  color: var(--gray-500); text-transform: uppercase; letter-spacing: .4px;
}
.history-row {
  display: grid;
  grid-template-columns: 32px minmax(160px,1fr) 120px 100px 80px 70px 70px 80px 36px;
  gap: 0; border-bottom: 1px solid var(--gray-100);
  align-items: center; transition: background .1s; cursor: pointer;
}
.history-row:last-child { border-bottom: none; }
.history-row:hover { background: var(--gray-50); }
.history-row.selected { background: var(--primary-light); }
.history-cell { padding: 10px 12px; font-size: 12px; color: var(--gray-700); overflow: hidden; }
.history-cell-keyword { font-weight: 600; color: var(--gray-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-cell-url { color: var(--gray-500); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-cell-domain { font-size: 12px; color: var(--gray-600); font-weight: 500; }
.history-cell-user { font-size: 11px; color: var(--gray-500); }
.history-cell-score { font-weight: 700; }
.history-cell-score.good { color: #065f46; }
.history-cell-score.ok { color: #92400e; }
.history-cell-score.bad { color: #991b1b; }
.history-delete-btn {
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--gray-400); border-radius: 4px; transition: all .12s;
}
.history-delete-btn:hover { background: var(--danger-light); color: var(--danger); }

.history-domain-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: var(--gray-50);
  border-top: 2px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  cursor: pointer; user-select: none;
  position: sticky; top: 0; z-index: 1;
}
.history-domain-header:first-child { border-top: none; }
.history-domain-header:hover { background: var(--gray-100); }
.history-domain-name { font-weight: 700; font-size: 13px; color: var(--gray-900); }
.history-domain-badge { background: var(--primary); color: #fff; border-radius: 99px; padding: 1px 8px; font-size: 11px; font-weight: 600; }
.history-domain-chevron { transition: transform 0.15s; color: var(--gray-400); flex-shrink: 0; display: flex; align-items: center; }
.history-domain-chevron.collapsed { transform: rotate(-90deg); }
.history-mode-badge {
  display: inline-block; padding: 2px 7px; border-radius: 10px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
}
.history-mode-badge.auto { background: #dbeafe; color: #1d4ed8; }
.history-mode-badge.new { background: #dcfce7; color: #166534; }
.history-mode-badge.optimize { background: #fef9c3; color: #713f12; }
.history-mode-badge.brief { background: #f3e8ff; color: #6b21a8; }

.bulk-action-bar {
  display: none; align-items: center; gap: 12px;
  padding: 10px 24px; background: var(--gray-900);
  border-bottom: 1px solid #222; flex-shrink: 0;
}
.bulk-action-bar.visible { display: flex; }
.bulk-action-label { font-size: 13px; font-weight: 600; color: var(--white); }
.bulk-action-btn {
  padding: 6px 14px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  cursor: pointer; border: none; font-family: var(--font); transition: all .12s;
}
.bulk-action-btn.danger { background: var(--danger); color: var(--white); }
.bulk-action-btn.danger:hover { background: #dc2626; }
.bulk-action-btn.secondary { background: #333; color: #ccc; }
.bulk-action-btn.secondary:hover { background: #444; color: var(--white); }
.bulk-clear-btn { background: none; border: none; color: #888; cursor: pointer; margin-left: auto; font-size: 18px; line-height: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   DOMAINS PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

.domains-page { flex: 1; display: flex; overflow: hidden; background: var(--gray-50); }
.domains-list-col {
  width: 280px; flex-shrink: 0;
  background: var(--white); border-right: 1px solid var(--gray-200);
  display: flex; flex-direction: column; overflow: hidden;
}
.domains-list-header {
  padding: 16px 16px 10px; border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.domains-list-title { font-size: 14px; font-weight: 700; color: var(--gray-900); }
.domains-search {
  margin: 8px 12px; padding: 7px 10px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 12px; outline: none; transition: border-color .15s; width: calc(100% - 24px);
}
.domains-search:focus { border-color: var(--primary); }
.domains-list-items { flex: 1; overflow-y: auto; padding: 4px 8px 8px; }
.domain-list-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 10px; border-radius: 8px; cursor: pointer;
  transition: background .1s; margin-bottom: 2px;
}
.domain-list-row:hover { background: var(--gray-50); }
.domain-list-row.active { background: var(--primary-light); }
.domain-list-name { font-size: 13px; font-weight: 600; color: var(--gray-800); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.domain-list-indicators { display: flex; gap: 4px; flex-shrink: 0; }
.domain-indicator {
  font-size: 10px; padding: 1px 5px; border-radius: 4px; font-weight: 600;
  background: var(--gray-100); color: var(--gray-500);
}
.domain-indicator.has { background: #d1fae5; color: #065f46; }

.domains-detail-col { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.domains-detail-header {
  padding: 16px 24px 0; background: var(--white);
  border-bottom: 1px solid var(--gray-200); flex-shrink: 0;
}
.domains-detail-name { font-size: 20px; font-weight: 700; color: var(--gray-900); margin-bottom: 12px; }
.domains-detail-tabs { display: flex; gap: 0; }
.domain-tab-btn {
  padding: 9px 16px; font-size: 13px; font-weight: 500; cursor: pointer;
  border: none; background: none; color: var(--gray-500); font-family: var(--font);
  border-bottom: 2px solid transparent; transition: all .12s;
}
.domain-tab-btn:hover { color: var(--gray-800); }
.domain-tab-btn.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }
.domains-detail-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.domain-tab-pane { display: none; }
.domain-tab-pane.active { display: block; }
.dp-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 6px;
}
.dp-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  display: block;
  margin-bottom: 6px;
}

/* Auto-Ausfüllen Box */
.dp-autofill-box {
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 14px 16px;
}

/* Reference Image Upload */
.ref-img-upload-area {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  background: var(--gray-50);
  cursor: default;
  transition: border-color .15s, background .15s;
}
.ref-img-upload-area.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.ref-img-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.ref-img-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  background: var(--gray-100);
}
.ref-img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ref-img-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,.65);
  color: #fff;
  border: none;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
}
.ref-img-thumb:hover .ref-img-delete { opacity: 1; }

.domain-overview-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px;
}
.domain-overview-card {
  background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 16px;
}
.domain-overview-card-label { font-size: 11px; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.domain-overview-card-value { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.domain-action-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.domain-btn {
  padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1.5px solid var(--gray-200); background: var(--white);
  font-family: var(--font); transition: all .12s; color: var(--gray-700);
}
.domain-btn:hover { border-color: var(--primary); color: var(--primary); }
.domain-btn.danger { border-color: var(--danger-light); color: var(--danger); }
.domain-btn.danger:hover { background: var(--danger-light); }

.domain-pages-list { display: flex; flex-direction: column; gap: 6px; }
.domain-page-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm); font-size: 12px;
}
.domain-page-type { padding: 2px 7px; border-radius: 10px; font-size: 10px; font-weight: 700; background: var(--gray-100); color: var(--gray-600); flex-shrink: 0; }
.domain-page-url { color: var(--gray-600); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.domain-page-title { color: var(--gray-800); font-weight: 500; }

/* Domain detail empty state */
.domains-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px; color: var(--gray-400);
}
.domains-empty-icon { font-size: 40px; }
.domains-empty-text { font-size: 14px; font-weight: 500; }

/* User identity modal */
.user-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
}
.user-modal {
  background: var(--white); border-radius: 16px; padding: 32px; width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3); text-align: center;
}
.user-modal h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; color: var(--gray-900); }
.user-modal p { font-size: 14px; color: var(--gray-500); margin-bottom: 24px; }
.user-modal input {
  width: 100%; padding: 12px 16px; border: 2px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 15px; font-family: var(--font); outline: none; text-align: center;
  transition: border-color .15s; margin-bottom: 12px;
}
.user-modal input:focus { border-color: var(--primary); }
.user-presets { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }
.user-preset-btn {
  padding: 5px 12px; border: 1.5px solid var(--gray-200); border-radius: 20px;
  font-size: 12px; cursor: pointer; background: var(--white); color: var(--gray-600);
  transition: all .12s; font-family: var(--font);
}
.user-preset-btn:hover { border-color: var(--primary); color: var(--primary); }
.user-modal-submit {
  width: 100%; padding: 12px; background: var(--primary); color: #000;
  border: none; border-radius: var(--radius-sm); font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: var(--font); transition: background .15s;
}
.user-modal-submit:hover { background: var(--primary-dark); }

/* Activity pill in header */
.activity-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 20px;
  border: 1px solid #333; background: #1a1a1a;
  color: #aaa; font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all .15s;
}
.activity-pill:hover { border-color: var(--primary); color: var(--primary); }
.activity-pill.running { border-color: var(--primary); color: var(--primary); }
.activity-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #555; flex-shrink: 0;
}
.activity-dot.running { background: var(--primary); animation: pulse 1.2s infinite; }

.activity-pill-wrap { position: relative; }
.activity-popup {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #1e1e1e; border: 1px solid #333; border-radius: 10px;
  min-width: 280px; box-shadow: 0 8px 24px rgba(0,0,0,.5);
  z-index: 999; overflow: hidden;
}
.activity-popup.hidden { display: none; }
.activity-popup-row {
  padding: 10px 14px; border-bottom: 1px solid #2a2a2a;
  display: grid; grid-template-columns: 1fr auto; gap: 2px 8px;
}
.activity-popup-kw { font-size: 13px; font-weight: 600; color: #eee; grid-column: 1; }
.activity-popup-phase { font-size: 11px; color: #888; grid-column: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-popup-time { font-size: 12px; color: var(--primary); font-weight: 600; grid-column: 2; grid-row: 1 / 3; align-self: center; white-space: nowrap; }
.activity-popup-footer {
  padding: 8px 14px; font-size: 11px; color: #666;
  cursor: pointer; text-align: right;
}
.activity-popup-footer:hover { color: var(--primary); }

/* History quick-link in report view */
.report-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500; color: var(--gray-600); cursor: pointer;
  background: var(--white); transition: all .12s; font-family: var(--font);
}
.report-back-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Network Diagram */
.network-container { flex: 1; min-height: 520px; border-radius: 8px; overflow: hidden; position: relative; }
.network-container svg { display: block; }

/* ── Domain Overview QuickActions ─────────────────────────────────────────── */
.domain-quickactions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.domain-qa-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.domain-qa-card:hover { border-color: var(--gray-300); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.domain-qa-card.done { border-color: #d1fae5; background: #f0fdf4; }
.domain-qa-card.todo { border-color: #fef3c7; background: #fffbeb; }

.domain-qa-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.domain-qa-body {
  flex: 1;
  min-width: 0;
}

.domain-qa-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.3;
}

.domain-qa-desc {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.domain-qa-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  border-radius: 6px;
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
  transition: all .15s;
}
.domain-qa-btn:hover { border-color: var(--primary); color: var(--primary); background: #fefce8; }
.domain-qa-btn.primary { background: var(--primary); border-color: var(--primary); color: #000; }
.domain-qa-btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #000; }

/* ── Domain Inline Crawl Panel ───────────────────────────────────────────── */
.domain-crawl-panel {
  padding: 16px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: #f8fafc;
  margin-bottom: 16px;
}
.domain-crawl-panel.hidden { display: none; }

/* ── Domain Overview Stats Grid ──────────────────────────────────────────── */
.domain-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.domain-overview-card {
  padding: 14px 16px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: var(--white);
}

.domain-overview-card-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 4px;
}

.domain-overview-card-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

/* ── CMS Provider Tabs ───────────────────────────────────────────────────── */
.cms-provider-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cms-provider-btn {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  border-radius: 8px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
  transition: all .15s;
}
.cms-provider-btn:hover { border-color: var(--gray-400); color: var(--gray-800); }
.cms-provider-btn.active {
  border-color: var(--primary);
  background: #fefce8;
  color: var(--gray-900);
}

/* ── Domain Add Button ───────────────────────────────────────────────────── */
.domain-add-btn {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-600);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.domain-add-btn:hover { border-color: var(--primary); color: var(--primary); background: #fefce8; }

/* Live-Editor: Darstellung an die Content-Vorschau angleichen (Carl/Tobias 2026-06-25).
   Der Editor strippt das Artikel-<style> (sonst leckt es ins Parent-DOM) → ohne diese
   Regeln wurden Tabellen, Überschriften und Listen unformatiert/„roh" angezeigt.
   Gleiche Werte wie applyNormalContentPreview, damit Editor ≈ Vorschau. */
#live-editor h1 { font-size: 30px; font-weight: 800; color: #0f172a; line-height: 1.2; margin: 8px 0 18px; }
#live-editor h2 { font-size: 23px; font-weight: 700; color: #0f172a; line-height: 1.3; margin: 36px 0 14px; }
#live-editor h3 { font-size: 19px; font-weight: 700; color: #1e293b; margin: 26px 0 10px; }
#live-editor h4, #live-editor h5, #live-editor h6 { font-size: 16px; font-weight: 600; color: #475569; margin: 18px 0 6px; }
#live-editor p { margin: 0 0 16px; }
#live-editor ul, #live-editor ol { margin: 0 0 18px; padding-left: 24px; }
#live-editor li { margin: 8px 0; }
#live-editor strong { color: #0f172a; font-weight: 700; }
#live-editor a { color: #6366f1; text-decoration: none; font-weight: 600; }
#live-editor a:hover { text-decoration: underline; }
#live-editor img { max-width: 100%; height: auto; display: block; margin: 24px auto; border-radius: 10px; }
#live-editor table { border-collapse: collapse; width: 100%; margin: 24px 0; font-size: 15px; }
#live-editor th, #live-editor td { border: 1px solid #e2e8f0; padding: 10px 14px; text-align: left; }
#live-editor th { background: #f8fafc; font-weight: 700; }
#live-editor blockquote { border-left: 4px solid #6366f1; margin: 24px 0; padding: 12px 22px; color: #475569; background: #f8fafc; border-radius: 0 10px 10px 0; }
#live-editor figure { margin: 28px 0; text-align: center; }
#live-editor figcaption { font-size: 13px; color: #64748b; margin-top: 10px; font-style: italic; }
#live-editor details { margin: 14px 0; border: 1px solid #e2e8f0; border-radius: 10px; padding: 6px 18px; }
#live-editor summary { font-weight: 700; color: #0f172a; cursor: pointer; padding: 8px 0; }
#live-editor nav { background: #f8fafc; border: 1px solid #f1f5f9; border-radius: 12px; padding: 12px 24px; margin: 0 0 32px; }
#live-editor nav h2 { font-size: 16px; margin: 12px 0 4px; border: none; }
