/* ==========================================================================
   PageSpeed Insights Pro (Core PHP Edition)
   Authentic Google Material Design + 1000% Enhanced Performance Suite
   ========================================================================== */

:root {
  --google-blue: #1a73e8;
  --google-blue-hover: #1557b0;
  --google-blue-light: #e8f0fe;
  --google-red: #ea4335;
  --google-yellow: #fbbc04;
  --google-green: #34a853;
  --score-green: #0cce6b;
  --score-green-bg: #e6f8ef;
  --score-green-border: #80e6b5;
  --score-orange: #ffa400;
  --score-orange-bg: #fff6e6;
  --score-orange-border: #ffd180;
  --score-red: #ff4e42;
  --score-red-bg: #ffebe9;
  --score-red-border: #ff9e97;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-muted: #80868b;
  --bg-page: #ffffff;
  --bg-card: #ffffff;
  --bg-subtle: #f8f9fa;
  --border-light: #dadce0;
  --border-subtle: #f1f3f4;
  --shadow-sm: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px -5px rgba(60,64,67,0.15), 0 8px 10px -6px rgba(60,64,67,0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --font-sans: 'Google Sans', 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Roboto Mono', 'SFMono-Regular', Consolas, monospace;
}

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

html {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg-page);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Keep all ordinary interface and content text comfortable to read. */
html {
  font-size: 16px;
}

body,
button,
input,
select,
textarea {
  font-size: 16px;
}

p,
span,
li,
a,
label,
td,
th,
caption,
summary,
dt,
dd,
figcaption,
time {
  font-size: inherit;
}

small {
  font-size: 15px;
}

a {
  color: var(--google-blue);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   NAVIGATION HEADER (Matches Google PageSpeed Insights exactly)
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 110;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-light);
  height: 64px;
}

.header-container {
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-area:hover {
  text-decoration: none;
  opacity: 0.92;
}

.logo-img {
  height: 34px;
  width: 34px;
  flex-shrink: 0;
}

.speedometer-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  transition: transform 0.2s ease;
}

.logo-area:hover .speedometer-icon {
  transform: rotate(6deg) scale(1.05);
}

.footer .speedometer-icon {
  width: 24px;
  height: 24px;
}

.pro-badge {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #1a73e8, #8430ce);
  color: #ffffff;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  box-shadow: 0 1px 4px rgba(132, 48, 206, 0.25);
  line-height: 1.2;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-nav a {
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.header-nav a:hover {
  color: var(--text-primary);
  background-color: var(--bg-subtle);
  text-decoration: none;
}

.header-nav a.active {
  color: var(--google-blue);
}

.battle-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--google-blue-light) !important;
  color: var(--google-blue) !important;
  font-weight: 600 !important;
}

.copy-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--google-blue);
  font-size: 16px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-link-btn:hover {
  background-color: var(--bg-subtle);
  border-color: #c6c9ce;
}

/* ==========================================================================
   HERO INPUT SECTION (Identical to User Screenshot)
   ========================================================================== */
.hero-section {
  padding: 56px 24px 40px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.search-box-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 12px;
}

.search-form {
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

.input-container {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background-color: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-container:focus-within {
  border-color: var(--google-blue);
  box-shadow: 0 0 0 1px var(--google-blue);
}

.input-container.error {
  border-color: var(--google-red);
  box-shadow: 0 0 0 1px var(--google-red);
}

.url-input {
  width: 100%;
  height: 52px;
  padding: 0 44px 0 18px;
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
}

.url-input::placeholder {
  color: var(--text-muted);
}

.clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: none;
  border-radius: var(--radius-full);
}

.clear-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
}

.analyze-btn {
  height: 52px;
  padding: 0 36px;
  background-color: var(--google-blue);
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.analyze-btn:hover {
  background-color: var(--google-blue-hover);
  box-shadow: 0 2px 4px 1px rgba(60,64,67,0.2);
}

.analyze-btn:active {
  transform: scale(0.99);
}

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

.analyze-btn.is-loading,
.analyze-btn:disabled.is-loading {
  background: linear-gradient(135deg, #1a73e8 0%, #1765cc 100%);
  opacity: 0.96;
  cursor: wait;
  box-shadow: 0 2px 6px rgba(26, 115, 232, 0.4);
}

/* Spinner Circle Animation */
.btn-spinner {
  width: 18px;
  height: 18px;
  animation: btn-spin 0.9s linear infinite;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

@keyframes btn-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Material-style expanding arc */
.btn-spinner-circle {
  stroke: currentColor;
  stroke-dasharray: 50;
  stroke-dashoffset: 20;
  animation: btn-arc 1.5s ease-in-out infinite;
}

@keyframes btn-arc {
  0% {
    stroke-dashoffset: 45;
  }
  50% {
    stroke-dashoffset: 15;
  }
  100% {
    stroke-dashoffset: 45;
  }
}

/* Animated Bouncing Dots */
.loading-dots {
  display: inline-flex;
  margin-left: 2px;
  letter-spacing: 2px;
}

.loading-dot {
  display: inline-block;
  animation: dot-wave 1.4s infinite ease-in-out both;
  font-weight: 700;
}

.loading-dot:nth-child(1) {
  animation-delay: 0s;
}
.loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dot-wave {
  0%, 80%, 100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.input-error-msg {
  color: var(--google-red);
  font-size: 16px;
  margin-top: 6px;
  padding-left: 4px;
  display: none;
}

.sample-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  font-size: 16px;
  color: var(--text-secondary);
}

.chip-btn {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 16px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}

.chip-btn:hover {
  background-color: var(--google-blue-light);
  border-color: var(--google-blue);
  color: var(--google-blue);
}

/* ==========================================================================
   BOTTOM HERO PROMO (Exact match to screenshot)
   ========================================================================== */
.hero-promo {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 48px;
  margin-top: 72px;
}

.promo-content h1 {
  font-size: 38px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 32px;
  letter-spacing: -0.5px;
}

.promo-links-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.promo-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.promo-links-list a {
  font-size: 16px;
  font-weight: 500;
  color: var(--google-blue);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.promo-illustration-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-art-svg {
  width: 100%;
  max-width: 440px;
  height: auto;
  transition: transform 0.3s ease;
}

.hero-art-svg:hover {
  transform: translateY(-4px) scale(1.02);
}

/* ==========================================================================
   LOADING & PROGRESS OVERLAY
   ========================================================================== */
.loading-indicator {
  display: none;
  padding: 40px 24px;
  text-align: center;
  max-width: 650px;
  margin: 30px auto;
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background-color: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  margin-bottom: 18px;
}

.progress-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, var(--google-blue), var(--google-green));
  border-radius: var(--radius-full);
  animation: indeterminate 2s infinite linear;
}

@keyframes indeterminate {
  0% { left: -30%; width: 30%; }
  50% { left: 40%; width: 50%; }
  100% { left: 100%; width: 30%; }
}

.loading-text {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 6px;
}

.loading-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

/* ==========================================================================
   RESULTS DASHBOARD (Google PageSpeed Layout + 1000% Extensions)
   ========================================================================== */
.results-dashboard {
  display: none;
  max-width: 1000px;
  margin: 0 auto 60px;
  padding: 0 24px;
  width: 100%;
  box-sizing: border-box;
}

/* Header bar inside results (URL, strategy switcher, timestamp) - Sticky on Desktop & Mobile */
.results-header {
  position: sticky;
  top: 64px;
  z-index: 100;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 12px;
  border-bottom: none;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: none;
}

.audit-meta-url {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 10px;
}

.audit-meta-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.strategy-tabs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border-bottom: none;
  gap: 6px;
}

.strategy-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border-bottom: none;
}

.strategy-tab:hover {
  color: var(--google-blue);
  background-color: rgba(66, 133, 244, 0.05);
}

.strategy-tab.active {
  color: var(--google-blue);
  background-color: var(--google-blue-light);
  border-bottom: none;
  font-weight: 500;
}

/* Sub Navigation for Features */
.features-navbar {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: none;
  margin-top: 8px;
  margin-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.feature-nav-btn {
  padding: 12px 18px;
  border: none;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.feature-nav-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-subtle);
}

.feature-nav-btn.active {
  color: var(--google-blue);
  border-bottom-color: var(--google-blue);
}

.feature-panel {
  display: none;
  padding: 24px 0;
  animation: fadeIn 0.25s ease-in-out;
}

.feature-panel.active {
  display: block;
}

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

/* ==========================================================================
   SECTION 1: DISCOVER WHAT YOUR REAL USERS ARE EXPERIENCING
   ========================================================================== */
.crux-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.crux-heading-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crux-icon-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e8f0fe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.crux-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

.crux-url-toggle {
  display: inline-flex;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f8f9fa;
}

.crux-toggle-btn {
  background: transparent;
  border: none;
  padding: 6px 14px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.crux-toggle-btn.active {
  background: #ffffff;
  color: var(--google-blue);
  box-shadow: 0 1px 2px rgba(60,64,67,0.15);
  font-weight: 600;
}

/* ==========================================================================
   AUTHENTIC CORE WEB VITALS ASSESSMENT CARD (CrUX Chrome UX Report)
   ========================================================================== */
.cwv-assessment-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 24px 28px;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.08);
  margin-bottom: 32px;
}

.cwv-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.cwv-status-badge-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cwv-pulse-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e6f4ea;
  color: #0b8043;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cwv-pulse-circle.failed {
  background: #fce8e6;
  color: #c5221f;
}

.cwv-assessment-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cwv-assessment-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.cwv-assessment-result {
  font-size: 16px;
  font-weight: 600;
  color: #0b8043;
}

.cwv-assessment-result.failed {
  color: #c5221f;
}

.cwv-info-icon {
  font-size: 16px;
  color: #5f6368;
  cursor: pointer;
  margin-left: 2px;
}

.cwv-view-toggle-btn {
  background: none;
  border: none;
  color: #1a73e8;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.cwv-view-toggle-btn:hover {
  text-decoration: underline;
}

.cwv-core-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  width: 100%;
}

.cwv-assessment-card.expanded .cwv-core-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.cwv-notable-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  width: 100%;
}

.cwv-assessment-card.expanded .cwv-notable-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  max-width: 66.666%;
}

.cwv-metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.cwv-metric-col {
  width: 100%;
}

.cwv-metric-block {
  width: 100%;
}

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

.cwv-shape-icon {
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  margin-right: 2px;
}
.cwv-shape-icon.good { color: #0cce6b; }
.cwv-shape-icon.needs-improvement { color: #ffa400; }
.cwv-shape-icon.poor { color: #ff4e42; }

.cwv-metric-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cwv-metric-name {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
  cursor: pointer;
  text-decoration: underline dotted #80868b;
  text-underline-offset: 3px;
}

.cwv-metric-name:hover {
  color: #1a73e8;
}

.cwv-delta-tag {
  color: #1a73e8;
  font-weight: 700;
  font-size: 16px;
  margin-left: 2px;
}

.cwv-bar-area {
  position: relative;
  padding-top: 26px;
  padding-bottom: 4px;
}

.cwv-pin-val {
  position: absolute;
  top: 0;
  font-size: 16px;
  font-weight: 600;
  transform: translateX(-50%);
  user-select: none;
  white-space: nowrap;
}

.cwv-pin-marker {
  position: absolute;
  top: 19px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.cwv-pin-circle {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #5f6368;
}

.cwv-pin-stem {
  width: 1.5px;
  height: 9px;
  background: #5f6368;
  margin-top: -1px;
}

.cwv-distribution-bar {
  width: 100%;
  height: 8px;
  display: flex;
  border-radius: 4px;
  overflow: hidden;
  background: #e0e0e0;
}

.cwv-dist-good {
  height: 100%;
  background-color: #0cce6b;
  transition: width 0.6s ease;
}

.cwv-dist-avg {
  height: 100%;
  background-color: #ffa400;
  transition: width 0.6s ease;
}

.cwv-dist-poor {
  height: 100%;
  background-color: #ff4e42;
  transition: width 0.6s ease;
}

.cwv-expanded-details {
  margin-top: 4px;
}

.cwv-page-loads-label {
  text-align: right;
  font-size: 16px;
  color: #5f6368;
  font-weight: 500;
  margin-bottom: 2px;
}

.cwv-pct-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  padding: 1px 0;
}

.cwv-pct-good-label { color: #0b8043; }
.cwv-pct-avg-label { color: #af5b00; }
.cwv-pct-poor-label { color: #c5221f; }
.cwv-pct-threshold { color: #5f6368; }
.cwv-pct-num { font-weight: 500; color: #202124; }

.cwv-percentile-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 16px;
  color: #5f6368;
  font-weight: 500;
  margin-top: 6px;
}

.cwv-tag-row {
  text-align: right;
  font-size: 16px;
  color: #5f6368;
  margin-top: 2px;
}

.cwv-notable-divider {
  border-top: 1px solid #dadce0;
  margin: 32px 0 20px;
  padding-top: 16px;
}

.cwv-notable-divider span {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #5f6368;
  text-transform: uppercase;
}

.cwv-crux-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid #dadce0;
}

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

.cwv-footer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: #5f6368;
}

.cwv-history-link, .cwv-footer-link {
  color: #1a73e8;
  text-decoration: none;
  cursor: pointer;
}
.cwv-history-link:hover, .cwv-footer-link:hover {
  text-decoration: underline;
}

/* Category Audit Cards (Accessibility, Best Practices, SEO) */
.category-audit-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 24px 28px;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.08);
  margin-bottom: 24px;
}

.category-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e8eaed;
}

.category-gauge-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.category-gauge-svg {
  width: 72px;
  height: 72px;
  transform: rotate(-90deg);
}

.category-gauge-bg {
  fill: none;
  stroke: #e8eaed;
  stroke-width: 6;
}

.category-gauge-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s ease;
}

.category-gauge-score {
  position: absolute;
  font-family: 'Roboto Mono', monospace;
  font-size: 22px;
  font-weight: 700;
}

.category-meta {
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.category-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.category-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.cat-subgroup-heading {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #5f6368;
  margin: 24px 0 10px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Collapsible Section Layout for Passed Audits & Category Groups */
.collapsible-audit-section {
  border: 1px solid #dadce0;
  border-radius: 6px;
  margin-top: 14px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.collapsible-audit-section:hover {
  border-color: #bdc1c6;
}

.collapsible-audit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  cursor: pointer;
  user-select: none;
  background: #ffffff;
  transition: background 0.15s ease;
}

.collapsible-audit-header:hover {
  background: #f8f9fa;
}

.collapsible-title {
  font-size: 16px;
  font-weight: 600;
  color: #202124;
}

.collapsible-toggle-btn {
  font-size: 16px;
  font-weight: 500;
  color: #1a73e8;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.collapsible-toggle-btn:hover {
  background: #e8f0fe;
}

.collapsible-content {
  border-top: 1px solid #e8eaed;
  padding: 8px 12px;
  background: #ffffff;
}

.collapsible-content .category-audit-row {
  margin-bottom: 6px;
}

.collapsible-content .category-audit-row:last-child {
  margin-bottom: 0;
}

.cat-status-dot {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.cat-status-dot.pass {
  color: #188038;
}

.cat-status-dot.fail {
  color: #c5221f;
}

.cat-status-dot.warn {
  color: #af5b00;
}

.cat-status-dot.manual, .cat-status-dot.notApplicable {
  color: #5f6368;
}

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

.category-audit-row {
  border: 1px solid #dadce0;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
  transition: background 0.15s ease;
}

.category-audit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}

.category-audit-header:hover {
  background: #f8f9fa;
}

.cat-audit-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cat-status-dot {
  font-size: 16px;
  display: inline-flex;
}
.cat-status-dot.pass { color: #0cce6b; }
.cat-status-dot.fail { color: #ff4e42; }
.cat-status-dot.manual { color: #ffa400; }

.cat-audit-title {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
}

.cat-audit-desc-box {
  padding: 10px 16px 14px 34px;
  font-size: 16px;
  color: #5f6368;
  line-height: 1.5;
  background: #fdfdfd;
  border-top: 1px solid #f1f3f4;
}


/* ==========================================================================
   DIAGNOSE PERFORMANCE ISSUES CARD & SCREENSHOT (PageSpeed Pro)
   ========================================================================== */
.diagnose-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 14px;
}

.diagnose-icon-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8f0fe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.diagnose-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.diagnose-main-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 24px 28px;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.08);
  margin-bottom: 28px;
}

.diagnose-divider {
  height: 1px;
  background-color: #e8eaed;
  margin: 22px 0;
  width: 100%;
}

/* Top 5 Small Gauges - Always on 1 single row like official Google PageSpeed Insights */
.diagnose-top-gauges {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 6px;
  padding: 8px 0;
  width: 100%;
  flex-wrap: nowrap !important;
}

.diagnose-gauge-item, .agentic-badge-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.diagnose-gauge-svg-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diagnose-gauge-svg {
  width: 52px;
  height: 52px;
  transform: rotate(-90deg);
}

.diagnose-gauge-bg {
  fill: none;
  stroke: #e8eaed;
  stroke-width: 4;
}

.diagnose-gauge-fill {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.diagnose-gauge-val {
  position: absolute;
  font-family: 'Roboto Mono', monospace;
  font-size: 16px;
  font-weight: 700;
}

.diagnose-gauge-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 6px;
}

.agentic-badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.agentic-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 14px;
  background: #e6f4ea;
  border: 1px solid #ceead6;
  color: #137333;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-sans);
  height: 32px;
  margin: 13px 0;
}

.agentic-pill.warn {
  background: #fef7e0;
  border-color: #feefc3;
  color: #b06000;
}

.agentic-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: currentColor;
}

/* Split Row: Large Performance Gauge (Left) & Screenshot (Right) */
.diagnose-split-row {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  gap: 24px;
  padding: 6px 0;
}

.diagnose-large-gauge-col {
  display: flex;
  justify-content: center;
  align-items: center;
}

.large-gauge-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 330px;
}

.large-gauge-svg-container {
  position: relative;
  width: 136px;
  height: 136px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.large-gauge-svg {
  width: 136px;
  height: 136px;
  transform: rotate(-90deg);
}

.large-gauge-bg {
  fill: none;
  stroke: #f1f3f4;
  stroke-width: 8;
}

.large-gauge-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s ease;
}

.large-gauge-score {
  position: absolute;
  font-family: 'Roboto Mono', monospace;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -1px;
}

.perf-metric-calculator-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 12px 0 4px;
}

.perf-calc-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 12px;
  background: #f8f9fa;
  border: 1px solid #dadce0;
  font-size: 16px;
  font-weight: 500;
  color: #3c4043;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.perf-calc-pill:hover {
  background: #e8f0fe;
  border-color: #1a73e8;
  color: #1a73e8;
}

.perf-calc-acronym {
  color: #5f6368;
  font-weight: 500;
}

.perf-calc-pts {
  color: #202124;
  font-weight: 700;
}

.large-gauge-label {
  font-size: 19px;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 10px;
}

.large-gauge-caption {
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-top: 6px;
}

.large-gauge-caption a {
  color: var(--google-blue);
  text-decoration: none;
}

.large-gauge-caption a:hover {
  text-decoration: underline;
}

.large-gauge-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
  font-size: 16px;
  color: var(--text-secondary);
}

.legend-shape.shape-poor { color: var(--score-red); font-size: 16px; }
.legend-shape.shape-average { color: var(--score-orange); font-size: 16px; }
.legend-shape.shape-good { color: var(--score-green); font-size: 16px; }

.diagnose-v-divider {
  width: 1px;
  height: 100%;
  min-height: 270px;
  background-color: #e8eaed;
}

.diagnose-screenshot-col {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.screenshot-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.screenshot-frame {
  background: #ffffff;
  border: 1px solid #dadce0;
  box-shadow: 0 4px 14px rgba(60, 64, 67, 0.12);
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transition: all 0.3s ease;
}

.screenshot-frame.mobile-frame {
  width: 165px;
  height: 330px;
  aspect-ratio: 9 / 18;
  border-radius: 18px;
  border: 4px solid #3c4043;
  box-shadow: 0 6px 20px rgba(60, 64, 67, 0.15);
  background: #000000;
}

.screenshot-frame.desktop-frame {
  width: 360px;
  max-width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  border-radius: 8px;
  border: 1px solid #dadce0;
  box-shadow: 0 4px 16px rgba(60, 64, 67, 0.12);
  background: #f8f9fa;
}

.diagnose-screenshot-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.screenshot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  background: #f8f9fa;
  color: var(--text-secondary);
  font-size: 16px;
}

/* Metrics Section */
.diagnose-metrics-section {
  padding: 4px 0 0;
}

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

.metrics-heading {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.expand-view-btn {
  background: none;
  border: none;
  color: var(--google-blue);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.expand-view-btn:hover {
  text-decoration: underline;
}

.diagnose-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 36px;
}

.diagnose-metric-item {
  display: flex;
  flex-direction: column;
  padding: 10px 0 14px;
  border-bottom: 1px solid #e8eaed;
}

.diagnose-metric-item:nth-last-child(-n+2) {
  border-bottom: none;
}

.metric-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 2px;
}

.metric-status-icon {
  font-size: 16px;
  display: inline-flex;
}
.metric-status-icon.good { color: #0cce6b; }
.metric-status-icon.needs-improvement { color: #ffa400; }
.metric-status-icon.poor { color: #ff4e42; }

.metric-value-large {
  font-family: inherit;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.3px;
}
.metric-value-large.good { color: #00875a; }
.metric-value-large.needs-improvement { color: #b06000; }
.metric-value-large.poor { color: #d93025; }

.metric-desc {
  font-size: 16px;
  color: #5f6368;
  line-height: 1.5;
  margin-top: 6px;
}

.metric-desc a {
  color: #1a73e8;
  text-decoration: none;
}

.metric-desc a:hover {
  text-decoration: underline;
}

/* Environment Details Card */
.env-info-box {
  background-color: #f8f9fa;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 20px 0 16px;
}

.env-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}

.env-info-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: #3c4043;
}

.env-info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
  flex-shrink: 0;
}

/* View Treemap Button */
.treemap-btn-wrapper {
  margin: 16px 0;
}

.view-treemap-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 4px;
  padding: 8px 16px;
  color: #1a73e8;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-treemap-btn:hover {
  background: #f8fafd;
  border-color: #1a73e8;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.15);
}

/* Filmstrip / Screenshots Carousel */
.filmstrip-wrapper {
  border: 1px solid #e8eaed;
  border-radius: 6px;
  background: #ffffff;
  padding: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0 20px;
  scrollbar-width: thin;
}

.filmstrip-track {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: max-content;
}

.filmstrip-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
  min-width: 48px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.filmstrip-frame:hover {
  transform: scale(1.04);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 2;
}

.filmstrip-thumb {
  height: 68px;
  width: auto;
  min-width: 48px;
  max-width: 120px;
  object-fit: cover;
  background: #ffffff;
  display: block;
}

.filmstrip-time {
  font-size: 16px;
  color: #5f6368;
  padding: 2px 4px;
  background: #f8f9fa;
  width: 100%;
  text-align: center;
  border-top: 1px solid #f1f3f4;
  font-family: 'Roboto Mono', monospace;
}

/* Audits Relevance Filter Bar */
.insights-filter-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 20px 0 8px;
  flex-wrap: wrap;
}

.insights-filter-label {
  font-size: 16px;
  color: #5f6368;
}

.insights-filter-chips {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-chip {
  border: 1px solid transparent;
  background: #f1f3f4;
  color: #3c4043;
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  background: #e8eaed;
}

.filter-chip.active {
  background: #1a73e8;
  color: #ffffff;
  font-weight: 600;
}

.insights-heading {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #5f6368;
  text-transform: uppercase;
  margin: 16px 0 12px;
}

.insights-subheading {
  font-size: 16px;
  font-weight: 600;
  color: #202124;
  margin: 18px 0 4px;
}

/* Treemap Modal */
.treemap-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(32, 33, 36, 0.65);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}

.treemap-modal.active {
  display: flex;
}

.treemap-modal-content {
  background: #ffffff;
  border-radius: 8px;
  width: 92%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.28);
  overflow: hidden;
  animation: modalIn 0.2s ease-out;
}

.treemap-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #dadce0;
  background: #f8f9fa;
}

.treemap-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
  color: #202124;
}

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

.treemap-external-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #dadce0;
  background: #ffffff;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  color: #1a73e8;
  cursor: pointer;
}

.treemap-external-btn:hover {
  background: #f1f3f4;
  border-color: #1a73e8;
}

.treemap-close-btn {
  background: none;
  border: none;
  font-size: 26px;
  color: #5f6368;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.treemap-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.treemap-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.treemap-stat-card {
  background: #f8f9fa;
  border: 1px solid #e8eaed;
  border-radius: 6px;
  padding: 12px 16px;
  text-align: center;
}

.treemap-stat-val {
  font-size: 20px;
  font-weight: 700;
  color: #202124;
  font-family: 'Roboto Mono', monospace;
}

.treemap-stat-label {
  font-size: 16px;
  color: #5f6368;
  margin-top: 2px;
}

.treemap-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.treemap-search {
  flex: 1;
  min-width: 220px;
  padding: 8px 14px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-size: 16px;
  outline: none;
}

.treemap-search:focus {
  border-color: #1a73e8;
}

.treemap-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 16px;
  color: #5f6368;
}

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

.tm-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

.treemap-visual-container {
  min-height: 220px;
  background: #f8f9fa;
  border: 1px solid #dadce0;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
  margin-bottom: 20px;
}

.treemap-node {
  padding: 8px 10px;
  border-radius: 4px;
  color: #ffffff;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.treemap-node:hover {
  transform: scale(1.02);
  filter: brightness(1.08);
  z-index: 2;
}

.tm-node-name {
  font-weight: 600;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tm-node-size {
  font-family: 'Roboto Mono', monospace;
  font-size: 16px;
  opacity: 0.95;
}

.treemap-table-container {
  border: 1px solid #e8eaed;
  border-radius: 6px;
  overflow: hidden;
}

.treemap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.treemap-table th {
  background: #f8f9fa;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: #3c4043;
  border-bottom: 1px solid #dadce0;
}

.treemap-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f3f4;
  color: #202124;
}

.treemap-table tr:hover td {
  background-color: #f8fafd;
}


/* ==========================================================================
   CIRCULAR SCORE GAUGES (Google PageSpeed Signatures)
   ========================================================================== */
.score-overview-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 28px 0;
}

.score-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(60,64,67,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.score-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.score-gauge {
  position: relative;
  width: 104px;
  height: 104px;
  margin-bottom: 12px;
}

.score-gauge svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.gauge-bg {
  fill: none;
  stroke: #e8eaed;
  stroke-width: 8;
}

.gauge-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 282.7;
  stroke-dashoffset: 282.7;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.score-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.score-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Score Colors */
.score-good .gauge-fill { stroke: var(--score-green); }
.score-good .gauge-text { color: var(--score-green); }
.score-average .gauge-fill { stroke: var(--score-orange); }
.score-average .gauge-text { color: var(--score-orange); }
.score-poor .gauge-fill { stroke: var(--score-red); }
.score-poor .gauge-text { color: var(--score-red); }

/* Score Scale Legend */
.score-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

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

.legend-pill {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}

.pill-good { background-color: var(--score-green); }
.pill-average { background-color: var(--score-orange); }
.pill-poor { background-color: var(--score-red); }

/* ==========================================================================
   CORE WEB VITALS METRICS GRID
   ========================================================================== */
.cwv-container {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 28px;
}

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

.cwv-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
}

.cwv-badge-passed {
  background-color: var(--score-green-bg);
  color: #137333;
  border: 1px solid var(--score-green-border);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 16px;
  font-weight: 600;
}

.cwv-badge-failed {
  background-color: var(--score-red-bg);
  color: #c5221f;
  border: 1px solid var(--score-red-border);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 16px;
  font-weight: 600;
}

.cwv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.cwv-metric-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  background-color: var(--bg-subtle);
  position: relative;
  overflow: hidden;
}

.cwv-metric-card.good { border-top: 4px solid var(--score-green); }
.cwv-metric-card.needs-improvement { border-top: 4px solid var(--score-orange); }
.cwv-metric-card.poor { border-top: 4px solid var(--score-red); }

.metric-name {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.metric-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-family: var(--font-mono);
}

.metric-target {
  font-size: 16px;
  color: var(--text-muted);
}

/* ==========================================================================
   OPPORTUNITIES & DIAGNOSTICS LIST
   ========================================================================== */
.section-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 32px 0 16px;
}

.opportunities-list, .diagnostics-list, .passed-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid #dadce0;
  margin-top: 8px;
}

/* Authentic Google PageSpeed Accordion Items */
.audit-accordion-item,
.opportunity-card {
  border: none !important;
  border-bottom: 1px solid #dadce0 !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  transition: background-color 0.15s ease;
}

.audit-accordion-item:hover,
.opportunity-card:hover {
  background-color: #f8f9fa !important;
}

.audit-accordion-header,
.opp-header {
  padding: 12px 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  cursor: pointer;
  user-select: none;
  gap: 12px;
}

.audit-title-cluster,
.opp-title-area {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

/* Authentic Google Severity Icons & Colors */
.audit-icon-shape,
.audit-severity-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
}

.score-icon-fail,
.severity-high {
  color: #d93025 !important; /* Authentic Google Red */
}

.score-icon-warn,
.severity-medium,
.status-warn {
  color: #e37400 !important; /* Authentic Google Orange */
  font-size: 16px;
}

.score-icon-pass,
.severity-low,
.status-pass {
  color: #0cce6b !important; /* Authentic Google Green */
  font-size: 16px;
}

.score-icon-info {
  color: #1a73e8 !important; /* Google Blue Info */
  font-size: 16px;
  font-weight: 700;
}

.score-icon-neutral {
  color: #5f6368 !important; /* Gray Circle Outline for Informative */
  font-size: 16px;
  line-height: 1;
  font-weight: normal;
}

.opp-status-icon {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.opp-status-icon.high { background-color: var(--score-red); }
.opp-status-icon.medium { background-color: var(--score-orange); }
.opp-status-icon.low { background-color: var(--score-green); }

.audit-title-text,
.opp-title,
.audit-main-title {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
}

.audit-savings-separator {
  color: #5f6368;
  font-size: 16px;
  user-select: none;
  margin: 0 2px;
}

.audit-savings-text,
.opp-savings {
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
}

.audit-savings-text.high-savings,
.opp-savings {
  color: #d93025;
}

.audit-savings-text.medium-savings {
  color: #e37400;
}

.audit-display-val {
  font-size: 16px;
  font-weight: 500;
  color: #5f6368;
  white-space: nowrap;
}

/* Accordion Disclosure Chevron */
.audit-chevron-toggle,
.opp-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #5f6368;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.audit-accordion-item.expanded .audit-chevron-toggle svg,
.opportunity-card.expanded .opp-chevron {
  transform: rotate(180deg);
}

/* Accordion Body: Collapsed by Default! */
.audit-accordion-body,
.opp-body {
  display: none;
  padding: 6px 12px 18px 36px !important;
  font-size: 16px;
  color: #3c4043;
  line-height: 1.6;
}

.audit-accordion-item.expanded .audit-accordion-body,
.opportunity-card.expanded .opp-body {
  display: block !important;
}

.audit-description {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: #3c4043;
  line-height: 1.6;
}

.audit-description a {
  color: #1a73e8;
  text-decoration: none;
}

.audit-description a:hover {
  text-decoration: underline;
}

.audit-empty-msg {
  padding: 14px 8px;
  font-size: 16px;
  color: #5f6368;
}

/* Passed Audits Rows */
.passed-audit-row,
.passed-audit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #f1f3f4;
  font-size: 16px;
  color: #3c4043;
}

.passed-dot {
  font-size: 16px;
  flex-shrink: 0;
}

/* Metric Tag Pills under Description (Matches Google PSI Screenshot) */
.audit-metric-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 12px 0;
  flex-wrap: wrap;
}

.opp-metric-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-size: 16px;
  color: #3c4043;
  font-weight: 500;
  background: #f8f9fa;
  user-select: none;
}

.opp-metric-tag.tag-unscored {
  color: #5f6368;
  border-color: #e8eaed;
  background: #ffffff;
}

.devtools-panel-hint {
  font-size: 16px;
  color: #5f6368;
  margin: 22px 0 24px 0;
  line-height: 1.5;
  padding: 0 4px;
}

.devtools-panel-hint a {
  color: #1a73e8;
  text-decoration: none;
}

.devtools-panel-hint a:hover {
  text-decoration: underline;
}

.diagnostics-subheading {
  font-size: 16px;
  font-weight: 600;
  color: #5f6368;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin: 28px 0 12px 0;
  padding: 0 4px;
}

.opp-party-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 3px;
  text-transform: none;
  letter-spacing: 0.2px;
  margin-left: 6px;
}

.opp-party-badge.party-first {
  background: #e8f0fe;
  color: #1a73e8;
  border: 1px solid #d2e3fc;
}

.opp-party-badge.party-third {
  background: #fce8e6;
  color: #c5221f;
  border: 1px solid #fad2cf;
}

.opp-party-badge.party-ad {
  background: #f1f3f4;
  color: #5f6368;
  border: 1px solid #dadce0;
}

.opp-subitem-url {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.opp-subitem-url .url-path {
  color: #202124;
  font-weight: 400;
}

.opp-subitem-url .url-host {
  color: #5f6368;
  font-size: 16px;
}

.opp-file-link:hover .url-path {
  text-decoration: underline;
  color: #1a73e8;
}

.opp-files-table-wrapper {
  margin-top: 14px;
  border: 1px solid #e8eaed;
  border-radius: 6px;
  background: #ffffff;
  overflow: visible;
}

.opp-files-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.opp-files-table th {
  background: #ffffff;
  color: #202124;
  font-weight: 600;
  font-size: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid #dadce0;
  text-align: left;
}

.opp-files-table th.num-col {
  text-align: right;
}

.opp-files-table tr.opp-group-row td {
  background: #f1f3f4;
  color: #202124;
  font-weight: 600;
  padding: 8px 14px;
  border-top: 1px solid #dadce0;
  border-bottom: 1px solid #dadce0;
  font-size: 16px;
}

.opp-files-table tr.opp-item-row td {
  padding: 8px 14px;
  border-bottom: 1px solid #f1f3f4;
  color: #3c4043;
  vertical-align: middle;
}

.opp-files-table tr.opp-item-row:hover {
  background: #f8fafd;
}

.opp-file-entry {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.opp-file-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  cursor: pointer;
  word-break: break-all;
}

.opp-file-path {
  color: #202124;
  font-weight: 400;
}

.opp-file-link:hover .opp-file-path {
  text-decoration: underline;
  color: #1a73e8;
}

.opp-file-host {
  color: #5f6368;
  font-size: 16px;
  margin-left: 5px;
  font-weight: normal;
}

/* Sleek Google-style floating asset tooltip */
.opp-url-hover-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 9999;
  background: #202124;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  font-size: 16px;
  line-height: 1.4;
  min-width: 440px;
  max-width: 620px;
  pointer-events: auto;
}

.opp-url-hover-tooltip::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 24px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid #202124;
}

.opp-file-entry:hover .opp-url-hover-tooltip,
.opp-url-hover-tooltip:hover {
  display: block;
}

.opp-tooltip-url {
  font-family: 'Roboto Mono', monospace;
  word-break: break-all;
  color: #e8eaed;
  font-size: 16px;
  margin-bottom: 8px;
}

.opp-tooltip-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #3c4043;
  padding-top: 6px;
}

.opp-tooltip-btn {
  background: #303134;
  color: #8ab4f8;
  border: 1px solid #5f6368;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  font-family: inherit;
  transition: all 0.15s ease;
}

.opp-tooltip-btn:hover {
  background: #3c4043;
  color: #aecbfa;
  border-color: #8ab4f8;
}

.opp-file-path {
  color: #202124;
  word-break: break-all;
}

.opp-file-host {
  color: #80868b;
  font-size: 16px;
  margin-left: 4px;
}

.opp-file-metric {
  font-family: 'Roboto Mono', monospace;
  font-size: 16px;
}

.category-audit-row .cat-audit-desc-box {
  display: none;
}

.category-audit-row.expanded .cat-audit-desc-box {
  display: block;
}

.category-audit-row.expanded .opp-chevron {
  transform: rotate(180deg);
}

/* ==========================================================================
   LIGHTHOUSE PERFORMANCE INSIGHTS & DETAILED AUDITS
   ========================================================================== */

/* Checklist (e.g. LCP request discovery, Document request latency) */
.lh-checklist {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lh-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  color: #3c4043;
  line-height: 1.5;
}

.lh-checklist-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.lh-checklist-pass {
  background: #e6f4ea;
  color: #137333;
}

.lh-checklist-fail {
  background: #fce8e6;
  color: #c5221f;
}

.lh-checklist-label {
  flex: 1;
}

.lh-checklist-label a {
  color: #1a73e8;
  text-decoration: none;
}

.lh-checklist-label a:hover {
  text-decoration: underline;
}

/* Node preview (e.g. LCP element preview) */
.lh-node-preview {
  margin: 12px 0;
  padding: 10px 14px;
  background: #f8f9fa;
  border: 1px solid #e8eaed;
  border-radius: 6px;
  font-size: 14px;
}

.lh-node-selector {
  font-family: 'Roboto Mono', monospace;
  color: #1a73e8;
  font-size: 13px;
  margin-bottom: 6px;
  word-break: break-all;
}

.lh-node-snippet {
  margin: 0;
  background: #202124;
  color: #f1f3f4;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'Roboto Mono', monospace;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* List section (e.g. Network dependency tree sections) */
.lh-list-section {
  margin-top: 16px;
  margin-bottom: 12px;
}

.lh-list-section__title {
  font-weight: 600;
  font-size: 15px;
  color: #202124;
  margin-bottom: 4px;
}

.lh-list-section__description {
  font-size: 14px;
  color: #5f6368;
  margin-bottom: 10px;
  line-height: 1.5;
}

.lh-list-section__description a {
  color: #1a73e8;
  text-decoration: none;
}

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

.lh-section-text {
  font-size: 14px;
  color: #5f6368;
  font-style: italic;
  margin: 8px 0;
}

/* Critical Request Chains / Network Tree */
.lh-crc-container {
  margin: 12px 0;
  padding: 12px 16px;
  background: #fafbfc;
  border: 1px solid #e8eaed;
  border-radius: 6px;
}

.lh-crc-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #202124;
}

.lh-crc-summary-value {
  color: #c5221f;
  font-weight: 700;
}

.lh-crc-tree {
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  overflow-x: auto;
  padding: 4px 0;
}

.lh-crc-initial-nav {
  color: #5f6368;
  font-style: italic;
  margin-bottom: 6px;
}

.lh-crc-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  line-height: 28px;
  white-space: nowrap;
}

.lh-crc-tree-marker {
  color: #9aa0a6;
  font-weight: 700;
  user-select: none;
}

.lh-crc-url {
  color: #1a73e8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lh-crc-url:hover .lh-crc-path {
  text-decoration: underline;
}

.lh-crc-host {
  color: #5f6368;
  font-size: 12px;
}

.lh-crc-metrics {
  color: #5f6368;
  font-size: 12px;
}

.lh-crc-duration {
  font-weight: 600;
  color: #3c4043;
}

.lh-crc-longest .lh-crc-duration {
  color: #c5221f;
}

/* Warnings banner */
.lh-warnings-banner {
  margin: 8px 0 12px 0;
  padding: 8px 12px;
  background: #fef7e0;
  border: 1px solid #f9ab00;
  border-radius: 4px;
  color: #795548;
  font-size: 13px;
  line-height: 1.4;
}

.lh-warnings-banner strong {
  color: #b06000;
}

/* Source location cell styling */
.lh-source-location {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.lh-source-unattributed {
  color: #80868b;
  font-style: italic;
}

.lh-code-inline {
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  background: #f1f3f4;
  padding: 2px 6px;
  border-radius: 3px;
  color: #202124;
  word-break: break-all;
}

/* Sub-items warnings inside tables */
.lh-subitem-row td {
  padding: 4px 14px 8px 24px !important;
  background: #fafbfc;
  border-bottom: 1px solid #f1f3f4;
}

.lh-subitem-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #b06000;
}

.lh-subitem-warn-icon {
  font-size: 14px;
}

/* Node cell styling (PageSpeed Insights element renderer) */
.lh-node-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 100%;
}

.lh-node-label {
  font-size: 13px;
  color: #3c4043;
  line-height: 1.4;
  word-break: break-word;
}

.lh-node-cell .lh-node-selector {
  font-family: 'Roboto Mono', monospace;
  font-size: 12px;
  color: #5f6368;
  margin-bottom: 2px;
  word-break: break-all;
}

.lh-node-snippet {
  margin-top: 2px;
}

.lh-node-snippet .lh-code-inline {
  display: inline-block;
  background: #f1f3f4;
  color: #1a73e8;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-all;
  max-width: 100%;
}

.lh-total-text {
  font-weight: 700;
  color: #202124;
  font-size: 13px;
}

/* Subitem data row styling (e.g. Layout shift culprits sub-causes, responsive image savings) */
.lh-subitem-data-row td {
  background: #fafbfc;
  border-bottom: 1px solid #edf2f7;
  padding-top: 6px !important;
  padding-bottom: 8px !important;
  font-size: 13px;
}

.lh-subitem-data-row td:first-child {
  padding-left: 28px !important;
  position: relative;
}

.lh-subitem-data-row td:first-child::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-left: 2px solid #bdc1c6;
  border-bottom: 2px solid #bdc1c6;
}

.lh-subitem-cause {
  color: #5f6368;
  font-size: 13px;
  font-style: italic;
  display: inline-block;
}

/* ==========================================================================
   WATERFALL VISUALIZER (Interactive Network Waterfall)
   ========================================================================== */
.waterfall-header-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.waterfall-stats-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.waterfall-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 16px;
  color: var(--text-secondary);
}

.waterfall-stat-pill strong {
  color: var(--text-primary);
  font-weight: 600;
}

.waterfall-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 3px;
  overflow-x: auto;
}

.waterfall-filter-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

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

.waterfall-filter-btn.active {
  background: var(--google-blue);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(26, 115, 232, 0.3);
}

.waterfall-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ffffff;
}

.waterfall-table th {
  background-color: #f8f9fa;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 16px;
  color: #5f6368;
  border-bottom: 1px solid var(--border-light);
  letter-spacing: 0.2px;
}

.waterfall-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.waterfall-table tbody tr:hover {
  background-color: #fbfcfe;
}

.waterfall-url-cell {
  max-width: 280px;
}

.waterfall-res-name {
  font-weight: 600;
  color: #202124;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 16px;
}

.waterfall-res-url {
  font-size: 16px;
  color: #80868b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.waterfall-type-badge {
  display: inline-block;
  padding: 2.5px 7px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.type-document { background: #e8f0fe; color: #1a73e8; }
.type-stylesheet { background: #f3e8fd; color: #8430ce; }
.type-script { background: #fef7e0; color: #b06000; }
.type-image { background: #e6f4ea; color: #137333; }
.type-font { background: #fce8e6; color: #c5221f; }
.type-other { background: #f1f3f4; color: #5f6368; }

.waterfall-status {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.status-ok { background: #e6f4ea; color: #137333; }
.status-redirect { background: #e8f0fe; color: #1a73e8; }
.status-err { background: #fce8e6; color: #c5221f; }

.waterfall-size-cell {
  font-family: var(--font-mono);
  font-size: 16px;
  color: #5f6368;
  white-space: nowrap;
}

/* Green Chart Timeline Bar & Track */
.waterfall-timeline-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.waterfall-timeline-track {
  position: relative;
  flex: 1;
  height: 18px;
  background-color: #f1f3f4;
  border-radius: 4px;
  overflow: hidden;
  min-width: 80px;
}

.waterfall-timeline-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #0cce6b 0%, #059669 100%); /* Signature Green Chart Bar */
  box-shadow: 0 1px 3px rgba(12, 206, 107, 0.35);
  min-width: 5px;
  transition: width 0.3s ease, left 0.3s ease;
}

.waterfall-duration-label {
  font-family: var(--font-mono);
  font-size: 16px;
  color: #5f6368;
  width: 52px;
  text-align: right;
  flex-shrink: 0;
}

/* ==========================================================================
   CODE FIXES & SERVER DIRECTIVES
   ========================================================================== */
.code-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #2d3034;
  color: #e8eaed;
  padding: 10px 16px;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
  font-size: 16px;
}

.copy-code-btn {
  background-color: #3c4043;
  color: #ffffff;
  border: 1px solid #5f6368;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  cursor: pointer;
}

.copy-code-btn:hover {
  background-color: #5f6368;
}

.code-pre {
  background-color: #202124;
  color: #f1f3f4;
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 18px;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  overflow-x: auto;
  line-height: 1.6;
}

/* ==========================================================================
   CRUX FIELD DATA UNAVAILABLE NOTICE
   ========================================================================== */
.crux-unavailable-card {
  padding: 24px;
  background-color: #fafafa;
  border: 1px solid #e8eaed;
  border-radius: var(--radius-md);
  margin-top: 14px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.crux-unavailable-icon {
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1;
}

.crux-unavailable-title {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
  margin-bottom: 6px;
}

.crux-unavailable-desc {
  font-size: 16px;
  color: #5f6368;
  line-height: 1.5;
  margin: 0;
}

.category-subgroup-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #5f6368;
  margin: 18px 0 10px;
}

/* ==========================================================================
   OFFICIAL MULTI-COLUMN FOOTER (Exact match to Google PageSpeed Insights)
   ========================================================================== */
.footer,
.psi-official-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  margin-top: 60px;
  padding: 48px 24px 32px;
}

.footer-links-grid,
.footer-columns-container {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.footer-col-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links-list a {
  color: #5f6368;
  font-size: 16px;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links-list a:hover {
  color: var(--google-blue);
  text-decoration: underline;
}

.footer-branding-strip {
  max-width: 1000px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.g-dev-brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-brand-links {
  display: flex;
  gap: 24px;
}

.footer-brand-links a {
  font-size: 16px;
  color: #5f6368;
  font-weight: 500;
  text-decoration: none;
}

.footer-brand-links a:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   FULL RESPONSIVE DESIGN SYSTEM (Desktop, Tablet & Mobile Across All Viewports)
   ========================================================================== */

/* Universal media constraints & overflow prevention */
img, svg, video, canvas {
  max-width: 100%;
}

.opp-files-table-wrapper {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.opp-files-table {
  min-width: 480px;
}

#waterfall-container {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.waterfall-table {
  min-width: 520px;
}

/* ==========================================================================
   TABLET & MEDIUM SCREENS (max-width: 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .header-container {
    padding: 0 16px;
  }
  .header-nav {
    gap: 10px;
  }
  .header-nav a, .copy-link-btn {
    padding: 6px 10px;
    font-size: 16px;
  }
  .features-navbar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .feature-nav-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .cwv-assessment-card.expanded .cwv-notable-grid {
    max-width: 100%;
  }
}

/* ==========================================================================
   MOBILE & TABLET PORTRAIT (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  /* Navigation Header */
  .header {
    height: 56px;
  }
  .header-container {
    padding: 0 12px;
  }
  .logo-area {
    gap: 9px !important;
  }
  .logo-img {
    height: 30px;
    width: 30px;
    object-fit: contain;
  }
  .speedometer-icon {
    width: 30px !important;
    height: 30px !important;
  }
  .speedometer-icon path {
    stroke-width: 3.5px !important;
  }
  .pro-badge {
    font-size: 16px !important;
    font-weight: 800 !important;
    letter-spacing: 0.6px !important;
    padding: 5px 12px !important;
    border-radius: 20px !important;
    box-shadow: 0 1px 4px rgba(26, 115, 232, 0.35) !important;
  }
  .header-nav {
    gap: 6px;
  }
  .header-btn-text,
  .battle-btn-text {
    display: none !important;
  }
  .copy-link-btn {
    padding: 6px 8px;
    min-width: 34px;
    justify-content: center;
  }
  .battle-nav-btn {
    padding: 6px 8px;
    font-size: 16px;
  }
  .docs-nav-link {
    padding: 6px 8px;
    font-size: 16px;
  }

  /* Hero Input Section */
  .hero-section {
    padding: 24px 14px 20px;
  }
  .hero-promo {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 28px;
  }
  .promo-illustration {
    order: -1;
    max-width: 220px;
    margin: 0 auto;
  }
  .promo-content h1 {
    font-size: clamp(22px, 5.5vw, 30px);
    line-height: 1.25;
    word-break: break-word;
  }
  .promo-content p {
    font-size: 16px;
  }
  .search-form {
    flex-direction: column;
    gap: 10px;
  }
  .url-input {
    font-size: 16px !important;
    height: 48px;
  }
  .analyze-btn {
    width: 100%;
    height: 48px;
    font-size: 16px;
  }
  .popular-sites {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    scrollbar-width: none;
  }
  .popular-btn {
    flex-shrink: 0;
  }

  /* Results Dashboard & Sticky Header */
  .results-dashboard {
    padding: 0 10px !important;
  }
  .results-header {
    position: sticky !important;
    top: 56px !important;
    z-index: 100 !important;
    background: #ffffff !important;
    border-bottom: none !important;
    padding: 10px 0 6px !important;
    margin: 0 0 6px 0 !important;
    box-shadow: none !important;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .audit-meta-url {
    font-size: 16px;
    word-break: break-all;
  }
  .strategy-tabs {
    width: 100%;
    display: flex;
    border-bottom: none !important;
    gap: 6px;
  }
  .strategy-tab {
    flex: 1;
    justify-content: center;
    padding: 8px 0;
    font-size: 16px;
    border-bottom: none !important;
  }

  /* CrUX Core Web Vitals Card */
  .crux-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .crux-title {
    font-size: 16px;
  }
  .cwv-assessment-card {
    padding: 14px 10px !important;
  }
  .cwv-top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .cwv-core-grid,
  .cwv-assessment-card.expanded .cwv-core-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .cwv-notable-grid,
  .cwv-assessment-card.expanded .cwv-notable-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    max-width: 100% !important;
  }
  .cwv-view-toggle-btn {
    align-self: flex-start;
  }

  /* Diagnose Performance Issues Card */
  .diagnose-main-card {
    padding: 14px 10px !important;
    margin-bottom: 16px !important;
  }
  .diagnose-top-gauges {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 2px !important;
    padding: 6px 0 10px !important;
    overflow: visible !important;
    width: 100% !important;
  }
  .diagnose-gauge-item, .agentic-badge-item {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    max-width: 20% !important;
    padding: 0 1px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }
  .diagnose-gauge-svg-wrap {
    width: 44px !important;
    height: 44px !important;
  }
  .diagnose-gauge-svg {
    width: 44px !important;
    height: 44px !important;
  }
  .diagnose-gauge-val {
    font-size: 16px !important;
    font-weight: 700 !important;
  }
  .agentic-pill {
    padding: 4px 6px !important;
    font-size: 16px !important;
    height: 24px !important;
    margin: 10px 0 !important;
  }
  .diagnose-gauge-title {
    font-size: 16px !important;
    white-space: normal !important;
    line-height: 1.15 !important;
    text-align: center !important;
    word-break: normal !important;
    hyphens: auto !important;
    margin-top: 2px !important;
    max-width: 100% !important;
  }
  .diagnose-split-row {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .diagnose-v-divider {
    display: none !important;
  }
  .screenshot-frame.desktop-frame {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 10;
  }
  .screenshot-frame.mobile-frame {
    width: 175px !important;
    height: 350px !important;
    margin: 0 auto;
  }
  .perf-metric-calculator-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }
  .perf-calc-pill {
    font-size: 16px;
    padding: 3px 6px;
  }
  .diagnose-metrics-grid {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  .diagnose-metric-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid #e8eaed !important;
  }
  .diagnose-metric-item:last-child {
    border-bottom: none !important;
  }
  .metric-item-top {
    margin-bottom: 0 !important;
    flex: 1 1 auto !important;
    font-size: 16px !important;
  }
  .metric-value-large {
    font-size: 16px !important;
    font-weight: 600 !important;
    text-align: right !important;
    margin-left: auto !important;
    line-height: 1 !important;
  }
  .metric-desc {
    width: 100% !important;
    margin-top: 6px !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
  }
  .env-info-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }
  .env-info-item {
    font-size: 16px;
    word-break: break-word;
  }

  /* Opportunities & Diagnostics Clean Mobile Padding */
  .audit-accordion-item,
  .opportunity-card {
    padding: 0 !important;
  }
  .audit-accordion-header,
  .opp-header {
    padding: 10px 0 !important;
    gap: 8px !important;
  }
  .audit-accordion-body,
  .opp-body {
    padding: 4px 0 12px 0 !important;
  }
  .audit-description {
    margin: 0 0 8px 0 !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
  }
  .opp-files-table-wrapper {
    margin-top: 8px !important;
    border-radius: 4px !important;
    width: 100% !important;
  }
  .opp-files-table {
    min-width: 100% !important;
    font-size: 16px !important;
  }
  .opp-files-table th {
    padding: 6px 8px !important;
    font-size: 16px !important;
  }
  .opp-files-table tr.opp-group-row td {
    padding: 6px 8px !important;
    font-size: 16px !important;
  }
  .opp-files-table tr.opp-item-row td {
    padding: 6px 8px !important;
    font-size: 16px !important;
  }

  /* Category Audit Cards (Accessibility, Best Practices, SEO) */
  .category-audit-card {
    padding: 16px 12px !important;
    margin-bottom: 20px !important;
  }
  .category-header {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 12px !important;
  }
  .category-gauge-wrap {
    margin: 0 auto !important;
  }
  .category-title {
    font-size: 18px !important;
  }
  .category-desc {
    font-size: 16px !important;
  }
  .category-audit-header {
    padding: 10px 10px !important;
  }
  .cat-audit-title {
    font-size: 16px !important;
    word-break: break-word !important;
  }
  .cat-audit-desc-box {
    padding: 10px 10px 14px 28px !important;
  }

  /* Insights Relevance Filter */
  .insights-filter-bar {
    justify-content: flex-start !important;
    gap: 8px !important;
    margin: 16px 0 10px !important;
  }
  .insights-filter-chips {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .filter-chip {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 16px;
  }

  /* Feature Panels */
  .code-box {
    font-size: 16px;
    padding: 12px;
  }

  /* Footer */
  .footer-container {
    padding: 32px 14px 24px !important;
  }
  .footer-links-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
  }
  .footer-branding-strip {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 12px !important;
  }
  .footer-brand-links {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 14px !important;
    font-size: 16px !important;
  }
}

/* ==========================================================================
   COMPACT MOBILE SCREENS (max-width: 480px)
   ========================================================================== */
@media (max-width: 480px) {
  .header-container {
    padding: 0 8px;
  }
  .logo-area {
    gap: 8px !important;
  }
  .logo-img {
    height: 28px;
    width: 28px;
  }
  .speedometer-icon {
    width: 28px !important;
    height: 28px !important;
  }
  .speedometer-icon path {
    stroke-width: 3.5px !important;
  }
  .pro-badge {
    font-size: 16px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    padding: 4px 10px !important;
    border-radius: 20px !important;
  }
  .battle-btn-text {
    display: none;
  }
  .battle-nav-btn {
    padding: 6px 8px;
    font-size: 16px;
  }
  .docs-nav-link {
    padding: 6px 6px;
    font-size: 16px;
  }
  .footer-links-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .cwv-status-badge-area {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .treemap-modal-content {
    width: 98% !important;
    max-height: 96vh !important;
    padding: 10px !important;
  }
  .treemap-stats-bar {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}

/* ==========================================================================
   COMPETITOR SPEED BATTLE — MODERN DESIGN SYSTEM & STICKY CONTROLS
   ========================================================================== */

.battle-container {
  max-width: 1040px;
  margin: 0 auto 60px;
  padding: 0 20px;
  box-sizing: border-box;
}

.battle-header-wrapper {
  text-align: center;
  margin: 28px auto 20px;
  max-width: 680px;
}

.battle-header-title {
  font-size: 32px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.battle-header-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Quick Matchups Chips */
.battle-quick-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0 24px;
}

.battle-chip-label {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 4px;
}

.battle-chip-btn {
  background: #f1f3f4;
  color: #3c4043;
  border: 1px solid transparent;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.battle-chip-btn:hover {
  background: #e8f0fe;
  color: #1a73e8;
  border-color: #d2e3fc;
}

.battle-chip-btn.active {
  background: #e8f0fe !important;
  color: #1a73e8 !important;
  border-color: #1a73e8 !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 3px rgba(26, 115, 232, 0.25);
}

.battle-error-banner {
  background: #fce8e6;
  border: 1px solid #fad2cf;
  color: #c5221f;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.5;
  text-align: left;
}

/* Battle Form Card */
.battle-form-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 2px 10px rgba(60, 64, 67, 0.06);
}

.battle-inputs-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.battle-input-wrap {
  position: relative;
}

.battle-input-label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.battle-url-input {
  width: 100%;
  height: 48px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 16px;
  color: var(--text-primary);
  background: #ffffff;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.battle-url-input:focus {
  outline: none;
  border-color: var(--google-blue);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.vs-circle-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #202124;
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

/* Battle Animated Loading State (Matches Screenshot 2) */
.battle-loading-card {
  max-width: 660px;
  margin: 32px auto;
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.battle-loading-icon-pulse {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e8f0fe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  animation: pulse-ring 2s infinite ease-in-out;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(26, 115, 232, 0.4); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 14px rgba(26, 115, 232, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(26, 115, 232, 0); }
}

.battle-loading-title {
  font-size: 22px;
  font-weight: 600;
  color: #202124;
  margin-bottom: 8px;
}

.battle-loading-subtitle {
  font-size: 16px;
  color: #5f6368;
  margin-bottom: 14px;
  word-break: break-all;
}

.battle-loading-chip {
  display: inline-block;
  background: #f1f3f4;
  color: #5f6368;
  font-size: 16px;
  font-weight: 500;
  border-radius: 16px;
  padding: 4px 14px;
  margin-bottom: 24px;
}

.battle-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: #e8eaed;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 28px;
}

.battle-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a73e8, #34a853);
  width: 25%;
  transition: width 0.4s ease;
}

.battle-steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto 24px;
  text-align: left;
}

.battle-step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #ffffff;
  border: 1px solid #e8eaed;
  border-radius: 10px;
  font-size: 16px;
  color: #5f6368;
  transition: all 0.25s ease;
}

.battle-step-item.active {
  border-color: #1a73e8;
  background: #f8fafd;
  color: #1a73e8;
  font-weight: 500;
}

.battle-step-item.completed {
  border-color: #ceead6;
  background: #f6fdf9;
  color: #137333;
}

.battle-step-item .step-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
  flex-shrink: 0;
}

.step-icon.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid #1a73e8;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin-step 0.8s linear infinite;
}

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

.battle-loading-note {
  font-size: 16px;
  color: #70757a;
  line-height: 1.5;
  margin-top: 18px;
}

/* ==========================================================================
   BATTLE RESULTS DASHBOARD (Matches Screenshot 3)
   ========================================================================== */

.battle-results-dashboard {
  margin-top: 24px;
}

/* Top Winner Banner */
.battle-winner-banner {
  background: linear-gradient(180deg, #e6f8f0 0%, #f4fbf7 100%);
  border: 1px solid #ceead6;
  border-radius: 16px;
  padding: 32px 24px 24px;
  text-align: center;
  margin-bottom: 20px;
}

.battle-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ceead6;
  color: #137333;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.battle-winner-title {
  font-size: 28px;
  font-weight: 700;
  color: #137333;
  margin-bottom: 8px;
}

.battle-winner-sub {
  font-size: 16px;
  color: #3c4043;
  line-height: 1.6;
  max-width: 750px;
  margin: 0 auto;
}

/* STICKY STRATEGY CONTROL BAR (Sticky on Desktop and Mobile) */
.battle-sticky-bar {
  position: sticky;
  top: 64px;
  z-index: 99;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #dadce0;
  padding: 12px 0;
  margin: 0 0 24px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.battle-tabs-pill {
  display: inline-flex;
  background: #f1f3f4;
  padding: 4px;
  border-radius: 24px;
  gap: 4px;
}

.battle-tab-pill {
  border: none;
  background: transparent;
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 500;
  color: #5f6368;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.battle-tab-pill.active {
  background: #202124;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.battle-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid #dadce0;
  background: #ffffff;
  color: #3c4043;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.battle-new-btn:hover {
  background: #f8f9fa;
  border-color: #202124;
}

/* Side-by-Side Battle Cards Grid */
.battle-cards-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.battle-site-card {
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(60, 64, 67, 0.06);
  position: relative;
  transition: all 0.25s ease;
}

.battle-site-card.is-winner {
  border: 2px solid #0cce6b;
  box-shadow: 0 4px 18px rgba(12, 206, 107, 0.12);
}

.card-top-tags {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.site-role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
}

.site-role-badge.role-a {
  background: #e8f0fe;
  color: #1a73e8;
}

.site-role-badge.role-b {
  background: #fce8e6;
  color: #c5221f;
}

.card-winner-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e6f4ea;
  color: #137333;
  font-size: 16px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
}

.card-domain-title {
  font-size: 20px;
  font-weight: 600;
  color: #202124;
  margin-bottom: 16px;
  word-break: break-all;
}

/* SVG Score Circle Gauge */
.battle-gauge-wrapper {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 0 auto 8px;
}

.battle-score-gauge {
  transform: rotate(-90deg);
}

.battle-gauge-center {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.battle-gauge-score {
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
}

.battle-gauge-total {
  font-size: 16px;
  color: #5f6368;
  font-weight: 500;
  margin-top: 2px;
}

.battle-gauge-label {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #5f6368;
  margin-bottom: 16px;
}

/* Mini Categories Grid */
.battle-mini-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: #f8f9fa;
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  margin-bottom: 18px;
}

.mini-cat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mini-cat-label {
  font-size: 16px;
  color: #5f6368;
}

.mini-cat-val {
  font-size: 16px;
  font-weight: 700;
  color: #202124;
}

.battle-inspect-link {
  display: block;
  text-align: center;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid #dadce0;
  color: #1a73e8;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s;
}

.battle-inspect-link:hover {
  background: #f8fafd;
  border-color: #1a73e8;
}

/* Center VS Badge */
.battle-center-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.battle-vs-swords {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #202124;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.battle-diff-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  background: #202124;
  color: #ffffff;
}

/* Head-to-Head Comparison Table */
.battle-table-card {
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(60, 64, 67, 0.04);
}

.battle-table-title {
  font-size: 16px;
  font-weight: 600;
  color: #202124;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.battle-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.battle-h2h-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  min-width: 600px;
}

.battle-h2h-table th {
  padding: 10px 14px;
  color: #5f6368;
  font-size: 16px;
  font-weight: 500;
  border-bottom: 1px solid #dadce0;
  text-align: left;
}

.battle-h2h-table th.center-col {
  text-align: center;
}

.battle-h2h-table th.right-col {
  text-align: right;
}

.battle-h2h-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #f1f3f4;
  vertical-align: middle;
}

.battle-h2h-table td.center-col {
  text-align: center;
}

.battle-h2h-table td.right-col {
  text-align: right;
}

.battle-winner-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e6f4ea;
  color: #137333;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 16px;
}

.battle-loser-text {
  color: #5f6368;
  font-size: 16px;
}

.battle-advantage-text {
  font-weight: 600;
  color: #202124;
  font-size: 16px;
}

/* Mobile Responsive Overrides */
@media (max-width: 768px) {
  .battle-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
  }
  .battle-results-dashboard {
    width: 100% !important;
    min-width: 0 !important;
  }
  .battle-table-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 16px 12px !important;
  }
  .battle-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .battle-winner-banner {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 20px 14px !important;
  }
  .battle-site-card {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 18px 14px !important;
  }
  .battle-header-title {
    font-size: 24px;
  }
  .battle-inputs-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .vs-circle-badge {
    margin: 0 auto;
  }
  .battle-cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .battle-center-vs {
    flex-direction: row;
    justify-content: center;
    margin: 4px 0;
  }
  .battle-sticky-bar {
    top: 56px !important;
    padding: 8px 10px !important;
    justify-content: space-between;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .battle-tabs-pill {
    flex: 1;
  }
  .battle-tab-pill {
    flex: 1;
    justify-content: center;
    padding: 6px 12px;
    font-size: 16px;
  }
  .battle-new-btn {
    padding: 6px 12px;
    font-size: 16px;
  }
  .battle-winner-title {
    font-size: 22px;
  }
}

