/* ============================================================
   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;
}

/* ============ 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;
}

.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 ============ */

.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: 0;
}

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

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

.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;
}

/* ============ Lighthouse Section ============ */

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

/* .lh-hero removed - unified into .hero */

.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;
}

.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;
}

/* 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);
}

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

/* --- 1200px: stack inputs, button beside keyword --- */
@media (max-width: 1200px) {
  .top-bar { height: auto; padding: 10px 0; }
  .top-bar-inner { flex-wrap: wrap; align-items: flex-start; gap: 24px; }
  .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 */
  .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; }
  .state-container { margin-top: 200px; min-height: calc(100vh - 200px); }
  .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-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-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);
  border-color: var(--green);
  color: #fff;
}
.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 Gap 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);
}

/* ============ 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);
}

/* ============ 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;
}

/* ============ 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);
}

.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;
}

.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;
}

.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;
}

/* 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-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);
}

.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;
  gap: 4px;
  justify-content: 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-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);
}

.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-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: var(--top-bar-height);
  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-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;
}

/* 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-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-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;
  color: var(--mid-grey);
}

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

/* Cannibalization */
.exec-cannibal-item {
  margin-bottom: 12px;
}

.exec-cannibal-kw {
  font-weight: 600;
  font-size: 14px;
  color: var(--body-color);
  margin-bottom: 4px;
}

.exec-cannibal-urls {
  font-size: 13px;
  color: var(--mid-grey);
  padding-left: 16px;
}

/* Improvement */
.exec-delta {
  font-weight: 600;
}

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

/* Freshness */
.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;
}

@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: rgba(42, 138, 129, 0.1); color: var(--secondary); }
.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;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}

.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: 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;
  font-weight: 700;
  font-size: 13px;
  min-width: 38px;
  height: 26px;
  border-radius: 13px;
  padding: 0 10px;
}

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

.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-action-plan-btn,
.footer-view-report-btn,
.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-action-plan-btn:hover,
.footer-view-report-btn:hover,
.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-action-plan-btn .material-symbols-rounded,
.footer-view-report-btn .material-symbols-rounded,
.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;
  }
}
