/* ============================================================
   AI Atlas Engine — Main Styles
   Matches llmswrangler.com design system
   ============================================================ */

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

:root {
  --brand:        #06b6d4;
  --brand-light:  #40cbe4;
  --brand-dark:   #088196;
  --bg:           #ffffff;
  --bg-card:      #f9f9f9;
  --bg-card-alt:  #f0f2f4;
  --border:       rgba(0,0,0,0.09);
  --border-med:   rgba(0,0,0,0.15);
  --accent:       #06b6d4;
  --accent-light: #67e8f9;
  --green:        #22c55e;
  --red:          #c30223;
  --yellow:       #f59e0b;
  --text:         #000000;
  --text-muted:   #333333;
  --text-dim:     #888888;
  --radius:       5px;
  --radius-sm:    2px;
  --radius-pill:  5px;
  --shadow:       0 4px 24px rgba(0,0,0,0.08);
  --shadow-brand: 0 0 32px rgba(6,182,212,0.15);
  --card-shadow:  0 4px 4px rgba(0,0,0,0.05);
  --font:         'IBM Plex Sans', 'Inter', system-ui, sans-serif;
  --mono:         'JetBrains Mono', 'Fira Code', monospace;
  --max-page-width: 100%;
}

html, body {
  overflow: hidden;
}
@media (max-width: 900px) {
  html, body {
    overflow-y: scroll;
  }
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Layout ────────────────────────────────────────────── */

.container {
  max-width: var(--max-page-width);
  margin: 0 auto;
  padding: 0 24px;
}

.container--sm {
  max-width: 640px;
}

/* ── Nav ───────────────────────────────────────────────── */

.nav {
  position: fixed;
  width: calc(100% - 60px);
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 64px;
  padding-left: 15px;
}
.home .nav {
  width: 100%;
  border-bottom: 1px solid var(--border);
  padding-left: 0;
}
@media (max-width: 900px) {
  .nav {
    position: fixed;
    width: 100%;
    z-index: 1001;
  }
  body:has(.dash-sidebar) .nav {
    width: 100% !important;
  }
}

.nav .btn svg {
  height: 14px;
}

.nav-inner {
  max-width: var(--max-page-width);
  margin: 0 auto;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-logo {
  line-height: 0;
  /* font-size: 1rem;
  font-weight: 800;
  color: var(--brand);
  text-decoration: none;
  letter-spacing: -0.02em; */
  img {
    height: 25px; /* definite dimension so width:auto has something to resolve against — the default logo SVG has a viewBox but no width/height attrs, so width/height both "auto" collapses to nothing in some browsers */
    width: auto;
    max-width: 150px; /* caps arbitrary white-label logo aspect ratios to fit the 64px nav */
    object-fit: contain;
    /* Any src other than the default Atlas logo is an uploaded white-label logo. */
    &:not([src$="atlas-trademark.svg"]) {
      height: 35px;
    }
  }
}

.nav-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.nav-meta:empty {
  display: none;
}

.nav-meta::before {
  content: '—';
  margin-right: 8px;
  color: var(--text-dim);
}

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

/* ── "My Agency" nav dropdown ─────────────────────────────── */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-dropdown-chevron {
  width: 12px;
  height: 12px;
  transition: transform 0.15s ease;
}
.nav-dropdown-toggle[aria-expanded="true"] .nav-dropdown-chevron {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: var(--shadow);
  z-index: 110;
}
.nav-dropdown-menu.open {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-dropdown-item {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}
.nav-dropdown-item:hover {
  background: var(--bg-card-alt);
  color: var(--text);
}
.nav-dropdown-item.hidden {
  display: none;
}
.nav-dropdown-divider {
  height: 1px;
  margin: 4px 2px;
  background: var(--border);
}
.nav-dropdown-divider.hidden {
  display: none;
}
.nav-dropdown-item--btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: inherit;
}
.nav-dropdown-menu--right {
  left: auto;
  right: 0;
}

/* ── User account menu (avatar + Sign Out) ───────────────────── */
.nav-user-toggle {
  padding: 4px 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.nav-user-toggle[aria-expanded="true"] .nav-user-avatar, 
.nav-user-toggle:hover .nav-user-avatar {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .5);
}
.nav-user-avatar {
  display: inline-flex;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  background: var(--bg-card-alt);
  color: var(--text-dim);
  flex-shrink: 0;
}
.nav-user-avatar .atlas-chat-msg-avatar {
  width: 26px;
  height: 26px;
  margin-top: 0;
}

/* ── "What's New" changelog launcher (nav) ─────────────────── */
.whats-new-btn {
  position: relative;
}
.whats-new-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 500;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--yellow);
}
.whats-new-entry {
  padding-bottom: 20px;
}
.whats-new-entry:not(:last-child) {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}
.whats-new-entry-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.whats-new-entry h3 {
  font-size: 1rem;
  margin: 4px 0 8px;
}
.whats-new-entry ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ── Account Data Chat launcher ───────────────────────────────────────────── */

.atlas-chat-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  color: #fff;
  font-family: var(--font);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  background: linear-gradient(135deg, #444, #333);
  box-shadow: 0px 0px 8px #333, var(--shadow-brand);
  border-radius: 50%;
  height: 50px;
  width: 50px;
  justify-content: center;
  /* position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  border: none;
  color: #fff;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0px 4px 10px #0d5460, var(--shadow-brand); */
}

/* .atlas-chat-fab:hover { background: var(--brand-dark); transform: translateY(-1px); } */
.atlas-chat-fab svg { 
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.atlas-chat-fab span { 
  display: none;
}

.atlas-chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100001;
  display: flex;
  justify-content: flex-end;
}

.atlas-chat-overlay.hidden { display: none; }

.atlas-chat-panel {
  width: 100%;
  max-width: 480px;
  height: 100%;
  background: var(--bg-card);
  /* border-left: 1.5px solid #333; */
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

@media (max-width: 640px) {
  .atlas-chat-panel { max-width: 100%; border-left: 0; }
}

.atlas-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: #333;
  flex-shrink: 0;
}

.atlas-chat-header-title { flex: 1; }
.atlas-chat-header-name { font-size: 1.3rem; font-weight: 700; color: #fff; }
.atlas-chat-header-scope { font-size: 0.72rem; color: #fff; margin-top: 2px; }

.atlas-chat-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
}
.atlas-chat-close svg { width: 16px; height: 16px; }

.atlas-chat-new {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
}
.atlas-chat-new svg { width: 18px; height: 18px; }
.atlas-chat-new:hover { color: var(--text); }

.atlas-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
}

.atlas-chat-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.atlas-chat-suggestion {
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
  box-shadow: var(--card-shadow);
}
.atlas-chat-suggestion:hover { border-color: var(--brand); color: var(--text); }

.atlas-chat-suggestions-bar {
  display: flex;
  padding: 10px 18px 0px 18px;
  flex-shrink: 0;
  justify-content: center;
}

.atlas-chat-suggestions-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
  box-shadow: var(--card-shadow);
}
.atlas-chat-suggestions-toggle svg { width: 14px; height: 14px; flex-shrink: 0; }
.atlas-chat-suggestions-toggle:hover { border-color: var(--brand); color: var(--text); }
.atlas-chat-suggestions-toggle.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.atlas-chat-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  line-height: 1.5;
}

.atlas-chat-msg--user {
  align-self: flex-end;
  /* background: var(--brand);
  color: #fff; */
  background: #f9f9f9;
  color: #000;
  border: 1px solid var(--border);
}

.atlas-chat-msg--assistant {
  align-self: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}

.atlas-chat-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 88%;
}

.atlas-chat-msg-row--assistant { align-self: flex-start; }
.atlas-chat-msg-row--user { align-self: flex-end; flex-direction: row-reverse; }

.atlas-chat-msg-row--assistant .atlas-chat-msg-avatar {
  border-radius: 0;
}
.atlas-chat-msg-row .atlas-chat-msg--assistant,
.atlas-chat-msg-row .atlas-chat-msg--user {
  align-self: auto;
  max-width: 100%;
}

.atlas-chat-msg-avatar {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.atlas-chat-msg-avatar--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.atlas-chat-msg--typing { display: flex; gap: 4px; padding: 12px 14px; }
.atlas-chat-msg--typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-dim);
  animation: atlas-chat-typing 1.1s infinite ease-in-out;
}
.atlas-chat-msg--typing span:nth-child(2) { animation-delay: 0.15s; }
.atlas-chat-msg--typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes atlas-chat-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.atlas-chat-msg-limitations {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.atlas-chat-msg-links {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.atlas-chat-msg-links a {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 9px;
}
.atlas-chat-msg-links a:hover { 
  background-color: var(--brand);
  color: #fff;
}

.atlas-chat-msg-checklist {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.atlas-chat-checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}
.atlas-chat-checklist-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  line-height: 1;
}
.atlas-chat-checklist-item--complete .atlas-chat-checklist-icon {
  background: var(--brand);
  color: #fff;
}
.atlas-chat-checklist-item--incomplete .atlas-chat-checklist-icon {
  border: 1.5px solid var(--border);
}
.atlas-chat-checklist-item--complete .atlas-chat-checklist-label {
  text-decoration: line-through;
  color: var(--text-dim);
}
.atlas-chat-checklist-item--incomplete .atlas-chat-checklist-label a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
.atlas-chat-checklist-item--incomplete .atlas-chat-checklist-label a:hover { text-decoration: underline; }

.atlas-chat-proposal {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff;
}
.atlas-chat-proposal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.atlas-chat-proposal-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.82rem;
  cursor: pointer;
}
.atlas-chat-proposal-checkbox {
  margin-top: 3px;
  flex-shrink: 0;
}
.atlas-chat-proposal-item-text {
  flex: 1;
  line-height: 1.35;
}
.atlas-chat-proposal-item-meta {
  color: var(--text-dim);
  font-weight: 400;
  text-transform: capitalize;
}
.atlas-chat-proposal-state {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.atlas-chat-proposal-state--created { color: var(--brand); }
.atlas-chat-proposal-state--skipped { color: var(--text-dim); }
.atlas-chat-proposal-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.atlas-chat-proposal-goto {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.atlas-chat-proposal-goto .btn {
  text-decoration: none;
}

.atlas-chat-suggestions-bar {
  border-top: 1px solid var(--border);
}

.atlas-chat-composer {
  display: flex;
  gap: 8px;
  margin: 14px 18px;
  /* border-top: 1px solid var(--border); */
  flex-shrink: 0;

  background: #fff;
  border: 1.5px solid var(--border-med);
  border-radius: 8px;
}
.atlas-chat-composer:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12);;
}

.atlas-chat-composer input {
  flex: 1;
  padding: 10px 12px;
  background: #fff;
  border: 0 !important;
  border-radius: 8px !important;
  /* border-radius: var(--radius);
  border: 1px solid var(--border); */
  font-family: var(--font);
  font-size: 0.85rem;
}
.atlas-chat-composer input:focus {
  border: 0 !important;
  box-shadow: none;
}

.atlas-chat-send {
  flex-shrink: 0;
  /* padding: 0;
  width: 40px;
  height: 40px; */
  justify-content: center;
  border-radius: 50%;

  padding: 5px !important;
  width: 30px;
  height: 30px;
  margin: 6px;
}
.atlas-chat-send svg {
  width: 22px;
  height: 22px;
}

/* ── Buttons ────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 9px 18px;
  border-radius: 6px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
  white-space: nowrap;
  background: transparent;
}
@media (max-width: 480px) {
  .btn {
    padding: 8px 10px;
    font-size: 0.82rem;
  }
}

.btn svg {
  width: auto;
  height: 20px;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  svg {
    fill: #fff;
  }
}

.btn-primary:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  background: rgba(0,0,0,0.04);
  border-color: var(--border-med);
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(0,0,0,0.04);
}

.btn-danger {
  background: var(--red);
  border-color: transparent;
  color: #fff;
  display: inline-block;
}

.modal-delete-comp-btn, 
.delete-competitor-btn, 
.prompt-card-actions .btn-danger,
.prompts-table-actions-col .btn-danger {
  color: var(--red);
  border-color: transparent;
  background: transparent;
}

.modal-danger-zone .btn-danger, 
#modal-delete-btn, 
#dash-modal-delete-btn {
  width: auto;
  flex: 0 0 auto;
  align-self: flex-start;
}

/* .btn-danger:hover {
  color: var(--red);
  background: var(--red);
} */

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: auto;
}

/* ── Forms ──────────────────────────────────────────────── */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-competitors-group {
    padding: 20px;
    background: rgba(0, 0, 0, .1);
    border-radius: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

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

.form-row .form-group:last-child {
  margin-bottom: 20px;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.required {
  color: var(--red);
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="email"],
textarea,
select {
  background: #fff;
  border: 1.5px solid var(--border-med);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 10px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(6,182,212,0.12);
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

select {
  appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.select2-container .select2-selection--single {
  height: auto !important;
  padding: 5px 0 !important;
  padding-right: 36px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  border: 1.5px solid var(--border-med) !important;
  border-radius: var(--radius-sm) !important;
  .select2-selection__arrow {
    display: none;
  }
   .select2-selection__clear {
    margin-right: 0px !important;
  }
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.field-hint-inline {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-dim);
}

.field-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.char-counter {
  font-size: 0.76rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.char-counter--warn {
  color: #b45309;
  font-weight: 600;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}

.form-actions a {
  color: var(--brand);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 0;
}

@media (max-width: 900px) {
  .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.modal-danger-zone {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-danger-zone__note {
  font-size: 0.875rem;
  color: #991b1b;
  line-height: 1.5;
}

/* Type-to-confirm delete panel — shared by the edit-company modal and any
   other permanent-delete flow that wants the reset-data-style confirmation. */
.danger-confirm-panel {
  margin-top: 8px;
  padding: 18px 20px;
  border: 1.5px solid rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.05);
  border-radius: var(--radius-sm);
}

.danger-confirm-title {
  font-weight: 700;
  color: var(--red);
  margin-bottom: 6px;
}

.danger-confirm-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.danger-confirm-input-wrap {
  margin: 14px 0;
}

.danger-confirm-input-wrap label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.danger-confirm-input-wrap input[type="text"] {
  width: 100%;
  max-width: 360px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: inherit;
}

.danger-confirm-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

/* ── Cards ──────────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--card-shadow);
}

/* ── Page Headers ───────────────────────────────────────── */

.page-header {
  margin: 15px 0 40px 0;
}
.page-header-hidden {
  opacity: 0;
}

.page-header h1 {
  display: flex;
  align-items: center;
  font-size: 1.375rem;
  line-height: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.page-header p {
  font-size: 0.9rem;
  color: #000;
  margin-top: 8px;
  line-height: 1.5;
}

.page-header--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.company-limit-badge {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Alerts ─────────────────────────────────────────────── */

.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-top: 16px;
}

.alert--error {
  background: rgba(244,63,94,0.07);
  border: 1px solid rgba(244,63,94,0.25);
  color: #be1234;
}

.alert--success {
  background: rgba(34,197,94,0.07);
  border: 1px solid rgba(34,197,94,0.2);
  color: #166534;
}

/* ── Setup Page ─────────────────────────────────────────── */

.page-setup {
  max-width: 1000px;
  margin: auto;
  padding-bottom: 80px;
}

/* ── Tabs ───────────────────────────────────────────────── */
/* Styled to match .cs-tabs on the Content Opportunities page. */

.tab-bar {
  display: flex;
  gap: 4px;
  margin: 24px 0;
  flex-wrap: wrap;
  border-bottom: 1.5px solid var(--border);
}

.tab-bar-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
  border-bottom: 1.5px solid var(--border);
}

.tab-bar-row .tab-bar {
  margin: 0;
  border-bottom: none;
}

.tab-bar-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.filter-select {
  padding: 6px 36px 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: var(--font);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--text);
  outline: none;
  cursor: pointer;
  margin-bottom: 8px;
}

.filter-select:focus { border-color: var(--brand); }

.prompts-toolbar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 768px) {
  .prompts-toolbar-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.prompts-toolbar-row .active-slots-banner {
  margin-bottom: 0;
  margin-left: auto;
}

.prompts-toolbar-row .filter-select {
  width: 160px;
  margin-bottom: 0;
}
@media (max-width: 768px) {
  .prompts-toolbar-row .filter-select {
    width: 100%;
  }
}

.modal > form, .modal > #topic-prompts-modal.modal-body {
  padding-top: 0px !important;
}
.topic-prompts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.topic-prompt-option {
  display: flex;
  gap: 8px;
}
.topic-prompt-copy {
  display: grid;
  grid-template-columns: 3fr 1fr;
  width: 100%;
}
.topic-prompt-category {
  text-align: right;
}

.view-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-toggle-btn {
  padding: 4px 14px;
  font-weight: 600;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-dim);
  border: none;
  cursor: pointer;
}

.view-toggle-btn + .view-toggle-btn {
  border-left: 1.5px solid var(--border);
}

.view-toggle-btn.active {
  background: var(--brand);
  color: #fff;
}

.prompt-row--active td {
  background: rgba(6,182,212,0.05);
}

.prompts-table-select-col {
  width: 40px;
  min-width: 40px;
}

#prompts-table th:nth-child(1),
#prompts-table td:nth-child(1) {
  min-width: 280px;
  white-space: normal;
  line-height: 1.45;
}

/* #prompts-table th:nth-child(1),
#prompts-table td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg-card);
  width: 55px;
} */
#prompts-table th:nth-child(1),
#prompts-table td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg-card);
}
@media (max-width: 900px) {
  #prompts-table th:nth-child(1),
  #prompts-table td:nth-child(1) {
    left: 0;
  }
}
#prompts-table td:nth-child(1) {
  font-weight: 500;
}
#prompts-table thead th:nth-child(1) {
  background: #333;
  z-index: 3;
  border-right: 1px solid var(--border);
  color: #fff;
}
#prompts-table tr:hover td:nth-child(1) {
  background: color-mix(in srgb, var(--bg-card) 96%, var(--brand) 4%);
}
@media (max-width: 900px) {
  #prompts-table th:nth-child(1),
  #prompts-table td:nth-child(1) {
    position: relative;
  }
}

.prompts-table-meta-col div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.prompts-table-actions-col {
  white-space: nowrap;
}

.prompts-table-actions-col .btn + .btn {
  margin-left: 4px;
}

#bulk-select-all-btn {
  padding: 4px 12px 4px 8px;
}

#bulk-clone-count {
  width: 120px;
}

.bulk-clone-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-dim);
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.bulk-clone-bar .filter-select {
  margin-bottom: 0;
  margin-left: auto;
}

.prompt-card-select-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: -6px;
}

.prompt-select-checkbox {
  cursor: pointer;
}

.tab {
  background: transparent;
  border: none;
  border-bottom: 4px solid transparent;
  border-radius: 0;
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 16px;
  margin-bottom: -1.5px;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
  border-bottom-color: var(--text);
  color: var(--text);
}

.tab.active {
  background: transparent;
  border-bottom-color: var(--brand);
  color: var(--brand);
}

/* ── Login ───────────────────────────────────────────── */
.login-screen .page-header {
  margin-top: 100px;
  margin-bottom: 24px;
  text-align: center;
}
.login-screen img {
  width: 150px;
  height: auto;
}

/* ── Status Bar ─────────────────────────────────────────── */

.status-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  padding: 12px 16px;
}

.status-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── Prompts Grid ───────────────────────────────────────── */

.prompts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.prompt-card {
  background: #FFF5DB;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s;
  box-shadow: var(--card-shadow);
}

.prompt-card:hover {
  border-color: var(--border-med);
  transform: scale(1.02);
}

.prompt-card-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
  flex: 1;
}

.prompt-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

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

.prompt-location-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(0,0,0,0.05);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
/* .prompt-location-badge--default {
  opacity: 0.6;
} */

.prompt-language-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(0,0,0,0.05);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
/* .prompt-language-badge--default {
  opacity: 0.6;
} */

.prompt-card .prompt-location-badge, 
.prompt-card .prompt-language-badge,
.prompt-card .prompt-gsc-badge {
  display: none;
}

.prompt-gsc-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(6,182,212,0.1);
  color: #0891b2;
  border: 1px solid rgba(6,182,212,0.35);
}

.prompt-category {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(6,182,212,0.1);
  color: var(--brand-dark);
  border: 1px solid rgba(6,182,212,0.3);
}

.prompt-category[data-cat="discovery"]         { background: rgba(6,182,212,0.1);   color: #0e7490; border-color: rgba(6,182,212,0.3); }
.prompt-category[data-cat="problem_aware"]     { background: rgba(245,158,11,0.1);  color: #92400e; border-color: rgba(245,158,11,0.3); }
.prompt-category[data-cat="comparison"]        { background: rgba(99,102,241,0.1);  color: #3730a3; border-color: rgba(99,102,241,0.3); }
.prompt-category[data-cat="buyer_intent"]      { background: rgba(34,197,94,0.1);   color: #14532d; border-color: rgba(34,197,94,0.3); }
.prompt-category[data-cat="industry"]          { background: rgba(244,63,94,0.08);  color: #9f1239; border-color: rgba(244,63,94,0.25); }
.prompt-category[data-cat="ai_recommendation"] { background: rgba(139,92,246,0.1); color: #4c1d95; border-color: rgba(139,92,246,0.3); }

.prompt-card-actions {
  display: flex;
  gap: 4px;
}

/* Active tracking state */
.prompt-card--active {
  background: var(--bg-card);
  border: 3px solid var(--brand);
}

.prompt-toggle-btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0;
  /* border-radius: var(--radius-pill); */
  background: transparent;
  color: var(--text-dim);
  /* border: 1px solid var(--border); */
  cursor: pointer;
  /* transition: background 0.15s, color 0.15s, border-color 0.15s; */
  border: 0;
}
.prompt-toggle-btn span.material-symbols-outlined {
    font-size: 1.2rem;
}
/* .prompt-toggle-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
} */
.prompt-toggle-btn--active {
  /* background: rgba(6,182,212,0.1);
  border-color: rgba(6,182,212,0.4); */
  background: transparent;
  border: 0;
  color: var(--brand-dark);
}
/* .prompt-toggle-btn--active:hover {
  background: rgba(6,182,212,0.18);
} */
/* Enabled but no check has run yet — distinct from a fully "Tracking" prompt */
.prompt-toggle-btn--pending {
  background: transparent;
  border: 0;
  color: var(--text-dim);
}

/* Over the account's pool limit — can't be tracked until the owner adds more prompts */
.prompt-toggle-btn--locked {
  background: transparent;
  border: 0;
  color: var(--yellow);
}

.track-prompts-action {
  position: relative;
}

.pending-check-hint {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  padding-top: 3px;
  text-align: center;
  white-space: nowrap;
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Active slots banner */
.active-slots-banner {
  font-size: 0.82rem;
  color: var(--text-dim);
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.active-slots-banner a {
  color: var(--brand);
  font-weight: 600;
  white-space: nowrap;
}
.active-slots-banner--full {
  border-color: rgba(245,158,11,0.4);
  background: rgba(245,158,11,0.06);
  color: #92400e;
}
.active-slots-banner--full a {
  color: #b45309;
}

.topic-prompts-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ccc;
  margin-bottom: 10px;
  padding-bottom: 10px;
}

/* ── Tracking-in-progress banner ────────────────────────── */
.prompts-tracking {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-left: 4px solid #258473;
  background: #f3faf8;
}
.prompts-tracking-content {
  display: grid;
  gap: 6px;
  flex: 1 1 240px;
}
.prompts-tracking-content progress {
  width: 100%;
  max-width: 400px;
  height: 8px;
  accent-color: #258473;
}
.tracking-banner {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(90deg, #1e3a8a 0%, #1d4ed8 100%);
  color: #fff;
  padding: 12px 20px;
  border-bottom: 2px solid rgba(255,255,255,0.15);
  margin-bottom: 30px;
  border-radius: 12px;
}
.tracking-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 0.9rem;
  font-weight: 500;
}
.tracking-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.tracking-banner-note {
  opacity: 0.75;
  font-size: 0.8rem;
  font-weight: 400;
}
.tracking-banner--done {
  transition: opacity 1.5s ease;
  opacity: 0;
}

/* ── KPI Row ────────────────────────────────────────────── */

.kpi-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.kpi-row-note {
  font-size: 0.8125rem;
  color: var(--text-dim);
  margin: 0 0 12px;
}
.kpi-range-toggle {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.kpi-range-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  line-height: 1.4;
}
.kpi-range-btn:hover {
  border-color: var(--brand);
  color: var(--text);
}
.kpi-range-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0;
}

.kpi-row + .kpi-group-header {
  margin-top: 28px;
}

.kpi-group-header {
  margin-bottom: 12px;
}

.kpi-group-header--with-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Performance Metrics + Action Items side-by-side ────── */

.kpi-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.kpi-column {
  min-width: 0;
}

/* Metrics grid — 2 columns by default, 3 when its column has room.
   container queries key this off the column's own rendered width, which
   shifts with page width and the sidebar/actions-column layout. */
.kpi-column--metrics {
  container-type: inline-size;
  container-name: kpi-metrics;
}

.kpi-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 0;
}

@container kpi-metrics (min-width: 480px) {
  .kpi-metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .kpi-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .kpi-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kpi-group-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 2px;
}

.kpi-group-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  /* box-shadow: var(--card-shadow); */
}

.kpi-card--action {
  border-left: none;
}

.kpi-card--score {
  background: linear-gradient(135deg, rgba(6,182,212,0.1) 0%, var(--bg-card) 100%);
  border-color: rgba(6,182,212,0.3);
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}

.kpi-card--score .kpi-value {
  color: var(--brand);
}

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

.kpi-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}
.kpi-link:hover { text-decoration: underline; }

/* ── Action Items — flat button-style rows, deliberately   ──
   ── plainer than the Performance Metrics stat cards above ── */

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

.kpi-card.kpi-action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.kpi-action-card:hover {
  border-color: var(--brand);
  background: var(--bg-card-alt);
}

.kpi-action-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.kpi-action-card__body .kpi-label {
  margin-bottom: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}

.kpi-action-card__value {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text-dim);
  line-height: 1.15;
}

.kpi-action-card__meta {
  display: none;
}

.kpi-action-card__chevron {
  flex-shrink: 0;
  font-size: 1.1rem;
  color: var(--text-dim);
  opacity: 0.55;
  transition: opacity 0.15s;
}

.kpi-action-card:hover .kpi-action-card__chevron {
  opacity: 1;
}

.kpi-action-card.kpi-card--locked .kpi-action-card__value {
  font-size: 0.9rem;
}


/* Prompt table sparkline */
.sparkline {
  display: block;
  margin: 0 auto;
  overflow: visible;
}

/* Site Health card states */
.kpi-card--health-pass {
  background: linear-gradient(135deg, rgba(34,197,94,0.08) 0%, var(--bg-card) 100%);
  border-color: rgba(34,197,94,0.3);
}
.kpi-card--health-pass .kpi-value--site-health { color: #22c55e; }

.kpi-card--health-warn {
  background: linear-gradient(135deg, rgba(234,179,8,0.08) 0%, var(--bg-card) 100%);
  border-color: rgba(234,179,8,0.3);
}
.kpi-card--health-warn .kpi-value--site-health { color: #ca8a04; }

.kpi-card--health-fail {
  background: linear-gradient(135deg, rgba(239,68,68,0.08) 0%, var(--bg-card) 100%);
  border-color: rgba(239,68,68,0.25);
}
.kpi-card--health-fail .kpi-value--site-health { color: #ef4444; }

/* ── Section Blocks ─────────────────────────────────────── */

.section-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
#provider-section.section-block {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
#section-overview .section-block {
  margin: 0;
}

.section-block-header {
  padding: 18px 24px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-block-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.section-block-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.45;
}

.section-block-header .btn {
  flex-shrink: 0;
}

/* ── Suggested Focus (Dashboard insights) ──────────────── */

.insights-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 24px 20px;
  height: 220px;
  overflow-y: auto;
}

.insight-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.insight-row__body { flex: 1; min-width: 0; }

.insight-row__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.insight-row__detail {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.insight-row__action {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
}
.insight-row__action:hover { text-decoration: underline; }

/* ── Info Tooltips ──────────────────────────────────────── */

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-dim);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  cursor: default;
  position: relative;
  vertical-align: middle;
  margin-left: 4px;
  flex-shrink: 0;
  text-transform: none;
  letter-spacing: 0;
}

.info-icon::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.45;
  /* pre-line keeps &#10; / newlines from data-tip as line breaks;
     tips without newlines still wrap normally. */
  white-space: pre-line;
  width: 220px;
  padding: 8px 10px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2147483647;
  text-transform: none;
  letter-spacing: 0;
}

.info-icon:hover::after {
  opacity: 1;
}

/* Edge-aware alignment — toggled by JS (components.js) based on the icon's
   position relative to the viewport, so tooltips near a screen edge don't
   get clipped or overflow off-screen. */
.info-icon--edge-left::after {
  left: 0;
  right: auto;
  transform: none;
}

.info-icon--edge-right::after {
  left: auto;
  right: 0;
  transform: none;
}

/* Keep tooltip inside viewport for right-aligned (centered) headers */
th.center .info-icon::after {
  left: auto;
  right: 0;
  transform: none;
  top: calc(100% + 6px);
}

/* A first-column header's icon sits at the table's left edge — a centered
   tooltip would overflow past it and get clipped by .table-wrap's
   overflow-x, so always open these rightward instead. Applies to every
   .data-table (Citations, Prompts, Fan-Out, Competitors, etc). */
.data-table th:first-child .info-icon::after {
  left: 0;
  right: auto;
  transform: none;
}

/* Reusable "?" icon-button placed next to a page title, opens the shared
   AtlasHelp modal (see components.js) — same look/position on every page. */
.help-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #333;
  background: var(--bg-card);
  color: #333;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  margin-left: 8px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.help-icon-btn:hover { border-color: var(--brand); color: var(--brand); }

/* thead stacking context so the tooltip renders above tbody rows */
.data-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* A hovered tooltip's containing sticky cell must temporarily out-rank
   every other sticky cell's stacking context (e.g. the frozen header row),
   otherwise the tooltip's own z-index is trapped inside its ancestor's
   lower stacking context and gets clipped regardless of how high it is. */
#prompt-table td:nth-child(1):has(.info-icon:hover),
#prompt-table th:nth-child(1):has(.info-icon:hover),
#fanout-table td:nth-child(1):has(.info-icon:hover),
#fanout-table th:nth-child(1):has(.info-icon:hover),
#fanout-table td:nth-child(2):has(.info-icon:hover),
#fanout-table th:nth-child(2):has(.info-icon:hover) {
  z-index: 2147483647;
}

/* ── Charts ─────────────────────────────────────────────── */

.chart-wrap {
  padding: 24px;
  position: relative;
  min-height: 160px;
}

#trend-chart {
  width: 100%;
  max-height: 220px;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.875rem;
}

.section-row {
  display: flex;
  gap: 24px;
  align-items: stretch;
}
#section-platforms .section-row {
  gap: 10px;
}

.section-row > .section-block {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.section-row > .section-block .chart-wrap {
  flex: 1;
}

@media (max-width: 768px) {
  .section-row {
    flex-direction: column;
  }
}

.chart-legend {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  padding: 0 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Tables ─────────────────────────────────────────────── */

.table-wrap {
  overflow: auto;
  height: 450px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* On #dashboard-content pages, JS (components.js fitTableWraps) overrides
   this with an inline height computed from the actual remaining space. */

/* ── Action Popover (AtlasPopover in components.js) ────────── */

.atlas-popover {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000000;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  padding: 14px 16px;
  min-width: 260px;
  max-width: 340px;
  font-size: 0.85rem;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;

  padding: 30px 26px 24px;
  min-width: 300px;
  max-width: 360px;
  border-left: none;
}

.atlas-popover .ap-close-btn {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}
.atlas-popover .ap-close-btn:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text);
}

.atlas-popover .ap-body {
  /* display: flex;
  gap: 10px; */
  align-items: center;
  text-align: center;
}
.atlas-popover .ap-body .btn {
  margin-top: 10px;
}
.atlas-popover .ap-status-icon {
  display: none;
  flex-shrink: 0;
  /* width: 25px;
  height: 25px;
  margin-top: 1px; */

  width: 50px;
  height: 50px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin: 0 0 4px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.18) 0%, rgba(34, 197, 94, 0.06) 65%, transparent 100%);
}
.atlas-popover .ap-status-icon svg { width: 75%; height: 75%; }
.atlas-popover--info .ap-status-icon,
.atlas-popover--progress .ap-status-icon,
.atlas-popover--success .ap-status-icon,
.atlas-popover--error .ap-status-icon {
  display: block;
}

.atlas-popover .ap-status-content {
  flex: 1;
  min-width: 0;
}
.ap-status-content p {
  font-size: 18px;
  line-height: 24px;
  text-align: center;
}

/* Toast-like status coloring — left accent bar + tinted background,
   layered on top of the base border above. */
.atlas-popover--info,
.atlas-popover--progress {
  border-left: 3px solid var(--brand-dark, #0891b2);
  /* background: rgb(6,182,212); */
}
.atlas-popover--info .ap-status-icon { color: var(--brand-dark, #0891b2); }
.atlas-popover--success {
  /* border-left: 3px solid #16a34a; */
  /* background: rgb(34,197,94); */
}
.atlas-popover--success .ap-status-icon { 
  color: #16a34a;
  border-radius: 50%;
  border: 1px solid #16a34a;
  background: #fff;
  padding: 3px;
  display: flex;
  align-items: center;
}
.atlas-popover--error {
  /* border-left: 3px solid var(--red); */
  /* background: rgb(239,68,68); */
}
.atlas-popover--error .ap-status-icon { 
  color: var(--red);
  border-radius: 50%;
  border: 1px solid var(--red);
  background: #fff;
  padding: 3px;
  display: flex;
  align-items: center;
}

/* .atlas-popover a {
  color: #fff;
} */

/* .atlas-popover .ap-error {
  color: var(--red);
} */

.atlas-popover .ap-cached-note {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.atlas-popover .ap-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 10px 0 4px;
}

.atlas-popover .ap-label:first-child {
  margin-top: 0;
}

.atlas-popover .ap-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg-page, #fff);
}

.atlas-popover .ap-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

/* Hero-style popover (e.g. Prompt Discovery completion) — big centered icon
 * badge + title + a full-width two-button row, instead of the toast-style
 * left accent bar. Pair with options.hero (and usually options.backdrop). */
.atlas-popover--hero {
  padding: 30px 26px 24px;
  min-width: 300px;
  max-width: 360px;
  border-left: none;
}
.atlas-popover--hero .ap-status-icon {
  width: 72px;
  height: 72px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin: 0 0 4px;
  background: radial-gradient(circle, rgba(34,197,94,0.18) 0%, rgba(34,197,94,0.06) 65%, transparent 100%);
}
.atlas-popover--hero.atlas-popover--info .ap-status-icon {
  background: radial-gradient(circle, rgba(6,182,212,0.18) 0%, rgba(6,182,212,0.06) 65%, transparent 100%);
}
.atlas-popover--hero .ap-status-icon svg {
  width: 36px;
  height: 36px;
  padding: 8px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}
.atlas-popover--hero.atlas-popover--info .ap-status-icon svg {
  background: var(--brand);
}
.atlas-popover--hero .ap-hero-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
  text-align: center;
}
.atlas-popover--hero .ap-status-content p {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}
.atlas-popover--hero .ap-actions {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 25px;
  margin-top: 25px;
}
.atlas-popover--hero .ap-actions .btn {
  flex: 1;
  justify-content: center;
}

/* Used by popovers whose anchor position can push them off-screen (e.g. Edit
 * Competitor on rows near the bottom/edge of a scrolled table) — overrides
 * the inline top/left AtlasPopover() sets so it's centered in the viewport
 * instead. */
.atlas-popover--centered {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%);
}

/* Dark blurred backdrop shown behind .atlas-popover--centered, matching the
 * app's .modal-overlay look. Sits just below .atlas-popover's z-index. */
.atlas-popover-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999998;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.action-buttons {
  display: flex;
  gap: 10px;
}

/* Prompt table — min widths + side scroll */
#prompt-table {
  table-layout: auto;
  min-width: 1100px;
}
#prompt-table-head {
  position: sticky;
  top: -30px;
  z-index: 999;
}
#mc-table th:nth-child(1),
#mc-table td:nth-child(1),
#cd-table th:nth-child(1),
#cd-table td:nth-child(1),
#data-table-discovered th:nth-child(1),
#data-table-discovered td:nth-child(1),
#data-table-nearmiss th:nth-child(1),
#data-table-nearmiss td:nth-child(1),
#data-table-notfound th:nth-child(1),
#data-table-notfound td:nth-child(1),
#prompt-table th:nth-child(1),
#prompt-table td:nth-child(1),
#cs-results-table th:nth-child(1),
#cs-results-table td:nth-child(1),
#cs-clusters-table th:nth-child(1),
#cs-clusters-table td:nth-child(1),
#cs-comparisons-table th:nth-child(1),
#cs-comparisons-table td:nth-child(1),
#cs-listicles-table th:nth-child(1),
#cs-listicles-table td:nth-child(1),
#cs-hubs-table th:nth-child(1),
#cs-hubs-table td:nth-child(1),
#cs-custom-table th:nth-child(1),
#cs-custom-table td:nth-child(1),
#competitor-table th:nth-child(1),
#competitor-table td:nth-child(1),
#mentions-table th:nth-child(1),
#mentions-table td:nth-child(1),
#recommendations-table th:nth-child(1),
#recommendations-table td:nth-child(1),
#citations-table th:nth-child(1),
#citations-table td:nth-child(1) {
  min-width: 300px;
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg-card);
}
#mc-table td:nth-child(1),
#cd-table td:nth-child(1),
#data-table-discovered td:nth-child(1),
#data-table-nearmiss td:nth-child(1),
#data-table-notfound td:nth-child(1),
#prompt-table td:nth-child(1),
#cs-results-table td:nth-child(1),
#cs-clusters-table td:nth-child(1),
#cs-comparisons-table td:nth-child(1),
#cs-listicles-table td:nth-child(1),
#cs-hubs-table td:nth-child(1),
#cs-custom-table td:nth-child(1),
#competitor-table td:nth-child(1),
#mentions-table td:nth-child(1),
#recommendations-table td:nth-child(1),
#citations-table td:nth-child(1) {
  font-weight: 500;
}
@media (max-width: 900px) {
  #mc-table th:nth-child(1),
  #mc-table td:nth-child(1),
  #cd-table th:nth-child(1),
  #cd-table td:nth-child(1),
  #data-table-discovered th:nth-child(1),
  #data-table-discovered td:nth-child(1),
  #data-table-nearmiss th:nth-child(1),
  #data-table-nearmiss td:nth-child(1),
  #data-table-notfound th:nth-child(1),
  #data-table-notfound td:nth-child(1),
  #prompt-table th:nth-child(1),
  #prompt-table td:nth-child(1),
  #cs-results-table th:nth-child(1),
  #cs-results-table td:nth-child(1),
  #cs-clusters-table th:nth-child(1),
  #cs-clusters-table td:nth-child(1),
  #cs-comparisons-table th:nth-child(1),
  #cs-comparisons-table td:nth-child(1),
  #cs-listicles-table th:nth-child(1),
  #cs-listicles-table td:nth-child(1),
  #cs-hubs-table th:nth-child(1),
  #cs-hubs-table td:nth-child(1),
  #cs-custom-table th:nth-child(1),
  #cs-custom-table td:nth-child(1),
  #competitor-table th:nth-child(1),
  #competitor-table td:nth-child(1),
  #mentions-table th:nth-child(1),
  #mentions-table td:nth-child(1),
  #recommendations-table th:nth-child(1),
  #recommendations-table td:nth-child(1),
  #citations-table th:nth-child(1),
  #citations-table td:nth-child(1) {
    min-width: 150px;
    position: relative;
  }
  .form-row.form-row--2 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}
#mc-table th:nth-child(1),
#cd-table th:nth-child(1),
#data-table-discovered th:nth-child(1),
#data-table-nearmiss th:nth-child(1),
#data-table-notfound th:nth-child(1),
#prompt-table thead th:nth-child(1),
#cs-results-table thead th:nth-child(1),
#cs-clusters-table thead th:nth-child(1),
#cs-comparisons-table thead th:nth-child(1),
#cs-listicles-table thead th:nth-child(1),
#cs-hubs-table thead th:nth-child(1),
#cs-custom-table thead th:nth-child(1),
#competitor-table thead th:nth-child(1),
#mentions-table thead th:nth-child(1),
#recommendations-table thead th:nth-child(1),
#citations-table thead th:nth-child(1) {
  background: #333;
  z-index: 3;
  border-right: 1px solid var(--border);
  color: #fff;
}
#prompt-table tr:hover td:nth-child(1),
#cs-results-table tr:hover td:nth-child(1),
#cs-clusters-table tr:hover td:nth-child(1),
#cs-comparisons-table tr:hover td:nth-child(1),
#cs-listicles-table tr:hover td:nth-child(1),
#cs-hubs-table tr:hover td:nth-child(1),
#cs-custom-table tr:hover td:nth-child(1),
#competitor-table tr:hover td:nth-child(1),
#mentions-table tr:hover td:nth-child(1),
#recommendations-table tr:hover td:nth-child(1),
#citations-table tr:hover td:nth-child(1) {
  background: color-mix(in srgb, var(--bg-card) 96%, var(--brand) 4%);
}
#prompt-table th:nth-child(2),
#prompt-table td:nth-child(2) { min-width: 360px; }
#prompt-table th:nth-child(3),
#prompt-table td:nth-child(3) { min-width: 60px; }
#prompt-table th:nth-child(4),
#prompt-table td:nth-child(4),
#prompt-table th:nth-child(4),
#prompt-table td:nth-child(4),
#prompt-table th:nth-child(5),
#prompt-table td:nth-child(5),
#prompt-table th:nth-child(6),
#prompt-table td:nth-child(6) { min-width: 100px; }
#prompt-table th:nth-child(7),
#prompt-table td:nth-child(7) { min-width: 160px; }
#prompt-table th:nth-child(8),
#prompt-table td:nth-child(8) { min-width: 160px; }
#prompt-table th:nth-child(9),
#prompt-table td:nth-child(9) { min-width: 120px; }

#prompt-table td:nth-child(1) {
  color: var(--text);
  word-break: break-word;
  white-space: normal;
  line-height: 1.5;
}

/* Fan-out table — freeze first two columns (Prompt, Sub-Query) */
#fanout-table {
  table-layout: auto;
  min-width: 900px;
}
#fanout-table th:nth-child(1),
#fanout-table td:nth-child(1) {
  font-weight: 500;
  min-width: 260px;
  max-width: 260px;
  position: sticky;
  left: 0;
  z-index: 1;
}
#fanout-table th:nth-child(1) {
  font-weight: 700;
}
#fanout-table td:nth-child(1) {
  background: var(--bg-card);
}
#fanout-table th:nth-child(2),
#fanout-table td:nth-child(2) {
  min-width: 280px;
  max-width: 280px;
  /* position: sticky;
  left: 260px;
  z-index: 2;
  background: var(--bg-card);
  border-right: 1px solid var(--border); */
}
/* #fanout-table thead th:nth-child(1),
#fanout-table thead th:nth-child(2) {
  background: var(--bg-card-alt);
  z-index: 3;
} */
#fanout-table tr:hover td:nth-child(1),
#fanout-table tr:hover td:nth-child(2) {
  background: color-mix(in srgb, var(--bg-card) 96%, var(--brand) 4%);
}
#fanout-table td:nth-child(1),
#fanout-table td:nth-child(2) {
  font-size: 0.88rem;
  color: var(--text);
  word-break: break-word;
  white-space: normal;
  line-height: 1.5;
}

.data-table th {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 20px;
  text-align: left;
  background: #333;
  color: #fff;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table th.center,
.data-table td.center {
  text-align: center;
}

.data-table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: middle;
  border-right: 1px solid var(--border);
}

.data-table th:nth-child(10), 
.data-table td:nth-child(10) {
    display: none;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(6,182,212,0.04);
  color: var(--text);
}

/* Sortable column headers */
.data-table th[data-sortable] {
  cursor: pointer;
  user-select: none;
}
.data-table th[data-sortable]:hover, 
.data-table th.mc-sortable:hover {
  color: rgba(255,255,255, 0.8);
}
.data-table th[data-sortable]::after {
  content: ' ⇅';
  opacity: 0.3;
  font-size: 0.7em;
}
.data-table th[data-sort='asc']::after {
  content: ' ↑';
  opacity: 1;
  color: var(--brand);
}
.data-table th[data-sort='desc']::after {
  content: ' ↓';
  opacity: 1;
  color: var(--brand);
}

.table-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.875rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
}

.pill--yes { background: rgba(34,197,94,0.12); color: #16a34a; }
.pill--no  { background: rgba(0,0,0,0.05); color: var(--text-dim); }

.url-cell {
  font-family: var(--mono);
  font-size: 0.78rem;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-cell a {
  color: var(--brand);
  text-decoration: none;
}

.url-cell a:hover {
  text-decoration: underline;
}

.actions-cell {
  white-space: nowrap;
}

/* ── Spinners ───────────────────────────────────────────── */

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-med);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner--lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

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

/* ── Attention pulse (e.g. "Track Prompts" once the first suggestions land) ── */
@keyframes attn-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(8, 145, 178, 0.55); }
  50%      { box-shadow: 0 0 0 10px rgba(8, 145, 178, 0); }
}
@keyframes attn-wiggle {
  0%, 100% { transform: rotate(0deg); }
  20%      { transform: rotate(-4deg); }
  40%      { transform: rotate(4deg); }
  60%      { transform: rotate(-3deg); }
  80%      { transform: rotate(3deg); }
}
.attn-pulse {
  animation: attn-glow 1.4s ease-out 3;
  /* , attn-wiggle 1.4s ease-in-out 3 */
}

/* ── Weld-rotate loader ─────────────────────────────────── */

.loader {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.loader::before,
.loader::after {
  content: "";
  display: block;
  border: 20px solid transparent;
  border-top-color: #06b6d4;
  position: absolute;
  left: 0;
  top: 0;
  animation: weld-rotate 2s infinite ease-in;
}
.loader::before {
  border-color: transparent transparent transparent #231f20;
  animation-delay: 0.5s;
}
@keyframes weld-rotate {
  0%,  25% { transform: rotate(0deg); }
  50%, 75% { transform: rotate(180deg); }
  100%     { transform: rotate(360deg); }
}

/* ── Loading Screen ─────────────────────────────────────── */

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Empty States ───────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.empty-state p {
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.empty-state-gsc {
  max-width: 420px;
  margin: 0 auto 24px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.empty-state-gsc p {
  margin-bottom: 12px;
  font-size: 0.85rem;
}

#prompt-edit-modal .form-actions, 
.prompt-label-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

#prompt-edit-modal .prompt-modal-actions-start {
  display: flex;
  align-items: center;
  gap: 16px;
}

#prompt-edit-modal .prompt-modal-create-another {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
}

#prompt-edit-modal .prompt-modal-create-another input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
}

/* ── "Suggest Prompts" quick-action card (empty state) ──── */

.suggest-prompts-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: 32px 20px;
  border: 1.5px dashed var(--border-med);
  border-radius: var(--radius);
  background: none;
  font-family: var(--font);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
}

.suggest-prompts-card:hover {
  border-color: var(--brand);
  background: var(--bg-card-alt);
  transform: translateY(-2px);
}

.suggest-prompts-card:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.suggest-prompts-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border-med);
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  transition: border-color 0.2s, color 0.2s;
}
#suggest-more-header-btn svg, 
#suggest-general-prompts-btn svg,
span.suggest-prompts-card-icon svg {
    width: 20px;
    fill: var(--yellow);
}
.suggest-prompts-card:hover .suggest-prompts-card-icon {
  border-color: var(--brand);
  color: var(--brand);
}

.suggest-prompts-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.suggest-prompts-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Modal ──────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 24px;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-med);
  border-radius: var(--radius);
  width: 100%;
  max-width: 800px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  padding: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal--sm {
  max-width: 420px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0;
}

.modal > form,
.modal > .modal-body {
  overflow-y: auto;
  padding: 24px 28px 28px;
  flex: 1 1 auto;
}
.modal > #atlas-help-modal-body {
  padding-top: 0;
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

#atlas-help-modal-body p {
  padding-bottom: 20px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
}

.modal-close:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text);
}

/* ── Provider Picker ────────────────────────────────────── */

.provider-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.provider-option {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.provider-option:has(input:checked) {
  border-color: var(--brand);
  background: rgba(6,182,212,0.07);
  color: var(--text);
}

.provider-option--disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

.provider-option--plan-locked {
  pointer-events: auto;
}

/* Plan-gated KPI card */
.kpi-card--locked {
  opacity: 0.65;
}
.kpi-card--locked .kpi-value {
  font-size: 1.4rem;
}
.kpi-lock {
  font-size: 1.25rem;
}

.provider-option input[type="checkbox"] {
  accent-color: var(--brand);
  width: 14px;
  height: 14px;
}

/* ── Business Profile Card ──────────────────────────────── */

.business-profile-row {
    display: flex;
    gap: 15px;
    flex-direction: row;
}

.business-card {
  display: none;
  position: relative;
  flex-basis: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 32px 0 0;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

#insights-section {
  flex-basis: 50%;
  position: relative;
  /* border-color: var(--brand-light); */
  box-shadow: 0 0 0 1px rgba(6,182,212,0.15), 0 4px 12px rgba(6,182,212,0.08);
}

/* #insights-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-dark));
} */

#insights-section .section-block-header {
  background: linear-gradient(135deg, rgba(6,182,212,0.07), rgba(8,129,150,0.02));
}
#insights-section h2 {
  display: flex;
  align-items: center;
  gap: 5px;
}
#insights-section h2 svg {
  width: 20px;
  fill: orange;
}

#visibility-trend {
  flex-basis: 50%;
}

.biz-card-banner {
  width: 100%;
  height: 40px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border);
}

.biz-card-banner--brand {
  /* position: absolute;
  bottom: 0; */
  overflow: hidden;
}

@media (max-width: 768px) {
    .business-profile-row {
        flex-direction: column;
    }
    .biz-card-banner--brand {
        position: relative;
    }
}

.biz-card-banner--brand::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 20%, rgba(0,0,0,0.03) 100%);
  pointer-events: none;
}

.biz-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px 28px;
  height: 88%;
}

.biz-card-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--border);
  padding: 4px;
}

.biz-card-logo--favicon {
  width: 32px;
  height: 32px;
  padding: 2px;
  margin-top: 4px;
}

.biz-card-img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.biz-card-favicon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  margin-top: 4px;
}

.biz-card-body {
  flex: 1;
  min-width: 0;
}

.biz-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.biz-card-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 2px;
}

.biz-card-url {
  font-size: 0.82rem;
  color: var(--brand);
  text-decoration: none;
  font-family: var(--mono);
}

.biz-card-url:hover {
  text-decoration: underline;
}

.biz-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.biz-card-tags-wrap {
  position: relative;
}

.biz-card-tags-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 28px;
  background: linear-gradient(to right, transparent, var(--bg) 75%);
  pointer-events: none;
}

.biz-card-tags {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  scrollbar-width: thin;
}

.biz-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(6,182,212,0.08);
  color: var(--brand-dark);
  border: 1px solid rgba(6,182,212,0.2);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Tag pill input ─────────────────────────────────────── */

.tags-pill-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 42px;
  padding: 6px 10px;
  background: #fff;
  border: 1.5px solid var(--border-med);
  border-radius: var(--radius-sm);
  cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.tags-pill-input:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(6,182,212,0.12);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 6px 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(6,182,212,0.08);
  color: var(--brand-dark);
  border: 1px solid rgba(6,182,212,0.2);
  line-height: 1.4;
  white-space: nowrap;
}

.tag-pill-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border: none;
  border-radius: 50%;
  background: rgba(6,182,212,0.18);
  color: var(--brand-dark);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s;
}

.tag-pill-remove:hover {
  background: rgba(6,182,212,0.38);
}

.tags-text-input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text);
  padding: 2px 2px;
  flex: 1;
  min-width: 120px;
}

.tags-text-input::placeholder {
  color: var(--text-dim);
}

/* ── Provider Breakdown Grid ────────────────────────────── */

#provider-section {
  margin-bottom: 30px;
}

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

.provider-card {
  padding: 24px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

/* .provider-card:last-child {
  border-right: none;
} */

.provider-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.provider-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.provider-logo {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  /* SVGs use currentColor — set via CSS color property */
  color: inherit;
}

/* tint each logo to its brand color */
.provider-logo[alt^="OpenAI"]    { color: #10a37f; filter: invert(48%) sepia(79%) saturate(406%) hue-rotate(115deg) brightness(94%) contrast(87%); }
.provider-logo[alt^="Anthropic"] { color: #d97706; filter: invert(56%) sepia(72%) saturate(590%) hue-rotate(1deg) brightness(98%) contrast(94%); }

.provider-logo-fallback {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.provider-logo--sm,
.provider-logo-fallback--sm {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  font-size: 0.6rem;
}

/* Hover label for standalone provider logos (table rows). Opens upward so
   the last row isn't clipped by .table-wrap's overflow. */
.provider-logo-tip {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  cursor: default;
}

.provider-logo-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2147483647;
}

.provider-logo-tip:hover::after {
  opacity: 1;
}

/* Provider logos inside buttons */
.btn-provider-logo {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.9;
  filter: brightness(0) invert(1);
}

.provider-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.provider-model {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--mono);
}

.provider-score {
  margin-left: auto;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

/* auto-fill keeps 4 columns on wide cards and wraps to 3 or 2 on narrow
   ones, so long labels like RECOMMENDED never overflow the card. */
.provider-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 16px 12px;
}

.provider-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 4px 2px;
  min-width: 0;
}

.provider-stat-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.provider-stat-label {
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  text-align: center;
}

/* ── Provider Badges (prompt table) ─────────────────────── */

.provider-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.provider-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  text-decoration: none;
  transition: filter 0.15s, opacity 0.15s;
}

a.provider-badge:hover {
  filter: brightness(0.88);
  opacity: 0.9;
  text-decoration: none;
}

.provider-badge--openai {
  background: rgba(16,163,127,0.1);
  color: #0d7a60;
  border: 1px solid rgba(16,163,127,0.25);
}

.provider-badge--anthropic {
  background: rgba(217,119,6,0.1);
  color: #92400e;
  border: 1px solid rgba(217,119,6,0.25);
}

.provider-badge--perplexity {
  background: rgba(32,128,141,0.1);
  color: #145f6b;
  border: 1px solid rgba(32,128,141,0.25);
}

.provider-badge--gemini {
  background: rgba(66,133,244,0.1);
  color: #1a56b0;
  border: 1px solid rgba(66,133,244,0.25);
}

.provider-badge--grok {
  background: rgba(120,80,255,0.1);
  color: #5b2fcf;
  border: 1px solid rgba(120,80,255,0.25);
}

.provider-badge--copilot {
  background: rgba(0,120,212,0.1);
  color: #005a9e;
  border: 1px solid rgba(0,120,212,0.25);
}

/* ── Sentiment Pills ────────────────────────────────────── */

.sentiment-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.sentiment-pill--positive {
  background: rgba(34,197,94,0.12);
  color: #15803d;
  border: 1px solid rgba(34,197,94,0.25);
}

.sentiment-pill--neutral {
  background: rgba(100,116,139,0.1);
  color: #475569;
  border: 1px solid rgba(100,116,139,0.2);
}

.sentiment-pill--negative {
  background: rgba(244,63,94,0.1);
  color: #be123c;
  border: 1px solid rgba(244,63,94,0.2);
}

.sentiment-pill--expandable {
  cursor: pointer;
  user-select: none;
}
.sentiment-pill--expandable:hover {
  background: rgba(244,63,94,0.18);
}

/* ── Citation Source Pills ──────────────────────────────── */

.citation-source-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.citation-source-pill--response {
  background: rgba(34,197,94,0.12);
  color: #15803d;
  border: 1px solid rgba(34,197,94,0.25);
}

.citation-source-pill--fanout {
  background: rgba(59,130,246,0.1);
  color: #1d4ed8;
  border: 1px solid rgba(59,130,246,0.2);
}

/* ── Entity Pills (Mentions / Recommendations own-competitor-other) ────── */

.entity-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.entity-pill--own {
  background: rgba(34,197,94,0.12);
  color: #15803d;
  border: 1px solid rgba(34,197,94,0.25);
}

.entity-pill--competitor {
  background: rgba(249,115,22,0.1);
  color: #c2410c;
  border: 1px solid rgba(249,115,22,0.22);
}

.sentiment-warn {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(251,146,60,0.12);
  color: #c2410c;
  border: 1px solid rgba(251,146,60,0.3);
  white-space: nowrap;
}
.excerpt-caret {
  display: inline-block;
  font-weight: 700;
  margin-left: 2px;
  transition: transform 0.15s;
}

/* ── Prompt filter bar ──────────────────────────────────── */

.table-filter-bar {
  display: flex;
  gap: 6px;
  padding: 0 0 12px;
  flex-wrap: wrap;
}
.filter-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  line-height: 1.4;
}
.filter-btn:hover {
  border-color: var(--brand);
  color: var(--text);
}
.filter-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.filter-btn.active .sentiment-pill {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-color: transparent;
}
.filter-count {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0,0,0,0.12);
  border-radius: 20px;
  padding: 0 6px;
  margin-left: 3px;
  line-height: 1.6;
  min-width: 18px;
  text-align: center;
  vertical-align: middle;
}
.filter-btn.active .filter-count {
  background: rgba(255,255,255,0.25);
}

/* ── Excerpt row ────────────────────────────────────────── */

.excerpt-row td {
  background: rgba(244,63,94,0.04);
  border-top: none !important;
}
.excerpt-cell {
  padding: 12px 16px 16px !important;
}
.excerpt-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.excerpt-text {
  font-size: 0.83rem;
  line-height: 1.65;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
  border-left: 3px solid rgba(244,63,94,0.3);
  padding-left: 12px;
}

.kpi-value--sentiment {
  font-size: 0.78rem !important;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  padding-top: 4px;
}

/* ── Fan-Out Tracking ───────────────────────────────────── */

/* #prompt-table's .data-table th/td:nth-child(10) rule above unconditionally
   hides whatever lands in that position. The Sentiment and Last Tracked
   columns can land there depending on which optional columns (Sub-Queries/
   Sentiment) are present for the current plan — force them to stay visible
   whenever actually rendered; real visibility is controlled elsewhere (JS
   style toggle for the header, or whether the row template includes the
   cell at all). */
#prompt-table td.sentiment-col-cell,
#prompt-table td.last-tracked-cell {
  display: table-cell !important;
}

.fanout-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fanout-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
}

.fanout-add-btn--tracked {
  color: var(--text-dim);
  border-color: var(--border);
}

.fanout-chip-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.fanout-chip-add-btn:hover {
  background: var(--brand-dark);
}
.fanout-chip-add-btn--tracked {
  background: none;
  color: #22c55e;
  cursor: default;
}
.fanout-chip-add-btn:disabled {
  cursor: default;
}

.fanout-summary-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  padding: 4px 0 16px;
}
.fanout-summary-stat {
  font-size: 0.85rem;
  color: var(--text-dim);
}
.fanout-summary-stat strong {
  color: var(--text);
  font-size: 1.05rem;
  margin-right: 4px;
}

.upgrade-callout {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
}
.upgrade-callout .kpi-lock {
  font-size: 1.6rem;
}
.upgrade-callout strong {
  display: block;
  color: var(--text);
  margin-bottom: 2px;
}
.upgrade-callout p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.upgrade-callout .btn {
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Select2 theme overrides ────────────────────────────── */

/* Country option row in dropdown */
.country-option {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.3;
}

.country-flag {
  font-size: 1.2em;
  flex-shrink: 0;
  line-height: 1;
}

.country-abbr {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  flex-shrink: 0;
  width: 28px;
}

.country-name {
  font-size: 0.9rem;
  color: var(--text);
}

/* Selection (collapsed pill) shows flag + abbr only */
.country-selection {
  display: flex;
  align-items: center;
  gap: 6px;
}

.country-selection .country-flag {
  font-size: 1.1em;
}

.country-selection .country-abbr {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  width: auto;
  letter-spacing: 0.03em;
}

/* Highlight abbr in selected option inside dropdown */
.select2-results__option--highlighted .country-abbr,
.select2-results__option--highlighted .country-name {
  color: inherit;
}

.select2-container--default .select2-selection--single {
  height: 44px;
  border: 1.5px solid var(--border-med);
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--text);
  transition: border-color 0.2s;
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(6,182,212,0.15);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text);
  line-height: 1;
  padding-left: 0;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--text-dim);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 42px;
  right: 10px;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-right: 6px;
}

.select2-dropdown {
  border: 1.5px solid var(--border-med);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-family: var(--font);
  font-size: 0.9rem;
}

.select2-search--dropdown .select2-search__field {
  border: 1.5px solid var(--border-med);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--font);
  font-size: 0.875rem;
}

.select2-search--dropdown .select2-search__field:focus {
  border-color: var(--brand);
  outline: none;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--brand);
  color: #fff;
}

.select2-container--default .select2-results__option[aria-selected=true] {
  background: rgba(6,182,212,0.1);
  color: var(--brand-dark);
}

/* ── Sidebar Dashboard Layout ───────────────────────────── */

.dash-shell {
  display: flex;
  min-height: calc(100vh - 64px);
}

/* Make the custom element transparent in the flex layout */
app-sidebar {
  display: contents;
}

app-favicon {
  display: contents;
}

.dash-sidebar {
  width: 224px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--text-muted);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  transition: width 0.15s ease;
  z-index: 1000;
}

/* Sidebar now spans the full viewport height, so the top nav and main
   content shift right to start snug against its right edge instead of
   sitting above it. Scoped to pages that actually render a sidebar. */
body:has(.dash-sidebar) .nav {
  width: calc(100% - 224px);
  margin-left: 224px;
}
body:has(.dash-sidebar.collapsed) .nav {
  width: calc(100% - 60px);
  margin-left: 60px;
}
.dash-content {
  margin-left: 224px;
  width: calc(100% - 224px) !important;
}
body:has(.dash-sidebar.collapsed) .dash-content {
  margin-left: 60px;
  width: calc(100% - 60px) !important;
}

.sidebar-collapse-toggle {
  position: absolute;
  bottom: 25px;
  right: -12px;
  width: 24px;
  height: 24px;
  border-radius: 100%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.sidebar-collapse-toggle svg {
  width: 12px;
  height: 12px;
  transition: transform 0.15s ease;
}

.dash-sidebar.collapsed .sidebar-collapse-toggle svg {
  transform: rotate(180deg);
}

/* ── Collapsed sidebar: icons only, submenus become flyouts ─────────── */

.dash-sidebar.collapsed {
  width: 60px;
}

.dash-sidebar.collapsed .sidebar-biz-info,
.dash-sidebar.collapsed .sidebar-biz-edit-btn,
.dash-sidebar.collapsed .sidebar-nav-label,
.dash-sidebar.collapsed .group-label,
.dash-sidebar.collapsed .sidebar-nav-group-chevron {
  display: none;
}

.dash-sidebar.collapsed .dash-sidebar-biz {
  justify-content: center;
  padding: 16px 8px;
}

.dash-sidebar.collapsed .sidebar-biz-avatar {
  cursor: pointer;
  border-radius: 100%;
  transition: box-shadow 0.15s;
}

.dash-sidebar.collapsed .sidebar-biz-avatar:hover {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.4);
}

.dash-sidebar.collapsed .sidebar-nav-item,
.dash-sidebar.collapsed .sidebar-nav-group-toggle {
  justify-content: center;
  padding: 8px;
}

.dash-sidebar.collapsed .sidebar-nav-group {
  position: relative;
}

.dash-sidebar.collapsed .sidebar-nav-group-items {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  margin: 0 0 0 6px;
  padding: 6px;
  min-width: 180px;
  background: #333;
  border: 1px solid #555;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 30;
}

.dash-sidebar.collapsed .sidebar-nav-group.is-open .sidebar-nav-group-items {
  display: flex;
}

.dash-sidebar.collapsed .sidebar-nav-group-items .sidebar-nav-item {
  padding: 8px 10px;
  font-size: 0.85rem;
}

.dash-sidebar.collapsed .sidebar-nav-group-items .sidebar-nav-label {
  display: inline;
}

/* .dash-sidebar-nav's overflow-y:auto otherwise clips the flyout since it
   also forces overflow-x to auto, cutting off anything positioned outside
   the nav's box (left: 100%). */
.dash-sidebar.collapsed .dash-sidebar-nav {
  overflow: visible;
}

.dash-sidebar-biz {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  background: #333;
  border-bottom: 1px solid #555;
  min-height: 64px;
}

.sidebar-biz-avatar {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
}

.sidebar-biz-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 100%;
  padding: 4px;
  display: block;
  background: #fff;
}

.sidebar-biz-info {
  min-width: 0;
}

.sidebar-biz-name {
  font-size: 0.8125rem;
  line-height: 1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-biz-domain {
  font-size: 0.72rem;
  line-height: 1rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-biz-edit-btn {
  flex-shrink: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  color: rgba(255,255,255,0.6);
  transition: color 0.15s, background 0.15s;
}

.sidebar-biz-edit-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.sidebar-biz-edit-btn svg {
  width: 14px;
  height: 14px;
}

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

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  user-select: none;
  .material-symbols-outlined {
    font-weight: normal;
    font-size: 20px;
  }
}

.sidebar-nav-item:hover, 
.sidebar-nav-item.active {
  background: var(--bg-card-alt);
  color: var(--text-muted);
  text-decoration: none;
}

.dash-sidebar.collapsed .sidebar-nav-group-items .sidebar-nav-item {
    justify-content: flex-start;
}
/* .sidebar-nav-item.active {
  background: rgba(6,182,212,0.1);
  color: var(--brand);
} */

/* .sidebar-nav-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.6;
}
.sidebar-nav-item.active svg,
.sidebar-nav-item:hover svg {
  opacity: 1;
}
#sidebar-nav-item-bot-tracker svg, 
#sidebar-nav-item-site-pages svg {
  fill: #fff;
}
#sidebar-nav-item-bot-tracker.active svg, 
.has-active #sidebar-nav-item-site-pages svg {
  fill: var(--brand);
} */

/* ── Sidebar submenu group ──────────────────────────────── */

.sidebar-nav-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  user-select: none;
  list-style: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}

.sidebar-nav-group-toggle:hover {
  background: var(--bg-card-alt);
  color: var(--text-muted);
}

.sidebar-nav-group-toggle svg.group-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.6;
}

.sidebar-nav-group-toggle:hover svg.group-icon,
.sidebar-nav-group.is-open .sidebar-nav-group-toggle svg.group-icon {
  opacity: 1;
}

.sidebar-nav-group-toggle .group-label {
  flex: 1;
}

.sidebar-nav-group-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: 0.4;
  transition: transform 0.2s;
}

.sidebar-nav-group.is-open .sidebar-nav-group-chevron {
  transform: rotate(180deg);
}

.sidebar-nav-group-items {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  overflow: hidden;
  padding-left: 28px;
  transition: grid-template-rows 0.22s ease, opacity 0.18s ease;
}

.sidebar-nav-group.is-open .sidebar-nav-group-items {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 2px;
}

.sidebar-nav-group-items-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-height: 0; /* lets the 0fr row track actually collapse to zero height */
}

.sidebar-nav-group-items .sidebar-nav-item {
  padding-left: 16px;
  font-size: 0.8rem;
}

.dash-sidebar.collapsed .sidebar-nav-group.has-active .sidebar-nav-group-toggle {
  background: #fff;
  color: var(--text-muted);
}
/* .sidebar-nav-group.has-active .sidebar-nav-group-toggle svg.group-icon {
  opacity: 1;
} */

/* ── Sidebar content area ───────────────────────────────── */

.dash-content {
  flex: 1;
  min-width: 0;
  padding: 90px 30px 30px 30px;
  overflow-y: auto;
  /* height: calc(100vh - 64px); */
  border-top: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
}
@media (max-width: 900px) {
  .dash-content {
    position: relative;
    padding: 150px 15px 15px;
    margin-left: 0;
    width: 100% !important;
    overflow-x: hidden;
  }
}

.company-content, 
.page-setup {
  flex: 1;
  min-width: 0;
  padding: 80px 15px 30px 15px;
  overflow-y: auto;
}
@media (max-width: 768px) {
  .company-content .page-header-actions {
    display: none;
  }
}

/* Scroll-linked sections (dashboard3.html) */
.dash-section {
  padding: 30px 0;
  border-bottom: 1px solid var(--border);
}
.dash-section:first-child {
    padding-top: 0;
}
.dash-section:last-child {
  border-bottom: none;
  padding-bottom: 16px;
}

.dash-pane-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.dash-pane-header .clear-competitors-btn {
  flex-shrink: 0;
  margin-top: 4px;
}

.dash-pane-header h1 {
  display: flex;
  align-items: center;
  font-size: 1.375rem;
  line-height: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.dash-pane-header p {
  font-size: 0.9rem;
  color: #000;
  margin-top: 8px;
  line-height: 1.5;
}

/* ── Dismissible pane notice (e.g. "connect GSC for better data") ──
 * Placed inside .dash-pane-header (a grid); grid-column spans every column
 * so it always renders on its own full-width row below the title/actions,
 * regardless of how many/how wide the header's other children are.
 * Reusable across pages via window.AtlasNotice (see components.js). */
.dash-pane-notice {
  grid-column: 1 / -1;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.5;
}

.dash-pane-notice-icon {
  flex-shrink: 0;
}

.dash-pane-notice-text {
  flex: 1;
}

.dash-pane-notice-link {
  font-weight: 700;
  white-space: nowrap;
}

.dash-pane-notice-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 2px;
  color: inherit;
  opacity: 0.6;
  font-family: var(--font);
}

.dash-pane-notice-close:hover {
  opacity: 1;
}

.dash-pane-notice--info {
  background: rgba(6,182,212,0.06);
  border: 1.5px solid rgba(6,182,212,0.2);
  color: var(--brand-dark);
}

.dash-pane-notice--info .dash-pane-notice-link {
  color: var(--brand-dark);
}

/* ── Sidebar responsive ─────────────────────────────────── */

.sidebar-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  border-radius: 6px;
}

.sidebar-mobile-toggle:hover {
  background: rgba(255,255,255,0.1);
}

.sidebar-mobile-toggle svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 900px) {
  .dash-shell {
    flex-direction: column;
    height: 100vh;
  }

  .dash-sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    top: 64px;
    left: auto;
    z-index: 1000;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  body:has(.dash-sidebar) .nav,
  body:has(.dash-sidebar.collapsed) .nav {
    margin-left: 0;
  }

  .sidebar-collapse-toggle {
    display: none;
  }

  .dash-sidebar-biz {
    display: flex;
  }

  /* Edit button no longer sits flush right once the hamburger joins it. */
  .sidebar-biz-edit-btn {
    margin-left: 0;
  }

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

  .dash-sidebar-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 128px);
    overflow-y: auto;
    padding: 8px;
    background: var(--text-muted);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  }

  .dash-sidebar.mobile-nav-open .dash-sidebar-nav {
    display: flex;
  }
}

/* ── Utilities ──────────────────────────────────────────── */

.hidden {
  display: none !important;
}

/* ── Companies List ─────────────────────────────────────── */

.companies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  padding-bottom: 80px;
}

.company-card {
  border: 1px solid #ccc;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.company-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(6,182,212,0.1);
}

.company-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.company-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 20px 16px;
  flex: 1;
}

.company-card-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--border);
  padding: 4px;
}

.company-card-logo--favicon {
  width: 28px;
  height: 28px;
  padding: 2px;
  margin-top: 6px;
}

.company-card-body {
  flex: 1;
  min-width: 0;
}

.company-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
@media (max-width: 768px) {
  .company-content .company-card-top {
    flex-direction: column;
    align-items: flex-start;
  }
}

.company-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.company-card-domain {
  font-size: 0.78rem;
  color: var(--brand);
  text-decoration: none;
  font-family: var(--mono);
  white-space: nowrap;
  flex-shrink: 0;
}

.company-card-domain:hover {
  text-decoration: underline;
}

.company-card-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 10px;
}

.company-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  background: #f8f8f8;
}

.company-card-footer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  justify-content: flex-end;
}

.edit-btn {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-med);
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.edit-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.company-card-date {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.company-card-cta {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--brand);
  letter-spacing: 0.01em;
}

/* ── "Add New Website" quick-add card ───────────────────────── */

.add-company-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 100%;
  padding: 32px 20px;
  border: 1.5px dashed var(--border-med);
  border-radius: var(--radius);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
}

.add-company-card:hover {
  border-color: var(--brand);
  background: var(--bg-card-alt);
  transform: translateY(-2px);
}

.add-company-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border-med);
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  transition: border-color 0.2s, color 0.2s;
}

.add-company-card:hover .add-company-card-icon {
  border-color: var(--brand);
  color: var(--brand);
}

.add-company-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.add-company-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Companies empty state — ghost preview grid ─────────────── */

.empty-state--companies {
  position: relative;
  padding: 0;
  text-align: left;
  overflow: hidden;
}

.ghost-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  padding-bottom: 40px;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 92%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 92%);
}

.company-card--ghost {
  border-style: dashed;
  cursor: default;
}

.ghost-block {
  border-radius: var(--radius-sm, 6px);
  background: linear-gradient(90deg, var(--bg-card-alt) 25%, var(--border) 50%, var(--bg-card-alt) 75%);
  background-size: 200% 100%;
  animation: ghost-shimmer 2.2s ease-in-out infinite;
}

@keyframes ghost-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.ghost-logo {
  width: 28px;
  height: 28px;
  margin-top: 6px;
  border-radius: 8px;
  flex-shrink: 0;
}

.ghost-line {
  height: 10px;
}

.ghost-line--name {
  width: 55%;
  height: 14px;
}

.ghost-line--domain {
  width: 30%;
}

.ghost-line--desc {
  width: 100%;
  margin-bottom: 8px;
}

.ghost-line--desc-short {
  width: 70%;
  height: 10px;
  margin-bottom: 10px;
}

.ghost-tag {
  display: inline-block;
  width: 54px;
  height: 20px;
  border-radius: var(--radius-pill);
  margin-right: 6px;
}

.ghost-line--date {
  width: 70px;
}

.ghost-line--cta {
  width: 90px;
}

.empty-state-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: linear-gradient(to bottom, transparent 0%, var(--bg) 65%);
}

.empty-state-overlay h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.empty-state-overlay p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 420px;
  margin-bottom: 22px;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 768px) {
  .page-header--row {
    flex-direction: column;
  }

  .dash-pane-header {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .prompts-grid {
    grid-template-columns: 1fr;
  }

  .whats-new-btn { display: none; }

  .data-table {
    font-size: 0.78rem;
  }
}

@media (max-width: 480px) {
  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .status-bar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    align-items: center;
  }

  #prompt-table th:nth-child(1), 
  #prompt-table td:nth-child(1) {
    position: relative;
  }

  .card {
    padding: 20px;
  }

  .container {
    padding: 0 16px;
  }
}

/* Dashboard ALT 3 */
/* .dash-3 .biz-card-banner--brand {
  position: relative;
} */
.dash-3 .business-card {
  margin-top: 0;
}

/* ── One-Click Fixes Page ───────────────────────────────── */

.page-fixes {
  padding: 0 0 80px;
}

.fixes-header {
  background: linear-gradient(135deg, rgba(6,182,212,0.07) 0%, transparent 60%);
  border-bottom: 1px solid var(--border);
  padding: 48px 0 40px;
  margin-bottom: 40px;
}

.fixes-header h1 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 6px;
}

.fixes-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 540px;
}

.fixes-url-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.fixes-url-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-med);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 0;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixes-url-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}

.fixes-url-dot--green { background: var(--green); }

/* Summary score bar */
.fixes-summary {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.fixes-summary-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.fixes-summary-counts {
  display: flex;
  gap: 16px;
}

.fixes-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.fixes-count-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fixes-count-dot--pass { background: var(--green); }
.fixes-count-dot--warn { background: var(--yellow); }
.fixes-count-dot--fail { background: var(--red); }

.fixes-wp-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(33,117,196,0.1);
  color: #1a5fa8;
  border: 1px solid rgba(33,117,196,0.25);
}

/* Check cards grid */
.fixes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.fix-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.fix-card:hover {
  border-color: var(--border-med);
  box-shadow: var(--shadow);
}

.fix-card--pass { border: 2px solid var(--green); }
.fix-card--warn { border: 2px solid var(--yellow); }
.fix-card--fail { border: 2px solid var(--red); }

.fix-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
}

.fix-status-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.fix-status-icon--pass { background: rgba(34,197,94,0.12); }
.fix-status-icon--warn { background: rgba(245,158,11,0.12); }
.fix-status-icon--fail { background: rgba(244,63,94,0.1); }

.fix-card-title-wrap {
  flex: 1;
  min-width: 0;
}

.fix-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 3px;
}

.fix-card-message {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.fix-card-body {
  padding: 0 20px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fix-card-detail {
  font-size: 0.8125rem;
  color: var(--text-dim);
  line-height: 1.55;
  word-break: break-word;
}

.fix-card-rec {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.fix-card-rec-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.fix-rec-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: all 0.18s;
}

.fix-rec-btn--plugin {
  background: var(--brand);
  color: #fff;
  border: 1.5px solid var(--brand);
}

.fix-rec-btn--plugin:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  transform: translateY(-1px);
}

.fix-rec-btn--manual {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border-med);
}

.fix-rec-btn--manual:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* Scan loading state */
.fixes-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.fixes-scan-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 360px;
}

.fixes-scan-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-dim);
  opacity: 0.4;
  transition: opacity 0.3s;
}

.fixes-scan-step.active {
  opacity: 1;
  color: var(--brand);
  font-weight: 600;
}

.fixes-scan-step.done {
  opacity: 0.7;
  color: var(--green);
}

.fixes-scan-step-icon {
  width: 18px;
  text-align: center;
  font-size: 0.85rem;
}

/* Empty/error state */
.fixes-empty {
  padding: 60px 0;
  text-align: center;
  color: var(--text-dim);
}

.fixes-empty h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

@media (max-width: 640px) {
  .fixes-grid {
    grid-template-columns: 1fr;
  }
  .fixes-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .fixes-wp-badge { margin-left: 0; }
}

@media print {

  .atlas-logo {
    margin-top: 40px;
  }

  .new-page {
    page-break-before: always; /* Legacy */
    break-before: page;        /* Modern standard */
  }

  .atlas-chat-fab, 
  .help-icon-btn {
    display: none;
  }

  /* html/body/.dash-content are locked to the viewport size for the
     app's fixed-shell scrolling layout — left as-is, printing clips
     content to whatever the on-screen window happened to be instead of
     reflowing to the page width, so content spills off / gets cut off. */
  html, body {
    overflow: visible !important;
    height: auto !important;
  }
  .dash-shell {
    min-height: 0 !important;
  }
  .dash-content {
    position: relative !important;
    height: auto !important;
    overflow: visible !important;
    width: 100% !important;
    margin-left: 0 !important;
  }
}

@page {
  margin: 12mm;
}
