/* ============================================================
   OptimAI - Brand Stylesheet
   Fonts: Fredoka (brand), M PLUS Rounded 1c (body)
   Colours: thus(digital) brand palette
   ============================================================ */

:root {
  --primary: #02605C;
  --secondary: #2A8A81;
  --tertiary: #9AC5C3;
  --body-color: #303030;
  --mid-grey: #7D8284;
  --invert-1: #CBD4D9;
  --invert-2: #E8ECEE;

  --bg: #F7F9FA;
  --surface: #FFFFFF;
  --border: #E2E8F0;

  --green: #16A34A;
  --amber: #D97706;
  --red: #DC2626;
  --green-bg: #F0FDF4;
  --amber-bg: #FFFBEB;
  --red-bg: #FEF2F2;
  --green-border: #BBF7D0;
  --amber-border: #FDE68A;
  --red-border: #FECACA;

  --top-bar-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
}

/* ============ Mobile Notice ============ */
.mobile-notice {
  display: none;
}
@media (max-width: 900px) {
  .mobile-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: var(--top-bar-height);
    background: var(--primary);
    color: #fff;
    padding: 24px 20px;
    font-size: 15px;
    line-height: 1.5;
  }
  .mobile-notice p { margin: 0; }
  /* Hide everything below the header when notice is shown */
  #app > *:not(.top-bar):not(.mobile-notice) { display: none !important; }
}

/* ============ Reset ============ */

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

body {
  font-family: 'M PLUS Rounded 1c', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--body-color);
  background: var(--bg);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.muted { color: var(--mid-grey); }

/* ============ Brand Typography ============ */

.brand-ai {
  color: var(--secondary);
  font-weight: 300;
}

.brand-inline {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}

.brand-inline .brand-ai {
  font-weight: 300;
  color: var(--secondary);
}

/* ============ Login Overlay ============ */

.overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #013D3A 0%, var(--primary) 40%, var(--secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  margin-bottom: 16px;
}

.login-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 30px;
  color: var(--primary);
  margin-bottom: 4px;
}

.login-subtitle {
  color: var(--mid-grey);
  font-size: 16px;
  margin-bottom: 32px;
}

.google-btn-wrap {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

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

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--mid-grey);
  font-size: 14px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.ms-signin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 280px;
  height: 44px;
  margin: 0 auto;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #3c4043;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.ms-signin-btn:hover {
  background: #f7f8f8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.ms-signin-btn:active {
  background: #eee;
}

.error-text {
  color: var(--red);
  font-size: 15px;
  margin-top: 4px;
}

/* User avatar in account button */
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

/* Account menu header (user info) */
.account-menu-header {
  padding: 12px 16px;
  font-size: 12px;
  color: var(--mid-grey);
  line-height: 1.4;
}

.account-menu-header strong {
  display: block;
  font-size: 13px;
  color: var(--body-color);
  font-weight: 500;
}

/* ============ Inputs & Buttons ============ */

input[type="text"],
input[type="url"],
input[type="password"] {
  font-family: inherit;
  font-size: 16px;
  padding: 10px 14px;
  border: 1.5px solid var(--secondary);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: var(--body-color);
  background: var(--surface);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--invert-2) inset;
  -webkit-text-fill-color: var(--body-color);
  border-color: var(--secondary);
  transition: background-color 5000s ease-in-out 0s;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 96, 92, 0.12);
}

input::placeholder { color: var(--invert-1); }

input[type="text"]:not(:placeholder-shown),
input[type="url"]:not(:placeholder-shown),
.analyze-form input:not(:placeholder-shown) {
  background: var(--invert-2);
}

.btn {
  font-family: inherit;
  font-weight: 500;
  font-size: 16px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: var(--secondary); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-danger {
  background: #DC2626;
  color: white;
}
.btn-danger:hover { background: #B91C1C; }

.btn-secondary {
  background: var(--invert-2);
  color: var(--body-color);
}

.btn-secondary:hover { background: var(--invert-1); }
.btn-sm { font-size: 13px; padding: 6px 14px; }
.btn-full { width: 100%; }

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

#analyze-btn {
  min-width: 130px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-icon {
  font-size: 24px;
  font-variation-settings: 'FILL' 1;
}

/* ============ Top Bar ============ */

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top-bar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.top-bar-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.brand-name {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 24px;
  color: var(--primary);
}

.analyze-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.analyze-form input[type="text"]:first-of-type {
  flex: 2;
  min-width: 0;
}

.analyze-form input[type="text"]:nth-of-type(2) {
  flex: 1;
  min-width: 0;
}

/* ============ State Containers ============ */

.state-container {
  margin-top: var(--top-bar-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--top-bar-height));
  text-align: center;
  padding: 40px 24px;
}

.state-container h2 {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--body-color);
}

.state-container p {
  font-size: 16px;
  max-width: 440px;
  color: var(--mid-grey);
  line-height: 1.6;
}

.empty-logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  margin-bottom: 20px;
  opacity: 1;
}

/* Spinner */

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--invert-2);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: 20px;
}

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

/* Error icon */

.error-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--red-bg);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* ============ Section Nav ============ */

.section-nav {
  position: fixed;
  top: var(--top-bar-height);
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 90;
  padding: 8px 24px;
}

/* Keywords scroll nav: hidden by default, shown only by JS when keywords tab active */
#kw-scroll-nav { display: none; }

.section-nav-inner {
  display: flex;
  justify-content: center;
  gap: 6px;
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.section-nav-inner::-webkit-scrollbar { display: none; }

.section-nav-btn {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--mid-grey);
  background: none;
  border: none;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.section-nav-btn:hover {
  color: var(--secondary);
  background: var(--invert-2);
}

.section-nav-btn.active {
  color: #fff;
  background: var(--secondary);
}

/* PDF export button moved to sticky footer toolbar */

/* ============ Results ============ */

.pr-header {
  margin-top: calc(var(--top-bar-height) + 64px);
  padding: 0 24px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.pr-header.no-scroll-nav {
  margin-top: calc(var(--top-bar-height) + 24px);
}

.pr-header:not(.hidden) ~ .results,
.pr-header:not(.hidden) ~ .action-plan {
  margin-top: 20px;
}

.results {
  margin-top: calc(var(--top-bar-height) + 64px);
  padding: 32px 24px 60vh;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ Hero (unified) ============ */

.hero {
  display: flex;
  align-items: center;
  gap: 32px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

/* Page-level hero: tighter bottom margin before treemap */
.results > .hero {
  margin-bottom: 10px;
}


.hero-gauge { flex-shrink: 0; }

.hero-gauge svg .gauge-fill {
  transition: stroke-dashoffset 0.8s ease;
}

.hero-info { flex: 1; }

a.score-url {
  display: block;
  font-size: 15px;
  color: var(--primary);
  margin-bottom: 4px;
  word-break: break-all;
  text-decoration: none;
  transition: color 0.15s;
}

a.score-url:hover,
a.score-url:active {
  color: var(--secondary);
}

.score-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
}

.score-detail-left {
  flex-shrink: 1;
  min-width: 0;
}

.score-detail-row .hero-lh-gauges {
  margin-top: 0;
  gap: 28px;
  padding-top: 8px;
  flex-shrink: 0;
}

.score-keyword {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.score-keyword::before { content: '\201C'; }
.score-keyword::after { content: '\201D'; }

.score-rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 14px;
  border-radius: 20px;
}

.score-rating[data-rating="green"] { background: var(--green-bg); color: var(--green); }
.score-rating[data-rating="amber"] { background: var(--amber-bg); color: var(--amber); }
.score-rating[data-rating="red"] { background: var(--red-bg); color: var(--red); }

/* Rating dot */

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-green { background: var(--green); }
.dot-amber { background: var(--amber); }
.dot-red { background: var(--red); }

/* ============ Section Headers ============ */

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mid-grey);
  white-space: nowrap;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============ Category Cards ============ */

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}

.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--invert-1);
  border-radius: var(--radius-sm);
  padding: 16px 16px 16px 14px;
  transition: box-shadow 0.15s;
  position: relative;
  padding-bottom: 36px;
}

.cat-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cat-card[data-rating="green"] { border-left-color: var(--green); }
.cat-card[data-rating="amber"] { border-left-color: var(--amber); }
.cat-card[data-rating="red"] { border-left-color: var(--red); }

.cat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.cat-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 16px;
  font-weight: 500;
  flex: 1;
}

.card-score {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 13px;
  font-weight: 700;
  min-width: 32px;
  height: 22px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
}

.card-score[data-rating="green"] { background: var(--green-bg); color: var(--green); }
.card-score[data-rating="amber"] { background: var(--amber-bg); color: var(--amber); }
.card-score[data-rating="red"] { background: var(--red-bg); color: var(--red); }

.cat-summary {
  font-size: 15px;
  color: var(--mid-grey);
  line-height: 1.5;
}

/* Suggestions */

.cat-suggestions {
  margin-top: 10px;
  border: none;
  font-family: inherit;
}

.cat-suggestions summary {
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.cat-suggestions summary::-webkit-details-marker { display: none; }

.cat-suggestions summary::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid var(--secondary);
  transition: transform 0.15s;
  flex-shrink: 0;
}

.cat-suggestions[open] summary::before {
  transform: rotate(90deg);
}

.cat-suggestions ul {
  margin-top: 8px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cat-suggestions li {
  font-size: 15px;
  color: var(--body-color);
  line-height: 1.5;
}

/* Coloured suggestion bullets */
.cat-suggestions[data-rating="green"] li::marker { color: var(--green); }
.cat-suggestions[data-rating="amber"] li::marker { color: var(--amber); }
.cat-suggestions[data-rating="red"] li::marker { color: var(--red); }

/* ============ Metrics Disclosure ============ */

.metrics-disclosure {
  margin-top: -20px;
  margin-bottom: 40px;
  border: none;
  font-family: inherit;
}

.metrics-disclosure summary {
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.metrics-disclosure summary::-webkit-details-marker { display: none; }

.metrics-disclosure summary::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid var(--secondary);
  transition: transform 0.15s;
  flex-shrink: 0;
}

.metrics-disclosure[open] summary::before {
  transform: rotate(90deg);
}

.metrics-disclosure summary {
  margin-bottom: 4px;
}

.metrics-disclosure .lh-audits {
  margin-top: 10px;
}

/* Per-card metrics pill + inline metrics */

.card-footer {
  position: absolute;
  bottom: 10px;
  right: 14px;
}

.metrics-pill {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--secondary);
  background: var(--invert-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.metrics-pill:hover,
.metrics-pill.active {
  background: var(--secondary);
  color: #fff;
}

.card-metrics {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.card-metrics .lh-audits {
  gap: 4px;
}

.card-metrics .lh-audit-row {
  font-size: 13px;
  padding: 4px 8px;
}

/* ============ AI Search Readiness ============ */

.ai-section {
  margin-bottom: 40px;
}

.hero-info p {
  font-size: 16px;
  color: var(--mid-grey);
  line-height: 1.6;
  margin-bottom: 10px;
}

.ai-dims-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}

.dim-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--invert-1);
  border-radius: var(--radius-sm);
  padding: 16px 16px 16px 14px;
  transition: box-shadow 0.15s;
  position: relative;
  padding-bottom: 36px;
}

.dim-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.dim-card[data-rating="green"] { border-left-color: var(--green); }
.dim-card[data-rating="amber"] { border-left-color: var(--amber); }
.dim-card[data-rating="red"] { border-left-color: var(--red); }

.dim-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.dim-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 16px;
  font-weight: 500;
  flex: 1;
}

.dim-verdict {
  font-size: 15px;
  color: var(--mid-grey);
  line-height: 1.6;
  margin-bottom: 8px;
}

/* ============ Audit Scores Section ============ */

.lighthouse-section {
  margin-bottom: 40px;
}

.lighthouse-scores {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.lh-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.lh-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--mid-grey);
  text-align: center;
}

.mini-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}

.mini-gauge:hover { opacity: 0.85; }
.mini-gauge:hover .mini-gauge-label { color: var(--primary); }

.mini-gauge-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary);
  text-align: center;
  transition: color 0.15s;
}

.lh-subtitle {
  font-size: 12px;
  color: var(--mid-grey);
  text-align: center;
}

.lh-summary {
  flex: 1;
  font-size: 15px;
  color: var(--mid-grey);
  line-height: 1.6;
}

.lh-summary-list {
  list-style: disc;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lh-summary-list li[data-rating="green"]::marker { color: var(--green); }
.lh-summary-list li[data-rating="amber"]::marker { color: var(--amber); }
.lh-summary-list li[data-rating="red"]::marker { color: var(--red); }

.hero-lh-gauges {
  display: flex;
  gap: 24px;
  margin-top: 16px;
}

.lh-audits {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

.lh-audit-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--invert-2);
  font-size: 15px;
}

.lh-audit-row:last-child { border-bottom: none; }

.lh-audit-title { flex: 1; }

.lh-audit-value {
  color: var(--mid-grey);
  font-size: 14px;
  min-width: 60px;
  text-align: right;
}

.lh-audit-score {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  border: 1.5px solid currentColor;
}

.metric-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: var(--secondary);
  background: rgba(42, 138, 129, 0.08);
  border: 1px solid rgba(42, 138, 129, 0.2);
  border-radius: 10px;
  padding: 1px 8px;
  margin-left: 8px;
  white-space: nowrap;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

/* ============ Hero Bar Charts ============ */

.hero-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 24px;
  margin-top: 14px;
}

.hero-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-bar-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--body-color);
  width: 110px;
  flex-shrink: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-bar-track {
  flex: 1;
  height: 20px;
  background: var(--invert-2);
  border-radius: 4px;
  position: relative;
  overflow: visible;
}

.hero-bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 8px;
  transition: width 0.6s ease-out;
}

.hero-bar-score {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.hero-bar-score-outside {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  padding-left: 6px;
  color: #303030;
}

.hero-bar-threshold {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-right: 1px dashed var(--invert-1);
  pointer-events: none;
  z-index: 1;
}

/* ============ Treemap Heatmap ============ */

.treemap-container {
  margin-bottom: 32px;
}
#exec-treemap-container {
  margin-bottom: 20px;
}

.treemap-container svg {
  display: block;
  width: 100% !important;
  height: auto !important;
}

/* ============ History Placeholder ============ */

.history-placeholder {
  background: var(--surface);
  border: 1px dashed var(--invert-1);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  margin-bottom: 40px;
}

.history-placeholder p {
  font-size: 16px;
  color: var(--mid-grey);
  font-style: italic;
}

/* ============ Info Tooltips ============ */

.info-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--invert-2);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s;
  vertical-align: middle;
}

.info-btn:hover {
  background: var(--secondary);
}
.info-btn:hover span {
  color: #fff;
}

.info-btn span {
  font-family: 'Times New Roman', Times, serif;
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
  color: var(--mid-grey);
  line-height: 1;
}

.info-tooltip {
  position: fixed;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  max-width: 340px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--body-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  white-space: pre-line;
}

.info-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ============ Sticky Footer Toolbar ============ */

.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 90;
  padding: 0 24px;
  height: 44px;
}

.back-to-top {
  position: fixed;
  bottom: 120px;
  right: 12px;
  z-index: 95;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.2s;
  opacity: 0;
  pointer-events: none;
}
.back-to-top:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}
.back-to-top .material-symbols-rounded {
  font-size: 20px;
}
.back-to-top:hover {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--primary);
}

.footer-inner {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
}

.footer-left-tools,
.footer-right-tools {
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-right-tools {
  margin-left: auto;
}

.footer-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: auto;
}

.footer-legal {
  font-size: 9px;
  font-weight: 400;
  color: var(--mid-grey);
  letter-spacing: 0.02em;
}

.footer-sep {
  font-size: 9px;
  color: var(--primary);
  font-weight: 500;
}

.footer-link {
  color: var(--secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Account button - white icon on teal circle */
.footer-account-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.footer-account-btn .material-symbols-rounded {
  font-size: 20px;
  font-variation-settings: 'FILL' 1;
}

.footer-account-btn:hover {
  background: var(--secondary);
}

/* Account popup menu */
.account-menu {
  position: absolute;
  bottom: 40px;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 180px;
  padding: 6px 0;
  z-index: 100;
}

.account-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}

.account-menu-item .material-symbols-rounded {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-variation-settings: 'FILL' 1;
  transition: background 0.12s;
}

.account-menu-item:hover {
  background: var(--bg);
  color: var(--secondary);
}

.account-menu-item:hover .material-symbols-rounded {
  background: var(--secondary);
}

.account-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Settings nudge tooltip */
.settings-nudge {
  position: absolute;
  bottom: 44px;
  left: 0;
  background: var(--amber);
  color: #fff;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 99;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  animation: nudge-pulse 2s ease-in-out 3;
  cursor: pointer;
}
.settings-nudge::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 14px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--amber);
}
@keyframes nudge-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Help nudge - sits above the footer Help button on first dashboard view */
.help-nudge {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  background: var(--amber);
  color: #fff;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 99;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  animation: nudge-pulse 2s ease-in-out 3;
  cursor: pointer;
}
.help-nudge::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 14px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--amber);
}

/* PDF nudge - sits above the footer Download PDF button on first report view */
.pdf-nudge {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  background: var(--amber);
  color: #fff;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 99;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  animation: nudge-pulse 2s ease-in-out 3;
  cursor: pointer;
}
.pdf-nudge::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 14px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--amber);
}

.footer-support-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}

.footer-support-btn:hover {
  background: var(--secondary);
}

.footer-support-btn .material-symbols-rounded {
  font-size: 15px;
  font-variation-settings: 'FILL' 1;
}

.footer-help-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}

.footer-help-btn:hover {
  background: var(--secondary);
}

.footer-help-btn .material-symbols-rounded {
  font-size: 15px;
  font-variation-settings: 'FILL' 1;
}

/* Download PDF button - white on teal */
.footer-pdf-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.footer-pdf-btn svg {
  stroke: #fff;
}

.footer-pdf-btn:hover {
  background: var(--secondary);
}

.footer-pdf-btn:disabled {
  background: var(--secondary);
  cursor: wait;
}

.footer-pdf-btn.generating {
  background: var(--secondary);
}

/* PDF spinner */
.footer-pdf-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ============ Replay Banner ============ */

.replay-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}

.replay-banner .material-symbols-rounded {
  font-size: 18px;
}

.replay-dismiss {
  margin-left: auto;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 12px;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.replay-dismiss:hover {
  background: rgba(255,255,255,0.35);
}

/* Methodology version banner - shown on v1 (pre 2026-05-24) reports.
   Quieter than replay-banner; informational not navigational. */
.methodology-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--amber-bg);
  color: #5C3D00;
  border: 1px solid var(--amber-border);
  padding: 10px 16px;
  border-radius: 8px;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.methodology-banner .material-symbols-rounded {
  font-size: 18px;
  color: var(--amber);
  flex-shrink: 0;
}

/* ============ Responsive ============ */

/* --- 1200px: stack inputs, button beside keyword --- */
@media (max-width: 1200px) {
  :root { --top-bar-height: 120px; }
  .top-bar { height: auto; min-height: var(--top-bar-height); padding: 10px 0; }
  .top-bar-inner { flex-wrap: wrap; align-items: flex-start; gap: 24px; }
  .top-bar-inner .brand { align-self: flex-start; padding-top: 4px; }
  .analyze-form {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
  /* URL field spans full width */
  .analyze-form input[type="text"]:first-of-type {
    flex: unset;
    grid-column: 1 / -1;
  }
  /* keyword + button share second row */
  .analyze-form input[type="text"]:nth-of-type(2) {
    flex: unset;
    grid-column: 1;
  }
  .analyze-form #analyze-btn {
    grid-column: 2;
    grid-row: 2;
  }
}

/* --- 900px: same stacked layout, tighter spacing --- */
@media (max-width: 900px) {
  .top-bar-inner { gap: 10px; }
  .hero { flex-direction: column; text-align: center; }
}

/* --- 640px: logo left + button right, inputs below --- */
@media (max-width: 640px) {
  .top-bar { padding: 12px 0; }
  .top-bar-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    padding: 0 12px;
    align-items: start;
  }
  /* Row 1: brand left, button right */
  .top-bar-inner .brand { grid-column: 1; grid-row: 1; padding-top: 0; }
  .analyze-form {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .analyze-form input[type="text"]:first-of-type { grid-column: 1; }
  .analyze-form input[type="text"]:nth-of-type(2) { grid-column: 1; }
  .analyze-form #analyze-btn {
    grid-column: 2;
    grid-row: 1 / 2;
    /* Pull out of form grid into top-bar-inner row 1 */
    position: absolute;
    right: 12px;
    top: 12px;
    font-size: 14px;
    padding: 8px 14px;
    min-width: unset;
    margin-bottom: 8px;
  }
  .top-bar { position: fixed; }
  .mobile-notice { margin-top: 200px; }
  .state-container { margin-top: 200px; min-height: calc(100vh - 200px); }
  .pr-header { margin-top: 200px; padding: 0 12px; }
  .results { margin-top: 200px; padding: 20px 12px 40px; }
  .hero { flex-direction: column; text-align: center; padding: 24px; }
  .categories-grid { grid-template-columns: 1fr; }
  .ai-dims-grid { grid-template-columns: 1fr; }
  .lighthouse-scores { justify-content: center; }
  .footer-center { display: none; }
  .results { padding-bottom: 60px; }
  .kw-table-wrap, .serp-table-wrap, .history-table-wrap { overflow-x: auto; }
}

/* ============ Treemap Card Highlight ============ */

@keyframes card-pulse {
  0% { box-shadow: 0 0 0 0 rgba(2, 96, 92, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(2, 96, 92, 0.15); }
  100% { box-shadow: 0 0 0 0 rgba(2, 96, 92, 0); }
}

.card-highlight {
  animation: card-pulse 0.75s ease-out 2;
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============ Keyword Opportunity ============ */

.kw-hero-stats {
  display: flex;
  gap: 16px;
  margin: 8px 0;
}

.kw-hero-stat {
  font-size: 13px;
  color: var(--mid-grey);
}

.kw-hero-stat strong {
  color: var(--body-color);
}

.kw-footnote {
  font-size: 11px;
  color: var(--mid-grey);
  margin-top: 8px;
  font-style: italic;
}

.kw-insight {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.kw-insight-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  background: var(--amber);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.kw-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.kw-stat {
  font-size: 14px;
  color: var(--mid-grey);
}

.kw-stat strong {
  color: var(--body-color);
}

.kw-stat-green strong { color: var(--green); }
.kw-stat-red strong { color: var(--red); }

.kw-table-wrap {
  overflow-x: auto;
}

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

.kw-table th {
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mid-grey);
  border-bottom: 2px solid var(--border);
}

.kw-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.kw-keyword {
  white-space: normal;
  min-width: 180px;
  font-weight: 500;
}

.kw-opp-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--amber);
  color: #fff;
  vertical-align: middle;
  margin-left: 4px;
}

.kw-row-opportunity {
  background: var(--amber-bg);
}

.kw-diff-easy { color: var(--green); font-weight: 600; }
.kw-diff-medium { color: var(--amber); font-weight: 600; }
.kw-diff-hard { color: var(--red); font-weight: 600; }

.kw-found { color: var(--green); font-weight: 600; }
.kw-missing { color: var(--red); font-weight: 600; }

.kw-row-found { background: var(--green-bg); }
.kw-row-missing { background: var(--red-bg); }
.kw-row-linked { background: var(--green-bg); }
.kw-cluster-card .kw-row-linked.kw-row-opportunity { background: var(--amber-bg); }
.kw-cluster-card .kw-row-linked.kw-row-missing { background: var(--red-bg); }


.kw-table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 40px;
}
.kw-table-card:has(+ .paa-section) {
  margin-bottom: 20px;
}

.kw-table-card .kw-footnote {
  padding: 0 12px 12px;
}

.kw-empty {
  padding: 24px;
  text-align: center;
  color: var(--mid-grey);
}

/* ============ SERP Intelligence ============ */

.serp-callout {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
}

.serp-callout-found {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
}

.serp-callout-missing {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
}

.serp-table-wrap {
  overflow-x: auto;
}

.serp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.serp-table th {
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mid-grey);
  border-bottom: 2px solid var(--border);
}

.serp-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.serp-pos {
  font-weight: 700;
  text-align: right;
  padding-right: 8px;
  width: 40px;
  color: var(--mid-grey);
}

.serp-title a {
  color: var(--secondary);
  text-decoration: none;
}

.serp-title a:hover {
  text-decoration: underline;
}

.serp-domain {
  color: var(--mid-grey);
  font-size: 12px;
}

.serp-row-current {
  background: var(--green-bg);
}

.serp-row-current .serp-pos {
  color: var(--green);
}

.serp-row-feature {
  background: #F8FAFC;
  color: var(--mid-grey);
  font-style: italic;
}

.serp-feature-label {
  font-size: 12px;
}

.serp-you-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--green);
  color: #fff;
  vertical-align: middle;
  margin-left: 4px;
}

.serp-table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 20px;
}

.serp-keywords {
  font-weight: 600;
  text-align: right;
  min-width: 60px;
}

.serp-traffic {
  text-align: right;
  min-width: 70px;
}

.serp-table th:first-child {
  text-align: right;
  padding-right: 8px;
}

.serp-table th:nth-last-child(1),
.serp-table th:nth-last-child(2) {
  text-align: right;
}

.serp-comparison {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.serp-comparison-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.serp-comparison-label {
  color: var(--mid-grey);
  min-width: 130px;
}

.serp-comparison-you {
  color: var(--primary);
}

.serp-comparison-avg {
  color: var(--mid-grey);
}

.serp-empty {
  padding: 24px;
  text-align: center;
  color: var(--mid-grey);
}

/* ============ AI Visibility Panel ============ */

/* Match effective spacing with other sections (40px total gap before next panel) */
.ai-section > .metrics-disclosure {
  margin-bottom: 24px;
}

.ai-vis-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-top: 16px;
}

.ai-vis-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.ai-vis-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.ai-vis-status.ai-vis-found {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
}

.ai-vis-status.ai-vis-not-found {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
}

.ai-vis-status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.ai-vis-found .ai-vis-status-icon {
  background: var(--green);
}

.ai-vis-not-found .ai-vis-status-icon {
  background: var(--red);
}

.ai-vis-query {
  font-size: 12px;
  color: var(--mid-grey);
  margin-top: 4px;
}

.ai-vis-engines {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.ai-vis-engine-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.ai-vis-engine-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ai-vis-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
}

.ai-vis-badge-found {
  background: var(--green);
  color: #fff;
}

.ai-vis-badge-missing {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
}

.ai-vis-badge-mentioned {
  background: var(--amber);
  color: #fff;
}

.ai-vis-badge-unavailable {
  background: var(--invert-2, #e8ecee);
  color: var(--mid-grey);
  border: 1px solid var(--border);
}

.ai-vis-engine-card--unavailable {
  background: var(--invert-2, #e8ecee);
  border-style: dashed;
}

.ai-vis-engine-card--unavailable .ai-vis-detail {
  color: var(--mid-grey);
  font-style: italic;
}

.ai-vis-detail {
  font-size: 13px;
  color: var(--mid-grey);
  margin-bottom: 4px;
}

.ai-vis-detail a {
  color: var(--secondary);
  text-decoration: none;
  word-break: break-all;
}

.ai-vis-detail a:hover {
  text-decoration: underline;
}

.ai-vis-engine-snippet {
  font-size: 13px;
  color: var(--body-color);
  background: var(--surface);
  border-left: 3px solid var(--tertiary);
  padding: 8px 12px;
  margin-top: 8px;
  border-radius: 0 4px 4px 0;
  line-height: 1.5;
}

/* ============ AI Search Opportunity ============ */

.ai-opp-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-top: 16px;
}

.ai-opp-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.ai-opp-coverage {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--body-color);
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.ai-opp-coverage-item strong {
  color: var(--primary);
}

.ai-opp-coverage-sep {
  color: var(--mid-grey);
}

.ai-opp-cards {
  display: grid;
  gap: 10px;
}

.ai-opp-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.ai-opp-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.ai-opp-type-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
  color: #fff;
}


.ai-opp-type-content_gap { background: var(--red); }
.ai-opp-type-topic_expansion { background: var(--amber); }
.ai-opp-type-format_change { background: var(--secondary); }
.ai-opp-type-companion_content { background: var(--primary); }

.ai-opp-impact {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
}

.ai-opp-impact-high {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.ai-opp-impact-medium {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}

.ai-opp-card-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--body-color);
  margin-bottom: 4px;
}

.ai-opp-card-detail {
  font-size: 13px;
  color: var(--mid-grey);
  line-height: 1.5;
}

.ai-opp-expandable {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 12px;
}

.ai-opp-expandable details {
  flex: 1;
}

.ai-opp-questions,
.ai-opp-topics {
  font-size: 13px;
}

.ai-opp-questions summary,
.ai-opp-topics summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--secondary);
  font-size: 12px;
}

.ai-opp-questions ul {
  margin-top: 6px;
  padding-left: 20px;
  color: var(--body-color);
}

.ai-opp-questions li {
  margin-bottom: 3px;
  line-height: 1.4;
}

.ai-opp-topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.ai-opp-topic-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--invert-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--body-color);
}
.ai-opp-topic-covered {
  background: var(--green-bg);
  border-color: var(--green);
  color: #166534;
  font-weight: 600;
}
.ai-opp-questions ul,
.ai-opp-topics ul {
  list-style: none;
  padding-left: 12px;
  margin: 4px 0 0 0;
}
.ai-opp-questions ul li,
.ai-opp-topics ul li {
  padding: 2px 8px;
  border-left: 3px solid transparent;
  margin-bottom: 3px;
  position: relative;
}
.ai-opp-questions ul li:not(.ai-opp-covered),
.ai-opp-topics ul li:not(.ai-opp-covered) {
  padding-left: 11px;
  border-left: 0;
}
.ai-opp-questions ul li:not(.ai-opp-covered)::before,
.ai-opp-topics ul li:not(.ai-opp-covered)::before {
  content: '\2022';
  color: var(--mid-grey);
  position: absolute;
  left: 0;
  top: 2px;
}
.ai-opp-questions li.ai-opp-covered,
.ai-opp-topics li.ai-opp-covered {
  background: var(--green-bg);
  border-left-color: var(--green);
  color: #166534;
  font-weight: 600;
}
.ai-opp-you-pill {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  background: var(--green);
  color: #fff;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

.ai-opp-domains {
  font-size: 12px;
  color: var(--mid-grey);
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ============ AI Visibility Competitor Analysis ============ */

.ai-vis-gap {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.ai-vis-gap-header {
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}

.ai-vis-gap-summary {
  font-size: 13px;
  color: var(--body-color);
  margin-bottom: 12px;
  line-height: 1.5;
}

.ai-vis-gap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.4;
}

.ai-vis-gap-table th {
  text-align: left;
  font-weight: 600;
  color: var(--mid-grey);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 10px;
  border-bottom: 2px solid var(--border);
}

.ai-vis-gap-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.ai-vis-gap-table tr:last-child td {
  border-bottom: none;
}

.ai-vis-gap-table .gap-dim {
  font-weight: 600;
  color: var(--body-color);
  white-space: nowrap;
}

.ai-vis-gap-table .gap-yours {
  color: var(--red);
  background: var(--red-bg);
  border-radius: 4px;
}

.ai-vis-gap-table .gap-cited {
  color: var(--green);
  background: var(--green-bg);
  border-radius: 4px;
}

.ai-vis-gap-table .gap-action {
  color: var(--body-color);
  font-size: 12px;
}

.ai-vis-gap-sources {
  font-size: 12px;
  color: var(--mid-grey);
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.ai-vis-caveat {
  font-size: 11px;
  color: var(--mid-grey);
  font-style: italic;
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--invert-2);
  border-radius: var(--radius-sm);
}

/* -- AI Vis: Citation Timeline & Collapsible Citations -- */

.ai-vis-timeline {
  margin: 16px 0;
}

.ai-vis-status-spark {
  display: inline-block;
  width: 100%;
  max-width: 220px;
  height: 60px;
  vertical-align: middle;
  margin-left: auto;
  flex-shrink: 0;
}

.ai-vis-cite-disclosure {
  margin-top: 8px;
}

.ai-vis-cite-disclosure summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--body-color);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.ai-vis-cite-disclosure summary::-webkit-details-marker { display: none; }

.ai-vis-cite-disclosure summary::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 8px solid var(--secondary);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.ai-vis-cite-disclosure[open] summary::before {
  transform: rotate(90deg);
}

.ai-vis-cite-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-vis-cite-mini {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
}

.ai-vis-cite-pos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  background: var(--green);
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.ai-vis-cite-pos--mentioned {
  background: var(--amber);
}

.ai-vis-cite-sentence {
  color: var(--body-color);
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

/* ============ People Also Ask ============ */

.paa-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-top: 16px;
  margin-bottom: 40px;
}

.paa-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
}

.paa-count {
  font-size: 11px;
  font-weight: 700;
  background: var(--invert-2);
  color: var(--mid-grey);
  padding: 2px 8px;
  border-radius: 10px;
}

.paa-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.paa-list li {
  font-size: 14px;
  line-height: 1.5;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.paa-list li::before {
  content: '?';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--tertiary);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  margin-right: 8px;
  vertical-align: middle;
}

.paa-list a {
  color: var(--secondary);
  text-decoration: none;
}

.paa-list a:hover {
  text-decoration: underline;
}

.paa-domain {
  font-size: 11px;
  color: var(--mid-grey);
  margin-left: 6px;
}

/* ============ History ============ */

.history-table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 20px;
}

.history-table-wrap {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.history-table th {
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mid-grey);
  border-bottom: 2px solid var(--border);
}

.history-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.history-replay-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.history-replay-btn:hover {
  background: var(--secondary);
}

.history-replay-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.history-sparkline {
  padding: 0;
  min-height: 160px;
}

.history-hero-delta {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.history-delta-arrow {
  font-size: 14px;
}

.history-hero-range {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.history-progress-sep {
  color: var(--mid-grey);
}

.history-hero-count {
  font-size: 11px;
  color: var(--mid-grey);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 8px;
}

.history-score-badge {
  font-weight: 700;
  font-size: 13px;
}

.history-empty, .history-loading {
  padding: 24px;
  text-align: center;
  color: var(--mid-grey);
  font-size: 14px;
}

/* ============ Credits Modal ============ */

.credits-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.credits-modal.hidden { display: none; }

.credits-modal-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 440px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.credits-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--mid-grey);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.credits-modal-close:hover { color: var(--body-colour); }

.credits-modal-title {
  font-family: var(--font-brand);
  font-size: 22px;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 4px;
  text-align: center;
}

.credits-modal-message {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--red, #d32f2f);
  margin: 0 0 4px;
  padding: 6px 12px;
  background: #fef2f2;
  border-radius: 8px;
}

.credits-modal-balance {
  text-align: center;
  font-size: 14px;
  color: var(--mid-grey);
  margin: 0 0 20px;
}

.credits-modal-packs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.credits-pack-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 12px;
  border: 2px solid var(--invert-2);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.credits-pack-btn:hover {
  border-color: var(--secondary);
  background: #f0faf9;
}

.credits-pack-btn.popular {
  border-color: var(--primary);
  background: linear-gradient(135deg, #f0faf9, #e6f5f3);
  position: relative;
}

.credits-pack-btn.popular::before {
  content: "Popular";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  background: var(--primary);
  padding: 2px 10px;
  border-radius: 6px;
}

.credits-pack-credits {
  font-weight: 700;
  font-size: 16px;
  color: var(--body-colour);
}

.credits-pack-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}

.credits-pack-vat {
  font-size: 11px;
  font-weight: 400;
  color: var(--mid-grey);
  margin-left: 2px;
}

/* ============ Purchase Toast ============ */

/* ============ Welcome Ribbon ============ */

.welcome-ribbon {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 12px;
  margin-bottom: 28px;
}

.welcome-ribbon.hidden { display: none; }

/* ============ Purchase Toast ============ */

.purchase-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.purchase-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.credits-bulk-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--mid-grey);
}

.credits-bulk-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.credits-bulk-link:hover { text-decoration: underline; }

.credits-modal-note {
  text-align: center;
  font-size: 12px;
  color: var(--mid-grey);
  margin: 12px 0 0;
}

.sheets-modal-link {
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
}
.sheets-modal-link:hover { color: var(--secondary) !important; }
.sheets-modal-link--muted { color: var(--mid-grey); }

/* ============ Profile Modal ============ */

.profile-modal-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--invert-2);
  object-fit: cover;
}

.profile-header-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 20px;
  color: var(--primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-email {
  font-size: 13px;
  color: var(--mid-grey);
  margin: 2px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-section {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.profile-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mid-grey);
  margin-bottom: 6px;
}

.profile-tier-row,
.profile-balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-tier-badge {
  display: inline-block;
  font-size: 15px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
  background: var(--invert-2);
  color: var(--body-color);
}

.profile-tier-badge.tier-pro {
  background: var(--primary);
  color: #fff;
}

.profile-tier-badge.tier-admin {
  background: var(--amber);
  color: #fff;
}

.profile-balance-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.profile-ledger {
  margin-top: 8px;
}

.profile-ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--invert-2);
}

.profile-ledger-row:last-child {
  border-bottom: none;
}

.profile-ledger-desc {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--body-color);
}

.profile-ledger-amount {
  font-weight: 600;
  margin-left: 12px;
  white-space: nowrap;
}

.profile-ledger-amount.positive {
  color: var(--green);
}

.profile-ledger-amount.negative {
  color: var(--red);
}

.profile-ledger-date {
  font-size: 13px;
  color: var(--mid-grey);
  margin-left: 12px;
  white-space: nowrap;
}

.profile-pro-features {
  padding: 16px;
  background: linear-gradient(135deg, rgba(2, 96, 92, 0.05), rgba(42, 138, 129, 0.05));
  border: 1px solid var(--tertiary);
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

.profile-pro-intro {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 8px;
}

.profile-pro-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}

.profile-pro-list li {
  font-size: 15px;
  padding: 4px 0;
  padding-left: 20px;
  position: relative;
  color: var(--body-color);
}

.profile-pro-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 12px;
  height: 12px;
  background: var(--green);
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.profile-pro-pricing {
  font-size: 14px;
  color: var(--mid-grey);
  margin: 0;
}

.profile-downgrade-btn {
  background: none;
  border: none;
  color: var(--mid-grey);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  transition: color 0.15s;
}

.profile-downgrade-btn:hover {
  color: var(--body-color);
}

.profile-partner-intro {
  font-size: 14px;
  color: var(--mid-grey);
  margin: 4px 0 12px;
}

.profile-partner-tiers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-partner-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(2, 96, 92, 0.04), rgba(42, 138, 129, 0.04));
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.profile-partner-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.partner-tier-credits {
  font-size: 15px;
  font-weight: 600;
  color: var(--body-colour);
}

.partner-tier-price {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
}

.profile-partner-note {
  font-size: 13px;
  color: var(--mid-grey);
  margin: 10px 0 0;
}

.profile-partner-note a {
  color: var(--secondary);
}

.profile-sub-status {
  font-size: 14px;
  color: var(--mid-grey);
  margin: 4px 0 0;
}

.account-menu-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--secondary);
  background: var(--invert-2);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: auto;
}
/* Sharing modal */
.sharing-modal-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  position: relative;
}
.sharing-modal-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}
.sharing-desc {
  font-size: 13px;
  color: var(--mid-grey);
  margin: 0 0 16px;
  line-height: 1.5;
}
.sharing-domain {
  font-size: 13px;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: var(--invert-2);
  border-radius: 4px;
}
.sharing-domain strong {
  font-weight: 600;
}
.sharing-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.sharing-toggle-label {
  font-size: 14px;
  font-weight: 500;
}
.sharing-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.sharing-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.sharing-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  transition: background 0.2s;
}
.sharing-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.sharing-switch input:checked + .sharing-slider {
  background: var(--green);
}
.sharing-switch input:checked + .sharing-slider::before {
  transform: translateX(20px);
}
.sharing-status {
  font-size: 12px;
  color: var(--mid-grey);
  margin-top: 8px;
  min-height: 16px;
}
.sharing-status.error {
  color: var(--amber);
}
/* Shared report indicator on dashboard */
.dash-shared-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--secondary);
  background: var(--invert-2);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  white-space: nowrap;
}

.profile-danger {
  border-top: 1px solid var(--red-border);
}

.profile-deactivate-btn {
  background: none;
  border: none;
  color: var(--red);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 0;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.profile-deactivate-btn:hover {
  opacity: 1;
}

.profile-danger-note {
  font-size: 13px;
  color: var(--mid-grey);
  margin: 6px 0 0;
}

/* ============ Site Scan ============ */

.site-scan {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--top-bar-height) + 24px) 24px 120px;
}

.ss-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.ss-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ss-back-btn {
  background: none;
  border: 1px solid var(--invert-1);
  border-radius: 8px;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  color: var(--mid-grey);
  transition: all 0.15s;
}

.ss-back-btn:hover {
  border-color: var(--secondary);
  color: var(--primary);
}

.ss-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--primary);
  margin: 0;
}

.ss-tabs {
  display: flex;
  gap: 2px;
  background: var(--invert-2);
  border-radius: 8px;
  padding: 3px;
  position: relative;
}

/* Action Plan nudge - fires once per browser on first report view to point users at the to-do list */
.action-plan-nudge {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--amber);
  color: #fff;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  padding: 10px 14px;
  border-radius: 8px;
  z-index: 99;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  animation: nudge-pulse 2s ease-in-out 3;
  cursor: pointer;
  max-width: 280px;
  white-space: normal;
}
.action-plan-nudge::after {
  content: '';
  position: absolute;
  top: -6px;
  right: 28px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--amber);
}

.ss-tab {
  padding: 6px 16px;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--mid-grey);
  transition: all 0.15s;
}

.ss-tab.active {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.ss-tab:hover:not(.active) {
  color: var(--body);
}

/* Discovery loading */
.ss-discovering {
  text-align: center;
  padding: 60px 0;
}

.ss-discover-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--invert-1);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

.ss-discover-stage {
  font-weight: 500;
  color: var(--body);
  margin: 0 0 4px;
}

.ss-discover-detail {
  color: var(--mid-grey);
  font-size: 13px;
  margin: 0;
}

.ss-discover-note {
  color: var(--mid-grey);
  font-size: 12px;
  margin: 12px 0 0;
}

.ss-batch-notify-card {
  margin-bottom: 16px;
}

.ss-batch-notify-card .btn {
  margin-top: 8px;
}

/* Page tree */
.ss-tree {
  border: 1px solid var(--invert-1);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  margin-bottom: 120px;
}

.ss-tree > .ss-section,
.ss-tree > .ss-page {
  margin-left: 16px;
}

.ss-tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--invert-2);
  border-bottom: 1px solid var(--invert-1);
  font-size: 13px;
  font-weight: 500;
  color: var(--mid-grey);
}

.ss-tree-header label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.ss-tree-header label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.ss-tree-header-count {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--secondary);
  padding: 1px 8px;
  border-radius: 10px;
  min-width: 24px;
  text-align: center;
  display: inline-block;
  margin-left: 16px;
}

.ss-tree-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
}

.ss-tree-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ss-tree-stat .material-symbols-rounded {
  font-size: 16px;
}

.ss-tree-stat--scanned {
  color: #16A34A;
}

.ss-tree-stat--warn {
  color: #D97706;
}

.ss-tree-stat--error {
  color: #DC2626;
}

.ss-tree-stat--error .info-btn {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.ss-tree-stat--error .info-btn span {
  color: #fff;
}

/* Section group (collapsible path segment) */
.ss-section {
  border-bottom: 1px solid var(--invert-2);
}

.ss-section:last-child {
  border-bottom: none;
}

.ss-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 0;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}

.ss-section-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ss-section-header:hover {
  background: var(--invert-2);
}

.ss-section-toggle {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid var(--secondary);
  transition: transform 0.15s;
  flex-shrink: 0;
}

.ss-section:not(.collapsed) > .ss-section-header .ss-section-toggle {
  transform: rotate(90deg);
}

.ss-section.collapsed > .ss-section-header .ss-section-toggle {
  transform: rotate(0deg);
}

.ss-section-path {
  font-weight: 500;
  font-size: 14px;
  color: var(--body);
  flex: 1;
}

.ss-section-count {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--secondary);
  padding: 1px 8px;
  border-radius: 10px;
  min-width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.ss-section-check-wrap {
  margin-left: 8px;
}

.ss-section-body {
  padding: 0;
}

.ss-section.collapsed .ss-section-body {
  display: none;
}

/* Page row */
.ss-page {
  display: grid;
  grid-template-columns: 80px 1fr 400px 44px 66px 60px;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 0;
  border-top: 1px solid var(--invert-2);
  font-size: 13px;
  transition: background 0.1s;
  cursor: pointer;
}

.ss-page:hover {
  background: #f8fafb;
}

.ss-row-controls {
  width: 80px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.ss-page-check {
  justify-self: center;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.ss-section-check {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.ss-page-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  min-width: 0;
}

.ss-page-path,
.ss-health-url {
  font-weight: 500;
  color: var(--body);
  word-break: normal;
  overflow-wrap: break-word;
}

.ss-page-extlink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  color: var(--mid-grey);
  text-decoration: none;
  vertical-align: middle;
  transition: color 0.15s ease;
}

.ss-page-extlink:hover {
  color: var(--primary);
}

.ss-page-extlink .material-symbols-rounded {
  font-size: 14px;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20;
}

.ss-page-title {
  font-size: 12px;
  color: var(--mid-grey);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-page-keyword {
  width: 100%;
  padding: 5px 9px !important;
  height: auto;
  line-height: normal;
  border: 1px solid var(--invert-1);
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
  transition: border-color 0.15s;
  box-sizing: border-box;
  font-weight: 500;
}

.ss-page-keyword.ss-keyword-suggested {
  color: var(--mid-grey);
  font-weight: 400;
}

.ss-page-keyword:focus {
  outline: none;
  border-color: var(--secondary);
}

/* Historic-keyword combobox */
.ss-keyword-combo {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
}
.ss-keyword-combo .ss-page-keyword {
  flex: 1 1 auto;
  padding-right: 36px !important;
}
.ss-keyword-toggle {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-left: 1px solid var(--invert-1);
  cursor: pointer;
  padding: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: background 0.15s;
}
.ss-keyword-toggle::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid var(--secondary);
  transition: border-color 0.15s;
}
.ss-keyword-toggle:hover {
  background: var(--secondary);
}
.ss-keyword-toggle:hover::after {
  border-top-color: #fff;
}
.ss-keyword-toggle .material-symbols-rounded {
  display: none;
}
.ss-keyword-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 2px;
  background: #fff;
  border: 1px solid var(--invert-1);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  padding: 4px;
}
.ss-keyword-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  color: var(--body);
}
.ss-keyword-option:hover {
  background: var(--invert-2);
}
.ss-keyword-option-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--invert-2);
  color: var(--body);
  flex-shrink: 0;
}
.ss-keyword-option-score[data-rating="green"] { background: #D4F1DE; color: #0F5132; }
.ss-keyword-option-score[data-rating="amber"] { background: #FFE8C2; color: #7A4E00; }
.ss-keyword-option-score[data-rating="red"] { background: #F8D0D0; color: #842029; }
.ss-keyword-option-kw {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.ss-keyword-option-date {
  color: var(--mid-grey);
  font-size: 11px;
  flex-shrink: 0;
}
.ss-keyword-shared-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--secondary);
  background: var(--invert-2);
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ss-page-score {
  text-align: center;
}

.ss-page-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  text-align: center;
}

.ss-page-score-badge[data-rating=""] {
  display: none;
}

.ss-page-score-badge[data-rating="green"] { background: #F0FDF4; color: #16A34A; border: 1px solid #16A34A; }
.ss-page-score-badge[data-rating="amber"] { background: #FFFBEB; color: #D97706; border: 1px solid #D97706; }
.ss-page-score-badge[data-rating="red"] { background: #FEF2F2; color: #DC2626; border: 1px solid #DC2626; }

.ss-page-score-link {
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ss-page-score-link:hover {
  background: var(--secondary) !important;
  color: #fff !important;
  border-color: var(--secondary) !important;
}

.ss-page-date {
  font-size: 12px;
  color: var(--mid-grey);
  white-space: nowrap;
}
.ss-page-date-link {
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}
.ss-page-date-link:hover {
  color: var(--secondary);
}

.ss-page-flags {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

.ss-page-flag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 7px;
  border-radius: 3px;
  cursor: help;
  white-space: nowrap;
}

.ss-page-flag--orphan { color: #fff; background: #D97706; }
.ss-page-flag--unlisted { color: #fff; background: #DC2626; }
.ss-page-flag--redirect { color: #fff; background: #6B7280; }

/* Warnings banner */
.ss-warnings {
  padding: 12px 16px;
  background: #FFFBEB;
  border-top: 1px solid #FDE68A;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #92400E;
}

.ss-warning-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ss-warning-item .material-symbols-rounded {
  font-size: 16px;
  color: #D97706;
}

/* Explainer card */
.ss-scan-running-banner {
  max-width: 1200px;
  margin: 0 auto 12px;
  padding: 12px 16px;
  background: var(--green-bg);
  border: 1px solid var(--green);
  border-radius: 8px;
  font-size: 13px;
  color: var(--body);
  line-height: 1.5;
}
.ss-cap-banner {
  max-width: 1200px;
  margin: 0 auto 12px;
  padding: 12px 16px;
  background: var(--amber-bg);
  border: 1px solid var(--amber);
  border-radius: 8px;
  font-size: 13px;
  color: var(--body);
  line-height: 1.5;
}
.ss-explainer {
  max-width: 1200px;
  margin: 0 auto 16px;
  padding: 20px 24px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.6;
  color: var(--body);
  position: relative;
}

.ss-explainer p {
  margin: 0 0 12px;
}

.ss-explainer strong {
  font-weight: 600;
}

.ss-explainer-title {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--body);
  margin: 0 0 12px;
}

.ss-explainer-note {
  background: rgba(217, 119, 6, 0.06);
  border-left: 3px solid var(--amber);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
}

.ss-explainer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.ss-explainer-action {
  background: #fff;
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 14px 16px;
}

.ss-explainer-action h4 {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ss-explainer-action h4 .material-symbols-rounded {
  font-size: 18px;
  font-variation-settings: 'FILL' 1;
  color: var(--primary);
}

.ss-explainer-action p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--mid-grey);
}

.region-explainer p { margin: 0; padding-right: 24px; }
.region-explainer a { color: var(--secondary); font-weight: 500; }

.ss-explainer-dismiss {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--body);
  font-size: 28px;
  cursor: pointer;
  padding: 2px 8px;
  line-height: 1;
  transition: color 0.15s;
}

.ss-explainer-dismiss:hover {
  color: #DC2626;
}

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

p.ss-explainer-tip {
  font-size: 13px;
  color: var(--body);
  margin: 20px 0 0;
  padding: 10px 14px;
  background: rgba(2, 96, 92, 0.06);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
}

/* Budget calculator */
.ss-budget {
  position: fixed;
  bottom: 44px;
  left: 0;
  right: 0;
  z-index: 90;
  background: #fff;
  border-top: 1px solid var(--invert-1);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.ss-budget-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.ss-budget-selected {
  font-weight: 600;
  color: var(--primary);
  font-size: 14px;
}

.ss-budget-breakdown {
  color: var(--mid-grey);
  font-size: 14px;
}

.ss-budget-balance {
  color: var(--mid-grey);
  font-size: 13px;
  margin-left: auto;
}

.ss-budget-buttons {
  display: flex;
  gap: 8px;
}

.ss-scan-btn,
.ss-summary-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 20px;
  font-size: 14px;
  white-space: nowrap;
}

.ss-scan-btn .material-symbols-rounded,
.ss-summary-btn .material-symbols-rounded {
  font-size: 20px;
  font-variation-settings: 'FILL' 1;
}

.ss-scan-btn:disabled,
.ss-summary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Site Health tab */
.ss-health-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 120px;
}

/* Reports tab */
.ss-reports-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 16px;
  color: var(--mid-grey);
  text-align: center;
  font-size: 14px;
}

.ss-reports-empty p {
  margin: 0;
}

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

/* Report cards - clickable, sidebar gauge layout */
.ss-report-card {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: #fff;
  border: 1px solid var(--invert-2);
  border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
  overflow: hidden;
}
.ss-report-card:hover {
  border-color: var(--tertiary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  background: var(--invert-2);
}
.ss-report-card:hover .ss-report-card-label {
  color: var(--secondary);
}

/* Left - main gauge */
.ss-report-card > .ss-report-main-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 16px 18px;
}
.ss-report-main-label {
  font-size: 11px;
  color: var(--mid-grey);
  font-weight: 500;
}

/* Right body - title + mini gauges */
.ss-report-card-body {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ss-report-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.ss-report-card-left {
  flex: 1;
  min-width: 0;
}
.ss-report-card-label {
  font-weight: 600;
  font-size: 15px;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}
.ss-report-card-meta {
  font-size: 12px;
  color: var(--mid-grey);
  margin-top: 2px;
}
.ss-report-card-actions {
  flex-shrink: 0;
}

/* Stats row: mini gauges + distribution chart */
.ss-report-card-stats {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.ss-report-card-stats > .ss-report-stat-block + .ss-report-stat-block {
  border-left: 1px solid var(--invert-2);
  margin-left: 16px;
  padding-left: 16px;
}

/* Mini gauges */
.ss-report-mini-gauges {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  flex-wrap: wrap;
}
.ss-report-mini-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.ss-report-mini-label {
  font-size: 10.5px;
  color: var(--mid-grey);
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ss-report-mini-label .info-btn {
  width: 14px;
  height: 14px;
  font-size: 9px;
}
/* Distribution chart (compact) */
.ss-report-dist {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-shrink: 0;
}
.ss-report-dist-bar {
  text-align: center;
  min-width: 32px;
}
.ss-report-dist-fill {
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  margin-bottom: 4px;
}
.ss-report-dist--green { background: var(--green); }
.ss-report-dist--amber { background: var(--amber); }
.ss-report-dist--red { background: var(--red); }
.ss-report-dist-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--body-color);
  line-height: 1.1;
}
.ss-report-dist-label {
  font-size: 10px;
  color: var(--mid-grey);
}

/* Stat blocks (distribution, improvement, freshness) */
.ss-report-stat-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}
.ss-report-stat-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--body-color);
  margin-bottom: 8px;
  white-space: nowrap;
  width: 100%;
}
.ss-report-stat-heading .material-symbols-rounded {
  font-size: 16px;
  font-variation-settings: 'FILL' 1;
}
.ss-report-stat-row {
  display: flex;
  gap: 8px;
}
.ss-report-stat-item {
  text-align: center;
}
.ss-report-stat-num {
  font-size: 28px;
  font-weight: 600;
  color: var(--body-color);
  line-height: 1.1;
}
.ss-report-stat-label {
  font-size: 11px;
  color: var(--mid-grey);
  margin-top: 2px;
}

.ss-report-card:hover .info-btn {
  background: var(--primary);
}
.ss-report-card:hover .info-btn span {
  color: #fff;
}
.ss-report-card:hover .info-btn:hover {
  background: var(--secondary);
}

.ss-report-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--mid-grey);
  font-size: 13px;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
}
.ss-report-delete .material-symbols-rounded {
  font-size: 20px;
}
.ss-report-delete:hover,
.ss-report-delete[data-confirm="true"] {
  color: #DC2626;
}

/* Hero card on full report page */
.exec-hero-card {
  margin-bottom: -4px;
  border-color: var(--invert-1);
  cursor: default;
}
.exec-hero-card:hover {
  background: #fff;
  border-color: var(--invert-1);
  box-shadow: none;
}
.exec-hero-meta {
  font-size: 18px;
  font-weight: 600;
  color: var(--body-color);
  line-height: 1.4;
}

.batch-confirm-label-wrap {
  margin: 0 0 16px;
}
.batch-confirm-label-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--mid-grey);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  text-align: center;
}
.batch-confirm-label-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 400;
  text-align: center;
  border: 1.5px solid var(--tertiary);
  border-radius: 8px;
  background: #fff !important;
  color: var(--body);
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s;
}
.batch-confirm-label-input:focus {
  outline: none;
  border-color: var(--secondary);
}
.batch-confirm-label-input.batch-label-edited {
  background: var(--invert-2) !important;
  font-weight: 500;
}

.ss-health-section {
  border: 1px solid var(--invert-1);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.ss-health-heading {
  padding: 12px 16px;
  background: var(--invert-2);
  border-bottom: 1px solid var(--invert-1);
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ss-health-heading .material-symbols-rounded {
  font-size: 18px;
  font-variation-settings: 'FILL' 1;
}

.ss-health-heading .ss-health-info {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.ss-health-heading .ss-health-info span {
  color: #fff;
}

.ss-health-count {
  background: var(--secondary);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  color: #fff;
  min-width: 24px;
  text-align: center;
}

.ss-health-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--invert-2);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ss-health-item:last-child {
  border-bottom: none;
}

.ss-health-url {
  color: var(--body);
  flex: 1;
  overflow: hidden;
  word-break: normal;
}

.ss-health-status {
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
}

.ss-health-status--redirect { background: #F3F4F6; color: #6B7280; }
.ss-health-status--broken { background: #FEF2F2; color: #DC2626; }
.ss-health-status--warning { background: #FFFBEB; color: #D97706; }

.ss-health-empty {
  padding: 32px;
  text-align: center;
  color: var(--mid-grey);
  font-size: 14px;
}

/* ---- Domain Intel Panel ---- */

.ss-domain-intel {
  margin-bottom: 20px;
}

.ss-intel-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ss-intel-loading {
  width: 100%;
  text-align: center;
  padding: 16px;
  color: #7D8284;
  font-size: 13px;
}

.ss-intel-gate, .ss-keywords-loading .ss-gate-scan-btn {
  text-align: center;
  padding: 32px 16px;
}
.ss-intel-gate p { margin: 8px 0; }
.ss-gate-scan-btn {
  margin-top: 16px;
  display: inline-block;
  padding: 10px 24px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
}

.ss-intel-card {
  flex: 1 1 0;
  min-width: 120px;
  background: #fff;
  border: 1px solid var(--invert-1);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  position: relative;
}

.ss-intel-card .info-btn {
  position: absolute;
  top: 6px;
  right: 6px;
}

.ss-intel-card-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.2;
}

.ss-intel-card-label {
  font-size: 12px;
  color: var(--mid-grey);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ss-intel-card-sub {
  font-size: 12px;
  color: var(--body-color);
  margin-top: 6px;
}

.ss-intel-anchors {
  flex: 0 0 100%;
  background: #fff;
  border: 1px solid var(--invert-1);
  border-radius: 10px;
  padding: 16px;
}

.ss-intel-anchors-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--body-color);
  margin-bottom: 10px;
}

.ss-intel-anchor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ss-intel-anchor {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--invert-2);
  border-radius: 12px;
  font-size: 12px;
  color: var(--body-color);
}

.ss-intel-anchor-count {
  font-size: 11px;
  color: var(--secondary);
  font-weight: 600;
}

/* ---- Batch Progress ---- */

.ss-batch-progress {
  padding: 0 0 24px;
}

.ss-batch-heading {
  font-size: 18px;
  font-weight: 600;
  color: var(--body);
  margin: 0 0 16px;
}

.ss-progress-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 0 4px;
}

.ss-progress-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--invert-2);
  border-radius: 4px;
  overflow: hidden;
}

.ss-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.ss-progress-text {
  font-size: 14px;
  color: var(--mid-grey);
  white-space: nowrap;
  min-width: 120px;
  text-align: right;
}

.ss-batch-pages {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ss-batch-page {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
}

.ss-batch-page:hover {
  background: var(--invert-2);
}

.ss-batch-page-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ss-batch-page-icon .material-symbols-rounded {
  font-size: 20px;
}

.ss-batch-page--queued .ss-batch-page-icon { color: var(--mid-grey); }
.ss-batch-page--scanning .ss-batch-page-icon { color: var(--primary); }
.ss-batch-page--complete .ss-batch-page-icon { color: #16A34A; }
.ss-batch-page--failed .ss-batch-page-icon { color: #DC2626; }

.ss-batch-page-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--body-color);
}

.ss-batch-page-score {
  font-weight: 600;
  font-size: 13px;
  padding: 2px 10px;
  border-radius: 10px;
  min-width: 36px;
  text-align: center;
}

.ss-batch-page-score[data-rating="green"] { background: #F0FDF4; color: #16A34A; }
.ss-batch-page-score[data-rating="amber"] { background: #FFFBEB; color: #D97706; }
.ss-batch-page-score[data-rating="red"] { background: #FEF2F2; color: #DC2626; }

.ss-batch-page-keyword {
  font-size: 13px;
  color: var(--mid-grey);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.ss-batch-page--scanning .ss-batch-page-icon .material-symbols-rounded {
  animation: spin-batch 1.2s linear infinite;
}

.ss-batch-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 20px 0 0;
}

/* ============ Executive Summary ============ */

.exec-summary {
  margin-top: calc(var(--top-bar-height) + 64px);
  padding: 24px 24px 80px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeIn 0.3s ease;
}

.exec-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.exec-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 22px;
  color: var(--primary);
  flex: 1;
}

.exec-loading {
  text-align: center;
  padding: 60px 0;
  color: var(--mid-grey);
}

.exec-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Score overview cards */
.exec-overview {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  align-items: center;
}

.exec-score-ring {
  text-align: center;
}

.exec-score-big {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
}

.exec-score-big[data-rating="green"] { color: #16A34A; }
.exec-score-big[data-rating="amber"] { color: #D97706; }
.exec-score-big[data-rating="red"] { color: #DC2626; }

.exec-score-label {
  font-size: 14px;
  color: var(--mid-grey);
  margin-top: 4px;
}

.exec-dist {
  display: flex;
  gap: 16px;
  align-items: end;
}

.exec-dist-bar {
  flex: 1;
  text-align: center;
}

.exec-dist-fill {
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  margin-bottom: 6px;
}

.exec-dist-fill--green { background: #16A34A; }
.exec-dist-fill--amber { background: #D97706; }
.exec-dist-fill--red { background: #DC2626; }

.exec-dist-count {
  font-size: 20px;
  font-weight: 600;
  color: var(--body-color);
}

.exec-dist-label {
  font-size: 12px;
  color: var(--mid-grey);
}

/* Section averages radar */
.exec-section-avgs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.exec-sec-card {
  text-align: center;
  padding: 12px 8px;
  background: #fff;
  border: 1px solid var(--invert-1);
  border-radius: 8px;
}

.exec-sec-score {
  font-size: 28px;
  font-weight: 600;
}

.exec-sec-score[data-rating="green"] { color: #16A34A; }
.exec-sec-score[data-rating="amber"] { color: #D97706; }
.exec-sec-score[data-rating="red"] { color: #DC2626; }

.exec-sec-label {
  font-size: 12px;
  color: var(--mid-grey);
  margin-top: 2px;
}

/* Generic exec section */
.exec-section {
  background: #fff;
  border: 1px solid var(--invert-1);
  border-radius: 10px;
  padding: 20px;
}

/* Exec summary scroll nav - no overrides needed, uses .section-nav as-is */

/* Portfolio chart label */
.exec-portfolio-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--mid-grey);
  margin-bottom: 2px;
  padding-left: 4px;
}

.exec-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--body-color);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.exec-section-title .material-symbols-rounded {
  font-size: 20px;
  color: var(--primary);
}

/* Page list rows (top 5, bottom 5) */
.exec-page-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--invert-2);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}
.exec-page-row:nth-child(even) { background: var(--bg); }
.exec-page-row:hover { background: var(--invert-2); }
.exec-page-row:last-child { border-bottom: none; }

.exec-page-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 600;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  flex-shrink: 0;
}

.exec-page-score[data-rating="green"] { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.exec-page-score[data-rating="amber"] { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber); }
.exec-page-score[data-rating="red"] { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }

.exec-page-url {
  flex: 1;
  font-size: 14px;
  color: var(--secondary);
  font-weight: 500;
  word-break: normal;
  overflow-wrap: break-word;
}

.exec-page-kw {
  font-size: 13px;
  color: var(--body-color);
  max-width: 300px;
  word-break: normal;
  overflow-wrap: break-word;
}

.exec-page-commentary {
  font-size: 13px;
  color: var(--mid-grey);
  line-height: 1.5;
  padding: 4px 12px 10px 44px;
  margin-top: -2px;
}
.exec-page-commentary-fix {
  color: var(--body-color);
}

/* Heatmap */
.exec-categories {
  overflow-x: auto;
}

.exec-categories table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.exec-categories th {
  text-align: center;
  font-weight: 500;
  color: var(--mid-grey);
  padding: 6px 8px;
  font-size: 11px;
  text-transform: uppercase;
}

.exec-categories td {
  text-align: center;
  padding: 6px 8px;
  border-bottom: 1px solid var(--invert-2);
}
.exec-categories tbody tr:nth-child(even) { background: var(--bg); }
.exec-categories tbody tr:hover { background: var(--invert-2); cursor: pointer; }

.exec-categories td:first-child {
  text-align: left;
  max-width: 250px;
  word-break: normal;
  overflow-wrap: break-word;
  color: var(--secondary);
  font-weight: 500;
}

.exec-cat-page {
  line-height: 1.4;
}

.exec-cat-meta {
  font-size: 13px;
  color: var(--mid-grey);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.exec-cat-date {
  font-weight: 500;
}

.exec-cat-kw {
  color: var(--body-color);
}

.exec-cat-sep {
  color: var(--invert-1);
}

.exec-cat-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
}

.exec-cat-cell[data-rating="green"] { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.exec-cat-cell[data-rating="amber"] { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber); }
.exec-cat-cell[data-rating="red"] { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }
.exec-cat-cell[data-rating=""] { background: var(--invert-2); color: var(--mid-grey); }

/* Issues list */
.exec-issue-group {
  margin-bottom: 16px;
}
.exec-issue-group:last-child { margin-bottom: 0; }

.exec-issue-group-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--mid-grey);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--invert-2);
}

.exec-issue-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--invert-2);
}

.exec-issue-row:last-child { border-bottom: none; }

.exec-issue-count {
  font-weight: 600;
  font-size: 13px;
  min-width: 50px;
}
.exec-issue-count[data-rating="red"] { color: var(--red); }
.exec-issue-count[data-rating="amber"] { color: var(--amber); }

.exec-issue-text {
  flex: 1;
  color: var(--body-color);
}

/* AI Citation - engine breakdown chips */
.exec-engine-breakdown {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0 4px;
  max-width: 280px;
}
.exec-engine-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 6px;
  background: var(--secondary);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  border: none;
  line-height: 1.4;
}
.exec-engine-chip:hover {
  background: var(--primary);
}
.exec-engine-chip.exec-engine-inactive {
  background: var(--invert-2);
  opacity: 0.7;
}
.exec-engine-chip.exec-engine-inactive:hover {
  opacity: 1;
}
.exec-engine-chip.exec-engine-inactive .exec-engine-name {
  color: var(--body-copy);
}
.exec-engine-chip.exec-engine-inactive .exec-engine-count {
  color: var(--mid-grey);
}
.exec-engine-name {
  font-weight: 600;
  color: #fff;
}
.exec-engine-count {
  color: rgba(255,255,255,0.8);
}

/* Citation History - Header layout (stats + chart side by side) */
.exec-citation-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.exec-citation-stats-col {
  flex: 0 0 auto;
  min-width: 200px;
}
.exec-citation-chart-col {
  flex: 1 1 0;
  min-width: 200px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 4px 0;
  background: var(--surface);
}
.exec-citation-chart-col svg {
  display: block;
}

/* Citation Table - matches categories breakdown style */
.exec-citation-table {
  overflow-x: auto;
  margin-top: 12px;
}
.exec-citation-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.exec-citation-table th {
  text-align: center;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--mid-grey);
  padding: 8px 8px;
  border-bottom: 2px solid var(--invert-2);
  white-space: nowrap;
}
.exec-citation-table td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--invert-2);
  vertical-align: middle;
}
.exec-citation-table tbody tr:hover:not(.exec-citation-detail-row) { background: var(--invert-2); cursor: pointer; }

/* Page column - wide, wrapping like categories */
.exec-cite-page-col {
  text-align: left !important;
  word-break: normal;
  overflow-wrap: break-word;
}
.exec-citation-page {
  display: flex;
  align-items: center;
  gap: 8px;
}
.exec-cite-page-text {
  color: var(--secondary);
  font-weight: 500;
  line-height: 1.4;
}
.exec-citation-kw {
  color: var(--mid-grey);
  font-size: 12px;
  font-weight: 400;
  margin-top: 2px;
}

/* Compact engine columns */
.exec-eng-col {
  text-align: center;
  padding: 6px 6px;
  white-space: nowrap;
  min-width: 52px;
}

/* Disclosure triangle - solid CSS triangle matching metrics-disclosure */
.exec-cite-triangle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.exec-cite-triangle::before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--secondary);
}
.exec-cite-triangle:hover::before {
  border-left-color: var(--primary);
}
.exec-cite-triangle-open {
  transform: rotate(90deg);
}
.exec-cite-triangle-spacer {
  display: inline-block;
  width: 20px;
  flex-shrink: 0;
}

/* Trend cell with mini sparkline */
.exec-citation-trend-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.exec-citation-mini-spark {
  width: 64px;
  height: 20px;
  flex-shrink: 0;
}
.exec-citation-mini-spark svg {
  display: block;
}

/* Trend icons */
.exec-trend-icon {
  font-size: 18px;
}
.exec-trend-up { color: var(--green); }
.exec-trend-down { color: var(--red); }
.exec-trend-flat { color: var(--mid-grey); }

/* Change labels in engine columns */
.exec-cite-change {
  font-size: 10px;
  display: block;
  line-height: 1;
  margin-top: 1px;
}
.exec-cite-gained { color: var(--green); }
.exec-cite-lost { color: var(--red); }

/* Expanded citation detail row - hidden by default, shown via class */
.exec-citation-detail-row {
  display: none;
}
.exec-citation-detail-row.exec-citation-detail-open {
  display: table-row;
}
.exec-citation-detail-row td {
  padding: 0 !important;
  border-bottom: 1px solid var(--invert-2);
}
.exec-citation-expanded {
  padding: 12px 16px 16px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.exec-citation-expanded-chart {
  margin-bottom: 8px;
}
.exec-citation-expanded-chart svg {
  display: block;
}
.exec-citation-expanded-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.exec-citation-stat {
  font-size: 12px;
  color: var(--mid-grey);
  background: var(--surface);
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.exec-trend-label {
  font-weight: 600;
  text-transform: capitalize;
}
.exec-trend-label--improving { color: var(--green); border-color: var(--green-border); background: var(--green-bg); }
.exec-trend-label--declining { color: var(--red); border-color: var(--red-border); background: var(--red-bg); }
.exec-trend-label--stable { color: var(--mid-grey); }

/* Expanded legend */
.exec-citation-expanded-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.exec-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--mid-grey);
}
.exec-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

/* Strategic Recommendations */
.exec-recs-list {
  margin: 8px 0 0;
  padding-left: 24px;
}
.exec-rec-item {
  margin-bottom: 16px;
}
.exec-rec-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.exec-rec-priority {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-transform: capitalize;
  line-height: 1.5;
  flex-shrink: 0;
}
.exec-rec-priority--high { background: var(--red); }
.exec-rec-priority--medium { background: var(--amber); }
.exec-rec-priority--low { background: var(--mid-grey); }
.exec-rec-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--body-copy);
}
.exec-rec-detail {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--mid-grey);
  line-height: 1.5;
}

/* Keyword Opportunities table */
.exec-gaps-table {
  overflow-x: auto;
  margin-top: 8px;
}
.exec-gaps-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.exec-gaps-table th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--mid-grey);
  padding: 8px 12px;
  border-bottom: 2px solid var(--invert-2);
}
.exec-gaps-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--invert-2);
  vertical-align: middle;
}
.exec-gaps-table tr:last-child td { border-bottom: none; }
.exec-gaps-table tr:hover { background: var(--invert-2); }
.exec-gap-onpage {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.exec-gap-onpage[data-found="green"] { background: var(--green-bg); color: var(--green); }
.exec-gap-onpage[data-found="red"] { background: var(--red-bg); color: var(--red); }

.exec-gap-row:hover {
  background: var(--invert-2);
}
.exec-source-popover {
  display: none;
  position: absolute;
  right: 8px;
  top: 100%;
  z-index: 20;
  background: #fff;
  border: 1px solid var(--invert-2);
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-width: 340px;
}
.exec-source-popover.exec-source-open {
  display: block;
}
.exec-source-popover-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mid-grey);
  margin-bottom: 6px;
}
.exec-source-popover ul {
  list-style: disc;
  margin: 0;
  padding: 0 0 0 18px;
}
.exec-source-popover li {
  padding: 3px 0;
}
.exec-source-link {
  color: var(--secondary);
  text-decoration: none;
  font-size: 12px;
  word-break: break-all;
}
.exec-source-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Cannibalization */
.exec-section-desc {
  font-size: 13px;
  color: var(--mid-grey);
  margin: -4px 0 16px;
  line-height: 1.5;
}
.exec-cannibal-item {
  margin-bottom: 16px;
  border: 1px solid var(--invert-2);
  border-radius: 8px;
  padding: 12px 16px;
}
.exec-cannibal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.exec-cannibal-kw {
  font-weight: 600;
  font-size: 14px;
  color: var(--body-color);
}
.exec-cannibal-count {
  font-size: 12px;
  color: var(--mid-grey);
}
.exec-cannibal-severity {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: auto;
}
.exec-cannibal-mild { background: var(--amber); color: #fff; }
.exec-cannibal-moderate { background: var(--amber); color: #fff; }
.exec-cannibal-serious { background: var(--red); color: #fff; }
.exec-cannibal-urls {
  font-size: 13px;
  color: var(--mid-grey);
}
.exec-cannibal-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--invert-2);
}
.exec-cannibal-url-row:last-child { border-bottom: none; }
.exec-cannibal-url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exec-cannibal-url-row .exec-page-score {
  flex-shrink: 0;
}
.exec-cannibal-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--green-bg, #e8f5e9);
  color: var(--green-text, #2e7d32);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.exec-cannibal-winner .exec-cannibal-url {
  color: var(--body-color);
  font-weight: 500;
}

/* Improvement */
.exec-delta {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 72px;
  font-size: 22px;
}
.exec-delta .material-symbols-rounded { font-size: 22px; }

.exec-delta--up { color: #16A34A; }
.exec-delta--down { color: #DC2626; }
.exec-delta--neutral { color: var(--mid-grey); }

.exec-imp-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.exec-imp-stats-col {
  flex: 0 0 auto;
  min-width: 200px;
}
.exec-imp-chart-col {
  flex: 1 1 0;
  min-width: 200px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 4px 0;
  background: var(--surface);
}
.exec-imp-chart-col svg {
  display: block;
}

.exec-improvement-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  margin-bottom: 0;
}

.exec-imp-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.exec-imp-num {
  font-size: 24px;
  font-weight: 600;
}
.exec-imp-num--up { color: #16A34A; }
.exec-imp-num--down { color: #DC2626; }
.exec-imp-num--neutral { color: var(--mid-grey); }

.exec-imp-label {
  font-size: 12px;
  color: var(--mid-grey);
}

.exec-imp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--invert-2);
}
.exec-imp-row:last-child { border-bottom: none; }
.exec-imp-row:nth-child(even) { background: var(--bg); }

.exec-imp-url {
  flex: 1;
  font-size: 13px;
  color: var(--secondary);
  font-weight: 500;
  overflow: hidden;
  min-width: 0;
}

.exec-imp-kw {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--mid-grey);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exec-imp-scores {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.exec-imp-date {
  font-size: 12px;
  color: var(--mid-grey);
}

.exec-imp-arrow {
  font-size: 14px;
  color: var(--mid-grey);
}

/* Freshness badges (heatmap column) */
.exec-fresh-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.exec-fresh-badge--fresh { background: var(--green-bg); color: var(--green); }
.exec-fresh-badge--recent { background: var(--amber-bg); color: var(--amber); }
.exec-fresh-badge--stale { background: var(--red-bg); color: var(--red); }
.exec-fresh-badge--none { color: var(--mid-grey); }

/* Freshness summary stats */
.exec-freshness {
  display: flex;
  gap: 20px;
}

.exec-fresh-item {
  text-align: center;
}

.exec-fresh-count {
  font-size: 24px;
  font-weight: 600;
}

.exec-fresh-label {
  font-size: 12px;
  color: var(--mid-grey);
}

/* Tech health cards */
.exec-tech-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.exec-tech-card {
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  background: var(--invert-2);
}

.exec-tech-count {
  font-size: 24px;
  font-weight: 600;
}

.exec-tech-count--ok { color: #16A34A; }
.exec-tech-count--warn { color: #D97706; }
.exec-tech-count--error { color: #DC2626; }

.exec-tech-label {
  font-size: 12px;
  color: var(--mid-grey);
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.ss-health-summary {
  margin-bottom: 20px;
}

.ss-health-summary .exec-tech-label {
  color: var(--body-color);
}

.ss-health-card-nav {
  cursor: pointer;
  transition: background 0.15s ease;
}

.ss-health-card-nav:hover {
  background: var(--invert-1);
}

.exec-tech-card {
  position: relative;
}

.ss-health-summary-tip {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 16px;
  height: 16px;
  font-size: 10px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.ss-health-summary-tip span {
  color: #fff;
}

.ss-health-summary-tip:hover {
  background: var(--secondary);
}

.ss-health-heading .ss-health-info:hover {
  background: var(--secondary);
  border-color: var(--secondary);
}

.ss-health-link {
  color: var(--primary);
  text-decoration: none;
}

.ss-health-link:hover {
  color: var(--secondary);
  text-decoration: underline;
}

@media (max-width: 1200px) {
  /* Hide distribution stat block on tablet - frees space for gauges to fit */
  .ss-report-stat-dist { display: none; }
  .exec-dist { display: none; }
  /* Shrink main gauge and tighten spacing so remaining blocks fit */
  .ss-report-card > .ss-report-main-gauge { padding: 14px 14px; }
  .ss-report-card > .ss-report-main-gauge svg { width: 100px; height: 100px; }
  .ss-report-mini-gauges { gap: 18px; }
  .ss-report-card-stats > .ss-report-stat-block + .ss-report-stat-block {
    margin-left: 12px;
    padding-left: 12px;
  }
  .ss-report-card-body { padding: 14px 14px; gap: 11px; }
}

@media (max-width: 768px) {
  .exec-overview { grid-template-columns: 1fr; }
  .exec-section-avgs { grid-template-columns: repeat(3, 1fr); }
}

/* ============ Transactions Page ============ */

.transactions-page {
  margin-top: var(--top-bar-height);
  padding: 32px 24px 80px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeIn 0.3s ease;
}

.transactions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.transactions-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 22px;
  color: var(--primary);
}

.transactions-balance {
  display: flex;
  align-items: center;
  gap: 8px;
}

.transactions-balance-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mid-grey);
}

.transactions-balance-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.transactions-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.transactions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.transactions-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mid-grey);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.transactions-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--invert-2);
  vertical-align: middle;
}

.transactions-table tbody tr:nth-child(even) {
  background: var(--bg);
}

.transactions-table tbody tr:hover {
  background: var(--invert-2);
}

.tx-col-amount {
  text-align: right;
}

.tx-date {
  white-space: nowrap;
  color: var(--mid-grey);
  font-size: 13px;
}

.tx-date-day {
  display: block;
}

.tx-date-time {
  display: block;
  font-size: 11px;
  color: var(--invert-1);
}

.tx-desc {
  color: var(--body-color);
  font-weight: 500;
}

.tx-amount {
  text-align: right;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}

.tx-amount.positive { color: var(--green); }
.tx-amount.negative { color: var(--red); }
.tx-amount.neutral { color: var(--mid-grey); }

.tx-col-balance,
.tx-col-amount { text-align: right; }
.tx-balance {
  text-align: right;
  font-weight: 600;
  font-size: 13px;
  color: var(--mid-grey);
  white-space: nowrap;
}

.tx-type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--invert-2);
  color: var(--mid-grey);
}

.tx-type-purchase { background: var(--green-bg); color: var(--green); }
.tx-type-trial { background: var(--green-bg); color: var(--green); }
.tx-type-refund { background: var(--amber-bg); color: var(--amber); }
.tx-type-analysis { background: var(--invert-2); color: var(--body-color); }
.tx-type-tier_change { background: var(--amber-bg); color: var(--amber); }
.tx-type-adjustment { background: var(--amber-bg); color: var(--amber); }

.tx-desc-keyword {
  display: block;
  font-weight: 600;
  color: var(--body-color);
}

.tx-desc-url {
  display: block;
  font-size: 12px;
  color: var(--mid-grey);
  word-break: break-all;
  margin-top: 1px;
}

.tx-type-refresh { background: rgba(42, 138, 129, 0.1); color: var(--secondary); }

.tx-row-linked {
  cursor: pointer;
  transition: background 0.1s;
}

.tx-row-linked:hover {
  background: var(--invert-2) !important;
}

.transactions-load-more {
  text-align: center;
  padding: 20px 0;
}

/* Profile "View all" pill */
.profile-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.profile-view-all {
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
  text-decoration: none;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--invert-2);
  border: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
}

.profile-view-all:hover {
  background: var(--secondary);
  color: #fff;
}

@media (max-width: 640px) {
  .transactions-page {
    padding: 20px 12px 80px;
    margin-top: 200px;
  }
  .transactions-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .tx-col-type {
    display: none;
  }
}

/* ============ Dashboard ============ */

.dashboard {
  margin-top: var(--top-bar-height);
  padding: 32px 24px 80px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeIn 0.3s ease;
}

.dashboard-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}
.dash-add-domain-btn { flex-shrink: 0; }
.dashboard-search { margin-left: auto; }

.dashboard-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 22px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-search {
  flex: 1;
  max-width: 500px;
  font-size: 14px !important;
  padding: 8px 12px !important;
}

.dashboard-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.dashboard-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mid-grey);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.dashboard-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--invert-2);
  vertical-align: middle;
}

.dashboard-table tbody tr:nth-child(even) {
  background: var(--bg);
}

.dashboard-table tbody tr:hover {
  background: var(--invert-2);
}

.dashboard-table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}

.dash-col-url {
  min-width: 100px;
}

.dash-col-keyword {
  min-width: 200px;
}

.dash-url {
  color: var(--secondary);
  font-weight: 500;
  word-break: normal;
  overflow-wrap: break-word;
  text-decoration: none;
}

.dash-keyword {
  font-weight: 500;
  color: var(--body-color);
}

.dash-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  text-align: center;
}

.dash-score-badge[data-rating="green"] { background: #F0FDF4; color: #16A34A; border: 1px solid #16A34A; }
.dash-score-badge[data-rating="amber"] { background: #FFFBEB; color: #D97706; border: 1px solid #D97706; }
.dash-score-badge[data-rating="red"] { background: #FEF2F2; color: #DC2626; border: 1px solid #DC2626; }

.dash-delta {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.dash-delta-up { color: var(--green); }
.dash-delta-down { color: var(--red); }
.dash-delta-neutral { color: var(--mid-grey); }

.dash-scans {
  color: var(--mid-grey);
  text-align: center;
}

.dash-date {
  color: var(--mid-grey);
  font-size: 13px;
  white-space: nowrap;
}

.dash-rescan-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.dash-rescan-btn:hover {
  background: var(--secondary);
}

.dash-rescan-btn .material-symbols-rounded {
  font-size: 14px;
  font-variation-settings: 'FILL' 1;
}

.dash-col-score,
.dash-col-delta,
.dash-col-scans {
  text-align: center;
}

td.dash-col-actions,
th.dash-col-actions-hdr {
  text-align: center;
  white-space: nowrap;
  width: 1%;
  padding-left: 8px;
  padding-right: 12px;
}

td.dash-col-actions .dash-pill {
  margin-left: 6px;
}

.dash-col-date {
  width: 1%;
  white-space: nowrap;
}

.dash-col-credits {
  width: 1%;
  white-space: nowrap;
}

.dash-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.dash-pill .material-symbols-rounded {
  font-size: 20px;
}

.dash-pill:hover {
  background: var(--secondary);
  transform: translateY(-1px);
}

/* Pro dashboard: domain grouping */
.dash-col-domain {
  min-width: 200px;
}

.dash-col-pages {
  text-align: center;
  width: 80px;
}

.dash-col-domain ~ .dash-col-score,
.dash-col-domain ~ .dash-col-delta,
.dash-col-domain ~ .dash-col-credits {
  text-align: right;
}

.dash-col-credits {
  text-align: center;
  width: 80px;
}

.dash-credits {
  font-weight: 500;
  color: var(--mid-grey);
}

.dashboard-table-wrap {
  transition: opacity 0.15s ease;
}

.dash-domain-name {
  font-weight: 600;
  color: var(--secondary);
}

.dash-page-count {
  font-weight: 500;
}

.dash-breadcrumb-root {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.dash-breadcrumb-root:hover {
  opacity: 1;
}

.dash-breadcrumb-sep {
  opacity: 0.35;
  margin: 0 8px;
  font-weight: 300;
}

.dash-breadcrumb-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  margin-left: 12px;
  padding: 2px 6px;
  color: var(--mid-grey);
  vertical-align: middle;
  transition: all 0.15s;
}

.dash-breadcrumb-close:hover {
  background: var(--invert-2);
  color: var(--text);
}

.dash-breadcrumb-close .material-symbols-rounded {
  font-size: 16px;
  vertical-align: middle;
  font-variation-settings: 'FILL' 1;
}

.dash-col-num {
  width: 36px;
  text-align: center;
  color: var(--mid-grey);
  font-size: 13px;
}

.dash-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  padding: 0 0 4px;
}

.dash-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.dash-page-btn:hover:not(:disabled) {
  background: var(--secondary);
}

.dash-page-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.dash-page-btn .material-symbols-rounded {
  font-size: 20px;
  font-variation-settings: 'FILL' 1;
}

.dash-page-info {
  font-size: 13px;
  color: var(--mid-grey);
  min-width: 80px;
  text-align: center;
}

@media (max-width: 640px) {
  .dashboard {
    padding: 20px 12px 80px;
    margin-top: 200px;
  }
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .dashboard-search {
    max-width: 100%;
    width: 100%;
  }
  .dash-col-scans,
  .dash-col-delta {
    display: none;
  }
}

@media (max-width: 480px) {
  .credits-modal-card {
    margin: 16px;
    padding: 28px 20px 20px;
  }
}

/* ============ Action Plan ============ */

.action-plan {
  margin-top: var(--top-bar-height);
  padding: 32px 24px 80px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeIn 0.3s ease;
}

.action-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.action-plan-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 22px;
  color: var(--primary);
}

.action-plan-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.action-plan-toggle {
  display: flex;
  background: var(--invert-2);
  border-radius: 6px;
  padding: 2px;
}

.action-plan-toggle-btn {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--mid-grey);
  cursor: pointer;
  transition: all 0.15s;
}

.action-plan-toggle-btn.active {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.action-plan-progress {
  font-size: 13px;
  font-weight: 600;
  color: var(--mid-grey);
  white-space: nowrap;
}

/* Section groups */
.ap-section-group {
  margin-bottom: 24px;
}

.ap-section-heading {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--primary);
  margin: 0 0 6px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--invert-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ap-heading-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-left: auto;
  color: var(--mid-grey);
  background: var(--invert-2);
}

.ap-dim-group {
  margin: 0 0 14px 8px;
  padding-left: 12px;
  border-left: 2px solid var(--invert-2);
}

.ap-dim-heading {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--body-color);
  margin: 8px 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ap-heading-score[data-rating="red"] { color: var(--red); background: var(--red-bg); border: 1px solid var(--red); }
.ap-heading-score[data-rating="amber"] { color: var(--amber); background: var(--amber-bg); border: 1px solid var(--amber); }
.ap-heading-score[data-rating="green"] { color: var(--green); background: var(--green-bg); border: 1px solid var(--green); }

/* Priority view section tag */
.ap-section-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ap-section-tag[data-rating="green"] {
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid var(--green);
}
.ap-section-tag[data-rating="amber"] {
  color: var(--amber);
  background: var(--amber-bg);
  border: 1px solid var(--amber);
}
.ap-section-tag[data-rating="red"] {
  color: var(--red);
  background: var(--red-bg);
  border: 1px solid var(--red);
}

.ap-tag-score {
  font-size: 10px;
  opacity: 0.7;
}

/* Cards */
.ap-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.ap-card:hover {
  border-color: var(--secondary);
  background: var(--invert-2);
}

/* Section view: colour-coded left edge by dimension rating */
.ap-card[data-rating="red"] { border-left: 3px solid var(--red); }
.ap-card[data-rating="amber"] { border-left: 3px solid var(--amber); }
.ap-card[data-rating="green"] { border-left: 3px solid var(--green); }

/* Custom checkbox */
.ap-card-check {
  display: none;
}

.ap-card-checkbox {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  margin-top: 1px;
  transition: all 0.15s;
  position: relative;
}

.ap-card-check:checked ~ .ap-card-checkbox {
  background: var(--primary);
  border-color: var(--primary);
}

.ap-card-check:checked ~ .ap-card-checkbox::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.ap-card-check:checked ~ .ap-card-content {
  opacity: 0.45;
}

.ap-card-check:checked ~ .ap-card-content .ap-card-text {
  text-decoration: line-through;
}

.ap-card-content {
  flex: 1;
  min-width: 0;
  transition: opacity 0.15s;
}

.ap-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

/* Priority view: push badge to right of meta row */
.ap-meta-spacer {
  flex: 1;
}

/* Section view: badge above card */
.ap-card-wrap {
  position: relative;
}

.ap-card-flag {
  margin-bottom: 4px;
}

.ap-card-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--body-color);
  margin: 0;
}

/* Dimension badge */
.ap-dim-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ap-dim-badge[data-rating="green"] {
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid var(--green);
}
.ap-dim-badge[data-rating="amber"] {
  color: var(--amber);
  background: var(--amber-bg);
  border: 1px solid var(--amber);
}
.ap-dim-badge[data-rating="red"] {
  color: var(--red);
  background: var(--red-bg);
  border: 1px solid var(--red);
}

/* Status badges */
.ap-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 7px;
  border-radius: 3px;
}

.ap-badge-amber {
  color: #fff;
  background: var(--amber);
}

.ap-badge-blue {
  color: #fff;
  background: var(--secondary);
}

.ap-badge-green {
  color: #fff;
  background: var(--green);
}

/* Needs work card highlight */
.ap-status-needs-work {
  border-left: 3px solid var(--amber);
}

.ap-status-new {
  border-left: 3px solid var(--secondary);
}

/* Resolved section */
.action-plan-resolved {
  margin-top: 24px;
}

.action-plan-resolved-summary {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--mid-grey);
  cursor: pointer;
  padding: 8px 0;
}

.action-plan-resolved-body .ap-card {
  opacity: 0.6;
}

/* Footer buttons */
.footer-refresh-sitemap-btn,
.footer-download-pdfs-btn,
.footer-export-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.footer-download-pdfs-btn:hover,
.footer-export-btn:hover {
  background: var(--secondary);
}

/* Refresh sitemap: outlined / knockout style */
.footer-refresh-sitemap-btn {
  background: var(--tertiary);
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.footer-refresh-sitemap-btn:hover {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}

.footer-refresh-sitemap-btn .material-symbols-rounded,
.footer-download-pdfs-btn .material-symbols-rounded,
.footer-export-btn .material-symbols-rounded {
  font-size: 16px;
  font-variation-settings: 'FILL' 1;
}

.footer-download-pdfs-btn:disabled,
.footer-export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .action-plan {
    padding: 20px 12px 80px;
  }
  .action-plan-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---- Keywords Tab ---- */
.ss-keywords-loading {
  text-align: center;
  padding: 48px 16px;
  color: var(--mid-grey);
}
.ss-keywords-loading p { margin: 8px 0; }

.ss-keywords-body .exec-card {
  background: #fff;
  border: 1px solid var(--invert-1);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}
.ss-keywords-body .exec-card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
}

.kw-cache-note {
  font-size: 11px;
  font-weight: 400;
  color: var(--mid-grey);
  margin-left: 8px;
}
.kw-refresh-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--secondary);
  vertical-align: middle;
}
.kw-refresh-btn:hover { color: var(--primary); }

.kw-count-badge {
  display: inline-block;
  background: var(--secondary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 6px;
  min-width: 24px;
  text-align: center;
  vertical-align: middle;
}

.kw-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kw-title-row .kw-info-btn {
  margin-left: auto;
}

.kw-section-desc {
  font-size: 13px;
  color: var(--mid-grey);
  margin: 0 0 12px;
}

.kw-section-toggle {
  cursor: pointer;
  user-select: none;
}
.kw-toggle-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.kw-toggle-arrow::before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--secondary);
}
.kw-toggle-arrow-open {
  transform: rotate(90deg);
}

.kw-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.kw-filter-input {
  width: 50%;
  font-size: 13px;
  padding: 6px 10px;
  box-sizing: border-box;
}

.kw-keyword-cell {
  font-weight: 500;
  text-align: left;
}
.kw-url-cell {
  font-size: 12px;
  color: var(--mid-grey);
  word-break: break-all;
  overflow-wrap: break-word;
}

.kw-pos-badge {
  font-size: 12px;
  font-weight: 600;
}
.kw-pos-top10 { color: var(--green); }
.kw-pos-top20 { color: var(--amber); }
.kw-pos-top30 { color: var(--red); }
.kw-pos-deep { color: var(--red); }
.kw-pos-none { color: var(--mid-grey); }

.kw-potential {
  color: var(--green);
  font-weight: 500;
}

.kw-scan-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.2;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.kw-scan-btn .material-symbols-rounded { font-size: 14px; }
.kw-scan-btn:hover { background: var(--secondary); transform: translateY(-1px); }

.kw-legend { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-left: auto; font-size: 11px; color: var(--mid-grey); }
.kw-legend-group { display: inline-flex; align-items: center; gap: 8px; }
.kw-legend-label { font-weight: 600; color: var(--copy); }
.kw-legend-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.kw-legend-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; border: 1px solid var(--border); }
.kw-legend-num { font-weight: 700; font-size: 11px; margin-right: 1px; }
.kw-detail-table { border-collapse: collapse; }
.kw-detail-table thead th { font-size: 11px; font-weight: 600; color: var(--mid-grey); text-transform: uppercase; letter-spacing: 0.3px; padding: 4px 8px 8px; border-bottom: 1px solid var(--border); }
.kw-detail-table tbody td { font-size: 13px; padding: 8px 8px !important; border-bottom: 1px solid var(--invert-2); }
.kw-detail-table tbody tr:last-child td { border-bottom: none; }
.kw-detail-table .kw-scan-btn { font-size: 11px; padding: 3px 8px; }
.kw-detail-table td:last-child, .kw-detail-table th:last-child { padding-left: 20px; }

.kw-show-all-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--secondary);
  cursor: pointer;
}
.kw-show-all-btn:hover { background: var(--bg); }

.kw-cluster-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.kw-cluster-card:hover {
  border-color: var(--secondary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  background: var(--invert-2);
}
.kw-cluster-card.kw-cluster-open:hover {
  background: var(--surface);
}
.kw-cluster-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.kw-cluster-meta {
  font-size: 12px;
  color: var(--mid-grey);
  margin-left: auto;
}

/* Keyword table rows - no hover bg except on linked rows */
.ss-keywords-body .exec-citation-table tbody tr:hover:not(.exec-citation-detail-row) { background: var(--invert-2); cursor: default; }
.ss-keywords-body .exec-citation-table tbody tr.kw-row-linked:hover:not(.exec-citation-detail-row) { cursor: pointer; }

/* Keywords tab reuses ss-intel-card pattern */
.ss-keywords-body .ss-intel-cards { margin-bottom: 16px; }

/* ============ Admin Panel ============ */

.admin-page {
  margin-top: var(--top-bar-height);
  padding: 32px 24px 80px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeIn 0.3s ease;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.admin-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 22px;
  color: var(--primary);
}

.admin-stats {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--mid-grey);
}

.admin-stat-value {
  font-weight: 700;
  color: var(--primary);
  margin-right: 3px;
}

.admin-stat-live .admin-stat-value {
  color: #16a34a;
}
.admin-stat-live::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  margin-right: 6px;
  animation: admin-pulse 2s ease-in-out infinite;
}
@keyframes admin-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.admin-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  margin-bottom: 16px;
}

.admin-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 14px;
  color: var(--body-colour);
}

.admin-search-input::placeholder {
  color: var(--mid-grey);
}

.admin-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mid-grey);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--invert-2);
  vertical-align: middle;
}

.admin-table tbody tr:nth-child(even) {
  background: var(--bg);
}

.admin-table tbody tr:hover {
  background: var(--invert-2);
}

.admin-table th.admin-col-right,
.admin-table td.admin-col-right,
.admin-intel-sub-table th.admin-col-right,
.admin-intel-sub-table td.admin-col-right {
  text-align: right;
}

.admin-user-name {
  font-weight: 600;
  color: var(--primary);
  display: block;
}

.admin-user-email {
  font-size: 12px;
  color: var(--mid-grey);
}

.admin-user-domain {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 500;
  color: #92400e;
  background: #fef3c7;
  border-radius: 4px;
  line-height: 1.4;
}

.admin-tier-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-tier-standard { background: var(--invert-2); color: var(--mid-grey); }
.admin-tier-pro { background: #E8F5E9; color: #2E7D32; }
.admin-tier-admin { background: #E3F2FD; color: #1565C0; }
.admin-tier-beta { background: #FFF3E0; color: #E65100; }

.admin-status-active { color: #16A34A; }
.admin-status-blocked { color: #DC2626; font-weight: 600; }
.admin-status-inactive { color: var(--mid-grey); }

.admin-actions {
  display: flex;
  gap: 6px;
}

.admin-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--mid-grey);
  cursor: pointer;
  transition: all 0.15s;
}

.admin-action-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.admin-action-btn .material-symbols-rounded {
  font-size: 16px;
  font-variation-settings: 'FILL' 1;
}

.admin-action-btn.admin-btn-danger:hover {
  background: #DC2626;
  border-color: #DC2626;
}

.admin-action-btn.admin-btn-unblock:hover {
  background: #16A34A;
  border-color: #16A34A;
}

/* Admin cog button in footer */
.footer-admin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--mid-grey);
  cursor: pointer;
  transition: color 0.15s;
}

.footer-admin-btn:hover {
  color: var(--primary);
}

.footer-admin-btn .material-symbols-rounded {
  font-size: 20px;
  font-variation-settings: 'FILL' 1;
}

.footer-reassign-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--mid-grey);
  cursor: pointer;
  transition: color 0.15s;
}
.footer-reassign-btn:hover:not(:disabled) { color: var(--primary); }
.footer-reassign-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.footer-reassign-btn .material-symbols-rounded {
  font-size: 20px;
  font-variation-settings: 'FILL' 1;
}

.reassign-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--invert-2);
  border-radius: 6px;
  background: #fff;
}
.reassign-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--invert-2);
  transition: background 0.1s;
}
.reassign-list-item:last-child { border-bottom: none; }
.reassign-list-item:hover { background: var(--invert-2); }
.reassign-list-email { font-size: 14px; color: var(--body-color); }
.reassign-list-meta { font-size: 12px; color: var(--mid-grey); }

/* Masquerade chip - replaces admin cog while admin is viewing as another user */
.footer-masquerade-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 10px;
  background: #f59e0b;
  color: #fff;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.4);
  max-width: 280px;
}
.footer-masquerade-chip.hidden {
  display: none;
}
.footer-masquerade-chip .material-symbols-rounded {
  font-size: 16px;
  font-variation-settings: 'FILL' 1;
}
.footer-masquerade-chip .masquerade-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
.footer-masquerade-chip .masquerade-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}
.footer-masquerade-chip .masquerade-exit:hover {
  background: rgba(255, 255, 255, 0.45);
}
.footer-masquerade-chip .masquerade-exit .material-symbols-rounded {
  font-size: 14px;
}

/* Admin modal (reuses credits-modal overlay pattern) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.modal-overlay.hidden { display: none; }

.modal-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 18px;
  color: var(--primary);
  margin: 0 0 4px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--mid-grey);
  margin: 0 0 20px;
}

.modal-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mid-grey);
  margin-bottom: 4px;
  margin-top: 12px;
}

.modal-label:first-of-type { margin-top: 0; }

.modal-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 14px;
  color: var(--body-colour);
  background: var(--bg);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

select.modal-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8'%3E%3Cpath d='M0 0l7 8 7-8z' fill='%232A8A81'/%3E%3C/svg%3E") no-repeat right 12px center / 14px 8px,
    linear-gradient(to right, transparent calc(100% - 38px), var(--border) calc(100% - 38px), var(--border) calc(100% - 37px), transparent calc(100% - 37px)) no-repeat,
    var(--bg);
  cursor: pointer;
}
select.modal-input:hover {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8'%3E%3Cpath d='M0 0l7 8 7-8z' fill='white'/%3E%3C/svg%3E") no-repeat right 12px center / 14px 8px,
    linear-gradient(to right, transparent calc(100% - 38px), var(--secondary) calc(100% - 38px)) no-repeat,
    var(--bg);
  border-color: var(--secondary);
}

.modal-input:focus {
  border-color: var(--secondary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* Admin tab content */
.admin-tab-content.hidden { display: none; }

.admin-stats {
  margin-bottom: 16px;
}

/* Intel summary cards */
.admin-intel-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.admin-intel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.admin-intel-card-value {
  font-family: 'Fredoka', sans-serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--primary);
  display: block;
}

.admin-intel-card-value.positive { color: #16A34A; }
.admin-intel-card-value.negative { color: #DC2626; }

.admin-intel-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mid-grey);
  margin-top: 4px;
  display: block;
}

/* Intel filters */
.admin-intel-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-filter-select,
.admin-filter-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 13px;
  color: var(--body-colour);
  background: var(--surface);
  outline: none;
}

.admin-filter-select {
  min-width: 140px;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8'%3E%3Cpath d='M0 0l7 8 7-8z' fill='%232A8A81'/%3E%3C/svg%3E") no-repeat right 12px center / 14px 8px,
    linear-gradient(to right, transparent calc(100% - 38px), var(--border) calc(100% - 38px), var(--border) calc(100% - 37px), transparent calc(100% - 37px)) no-repeat,
    var(--surface);
  cursor: pointer;
}
.admin-filter-select:hover {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8'%3E%3Cpath d='M0 0l7 8 7-8z' fill='white'/%3E%3C/svg%3E") no-repeat right 12px center / 14px 8px,
    linear-gradient(to right, transparent calc(100% - 35px), var(--secondary) calc(100% - 35px)) no-repeat,
    var(--surface);
  border-color: var(--secondary);
}
.admin-filter-input { flex: 1; min-width: 200px; }

.admin-filter-select:focus,
.admin-filter-input:focus {
  border-color: var(--secondary);
}

/* Intel detail panel (expandable per-month) */
.admin-intel-detail {
  margin-top: 16px;
}

.admin-intel-detail.hidden { display: none; }

.admin-intel-detail-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--primary);
  margin-bottom: 12px;
}

.admin-intel-sub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}

.admin-intel-sub-table th {
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mid-grey);
  border-bottom: 2px solid var(--border);
}

.admin-intel-sub-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--invert-2);
}

.admin-intel-sub-table tbody tr:hover {
  background: var(--invert-2);
}

/* Clickable month rows */
.admin-table tbody tr.admin-month-row {
  cursor: pointer;
}

.admin-table tbody tr.admin-month-row:hover {
  background: var(--invert-2);
}

.admin-margin-positive { color: #16A34A; font-weight: 600; }
.admin-margin-negative { color: #DC2626; font-weight: 600; }

@media (max-width: 600px) {
  .admin-page { padding: 16px 12px 80px; }
  .admin-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .admin-stats { flex-wrap: wrap; }
  .admin-table { font-size: 13px; }
  .admin-table th, .admin-table td { padding: 8px 10px; }
  .admin-intel-summary { grid-template-columns: repeat(2, 1fr); }
  .admin-intel-filters { flex-direction: column; }
}

/* ── Support tickets (admin) ── */
.admin-tab-badge {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin-left: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #DC2626;
  border-radius: 10px;
  text-align: center;
  line-height: 1.4;
}

.admin-tab-badge.hidden { display: none; }

.admin-support-filters {
  margin-bottom: 16px;
}

.ss-tabs-inline {
  display: inline-flex;
}

.admin-status-count {
  font-size: 11px;
  opacity: 0.75;
  margin-left: 2px;
}

.admin-status-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-status-pill.admin-status-open { background: #FEF3C7; color: #92400E; }
.admin-status-pill.admin-status-in_progress { background: #DBEAFE; color: #1E40AF; }
.admin-status-pill.admin-status-closed { background: var(--invert-2); color: var(--mid-grey); }

.admin-table tbody tr.admin-ticket-row {
  cursor: pointer;
}

.admin-table tbody tr.admin-ticket-row:hover {
  background: var(--invert-2);
}

.admin-ticket-message {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--body-colour);
  white-space: pre-wrap;
  max-height: 280px;
  overflow-y: auto;
}

.modal-card.modal-card-wide {
  max-width: 560px;
}

/* ── Branding Modal ── */
.branding-modal-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.branding-modal-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}
.branding-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--border);
}
.branding-toggle-label {
  font-size: 14px;
  font-weight: 500;
}
.branding-config {
  padding-top: 16px;
}
.branding-section {
  margin-bottom: 20px;
}
.branding-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--body-colour);
  margin-bottom: 8px;
}
.branding-hint {
  font-size: 11px;
  color: var(--mid-grey);
  margin: 6px 0 0;
  line-height: 1.4;
}

/* Logo upload */
.branding-logo-area {
  display: flex;
  align-items: center;
  gap: 16px;
}
.branding-logo-preview {
  width: 120px;
  height: 48px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--invert-2);
  flex-shrink: 0;
}
.branding-logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.branding-logo-empty {
  font-size: 11px;
  color: var(--mid-grey);
}
.branding-logo-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
/* Colour inputs */
.branding-colour-row {
  display: flex;
  gap: 16px;
}
.branding-colour-field {
  flex: 1;
}
.branding-colour-field label {
  display: block;
  font-size: 12px;
  color: var(--mid-grey);
  margin-bottom: 4px;
}
.branding-colour-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  background: var(--surface);
}
.branding-colour-swatch {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.branding-colour-input {
  border: none;
  outline: none;
  font-family: monospace;
  font-size: 14px;
  width: 100%;
  min-width: 0;
  color: var(--body-colour);
  background: transparent;
}

/* Font picker buttons */
.branding-font-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.branding-font-btn {
  flex: 1;
  padding: 10px 14px;
  padding-right: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 15px;
  color: var(--body-colour);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s;
  position: relative;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237D8284' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.branding-font-btn:hover {
  border-color: var(--secondary);
}
.branding-weight-select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--body-colour);
  background: var(--surface);
  cursor: pointer;
  min-width: 140px;
}

/* Live preview */
.branding-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  background: var(--surface);
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.branding-preview-header {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--primary);
}
.branding-preview-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--body-colour);
  margin-bottom: 12px;
}
.branding-preview-swatches {
  display: flex;
  align-items: center;
  gap: 8px;
}
.branding-preview-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.branding-preview-swatch-label {
  font-size: 11px;
  color: var(--mid-grey);
  margin-right: 8px;
}

/* Save button */
.branding-save-btn {
  width: 100%;
  margin-top: 4px;
}
.branding-status {
  font-size: 12px;
  color: var(--mid-grey);
  margin-top: 8px;
  min-height: 16px;
  text-align: center;
}
.branding-status.error {
  color: var(--red);
}
.branding-status.success {
  color: var(--green);
}

/* ── Font Picker Dialog ── */
.font-picker-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 420px;
  position: relative;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.font-picker-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
}
.font-picker-search {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  margin-bottom: 12px;
  box-sizing: border-box;
}
.font-picker-search:focus {
  border-color: var(--secondary);
}
.font-picker-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  max-height: 400px;
}
.font-picker-row {
  padding: 10px 12px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.1s;
}
.font-picker-row:hover {
  background: var(--invert-2);
}
.font-picker-row.active {
  background: var(--invert-2);
  font-weight: 600;
}
.font-picker-row-name {
  font-size: 16px;
}
.font-picker-row-cat {
  font-size: 11px;
  color: var(--mid-grey);
}
.font-picker-empty {
  padding: 24px;
  text-align: center;
  color: var(--mid-grey);
  font-size: 13px;
}
