/* ── Typography foundation ──────────────────── */
html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
}
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
}
button, input, select { line-height: 1; }
textarea { line-height: 1.6; }
code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
/* ─────────────────────────────────────────────── */

/* ══════════════════════════════════════
   RESET & BASE
══════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #0a0a0f;
  color: #e2e2e8;
  height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════
   SHARED INPUTS
══════════════════════════════════════ */
.field-input {
  background: #12121e;
  border: 1px solid #22223a;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #e0e0f0;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}

.field-input:focus {
  border-color: #5a3e9a;
  box-shadow: 0 0 0 3px #5a3e9a22;
}

.field-input::placeholder { color: #2a2a45; }

.field-label {
  font-size: 11px;
  font-weight: 500;
  color: #44446a;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ══════════════════════════════════════
   LOGIN SCREEN
══════════════════════════════════════ */
#login-screen {
  position: fixed;
  inset: 0;
  background: #0a0a0f;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  transition: opacity .4s, transform .4s;
}

#login-screen.hide {
  opacity: 0;
  pointer-events: none;
  transform: scale(.97);
}

.login-card {
  width: 400px;
  background: #0f0f1a;
  border: 1px solid #1e1e35;
  border-radius: 16px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.login-logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wp-icon {
  width: 36px;
  height: 36px;
  background: #1a1435;
  border: 1px solid #2d1f55;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.login-title {
  font-size: 17px;
  font-weight: 500;
  color: #fff;
}

.login-subtitle {
  font-size: 12px;
  color: #444466;
  margin-top: 4px;
}

.login-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-btn {
  background: #5a3e9a;
  border: none;
  border-radius: 8px;
  padding: 11px;
  font-size: 13.5px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  transition: background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-btn:hover { background: #6a4eaa; }
.login-btn:disabled { background: #2a2240; color: #444466; cursor: not-allowed; }

.login-error {
  font-size: 12px;
  color: #f87171;
  background: #1a0a0a;
  border: 1px solid #3a1515;
  border-radius: 6px;
  padding: 8px 12px;
  display: none;
}

.login-error.show { display: block; }

.login-hint {
  font-size: 11px;
  color: #2a2a45;
  text-align: center;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff44;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════
   SITE SETUP SCREEN
══════════════════════════════════════ */
#site-setup-screen {
  position: fixed;
  inset: 0;
  background: #0a0a0f;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 250;
}

#site-setup-screen.show { display: flex; }

.setup-card {
  width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: #0f0f1a;
  border: 1px solid #1e1e35;
  border-radius: 16px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setup-title {
  font-size: 16px;
  font-weight: 500;
  color: #fff;
}

.setup-subtitle {
  font-size: 12px;
  color: #555;
  line-height: 1.6;
}

.setup-discovery {
  background: #0c1a10;
  border: 1px solid #1a3022;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 12px;
  color: #6ee7a0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.setup-discovery.fail {
  background: #1a0c0c;
  border-color: #3a1515;
  color: #f87171;
}

.site-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-entry {
  background: #12121e;
  border: 1px solid #1e1e35;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-entry-icon {
  width: 32px;
  height: 32px;
  background: #1a1435;
  border: 1px solid #2d1f55;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.site-entry-info { flex: 1; min-width: 0; }

.site-entry-name {
  font-size: 13px;
  font-weight: 500;
  color: #c8c8e0;
}

.site-entry-url {
  font-size: 11px;
  color: #444466;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-entry-status {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
  flex-shrink: 0;
}

.status-ok  { background: #0d2010; color: #4ade80; border: 1px solid #1a3a20; }
.status-fail{ background: #1a0a0a; color: #f87171; border: 1px solid #3a1515; }
.status-pending{ background: #1a1a10; color: #facc15; border: 1px solid #2a2a18; }

.site-entry-remove {
  background: none;
  border: none;
  color: #333355;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  transition: color .15s;
  flex-shrink: 0;
}

.site-entry-remove:hover { color: #f87171; }

.add-site-row {
  display: flex;
  gap: 8px;
}

.add-site-name { flex: 0 0 140px; }
.add-site-url  { flex: 1; }

.btn-add-site {
  background: #1a1435;
  border: 1px solid #2d1f55;
  border-radius: 7px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #a78bfa;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}

.btn-add-site:hover { background: #221a45; }

.setup-actions { display: flex; gap: 10px; }

.btn-setup-continue {
  flex: 1;
  background: #5a3e9a;
  border: none;
  border-radius: 8px;
  padding: 11px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  transition: background .15s;
}

.btn-setup-continue:hover    { background: #6a4eaa; }
.btn-setup-continue:disabled { background: #2a2240; color: #444466; cursor: not-allowed; }

/* ══════════════════════════════════════
   APP SHELL
══════════════════════════════════════ */
#app {
  display: none;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 52px 1fr;
  height: 100vh;
}

#app.visible { display: grid; }

/* ── TOPBAR ── */
.topbar {
  grid-column: 1 / -1;
  background: #0f0f1a;
  border-bottom: 1px solid #1e1e30;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
}

.site-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e88;
  flex-shrink: 0;
}

.topbar-brand {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}

.site-switcher { position: relative; margin-left: 4px; }

.site-switcher-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #14142a;
  border: 1px solid #22223a;
  border-radius: 7px;
  padding: 5px 10px;
  cursor: pointer;
  transition: border-color .15s;
}

.site-switcher-btn:hover { border-color: #3a3a5a; }

.site-switcher-current {
  font-size: 12px;
  font-weight: 500;
  color: #c8c8e0;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-switcher-arrow {
  font-size: 10px;
  color: #555;
  transition: transform .2s;
}

.site-switcher-btn.open .site-switcher-arrow { transform: rotate(180deg); }

.site-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #0f0f1a;
  border: 1px solid #1e1e35;
  border-radius: 10px;
  min-width: 240px;
  z-index: 100;
  display: none;
  overflow: hidden;
  box-shadow: 0 8px 24px #00000066;
}

.site-dropdown.show { display: block; }

.site-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .15s;
}

.site-dropdown-item:hover       { background: #141428; }
.site-dropdown-item.active-site { background: #1a1435; }

.site-dd-info { flex: 1; min-width: 0; }

.site-dd-name {
  font-size: 12px;
  font-weight: 500;
  color: #c8c8e0;
}

.site-dd-url {
  font-size: 10px;
  color: #444466;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-dd-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.site-dd-dot.ok   { background: #22c55e; }
.site-dd-dot.fail { background: #f87171; }

.site-dd-add {
  padding: 8px 14px;
  border-top: 1px solid #1a1a2a;
  font-size: 11px;
  color: #555;
  cursor: pointer;
  transition: color .15s;
}

.site-dd-add:hover { color: #a78bfa; }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-badge {
  font-size: 11px;
  color: #8b6ef5;
  background: #1a1430;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #2d1f55;
}

.logout-btn {
  font-size: 11px;
  color: #44446a;
  background: none;
  border: 1px solid #1e1e35;
  border-radius: 5px;
  padding: 3px 9px;
  cursor: pointer;
  transition: color .15s;
}

.logout-btn:hover { color: #888; }

/* ── SIDEBAR ── */
.sidebar {
  background: #0c0c18;
  border-right: 1px solid #1a1a2a;
  padding: 16px 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  position: relative;
}

.site-context-pill {
  margin: 0 12px 16px;
  background: #1a1435;
  border: 1px solid #2d1f55;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  color: #a78bfa;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-section { padding: 0 12px; margin-bottom: 20px; }

.nav-label {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  min-height: 32px;
  border-radius: 6px;
  font-size: 13px;
  color: #888;
  cursor: pointer;
  transition: all .15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover  { background: #14142a; color: #ccc; }
.nav-item.active { background: #1a1435; color: #a78bfa; }

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 400;
  background: #1a1435;
  color: #a78bfa;
  border-radius: 8px;
  padding: 1px 6px;
}

/* ── MAIN ── */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0a0a0f;
}

/* ── TABS ── */
.tabs {
  display: flex;
  border-bottom: 1px solid #1a1a2a;
  background: #0c0c18;
  padding: 0 20px;
  flex-shrink: 0;
}

.tab {
  font-size: 12px;
  padding: 12px 16px;
  color: #555;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab:hover  { color: #888; }
.tab.active { color: #a78bfa; border-bottom-color: #a78bfa; }

/* ══════════════════════════════════════
   VIEWS
══════════════════════════════════════ */
.view {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: none;
  flex-direction: column;
  gap: 14px;
}

.view.show { display: flex; }

/* ── LIST ── */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 10px;
  flex-wrap: wrap;
}

.list-title {
  font-size: 14px;
  font-weight: 500;
  color: #ccc;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-primary {
  background: #5a3e9a;
  border: none;
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  transition: background .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-primary:hover    { background: #6a4eaa; }
.btn-primary:disabled { background: #2a2240; cursor: not-allowed; }

.btn-secondary {
  background: #12122a;
  border: 1px solid #2a2a45;
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #8888cc;
  cursor: pointer;
  transition: all .15s;
}

.btn-secondary:hover { background: #1a1a3a; color: #aaaaee; }

/* ── POST ROWS ── */
.post-row {
  background: #0f0f1a;
  border: 1px solid #1a1a30;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color .15s;
}

.post-row:hover { border-color: #2a2a45; }

.post-row-info { flex: 1; min-width: 0; }

.post-row-title {
  font-size: 13px;
  font-weight: 500;
  color: #c8c8e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-row-meta {
  font-size: 11px;
  color: #444466;
  margin-top: 3px;
}

.post-row-actions { display: flex; gap: 6px; flex-shrink: 0; }

.badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  flex-shrink: 0;
}

.badge-publish { background: #0d2010; color: #4ade80; border: 1px solid #1a3a20; }
.badge-draft   { background: #1a1a10; color: #facc15; border: 1px solid #2a2a18; }
.badge-trash   { background: #1a1010; color: #888;    border: 1px solid #2a2020; }

.row-btn {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 500;
  border: 1px solid;
  transition: all .15s;
}

.row-btn-edit    { background: #12122a; border-color: #2a2a45; color: #8888cc; }
.row-btn-edit:hover { background: #1a1a3a; color: #aaaaee; }
.row-btn-publish { background: #0d2010; border-color: #1a3a20; color: #4ade80; }
.row-btn-publish:hover { background: #122818; }
.row-btn-trash   { background: #1a1a10; border-color: #2a2a18; color: #888; }
.row-btn-trash:hover { background: #222210; color: #aaa; }
.row-btn-delete  { background: #1a0a0a; border-color: #3a1515; color: #f87171; }
.row-btn-delete:hover { background: #220f0f; }

.empty-state {
  text-align: center;
  padding: 40px;
  color: #333355;
  font-size: 13px;
}

/* ══════════════════════════════════════
   EDITOR
══════════════════════════════════════ */
.editor-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.editor-back {
  background: none;
  border: 1px solid #1e1e35;
  border-radius: 6px;
  padding: 6px 10px;
  color: #666;
  font-size: 12px;
  cursor: pointer;
  transition: color .15s;
}

.editor-back:hover { color: #aaa; }

.editor-mode-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
}

.editor-mode-new  { background: #1a1435; color: #a78bfa; border: 1px solid #2d1f55; }
.editor-mode-edit { background: #101a25; color: #60a5fa; border: 1px solid #1a2e45; }

.editor-draft-notice {
  background: #12180d;
  border: 1px solid #1e3015;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #6ee7a0;
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 16px;
}

.editor-main  { display: flex; flex-direction: column; gap: 12px; }
.editor-seo   { display: flex; flex-direction: column; gap: 10px; }

.seo-panel {
  background: #0f0f1a;
  border: 1px solid #1a1a30;
  border-radius: 10px;
  padding: 14px;
}

.seo-panel-title {
  font-size: 11px;
  font-weight: 500;
  color: #44446a;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.seo-field        { margin-bottom: 10px; }
.seo-field:last-child { margin-bottom: 0; }

.seo-label {
  font-size: 10px;
  font-weight: 500;
  color: #44446a;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.seo-input {
  background: #12121e;
  border: 1px solid #22223a;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  color: #d0d0e8;
  outline: none;
  width: 100%;
  transition: border-color .15s;
}

.seo-input:focus { border-color: #5a3e9a; }
.seo-input::placeholder { color: #2a2a45; }

.seo-textarea {
  background: #12121e;
  border: 1px solid #22223a;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  color: #d0d0e8;
  outline: none;
  width: 100%;
  resize: vertical;
  min-height: 65px;
  transition: border-color .15s;
}

.seo-textarea:focus { border-color: #5a3e9a; }
.seo-textarea::placeholder { color: #2a2a45; }

.seo-counter {
  font-size: 10px;
  color: #333355;
  text-align: right;
  margin-top: 2px;
}

.seo-counter.warn { color: #facc15; }
.seo-counter.over { color: #f87171; }

.seo-score-bar {
  height: 4px;
  border-radius: 2px;
  background: #1a1a2a;
  margin-top: 6px;
  overflow: hidden;
}

.seo-score-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .4s;
}

/* ── SEO Score Dashboard ─────────────────────────────── */
.seo-dash-score-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 12px;
}
.seo-dash-ring { width: 90px; height: 90px; transform: rotate(-90deg); }
.seo-dash-ring-bg {
  fill: none;
  stroke: #1a1a2a;
  stroke-width: 6;
}
.seo-dash-ring-fg {
  fill: none;
  stroke: #22c55e;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset .6s ease, stroke .3s;
}
.seo-dash-score-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.seo-dash-score-num {
  font-size: 24px;
  font-weight: 500;
  color: #a78bfa;
  line-height: 1;
}
.seo-dash-score-label {
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #444466;
  margin-top: 2px;
}

/* Dashboard sections */
.seo-dash-sections {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.seo-dash-section {
  border: 1px solid #1a1a30;
  border-radius: 6px;
  overflow: hidden;
}
.seo-dash-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: #0a0a14;
  border: none;
  padding: 8px 10px;
  cursor: pointer;
  transition: background .15s;
}
.seo-dash-section-hdr:hover { background: #12121e; }
.seo-dash-section-title {
  font-size: 10px;
  font-weight: 500;
  color: #7777aa;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.seo-dash-section-arrow {
  font-size: 10px;
  color: #555577;
  transition: transform .2s;
}
.seo-dash-section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.seo-dash-section-body.seo-dash-section-open {
  max-height: 600px;
}

/* Dashboard checklist items */
.seo-dash-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 10px;
  border-top: 1px solid #0f0f1a;
}
.seo-dash-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 3px;
}
.seo-dash-dot-green { background: #22c55e; }
.seo-dash-dot-amber { background: #facc15; }
.seo-dash-dot-gray  { background: #444466; }
.seo-dash-dot-red   { background: #f87171; }

.seo-dash-item-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.seo-dash-item-label {
  font-size: 11px;
  color: #c0c0d8;
  font-weight: 500;
}
.seo-dash-item-hint {
  font-size: 10px;
  color: #666688;
  line-height: 1.4;
}

/* Quick-fix buttons */
.seo-dash-fix {
  display: inline;
  background: none;
  border: none;
  color: #a78bfa;
  font-size: 10px;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  text-decoration: none;
  transition: color .15s;
}
.seo-dash-fix:hover { color: #c4b5fd; text-decoration: underline; }

.schema-box {
  background: #0a0a18;
  border: 1px solid #1a1a35;
  border-radius: 6px;
  padding: 8px;
  font-size: 10px;
  color: #888;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Focus Keyword Checklist ─────────────────────────── */
.fkw-checklist { display: flex; flex-direction: column; gap: 4px; }

.fkw-check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #12121e;
  font-size: 11px;
}
.fkw-check-row:last-child { border-bottom: none; }

.fkw-check-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
}
.fkw-pass { background: rgba(34,197,94,.15); color: #22c55e; }
.fkw-warn { background: rgba(250,204,21,.15); color: #facc15; }

.fkw-check-label { color: #c0c0d8; flex: 1; }

.fkw-check-hint {
  font-size: 10px;
  color: #facc15;
  opacity: .8;
  max-width: 50%;
  text-align: right;
}

/* ── Keyphrase Density ───────────────────────────────── */
.fkw-density { margin-top: 6px; }

.fkw-density-stat {
  font-size: 11px;
  margin-bottom: 4px;
}

.fkw-density-bar-track {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: #1a1a2a;
  overflow: hidden;
}

.fkw-density-bar-optimal {
  position: absolute;
  left: 16.67%;         /* 0.5/3 * 100 */
  width: 66.67%;        /* (2.5-0.5)/3 * 100 */
  height: 100%;
  background: rgba(34,197,94,.15);
  border-radius: 3px;
}

.fkw-density-bar-fill {
  position: absolute;
  left: 0;
  height: 100%;
  border-radius: 3px;
  transition: width .4s, background .3s;
}

.fkw-density-hint {
  font-size: 10px;
  margin-top: 3px;
}

/* ── LSI / Related Keywords ──────────────────────────── */
.fkw-lsi { }

.lsi-kw-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 6px;
}

.lsi-kw-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #12121e;
  border-radius: 5px;
  font-size: 11px;
}

.lsi-kw-status { font-size: 11px; font-weight: 500; flex-shrink: 0; }
.lsi-found  { color: #22c55e; }
.lsi-missing { color: #f87171; }

.lsi-kw-text { color: #c0c0d8; flex: 1; }

.lsi-kw-remove {
  background: none;
  border: none;
  color: #444466;
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
}
.lsi-kw-remove:hover { color: #f87171; }

.btn-lsi-add {
  background: #1a1a30;
  border: 1px solid #22223a;
  border-radius: 6px;
  color: #a78bfa;
  font-size: 11px;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.btn-lsi-add:hover { background: #22223a; }

.btn-lsi-suggest {
  background: linear-gradient(135deg, #2a1a4a, #1a1a30);
  border: 1px solid #33225a;
  border-radius: 6px;
  color: #a78bfa;
  font-size: 11px;
  padding: 6px 12px;
  cursor: pointer;
  width: 100%;
  transition: background .15s, border-color .15s;
}
.btn-lsi-suggest:hover { border-color: #5a3e9a; }
.btn-lsi-suggest:disabled { opacity: .5; cursor: wait; }

.lsi-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.lsi-pill {
  background: #1a1a30;
  border: 1px solid #22223a;
  border-radius: 12px;
  color: #c0c0d8;
  font-size: 10px;
  padding: 3px 10px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.lsi-pill:hover { border-color: #5a3e9a; background: #22223a; }
.lsi-pill:disabled { cursor: default; }

/* ── Readability Section ─────────────────────────────── */

/* Circular score ring */
.read-score-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 10px;
}
.read-score-ring { width: 80px; height: 80px; transform: rotate(-90deg); }
.read-score-bg {
  fill: none;
  stroke: #1a1a2a;
  stroke-width: 6;
}
.read-score-fg {
  fill: none;
  stroke: #22c55e;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset .6s ease, stroke .3s;
}
.read-score-num {
  position: absolute;
  font-size: 20px;
  font-weight: 500;
  color: #a78bfa;
}

/* Outdated banner */
.read-outdated {
  background: rgba(250,204,21,.08);
  border: 1px solid rgba(250,204,21,.2);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 10px;
  color: #facc15;
  line-height: 1.5;
  margin-bottom: 8px;
}
.read-outdated-btn {
  background: none;
  border: none;
  color: #facc15;
  font-size: 10px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
}
.read-outdated-btn:hover { color: #fde68a; }

/* Analyze button */
.btn-read-analyze {
  background: linear-gradient(135deg, #1a2a4a, #1a1a30);
  border: 1px solid #223355;
  border-radius: 6px;
  color: #7ab8fa;
  font-size: 11px;
  padding: 7px 14px;
  cursor: pointer;
  width: 100%;
  transition: background .15s, border-color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-read-analyze:hover { border-color: #4488cc; }
.btn-read-analyze:disabled { opacity: .5; cursor: wait; }

/* Spinner */
.read-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(122,184,250,.25);
  border-top-color: #7ab8fa;
  border-radius: 50%;
  animation: read-spin .6s linear infinite;
}
@keyframes read-spin { to { transform: rotate(360deg); } }

/* Results checklist */
.read-checklist {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
}
.read-check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #12121e;
}
.read-check-row:last-child { border-bottom: none; }

.read-check-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
}
.read-good { background: rgba(34,197,94,.15); color: #22c55e; }
.read-ok   { background: rgba(250,204,21,.15); color: #facc15; }
.read-poor { background: rgba(248,113,113,.15); color: #f87171; }

.read-check-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.read-check-label {
  font-size: 11px;
  color: #c0c0d8;
}
.read-check-hint {
  font-size: 10px;
  color: #888;
  line-height: 1.4;
}

/* ── SERP & Social Preview ────────────────────────────── */

/* Counter colors */
.serp-ctr-green { color: #22c55e !important; }
.serp-ctr-amber { color: #facc15 !important; }
.serp-ctr-red   { color: #f87171 !important; }

.serp-counter-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.serp-trunc-warn {
  font-size: 10px;
  color: #facc15;
  white-space: nowrap;
}

/* Tabs */
.serp-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 10px;
  background: #0a0a14;
  border-radius: 6px;
  padding: 2px;
}
.serp-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  color: #555577;
  padding: 5px 0;
  cursor: pointer;
  transition: background .15s, color .15s;
  text-align: center;
}
.serp-tab:hover { color: #aaa; }
.serp-tab-active {
  background: #1a1a30;
  color: #c0c0e0;
}

/* Cards (hidden by default, .serp-card-active shows) */
.serp-card { display: none; }
.serp-card-active { display: block; }

/* Desktop card */
.serp-card-desktop {
  background: #fff;
  border-radius: 8px;
  padding: 14px 16px;
  max-width: 600px;
}
.serp-card-desktop .serp-url {
  font-size: 12px;
  color: #202124;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.serp-breadcrumb { color: #5f6368; }
.serp-card-desktop .serp-title {
  font-size: 20px;
  color: #1a0dab;
  line-height: 1.3;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.serp-card-desktop .serp-title:hover { text-decoration: underline; }
.serp-card-desktop .serp-desc {
  font-size: 14px;
  color: #4d5156;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.serp-card-desktop .serp-desc strong,
.serp-card-mobile .serp-desc strong,
.serp-card-desktop .serp-title strong,
.serp-card-mobile .serp-title strong {
  font-weight: 500;
}

/* Mobile card */
.serp-card-mobile {
  background: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  max-width: 360px;
}
.serp-card-mobile .serp-url {
  font-size: 11px;
  color: #202124;
  margin-bottom: 2px;
}
.serp-card-mobile .serp-title {
  font-size: 16px;
  color: #1a0dab;
  line-height: 1.3;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.serp-card-mobile .serp-desc {
  font-size: 12px;
  color: #4d5156;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Social / OG card */
.serp-card-social {
  background: #fff;
  border: 1px solid #dadde1;
  border-radius: 8px;
  overflow: hidden;
  max-width: 500px;
}
.serp-og-image {
  background: #e4e6eb;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #65676b;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.serp-og-body {
  padding: 10px 12px;
}
.serp-og-domain {
  font-size: 11px;
  color: #606770;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 2px;
}
.serp-og-title {
  font-size: 15px;
  font-weight: 500;
  color: #1d2129;
  line-height: 1.3;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.serp-og-desc {
  font-size: 13px;
  color: #606770;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Content Gap Analysis ────────────────────────────── */
.cgap-results { margin-top: 8px; }
.cgap-assessment {
  font-size: 11px;
  color: #999;
  line-height: 1.5;
  margin-bottom: 8px;
  padding: 8px;
  background: #0a0a14;
  border-radius: 6px;
}
.cgap-issues { display: flex; flex-direction: column; gap: 4px; }
.cgap-issue {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  background: #0a0a14;
  border-radius: 6px;
  cursor: pointer;
}
.cgap-sev-badge {
  font-size: 9px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  flex-shrink: 0;
  margin-top: 1px;
}
.cgap-sev-high { background: rgba(248,113,113,.15); color: #f87171; }
.cgap-sev-med  { background: rgba(250,204,21,.15);  color: #facc15; }
.cgap-sev-low  { background: rgba(34,197,94,.15);   color: #22c55e; }
.cgap-issue-body { flex: 1; min-width: 0; }
.cgap-issue-desc { font-size: 11px; color: #c0c0d8; }
.cgap-issue-sugg { font-size: 10px; color: #888; margin-top: 4px; line-height: 1.4; }
.cgap-topics { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cgap-strength { font-size: 11px; color: #aaa; display: flex; align-items: center; gap: 6px; padding: 2px 0; }

/* ── Internal Links ──────────────────────────────────── */
.ilinks-count {
  font-size: 11px;
  color: #666688;
  margin-bottom: 6px;
}
.ilinks-results { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ilink-card {
  background: #0a0a14;
  border: 1px solid #1a1a30;
  border-radius: 6px;
  padding: 8px 10px;
}
.ilink-title { font-size: 12px; color: #c0c0d8; font-weight: 500; }
.ilink-url { font-size: 10px; color: #555577; margin: 2px 0 4px; word-break: break-all; }
.ilink-anchor-row { display: flex; align-items: center; gap: 6px; }
.ilink-reason { font-size: 10px; color: #666688; margin-top: 4px; font-style: italic; }

/* ── Technical SEO ───────────────────────────────────── */
.tech-seo-warn {
  font-size: 10px;
  color: #facc15;
  margin-top: 4px;
}
.tech-seo-noindex-warn {
  background: rgba(248,113,113,.1);
  border: 1px solid rgba(248,113,113,.3);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 10px;
  color: #f87171;
  margin-top: 6px;
  font-weight: 500;
}
.tech-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}
.tech-toggle-label { font-size: 11px; color: #c0c0d8; }
.tech-toggle {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
}
.tech-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.tech-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #333;
  border-radius: 18px;
  transition: background .2s;
}
.tech-toggle-slider::before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.tech-toggle input:checked + .tech-toggle-slider { background: #22c55e; }
.tech-toggle input:checked + .tech-toggle-slider::before { transform: translateX(16px); }

/* ── Image Audit ─────────────────────────────────────── */
.img-audit-summary {
  font-size: 11px;
  color: #666688;
  margin-bottom: 6px;
}
.img-audit-results { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.img-audit-row {
  background: #0a0a14;
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.img-audit-src {
  font-size: 10px;
  color: #666688;
  word-break: break-all;
  flex: 1;
  min-width: 80px;
}
.img-badge {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
  flex-shrink: 0;
}
.img-badge-ok   { background: rgba(34,197,94,.15); color: #22c55e; }
.img-badge-warn { background: rgba(250,204,21,.15); color: #facc15; }
.img-alt-input { flex-basis: 100%; margin-top: 4px; }
.img-alt-suggestion {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}

.editor-field-label {
  font-size: 11px;
  font-weight: 500;
  color: #44446a;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.editor-title-input {
  background: #12121e;
  border: 1px solid #22223a;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 500;
  color: #e0e0f0;
  outline: none;
  width: 100%;
  transition: border-color .15s;
}

.editor-title-input:focus { border-color: #5a3e9a; }
.editor-title-input::placeholder { color: #2a2a45; }

.editor-body-input {
  background: #12121e;
  border: 1px solid #22223a;
  border-radius: 8px;
  padding: 14px;
  font-size: 13px;
  color: #d0d0e8;
  outline: none;
  width: 100%;
  min-height: 220px;
  resize: vertical;
  line-height: 1.7;
  transition: border-color .15s;
}

.editor-body-input:focus { border-color: #5a3e9a; }
.editor-body-input::placeholder { color: #2a2a45; }

.editor-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-save-draft {
  background: #1a1435;
  border: 1px solid #2d1f55;
  border-radius: 7px;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 500;
  color: #a78bfa;
  cursor: pointer;
  transition: background .15s;
}

.btn-save-draft:hover    { background: #221a45; }
.btn-save-draft:disabled { opacity: .4; cursor: not-allowed; }

.btn-publish-req {
  background: #0d2010;
  border: 1px solid #1a3a20;
  border-radius: 7px;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 500;
  color: #4ade80;
  cursor: pointer;
  transition: background .15s;
}

.btn-publish-req:hover { background: #122818; }

.btn-ai-fill {
  background: #12121e;
  border: 1px solid #2d1f55;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #8b6ef5;
  cursor: pointer;
  transition: background .15s;
}

.btn-ai-fill:hover { background: #1a1030; }

.editor-status {
  font-size: 11px;
  color: #444466;
  margin-left: auto;
}

/* ══════════════════════════════════════
   KEYWORDS
══════════════════════════════════════ */
.kw-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.kw-stat {
  background: #0f0f1a;
  border: 1px solid #1a1a30;
  border-radius: 8px;
  padding: 12px;
}

.kw-stat-val {
  font-size: 20px;
  font-weight: 500;
  color: #a78bfa;
}

.kw-stat-key {
  font-size: 11px;
  color: #444466;
  margin-top: 2px;
}

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

.kw-filter-group { display: flex; gap: 5px; }

.kw-filter {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid #2a2a45;
  background: #12122a;
  color: #8888aa;
  cursor: pointer;
  transition: all .15s;
}

.kw-filter:hover  { border-color: #5a3e9a; color: #a890ee; }
.kw-filter.active { background: #1a1435; border-color: #5a3e9a; color: #a78bfa; }

.kw-search {
  background: #12121e;
  border: 1px solid #22223a;
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12px;
  color: #e0e0f0;
  outline: none;
  width: 180px;
  transition: border-color .15s;
}

.kw-search:focus { border-color: #5a3e9a; }
.kw-search::placeholder { color: #2a2a45; }

.kw-table-wrap {
  background: #0f0f1a;
  border: 1px solid #1a1a30;
  border-radius: 10px;
  overflow: hidden;
}

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

.kw-table th {
  background: #141428;
  padding: 9px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 500;
  color: #44446a;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid #1a1a35;
}

.kw-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #12121e;
  vertical-align: middle;
}

.kw-table tr:last-child td { border-bottom: none; }
.kw-table tr:hover td      { background: #121225; }

.kw-keyword { font-weight: 500; color: #c8c8e0; }

.intent-badge, .priority-badge, .cluster-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
}

.intent-informational  { background: #0d1a25; color: #60a5fa; border: 1px solid #1a2e45; }
.intent-commercial     { background: #1a1010; color: #fb923c; border: 1px solid #2a1a10; }
.intent-navigational   { background: #0d1a10; color: #4ade80; border: 1px solid #1a2e20; }
.intent-transactional  { background: #1a0d1a; color: #e879f9; border: 1px solid #2a1535; }

.priority-high   { background: #1a1010; color: #f87171; border: 1px solid #2a1515; }
.priority-medium { background: #1a1a10; color: #facc15; border: 1px solid #2a2a18; }
.priority-low    { background: #0d1a10; color: #4ade80; border: 1px solid #1a2e20; }

.cluster-tag { background: #12122a; color: #8888cc; border: 1px solid #1e1e3a; }

.kw-btn {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid;
  transition: all .15s;
  margin-right: 4px;
}

.kw-btn-write { background: #0d1a10; border-color: #1a2e20; color: #4ade80; }
.kw-btn-write:hover { background: #122818; }
.kw-btn-del   { background: #1a0a0a; border-color: #2a1515; color: #f87171; }
.kw-btn-del:hover { background: #220f0f; }

/* ── UPLOAD ── */
.upload-zone {
  border: 2px dashed #2a2a45;
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.upload-zone:hover,
.upload-zone.drag { border-color: #5a3e9a; background: #0f0f1e; }

.upload-zone-icon { font-size: 28px; margin-bottom: 8px; }
.upload-zone-text { font-size: 13px; color: #888; }
.upload-zone-sub  { font-size: 11px; color: #444466; margin-top: 4px; }

.manual-kw-area { display: flex; gap: 10px; align-items: flex-start; }

.manual-kw-input {
  flex: 1;
  background: #12121e;
  border: 1px solid #22223a;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #e0e0f0;
  outline: none;
  min-height: 100px;
  resize: vertical;
  transition: border-color .15s;
}

.manual-kw-input:focus { border-color: #5a3e9a; }
.manual-kw-input::placeholder { color: #2a2a45; }

/* ══════════════════════════════════════
   AI CHAT
══════════════════════════════════════ */
.chat-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  height: 100%;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}

.msg { display: flex; flex-direction: column; gap: 4px; }

.msg-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.msg.user .msg-label  { color: #5a5a7a; text-align: right; }
.msg.user             { align-items: flex-end; }
.msg.assistant .msg-label { color: #7c5fe8; }
.msg.system .msg-label    { color: #22c55e; }

.msg-bubble {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
  max-width: 85%;
}

.msg.user .msg-bubble      { background: #14142a; border: 1px solid #1e1e38; color: #c8c8e0; }
.msg.assistant .msg-bubble { background: #120f1e; border: 1px solid #2a1e4a; color: #d8d0f0; }
.msg.system .msg-bubble    {
  background: #0d1a10;
  border: 1px solid #1a3022;
  color: #6ee7a0;
  font-size: 11.5px;
}

.thinking {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}

.thinking span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7c5fe8;
  animation: bounce .9s ease-in-out infinite;
}

.thinking span:nth-child(2) { animation-delay: .15s; }
.thinking span:nth-child(3) { animation-delay: .3s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30%            { transform: translateY(-4px); opacity: 1; }
}

.chat-input-area {
  padding: 12px 20px;
  background: #0c0c18;
  border-top: 1px solid #1a1a28;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  background: #12121e;
  border: 1px solid #22223a;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  color: #e0e0f0;
  outline: none;
  transition: border-color .15s;
}

.chat-input:focus { border-color: #4a3a8a; }
.chat-input::placeholder { color: #3a3a55; }

.send-btn {
  background: #5a3e9a;
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  flex-shrink: 0;
}

.send-btn:hover    { background: #6a4eaa; }
.send-btn:disabled { background: #2a2a40; cursor: not-allowed; }
.send-btn svg      { width: 16px; height: 16px; }

/* ══════════════════════════════════════
   MODALS
══════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: #00000088;
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal {
  background: #0f0f1a;
  border: 1px solid #1e1e35;
  border-radius: 14px;
  padding: 26px;
  width: 420px;
  max-width: 95vw;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-icon  { font-size: 26px; text-align: center; }
.modal-title { font-size: 15px; font-weight: 500; color: #fff; text-align: center; }

.modal-body {
  font-size: 13px;
  color: #888;
  line-height: 1.6;
  text-align: center;
}

.modal-body strong { color: #ccc; }

.modal-input {
  background: #12121e;
  border: 1px solid #22223a;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #e0e0f0;
  outline: none;
  width: 100%;
  transition: border-color .15s;
}

.modal-input:focus { border-color: #5a3e9a; }
.modal-input::placeholder { color: #2a2a45; }

.modal-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: #888;
  cursor: pointer;
}

.modal-checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: #f87171;
  cursor: pointer;
}

.modal-actions { display: flex; gap: 10px; }

.modal-btn-cancel {
  flex: 1;
  background: #1a1a2a;
  border: 1px solid #2a2a40;
  border-radius: 7px;
  padding: 9px;
  font-size: 13px;
  color: #888;
  cursor: pointer;
  transition: background .15s;
}

.modal-btn-cancel:hover { background: #222235; }

.modal-btn-confirm {
  flex: 1;
  border: none;
  border-radius: 7px;
  padding: 9px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}

.modal-btn-confirm.green  { background: #1a3a20; color: #4ade80; }
.modal-btn-confirm.green:hover { background: #1e4425; }
.modal-btn-confirm.red    { background: #3a1515; color: #f87171; }
.modal-btn-confirm.red:hover { background: #451a1a; }
.modal-btn-confirm.purple { background: #2a1a4a; color: #a78bfa; }
.modal-btn-confirm.purple:hover { background: #321d58; }
.modal-btn-confirm:disabled { opacity: .3; cursor: not-allowed; }

.modal-step-indicator { display: flex; gap: 6px; justify-content: center; }

.step-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2a2a45;
  transition: background .2s;
}

.step-dot.active { background: #f87171; }
.step-dot.done   { background: #4ade80; }

.modal-warning-box {
  background: #1a0a0a;
  border: 1px solid #3a1515;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #f87171;
  text-align: center;
}

/* ══════════════════════════════════════
   GENERATE MODAL
══════════════════════════════════════ */
.gen-field  { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.gen-label  { font-size: 11px; font-weight: 500; color: #44446a; letter-spacing: .08em; text-transform: uppercase; }

.gen-select {
  background: #12121e;
  border: 1px solid #22223a;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 12px;
  color: #d0d0e8;
  outline: none;
  width: 100%;
}

.gen-kw-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }

.gen-chip {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 20px;
  background: #1a1435;
  border: 1px solid #2d1f55;
  color: #a78bfa;
  cursor: pointer;
  transition: all .15s;
}

.gen-chip.selected { background: #2d1f55; border-color: #5a3e9a; }

.progress-bar {
  height: 4px;
  background: #1a1a2a;
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #5a3e9a, #a78bfa);
  animation: prog 2s ease-in-out infinite;
}

@keyframes prog {
  0%   { width: 0%;  margin-left: 0%; }
  50%  { width: 60%; margin-left: 20%; }
  100% { width: 0%;  margin-left: 100%; }
}

/* ══════════════════════════════════════
   TAXONOMY MANAGEMENT
══════════════════════════════════════ */

/* ── Add / inline-edit form ── */
.tax-add-form {
  display: none;
  padding: 14px;
  background: #12122a;
  border: 1px solid #2a2a45;
  border-radius: 8px;
  margin-bottom: 16px;
}

.tax-add-form.show { display: block; }

.tax-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.tax-form-field { display: flex; flex-direction: column; gap: 4px; }

.tax-form-field--full { grid-column: 1 / -1; }

.tax-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.tax-required { color: #f87171; margin-left: 2px; }

.tax-hint {
  font-size: 10px;
  color: #555577;
  font-weight: 400;
}

/* ── Management table ── */
.tax-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.tax-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 500;
  color: #6060a0;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid #1a1a30;
}

.tax-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #0f0f1a;
  color: #c8c8e0;
  vertical-align: middle;
}

.tax-term-row:hover td { background: #0d0d1e; }

.tax-name-cell { font-weight: 500; }

.tax-slug-cell,
.tax-parent-cell {
  font-size: 11px;
  color: #8888aa;
}

.tax-desc-cell {
  font-size: 11.5px;
  color: #8888aa;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tax-count-cell {
  font-size: 11px;
  color: #8888aa;
  text-align: center;
}

.tax-actions-cell {
  white-space: nowrap;
  width: 1%;
}

.tax-term-name { color: #c8c8e0; }

.tax-tree-indicator {
  color: #333355;
  font-size: 11px;
  margin-right: 2px;
  user-select: none;
}

/* ── Inline action buttons ── */
.btn-inline-edit,
.btn-inline-delete {
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, color .12s;
}

.btn-inline-edit {
  background: #1a1a35;
  border-color: #2a2a55;
  color: #a0a0d0;
  margin-right: 4px;
}

.btn-inline-edit:hover { background: #22224a; color: #c8c8f0; }

.btn-inline-delete {
  background: transparent;
  border-color: #2a1515;
  color: #8a4444;
}

.btn-inline-delete:hover { background: #1a0a0a; color: #f87171; border-color: #5a2020; }

/* ── Inline edit row ── */
.tax-edit-row td { padding: 12px 14px; background: #0d0d22; }

.tax-inline-edit-form { padding: 4px 0; }

.tax-edit-error {
  font-size: 11px;
  color: #f87171;
  margin-top: 6px;
}

/* ── Inline delete confirm ── */
.tax-del-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tax-del-msg {
  font-size: 11.5px;
  color: #aaaacc;
}

/* ── Danger button ── */
.btn-danger {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  background: #3a0a0a;
  border: 1px solid #6a2020;
  color: #f87171;
  transition: background .12s;
}

.btn-danger:hover { background: #550f0f; }

/* ── Tag pill input ── */
.tax-tag-wrap { position: relative; }

.tax-tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 22px;
  margin-bottom: 2px;
}

.tax-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  background: #1a1435;
  border: 1px solid #2d1f55;
  color: #a78bfa;
}

.tax-pill-remove {
  background: none;
  border: none;
  color: #5a3e9a;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 1px;
  display: flex;
  align-items: center;
  transition: color .12s;
}

.tax-pill-remove:hover { color: #f87171; }

.tax-tag-suggestions {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: #0f0f1a;
  border: 1px solid #2a2a45;
  border-radius: 7px;
  z-index: 50;
  display: none;
  overflow: hidden;
  box-shadow: 0 4px 16px #00000066;
}

.tax-sug-item {
  padding: 7px 12px;
  font-size: 12px;
  color: #c8c8e0;
  cursor: pointer;
  transition: background .1s;
}

.tax-sug-item:hover   { background: #14142a; }
.tax-sug-create       { color: #a78bfa; }

/* ── Category checklist ── */
.tax-checklist {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 140px;
  overflow-y: auto;
}

.tax-check-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #c8c8e0;
  cursor: pointer;
  padding: 3px 0;
}

.tax-check-row input[type="checkbox"] {
  accent-color: #a78bfa;
  width: 13px;
  height: 13px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── AI suggestions area ── */
.tax-ai-area { margin-top: 4px; }

.tax-ai-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tax-pill-suggestion {
  cursor: pointer;
  background: #12182a;
  border-color: #1e2e55;
  color: #60a5fa;
  transition: all .15s;
}

.tax-pill-suggestion:hover { background: #1a2045; border-color: #3a5e9a; }

.tax-pill-used {
  opacity: .45;
  pointer-events: none;
}

/* ══════════════════════════════════════
   CONTENT INBOX
══════════════════════════════════════ */

/* Two-panel layout */
.inbox-layout {
  display: flex;
  height: 100%;
  gap: 0;
  min-height: 0;
}

.inbox-left {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1a1a2a;
  background: #0c0c18;
}

.inbox-right {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Filters ── */
.inbox-filters {
  display: flex;
  gap: 2px;
  padding: 10px 10px 0;
  flex-wrap: wrap;
}

.inbox-tab {
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 5px;
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  font-weight: 500;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.inbox-tab:hover  { color: #888; background: #14142a; }
.inbox-tab.active { color: #a78bfa; background: #1a1435; }

.inbox-tab-count {
  font-size: 9px;
  background: #1a1a30;
  color: #888;
  border-radius: 8px;
  padding: 1px 5px;
}

.inbox-tab.active .inbox-tab-count {
  background: #2d1f55;
  color: #a78bfa;
}

/* ── Item list ── */
.inbox-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: all .15s;
  border-left: 3px solid transparent;
}

.inbox-item:hover    { background: #14142a; }
.inbox-item.selected { background: #1a1435; border-left-color: #5a3e9a; }

.inbox-item-body { flex: 1; min-width: 0; }

.inbox-item-title {
  font-size: 12px;
  font-weight: 500;
  color: #c8c8e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.inbox-item-source {
  font-size: 10px;
  color: #444466;
}

/* Priority dots */
.inbox-priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.inbox-priority-high   { background: #f87171; }
.inbox-priority-medium { background: #facc15; }
.inbox-priority-low    { background: #4ade80; }

/* Status pills */
.inbox-status-pill {
  font-size: 9px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}

.inbox-status-new     { background: #101a25; color: #60a5fa; border: 1px solid #1a2e45; }
.inbox-status-review  { background: #1a1a10; color: #facc15; border: 1px solid #2a2a18; }
.inbox-status-used    { background: #0d2010; color: #4ade80; border: 1px solid #1a3a20; }
.inbox-status-archived { background: #1a1010; color: #888;   border: 1px solid #2a2020; }

/* Add button */
.inbox-add-btn {
  margin: 8px;
  padding: 9px;
  background: #1a1435;
  border: 1px solid #2d1f55;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: #a78bfa;
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}
.inbox-add-btn:hover { background: #221a45; }

/* ── List states ── */
.inbox-list-empty {
  text-align: center;
  padding: 30px 10px;
  color: #333355;
  font-size: 12px;
}

.inbox-list-error {
  text-align: center;
  padding: 20px 10px;
  color: #f87171;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.inbox-retry-btn {
  background: #1a1435;
  border: 1px solid #2d1f55;
  border-radius: 5px;
  color: #a78bfa;
  font-size: 11px;
  padding: 5px 12px;
  cursor: pointer;
}

/* Skeleton loader */
.inbox-skeleton {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.inbox-skeleton-line {
  height: 10px;
  border-radius: 4px;
  background: #1a1a2a;
  animation: inbox-pulse 1.2s ease-in-out infinite;
}
.inbox-skeleton-line.long  { width: 80%; }
.inbox-skeleton-line.short { width: 50%; }
@keyframes inbox-pulse {
  0%, 100% { opacity: .3; }
  50%      { opacity: .6; }
}

/* ── Detail panel ── */
.inbox-empty-detail {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #333355;
  font-size: 13px;
}

.inbox-detail-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inbox-detail-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inbox-detail-title {
  font-size: 16px;
  font-weight: 500;
  color: #e0e0f0;
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition: border-color .15s;
}
.inbox-detail-title:hover { border-bottom-color: #44446a; }

.inbox-detail-title-input {
  font-size: 16px;
  font-weight: 500;
  color: #e0e0f0;
  background: #12121e;
  border: 1px solid #5a3e9a;
  border-radius: 6px;
  padding: 4px 8px;
  outline: none;
  flex: 1;
}

.inbox-detail-meta {
  font-size: 11px;
  color: #444466;
}

.inbox-detail-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.inbox-action-btn {
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  border: 1px solid;
  transition: all .15s;
}

.inbox-btn-generate  { background: #1a1435; border-color: #2d1f55; color: #a78bfa; }
.inbox-btn-generate:hover { background: #221a45; }
.inbox-btn-summarise { background: #101a25; border-color: #1a2e45; color: #60a5fa; }
.inbox-btn-summarise:hover { background: #142235; }
.inbox-btn-archive   { background: #1a1a10; border-color: #2a2a18; color: #888; }
.inbox-btn-archive:hover { background: #222210; }
.inbox-btn-delete    { background: #12121e; border-color: #2a2a45; color: #888; }
.inbox-btn-delete:hover { background: #1a1a2a; }
.inbox-btn-delete-confirm { background: #2a1515; border-color: #3a1515; color: #f87171; }
.inbox-btn-delete-final   { background: #3a1515; border-color: #551a1a; color: #f87171; font-weight: 500; }

.inbox-action-btn:disabled { opacity: .4; cursor: wait; }

/* ── Sections ── */
.inbox-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inbox-section-label {
  font-size: 10px;
  font-weight: 500;
  color: #44446a;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.inbox-source-link {
  font-size: 12px;
  color: #60a5fa;
  text-decoration: none;
  word-break: break-all;
}
.inbox-source-link:hover { text-decoration: underline; }

/* Summary */
.inbox-summary-block {
  background: #12182a;
  border: 1px solid #1e2e45;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  color: #c0c8e0;
  line-height: 1.6;
}

.inbox-summary-empty {
  font-size: 12px;
  color: #444466;
  font-style: italic;
}

.inbox-summary-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #60a5fa;
}

.inbox-inline-error {
  font-size: 11px;
  color: #f87171;
  margin-top: 4px;
}

/* Spinner */
.inbox-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(96,165,250,.25);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* Content preview */
.inbox-content-preview {
  background: #0a0a14;
  border: 1px solid #1a1a30;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 11px;
  color: #888;
  max-height: 140px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}
.inbox-content-preview.expanded { max-height: none; }

.inbox-toggle-content {
  background: none;
  border: none;
  color: #a78bfa;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}
.inbox-toggle-content:hover { text-decoration: underline; }

/* Tags */
.inbox-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.inbox-tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 12px;
  background: #1a1435;
  border: 1px solid #2d1f55;
  color: #a78bfa;
  display: flex;
  align-items: center;
  gap: 4px;
}

.inbox-tag-remove {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  line-height: 1;
}
.inbox-tag-remove:hover { color: #f87171; }

.inbox-tag-input {
  background: none;
  border: none;
  outline: none;
  color: #c8c8e0;
  font-size: 11px;
  min-width: 80px;
}
.inbox-tag-input::placeholder { color: #333355; }

/* Todos */
.inbox-todos {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inbox-todo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
  color: #c8c8e0;
  cursor: pointer;
}
.inbox-todo.done span { text-decoration: line-through; color: #444466; }

.inbox-todo input[type="checkbox"] {
  accent-color: #a78bfa;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.inbox-todo-add { margin-top: 4px; }

.inbox-todo-input {
  background: none;
  border: none;
  border-bottom: 1px solid #1a1a30;
  outline: none;
  color: #c8c8e0;
  font-size: 12px;
  padding: 5px 0;
  width: 100%;
}
.inbox-todo-input::placeholder { color: #333355; }
.inbox-todo-input:focus { border-bottom-color: #5a3e9a; }

/* Linked article */
.inbox-linked-post {
  font-size: 12px;
  color: #60a5fa;
  text-decoration: none;
}
.inbox-linked-post:hover { text-decoration: underline; }

.inbox-muted {
  font-size: 12px;
  color: #444466;
}

/* ── Error banner ── */
.inbox-error-banner {
  background: #1a0a0a;
  border: 1px solid #3a1515;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: #f87171;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inbox-error-dismiss {
  background: none;
  border: none;
  color: #f87171;
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
}

/* ── Toast ── */
.inbox-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a3a20;
  border: 1px solid #2a5a30;
  color: #4ade80;
  font-size: 12px;
  padding: 8px 18px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 500;
}
.inbox-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Add modal extras ── */
.inbox-modal-tabs {
  display: flex;
  gap: 2px;
  background: #0a0a14;
  border-radius: 6px;
  padding: 2px;
}

.inbox-modal-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #555577;
  padding: 7px;
  cursor: pointer;
  transition: all .15s;
}
.inbox-modal-tab:hover  { color: #888; }
.inbox-modal-tab.active { background: #1a1435; color: #a78bfa; }

.inbox-modal-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inbox-modal-error {
  font-size: 12px;
  color: #f87171;
  background: #1a0a0a;
  border: 1px solid #3a1515;
  border-radius: 6px;
  padding: 8px 12px;
}

.inbox-url-error {
  font-size: 11px;
  color: #f87171;
  margin-top: 2px;
}

.inbox-url-content-preview {
  background: #0a0a14;
  border: 1px solid #1a1a30;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 11px;
  color: #888;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.inbox-fetch-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #60a5fa;
}

/* ══════════════════════════════════════
   NEW NAV ICONS + STUB MODULE LAYOUT
   (added — do not edit existing rules above)
══════════════════════════════════════ */
.nav-item .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-svg-icon {
  width: 16px;
  height: 16px;
  display: block;
  color: currentColor;
}

#sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  cursor: col-resize;
  z-index: 10;
  background: transparent;
  transition: background 0.15s;
}

#sidebar-resize-handle:hover {
  background: rgba(255, 255, 255, 0.08);
}

#sidebar-resize-handle.dragging {
  background: rgba(255, 255, 255, 0.15);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.section-title {
  font-size: 14px;
  font-weight: 500;
  color: #ccc;
  margin: 0;
}

.section-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.section-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-card {
  background: #0f0f1a;
  border: 1px solid #1a1a30;
  border-radius: 10px;
  padding: 14px 16px;
}

.stat-card-label {
  font-size: 10px;
  color: #555577;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 6px;
}

.stat-card-value {
  font-size: 22px;
  font-weight: 500;
  color: #c8c8e0;
  line-height: 1.1;
}

.stub-empty-state {
  background: #0f0f1a;
  border: 1px dashed #1f1f35;
  border-radius: 10px;
  padding: 44px 24px;
  text-align: center;
}

.stub-empty-state-title {
  font-size: 13px;
  color: #6a6a8a;
  margin-bottom: 6px;
  font-weight: 500;
}

.stub-empty-state-desc {
  font-size: 12px;
  color: #44446a;
  max-width: 440px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════
   BI MODULES — competitors / products / industry / partners
   Phase 2a scaffold. Refined as the BI suite matures.
   ════════════════════════════════════════════════════════════ */

.bi-stat-cards {
  grid-template-columns: repeat(4, 1fr);
}

.bi-stat-value-text {
  font-size: 14px;
  font-weight: 500;
  color: #aaaacc;
  line-height: 1.4;
  padding-top: 4px;
}

/* ── BI list + card ── */
.bi-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bi-card {
  background: #0f0f1a;
  border: 1px solid #1a1a30;
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .15s, background .15s;
}

.bi-card:hover {
  border-color: #2a2a45;
  background: #11111e;
}

.bi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.bi-card-name {
  font-size: 15px;
  font-weight: 500;
  color: #d8d8e8;
  letter-spacing: 0.005em;
}

.bi-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.bi-badge {
  font-size: 9.5px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid;
  line-height: 1.2;
}

.bi-badge-pending { color: #d4a857; background: #2a2210; border-color: #4a3a20; }
.bi-badge-look    { color: #7a9cd8; background: #14182a; border-color: #2a3050; }
.bi-badge-comp    { color: #7ac8a0; background: #142220; border-color: #2a4035; }
.bi-badge-alt     { color: #d88090; background: #2a1418; border-color: #4a2530; }

.bi-badge-source {
  color: #6a6a8a;
  background: #12121e;
  border-color: #22223a;
  text-transform: lowercase;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.bi-card-url {
  font-size: 12px;
  word-break: break-all;
}
.bi-card-url a {
  color: #7a8acc;
  text-decoration: none;
}
.bi-card-url a:hover {
  color: #9aa6dc;
  text-decoration: underline;
}

.bi-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: #a8a8c0;
  line-height: 1.5;
}

.bi-card-meta-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: baseline;
}

.bi-card-meta-label {
  color: #555577;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 10px;
}

/* relationship counts bar */
.bi-card-relbar {
  display: flex;
  gap: 16px;
  padding: 8px 10px;
  background: #0a0a14;
  border: 1px solid #15152a;
  border-radius: 8px;
  font-size: 11px;
  color: #8888aa;
  align-items: center;
  flex-wrap: wrap;
}

.bi-card-relbar-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bi-card-relbar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.bi-card-relbar-dot-look { background: #7a9cd8; }
.bi-card-relbar-dot-comp { background: #7ac8a0; }
.bi-card-relbar-dot-alt  { background: #d88090; }

.bi-card-relbar-count {
  color: #d8d8e8;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.bi-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px dashed #1a1a30;
}

.bi-card-footer-meta {
  font-size: 11px;
  color: #555577;
}

.bi-card-details-btn {
  background: none;
  border: none;
  color: #8888cc;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
  transition: color .12s;
}

.bi-card-details-btn:hover { color: #aaaaee; }

/* ── BI empty state (richer than stub-empty-state) ── */
.bi-empty-state {
  background: #0f0f1a;
  border: 1px dashed #1f1f35;
  border-radius: 12px;
  padding: 56px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bi-empty-icon {
  font-size: 36px;
  margin-bottom: 16px;
  opacity: 0.7;
}

.bi-empty-title {
  font-size: 15px;
  font-weight: 500;
  color: #aaaacc;
  margin-bottom: 10px;
}

.bi-empty-desc {
  font-size: 12.5px;
  color: #6a6a8a;
  max-width: 480px;
  line-height: 1.6;
  margin-bottom: 22px;
}

.bi-empty-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.bi-empty-hint {
  font-size: 11px;
  color: #44446a;
  font-style: italic;
  max-width: 480px;
  line-height: 1.55;
}

/* ── Phase scaffold banner ── */
.bi-phase-banner {
  margin-top: 6px;
  padding: 10px 14px;
  background: #12121e;
  border: 1px solid #22223a;
  border-radius: 8px;
  font-size: 11.5px;
  color: #6a6a8a;
  line-height: 1.55;
}

.bi-phase-banner code {
  background: #1a1a30;
  border: 1px solid #2a2a45;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10.5px;
  color: #aaaaee;
}

.bi-phase-banner-tag {
  display: inline-block;
  background: #2a1a44;
  border: 1px solid #3a2a64;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b0a0e8;
  margin-right: 8px;
  vertical-align: 1px;
}

/* ────────────────────────────────────────────────────────────
   BI · Add-Competitor modal (Phase B)
   ──────────────────────────────────────────────────────────── */

.bi-modal-add {
  width: 680px;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.bi-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 24px 0;
}

.bi-modal-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bi-modal-close {
  background: none;
  border: none;
  color: #555577;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: inherit;
  transition: color .12s, background .12s;
}
.bi-modal-close:hover {
  color: #d8d8e8;
  background: #1a1a2e;
}

.bi-modal-tabs {
  display: flex;
  gap: 4px;
  padding: 14px 24px 0;
  border-bottom: 1px solid #1a1a30;
  flex-shrink: 0;
}

.bi-modal-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: #6a6a8a;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color .12s, border-color .12s;
  font-family: inherit;
}
.bi-modal-tab:hover { color: #aaaacc; }
.bi-modal-tab.active {
  color: #aaaaee;
  border-bottom-color: #5a3e9a;
}

.bi-modal-panel {
  padding: 20px 24px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bi-modal-panel[hidden] { display: none !important; }

/* Form grid */
.bi-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.bi-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bi-form-field-wide {
  grid-column: 1 / -1;
}

.bi-form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #6a6a8a 50%),
    linear-gradient(135deg, #6a6a8a 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.bi-form-hint {
  font-size: 11.5px;
  color: #6a6a8a;
  line-height: 1.55;
  margin-top: -4px;
  font-style: italic;
}

/* Fetch tab */
.bi-fetch-hint {
  font-size: 12.5px;
  color: #8a8aaa;
  line-height: 1.65;
  padding: 12px 14px;
  background: #0a0a14;
  border: 1px dashed #1f1f35;
  border-radius: 8px;
}

.bi-rel-token {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.bi-rel-token-look { color: #7a9cd8; background: #14182a; }
.bi-rel-token-comp { color: #7ac8a0; background: #142220; }
.bi-rel-token-alt  { color: #d88090; background: #2a1418; }

.bi-fetch-start-row {
  display: flex;
  justify-content: flex-end;
}

.bi-fetch-btn {
  padding: 9px 18px;
  font-size: 13px;
}

/* Fetch progress (multi-step) */
.bi-fetch-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: #0a0a14;
  border: 1px solid #1a1a30;
  border-radius: 8px;
}

.bi-fetch-progress-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: #44446a;
  transition: color .15s;
}

.bi-fetch-progress-step.active { color: #aaaacc; }
.bi-fetch-progress-step.done   { color: #7ac8a0; }

.bi-fetch-progress-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #2a2a45;
  background: #0a0a14;
  flex-shrink: 0;
  transition: all .15s;
}
.bi-fetch-progress-step.active .bi-fetch-progress-icon {
  border-color: #5a3e9a;
  border-top-color: transparent;
  animation: bi-spin .8s linear infinite;
}
.bi-fetch-progress-step.done .bi-fetch-progress-icon {
  background: #7ac8a0;
  border-color: #7ac8a0;
  animation: none;
}

@keyframes bi-spin {
  to { transform: rotate(360deg); }
}

/* Fetch results — extracted profile */
.bi-fetch-results-section + .bi-fetch-results-section {
  margin-top: 4px;
}

.bi-fetch-results-section-title {
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6a6a8a;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1a1a30;
}

.bi-extracted-profile {
  background: #0a0a14;
  border: 1px solid #1a1a30;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bi-extracted-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: center;
}

.bi-extracted-label {
  color: #555577;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 10px;
}

.bi-extracted-input {
  background: #0a0a14;
  border: 1px solid #1f1f35;
  color: #d8d8e8;
  padding: 7px 11px;
  border-radius: 6px;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  width: 100%;
}
.bi-extracted-input:focus {
  border-color: #5a3e9a;
  box-shadow: 0 0 0 2px #5a3e9a22;
}

/* Neighbor proposals */
.bi-neighbor-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bi-neighbor-group + .bi-neighbor-group {
  margin-top: 12px;
}

.bi-neighbor-group-header {
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #8a8aaa;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.bi-neighbor-group-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.bi-neighbor-group-dot.look { background: #7a9cd8; }
.bi-neighbor-group-dot.comp { background: #7ac8a0; }
.bi-neighbor-group-dot.alt  { background: #d88090; }

.bi-neighbor-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 13px;
  background: #0a0a14;
  border: 1px solid #1a1a30;
  border-radius: 7px;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
  user-select: none;
}
.bi-neighbor-card:hover {
  border-color: #2a2a45;
  background: #0d0d18;
}
.bi-neighbor-card.checked {
  border-color: #5a3e9a;
  background: #15102a;
}

.bi-neighbor-checkbox {
  width: 16px;
  height: 16px;
  border: 1.5px solid #2a2a45;
  border-radius: 3px;
  margin-top: 1px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  background: #0a0a14;
  transition: all .12s;
  line-height: 1;
}
.bi-neighbor-card.checked .bi-neighbor-checkbox {
  background: #5a3e9a;
  border-color: #5a3e9a;
}

.bi-neighbor-info { flex: 1; min-width: 0; }
.bi-neighbor-name { color: #d8d8e8; font-weight: 500; margin-bottom: 2px; }
.bi-neighbor-url  { color: #7a8acc; font-size: 11px; word-break: break-all; margin-bottom: 3px; }
.bi-neighbor-meta { color: #6a6a8a; font-size: 11px; }

/* ────────────────────────────────────────────────────────────
   BI · Competitor detail view (Phase C)
   ──────────────────────────────────────────────────────────── */

.bi-detail-header {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 6px 16px;
  margin-bottom: 6px;
}

.bi-detail-back {
  grid-row: 1;
  grid-column: 1;
  background: none;
  border: none;
  color: #8888cc;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
  transition: color .12s;
  text-align: left;
  align-self: start;
  justify-self: start;
}
.bi-detail-back:hover { color: #aaaaee; }

.bi-detail-title-row {
  grid-row: 2;
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.bi-detail-title {
  font-size: 20px;
  font-weight: 500;
  color: #e0e0f0;
  margin: 0;
  letter-spacing: 0.005em;
}

.bi-detail-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.bi-detail-actions {
  grid-row: 2;
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-self: end;
}

.bi-detail-pending-pill {
  display: inline-block;
  background: #2a2210;
  border: 1px solid #4a3a20;
  color: #d4a857;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.bi-detail-section {
  margin-top: 18px;
}

.bi-detail-section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1a1a30;
}

.bi-detail-section-title {
  font-size: 13px;
  font-weight: 500;
  color: #c8c8e0;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.01em;
}

.bi-detail-rel-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.bi-detail-rel-dot-look { background: #7a9cd8; }
.bi-detail-rel-dot-comp { background: #7ac8a0; }
.bi-detail-rel-dot-alt  { background: #d88090; }

.bi-detail-rel-count {
  font-size: 11px;
  color: #6a6a8a;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-left: 4px;
}

.bi-detail-add-rel {
  background: #12122a;
  border: 1px solid #2a2a45;
  border-radius: 6px;
  color: #8888cc;
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 10px;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
}
.bi-detail-add-rel:hover {
  background: #1a1a3a;
  color: #aaaaee;
  border-color: #3a3a55;
}

/* Profile */
.bi-detail-profile {
  background: #0f0f1a;
  border: 1px solid #1a1a30;
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.bi-detail-profile-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  align-items: center;
}

.bi-detail-profile-label {
  color: #555577;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 10px;
}

.bi-detail-profile-value {
  color: #c8c8e0;
  font-size: 13px;
  word-break: break-word;
}

.bi-detail-profile-value a {
  color: #7a8acc;
  text-decoration: none;
}
.bi-detail-profile-value a:hover {
  color: #9aa6dc;
  text-decoration: underline;
}

/* Relationship sub-groups */
.bi-detail-rel-subgroup {
  margin-top: 12px;
}

.bi-detail-rel-subgroup-label {
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6a6a8a;
  margin-bottom: 8px;
}

.bi-detail-rel-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bi-detail-rel-empty {
  font-size: 12px;
  color: #555577;
  font-style: italic;
  padding: 14px 0;
}

/* Relationship cards (validated + pending) */
.bi-rel-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: #0f0f1a;
  border: 1px solid #1a1a30;
  border-radius: 8px;
  transition: border-color .12s, background .12s;
}

.bi-rel-card:hover {
  border-color: #2a2a45;
  background: #11111e;
}

.bi-rel-card-pending {
  border-color: #2a2210;
  background: #14110a;
  border-style: dashed;
}
.bi-rel-card-pending:hover {
  border-color: #4a3a20;
  background: #181410;
}

.bi-rel-card-info { flex: 1; min-width: 0; }

.bi-rel-card-name {
  color: #d8d8e8;
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 3px;
}

.bi-rel-card-url {
  font-size: 11.5px;
  margin-bottom: 4px;
  word-break: break-all;
}
.bi-rel-card-url a {
  color: #7a8acc;
  text-decoration: none;
}
.bi-rel-card-url a:hover {
  color: #9aa6dc;
  text-decoration: underline;
}

.bi-rel-card-meta {
  font-size: 11.5px;
  color: #8888aa;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bi-rel-card-confidence {
  display: inline-block;
  background: #2a2210;
  border: 1px solid #4a3a20;
  color: #d4a857;
  font-size: 10px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

.bi-rel-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}

.bi-rel-card-btn {
  background: #12122a;
  border: 1px solid #2a2a45;
  border-radius: 6px;
  color: #8888cc;
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
  white-space: nowrap;
}
.bi-rel-card-btn:hover {
  background: #1a1a3a;
  color: #aaaaee;
}

.bi-rel-card-btn-accept {
  background: #142220;
  border-color: #2a4035;
  color: #7ac8a0;
}
.bi-rel-card-btn-accept:hover {
  background: #1c2e29;
  border-color: #3a5045;
  color: #9adabd;
}

.bi-rel-card-btn-reject {
  background: #2a1418;
  border-color: #4a2530;
  color: #d88090;
}
.bi-rel-card-btn-reject:hover {
  background: #341a20;
  border-color: #5a3040;
  color: #e2a0ad;
}

.bi-rel-card-btn-unlink {
  color: #6a6a8a;
}
.bi-rel-card-btn-unlink:hover {
  color: #d88090;
  border-color: #4a2530;
}

/* ────────────────────────────────────────────────────────────
   BI · Multi-relationship select (used in manual entry +
   fetch-extracted profile) and rel-pill toggles (used on each
   proposed-competitor card)
   ──────────────────────────────────────────────────────────── */

.bi-form-field-hint-inline {
  color: #6a6a8a;
  font-weight: 400;
  font-size: 10px;
  margin-left: 6px;
  text-transform: none;
  letter-spacing: 0;
}

.bi-rel-multi {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bi-rel-multi-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #0a0a14;
  border: 1px solid #1a1a30;
  border-radius: 8px;
  cursor: pointer;
  transition: all .12s;
  user-select: none;
  flex: 1;
  min-width: 0;
}

.bi-rel-multi-item input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #5a3e9a;
}

.bi-rel-multi-item:hover {
  border-color: #2a2a45;
  background: #0d0d18;
}

.bi-rel-multi-item:has(input:checked) {
  border-color: #5a3e9a;
  background: #15102a;
}

.bi-rel-multi-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.bi-rel-multi-name {
  font-weight: 500;
  font-size: 12.5px;
  color: #d8d8e8;
}

.bi-rel-multi-hint {
  font-size: 10.5px;
  color: #6a6a8a;
  line-height: 1.3;
}

/* Compact variant in the extracted-profile relationship row */
.bi-extracted-row-multi {
  align-items: start;
}
.bi-extracted-row-multi .bi-rel-multi-item {
  padding: 7px 11px;
  gap: 8px;
}
.bi-extracted-row-multi .bi-rel-multi-name {
  font-size: 11.5px;
}
.bi-extracted-row-multi .bi-rel-multi-hint {
  display: none;
}

/* Rel-pill toggles (one per relationship on each proposed-competitor card) */
.bi-rel-pill {
  background: #0a0a14;
  border: 1px solid #1a1a30;
  border-radius: 999px;
  color: #555577;
  font-size: 10.5px;
  font-weight: 500;
  padding: 3px 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
  line-height: 1.3;
}

.bi-rel-pill:hover {
  color: #aaaaee;
  border-color: #2a2a45;
}

.bi-rel-pill.active.bi-rel-pill-alt  { color: #d88090; background: #2a1418; border-color: #4a2530; }
.bi-rel-pill.active.bi-rel-pill-look { color: #7a9cd8; background: #14182a; border-color: #2a3050; }
.bi-rel-pill.active.bi-rel-pill-comp { color: #7ac8a0; background: #142220; border-color: #2a4035; }

/* ── Proposed-competitor card (in the fetch results, after extraction) ── */
.bi-proposed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bi-proposed-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  background: #0a0a14;
  border: 1px solid #1a1a30;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
  user-select: none;
}

.bi-proposed-card:hover {
  border-color: #2a2a45;
  background: #0d0d18;
}

.bi-proposed-card.checked {
  border-color: #5a3e9a;
  background: #15102a;
}

.bi-proposed-checkbox {
  width: 16px;
  height: 16px;
  border: 1.5px solid #2a2a45;
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  background: #0a0a14;
  transition: all .12s;
  line-height: 1;
}

.bi-proposed-card.checked .bi-proposed-checkbox {
  background: #5a3e9a;
  border-color: #5a3e9a;
}

.bi-proposed-info { flex: 1; min-width: 0; }

.bi-proposed-name {
  color: #d8d8e8;
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 2px;
}

.bi-proposed-url {
  color: #7a8acc;
  font-size: 11px;
  word-break: break-all;
  margin-bottom: 3px;
}

.bi-proposed-meta {
  color: #6a6a8a;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bi-proposed-rels {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-items: center;
}

/* Profile section multi-badges */
.bi-detail-profile-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* Suggest-from-my-site context textarea */
.bi-suggest-context-textarea {
  resize: vertical;
  font-family: inherit;
  min-height: 72px;
  line-height: 1.55;
}

/* Detail-view Delete button — colour-shifts to warning on hover */
.bi-detail-delete-btn:hover {
  color: #d88090;
  border-color: #4a2530;
  background: #1a1218;
}

/* Fetch-modal "this is my own site" toggle */
.bi-fetch-mode-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: #14102a;
  border: 1px solid #2a2150;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  color: #c8c8e0;
  user-select: none;
  line-height: 1.45;
}
.bi-fetch-mode-toggle:hover {
  background: #1a1432;
  border-color: #3a2a6a;
}
.bi-fetch-mode-toggle input[type="checkbox"] {
  accent-color: #5a3e9a;
  cursor: pointer;
  margin: 2px 0 0;
  flex-shrink: 0;
}
.bi-fetch-mode-toggle:has(input:checked) {
  background: #1f1640;
  border-color: #5a3e9a;
}
.bi-fetch-mode-hint {
  display: block;
  font-size: 11px;
  color: #6a6a8a;
  font-weight: 400;
  margin-top: 2px;
}
