@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,400;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --bg-base: #fafaf9;
  --bg-card: #ffffff;
  --bg-hover: #f5f5f4;
  --bg-alt: #f5f5f4;
  --border: #e5e5e5;
  --border-active: #1a1a1a;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --accent-blue: #2563eb;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-yellow: #f59e0b;
  --accent-gold: #d97706;
  
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-title: 'Merriweather', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --sidebar-width: 220px;
  --sidebar-collapsed-width: 56px;
  --content-padding: 32px;
  --card-gap: 16px;
  --section-gap: 48px;
}

[data-theme="dark"] {
  --bg-base: #1c1917;
  --bg-card: #272522;
  --bg-hover: #3f3f46;
  --bg-alt: #272522;
  --border: #44403c;
  --border-active: #f5f5f4;
  --text-primary: #f5f5f4;
  --text-secondary: #d6d3d1;
  --text-muted: #78716c;
  --accent-blue: #3b82f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  background-color: var(--bg-base);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* App Layout */
.app-layout {
  display: flex;
  flex: 1;
}

/* Sidebar */
.global-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-hover);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 64px; /* For top nav */
  bottom: 0;
  left: 0;
  z-index: 900;
  transition: width 200ms ease;
  display: flex;
  flex-direction: column;
}

.sidebar-toggle-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.sidebar-toggle-btn:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text-primary);
}

.brand-container {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  color: var(--accent-blue);
  font-size: 1.8rem;
  text-shadow: 0 0 10px rgba(0, 112, 209, 0.08);
}

.brand-title {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px 8px;
}

.nav-section {
  margin-bottom: 16px;
}

.nav-category {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 16px 16px 0 16px;
  margin-bottom: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-category:first-of-type {
  border-top: none;
  padding-top: 0;
}

.nav-category-pill {
  background: #EFF6FF;
  color: #3B82F6;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  transition: var(--transition);
}

.nav-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.nav-item a:hover {
  color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.03);
}

.nav-item a.active {
  color: var(--text-primary);
  background: linear-gradient(90deg, var(--accent-blue), rgba(0, 112, 209, 0.2));
  box-shadow: 0 0 15px rgba(0, 112, 209, 0.08);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.03);
}

.tab-btn.active {
  color: var(--text-primary);
  background: linear-gradient(90deg, var(--accent-blue), rgba(0, 112, 209, 0.2));
  box-shadow: 0 0 15px rgba(0, 112, 209, 0.08);
}

/* Collapsed Sidebar State */
.sidebar-collapsed .global-sidebar {
  width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .brand-title,
.sidebar-collapsed .nav-category span:not(.nav-icon),
.sidebar-collapsed .nav-item span.item-text,
.sidebar-collapsed .nav-category-pill,
.sidebar-collapsed .item-text {
  display: none !important;
}

.sidebar-collapsed .brand-container {
  padding: 16px 0;
  justify-content: center;
}

.sidebar-collapsed .nav-icon {
  margin-right: 0;
  margin-left: auto;
  margin-right: auto;
  font-size: 18px;
}

.sidebar-collapsed .nav-item a {
  padding: 12px;
  justify-content: center;
}

.sidebar-collapsed .tab-btn {
  justify-content: center !important;
  padding: 12px !important;
}

.sidebar-collapsed .tab-btn i {
  margin: 0 !important;
}

.sidebar-collapsed .nav-category {
  justify-content: center;
  padding-top: 12px;
}

/* Hide toggle icon switch via CSS or JS. We'll do JS. */

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  margin-top: 64px;
  padding: var(--content-padding);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 64px);
  transition: margin-left 200ms ease;
}

.no-sidebar .main-content {
  margin-left: 0;
}

/* Top Navbar */
.top-navbar {
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.topnav-left, .topnav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.topnav-brand {
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  display: flex;
  gap: 12px;
  align-items: center;
}

.logo-img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: #fafaf9;
}

.topnav-divider {
  display: none;
}

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

.topnav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  transition: color 0.2s;
}

.topnav-link:hover {
  color: var(--text-primary);
}

.topnav-link.active {
  color: var(--text-primary);
  font-weight: 600;
}

.topnav-search {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s;
}

.topnav-search:hover {
  color: var(--text-primary);
}

.topnav-hamburger {
  display: none;
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
}

/* Search Drawer */
.search-drawer {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  height: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  z-index: 950;
  overflow: hidden;
  transition: height 0.3s ease;
  display: flex;
  align-items: center;
  padding: 0 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.search-drawer.open {
  height: 48px;
}

.search-drawer input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--text-primary);
  background: transparent;
}

.search-drawer input::placeholder {
  color: #9CA3AF;
}

/* Mobile Dropdown */
.mobile-dropdown {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  z-index: 950;
  display: flex;
  flex-direction: column;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  visibility: hidden;
}

.mobile-dropdown.open {
  transform: translateY(0);
  visibility: visible;
}

.mobile-dropdown a {
  padding: 16px 24px;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.mobile-dropdown a:last-child {
  border-bottom: none;
}

.mobile-dropdown a:hover, .mobile-dropdown a.active {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.topnav-cta {
  background: var(--accent-blue);
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.topnav-cta:hover {
  opacity: 0.9;
  color: white;
}

.topnav-search {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

/* Section Formatting */
.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 20px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
  display: inline-block;
  border-bottom-color: var(--accent-blue);
}

.tool-section {
  margin-bottom: var(--section-gap);
}

/* Tool Cards */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--card-gap);
}

.tool-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tool-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.tool-icon-large {
  font-size: 28px;
  text-align: center;
  margin-bottom: 16px;
}

.tool-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  text-align: center;
}

.tool-desc {
  font-size: 12px;
  color: #888888;
  margin: 0 0 16px 0;
  text-align: center;
  line-height: 1.4;
  flex: 1;
}

.btn-open {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.tool-card:hover .btn-open {
  background-color: var(--accent-blue);
  color: #fff;
}

/* Badges */
.badge {
  position: absolute;
  top: -8px;
  right: -8px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-popular {
  background-color: var(--accent-gold);
  color: #000;
}

.badge-live {
  background-color: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  background-color: var(--accent-green);
  border-radius: 50%;
  display: inline-block;
}

.badge-soon {
  background-color: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge-soon::before {
  content: '';
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
  display: inline-block;
}

.badge-sidebar {
  font-size: 10px;
  color: var(--accent-green);
}

/* Tool Inner View Headers */
.tool-back-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  transition: color 0.2s;
}
.tool-back-link:hover {
  color: var(--text-primary);
}

.tool-header-inner {
  margin-bottom: 32px;
}
.tool-header-inner h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px 0;
}
.tool-header-inner p {
  color: var(--text-secondary);
  margin: 0;
}

.about-tool-section {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.about-tool-section h3 {
  font-size: 16px;
  margin: 0 0 12px 0;
}
.about-tool-section p {
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Responsive */
@media (max-width: 768px) {
  .global-sidebar {
    transform: translateX(-100%);
  }
  
  .global-sidebar.open {
    transform: translateX(0);
    box-shadow: 5px 0 25px rgba(0,0,0,0.5);
  }

  .main-content {
    margin-left: 0;
    padding: 24px 16px;
  }

  .mobile-menu-btn {
    display: block !important;
  }
  
  .tool-grid {
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
  }

  .topnav-links, .topnav-search, .desktop-only {
    display: none !important;
  }

  .topnav-hamburger {
    display: block !important;
  }
}

/* Repair Guides Catalog Layout */
.catalog-top-zone {
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  background: white;
}

.search-container {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

#catalogSearch {
  width: 100%;
  padding: 12px 16px 12px 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1.1rem;
  background: var(--bg-card);
  color: var(--text-primary);
}
#catalogSearch:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.clear-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
}

.catalog-main-zone {
  display: flex;
  flex: 1;
}

.catalog-sidebar {
  width: 200px;
  background: white;
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-category {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 24px;
  margin-bottom: 8px;
}

.brand-link {
  padding: 8px 24px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.brand-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.brand-link.active {
  background: rgba(37, 99, 235, 0.05);
  color: var(--accent-blue);
  border-left-color: var(--accent-blue);
  font-weight: 600;
}

.catalog-grid-wrapper {
  flex: 1;
  padding: 32px 48px;
  background: var(--bg-base);
  overflow-y: auto;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 32px;
}

.series-column {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.series-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.model-item {
  display: flex;
  align-items: center;
  padding: 6px 0;
  text-decoration: none;
  font-size: 0.95rem;
  transition: opacity 0.2s;
}

.guide-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
}

.model-item.has-guide {
  color: var(--text-primary);
}
.model-item.has-guide .guide-dot {
  background-color: var(--accent-blue);
}
.model-item.has-guide:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.model-item.no-guide {
  color: var(--text-muted);
  pointer-events: none;
}
.model-item.no-guide .guide-dot {
  background-color: var(--border);
}

.view-all-link {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
}
.view-all-link:hover {
  text-decoration: underline;
}

/* Device Page Layout */
.device-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  gap: 48px;
}

.device-sidebar {
  width: 220px;
  position: sticky;
  top: 76px; /* 52px topnav + 24px padding */
  height: max-content;
  flex-shrink: 0;
}

.device-sidebar-header {
  margin-bottom: 24px;
}

.device-sidebar-subtext {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.device-sidebar-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
}

.device-nav-link {
  display: block;
  padding: 8px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 4px;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}

.device-nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.device-nav-link.active {
  color: var(--accent-blue);
  border-left-color: var(--accent-blue);
  background: rgba(37, 99, 235, 0.05);
  font-weight: 600;
}

.device-content {
  flex: 1;
  min-width: 0;
}

.device-section {
  margin-bottom: 64px;
  scroll-margin-top: 80px; /* Offset for sticky nav when clicking links */
}

.device-h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.device-h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

/* Guide Cards */
.guide-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.device-guide-card {
  display: flex;
  height: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s;
  position: relative;
}

.device-guide-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: var(--border-hover, #cbd5e1);
}

.guide-card-text {
  width: 40%;
  padding: 16px;
  display: flex;
  align-items: flex-end;
  border-right: 1px solid var(--border);
}

.guide-card-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.guide-card-image {
  width: 60%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2rem;
}

.guide-featured-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent-blue);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Troubleshooting Accordion */
.troubleshooting-accordion details {
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
}

.troubleshooting-accordion summary {
  padding: 16px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary);
  list-style: none; /* Hide default arrow */
  display: flex;
  align-items: center;
}
.troubleshooting-accordion summary::-webkit-details-marker {
  display: none;
}
.troubleshooting-accordion summary::before {
  content: '▼';
  font-size: 0.8rem;
  margin-right: 12px;
  color: var(--text-muted);
  transition: transform 0.2s;
  display: inline-block;
}
.troubleshooting-accordion details[open] summary::before {
  transform: rotate(180deg);
}
.troubleshooting-accordion .accordion-content {
  padding: 0 16px 16px 36px;
  color: var(--text-secondary);
}

/* Parts & Tools Grid */
.parts-tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.pt-col h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.pt-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.pt-item:last-child {
  border-bottom: none;
}
.pt-buy-link {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
}
.pt-buy-link:hover {
  text-decoration: underline;
}

/* Diagnostics Banner */
.diagnostics-cta-banner {
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 12px;
  padding: 32px;
  margin-top: 16px;
}
.diagnostics-cta-banner h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.diagnostics-cta-banner p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.diag-btn-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.diag-btn-banner {
  background: white;
  border: 1px solid var(--border);
  padding: 12px 20px;
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.diag-btn-banner:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.diag-btn-banner i {
  color: var(--accent-blue);
}

/* Monetization: Ads */
.ad-slot {
  background: #F3F4F6;
  border: 1px dashed #D1D5DB;
  color: #9CA3AF;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.ad-300x250 {
  width: 300px;
  height: 250px;
}
.ad-728x90 {
  width: 100%;
  max-width: 728px;
  height: 90px;
}

/* Monetization: Affiliate Sidebar */
.affiliate-card {
  background: white;
  border: 1px solid #E5E7EB;
  padding: 12px;
  border-radius: 8px;
  margin-top: 24px;
}
.affiliate-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.affiliate-card hr {
  margin: 8px 0 12px 0;
  border: 0;
  border-top: 1px solid #E5E7EB;
}
.affiliate-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.affiliate-item:last-child {
  margin-bottom: 0;
}
.affiliate-buy {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8rem;
}
.affiliate-buy:hover {
  text-decoration: underline;
}
.affiliate-disclaimer {
  display: block;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Monetization: Support Footer Strip */
.support-footer-strip {
  background: #EFF6FF;
  color: #1D4ED8;
  text-align: center;
  font-size: 14px;
  padding: 12px 24px;
  width: 100%;
  margin-top: auto;
}

/* Monetization: Guide Layout */
.guide-page-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  gap: 40px;
  padding: 0 24px;
}
.guide-right-sidebar {
  width: 300px;
  position: sticky;
  top: 80px;
  height: max-content;
  flex-shrink: 0;
  padding-top: 40px;
}

/* Blog Layout */
.blog-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}

.blog-hero {
  display: none; /* Removed in favor of featured post */
}

.blog-filters {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  margin-bottom: 24px;
  /* hide scrollbar */
  scrollbar-width: none;
}
.blog-filters::-webkit-scrollbar {
  display: none;
}

.blog-filter {
  padding: 8px 16px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
}

.blog-filter:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.blog-filter.active {
  background: var(--text-primary);
  color: white;
  border-color: var(--text-primary);
}

/* Featured Post */
.featured-post {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  background: #111827;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 32px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

@media (max-width: 768px) {
  .featured-post {
    aspect-ratio: 16 / 9;
  }
}

.featured-post:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.15);
}

.featured-post-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 60%, transparent 100%), #374151; /* Placeholder image bg */
}

.featured-post-content {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 32px;
  width: 100%;
  max-width: 800px;
}

.featured-post-title {
  color: white;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
}

.featured-post-meta {
  color: #D1D5DB;
  font-size: 0.9rem;
  font-weight: 500;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

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

.blog-card {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
}

.blog-card:hover {
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.blog-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #F3F4F6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #9CA3AF;
}

.blog-card-content {
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-category {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: inline-block;
}

/* Category Colors */
.cat-how-to { color: #2563EB; }
.cat-repair-guides { color: #EA580C; }
.cat-buying-advice { color: #16A34A; }
.cat-news { color: #7C3AED; }

.blog-card-title {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Answers Layout */
.answers-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px;
}

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

.answers-h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.btn-ask {
  background: var(--accent-blue);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-ask:hover { background: #1d4ed8; }

.answers-progress-box {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 32px;
}
.ap-text {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.ap-bar-bg {
  width: 100%;
  height: 8px;
  background: #E5E7EB;
  border-radius: 4px;
  overflow: hidden;
}
.ap-bar-fill {
  height: 100%;
  background: #10B981;
}

.answers-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}
.answers-filters {
  display: flex;
  gap: 24px;
}
.ans-filter {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.ans-filter.active {
  color: var(--text-primary);
  border-bottom: 2px solid var(--text-primary);
  padding-bottom: 16px;
  margin-bottom: -17px;
}
.answers-search {
  position: relative;
}
.answers-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.answers-search input {
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  font-size: 0.9rem;
}

.answers-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.q-row {
  display: flex;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  align-items: center;
}
.q-row:hover {
  border-color: #D1D5DB;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.q-img {
  width: 48px;
  height: 48px;
  background: #F3F4F6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #9CA3AF;
  margin-right: 16px;
  flex-shrink: 0;
}

.q-box {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  min-width: 64px;
  margin-right: 24px;
  flex-shrink: 0;
}
.q-box.accepted {
  border-color: #10B981;
  background: rgba(16,185,129,0.05);
}
.q-box.has-answers {
  border-color: #3B82F6;
}
.q-count {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}
.q-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 4px;
}
.q-box.accepted .q-count, .q-box.accepted .q-label { color: #10B981; }
.q-box.has-answers .q-count, .q-box.has-answers .q-label { color: #3B82F6; }

.q-content {
  flex: 1;
  min-width: 0;
}

.q-pill-accepted {
  display: inline-block;
  background: #10B981;
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.q-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-blue);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.q-device {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.q-meta {
  display: flex;
  align-items: center;
  margin-left: 24px;
  text-align: right;
  flex-shrink: 0;
}
.q-meta-text {
  margin-left: 12px;
}
.q-author {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.q-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.q-avatar {
  width: 32px;
  height: 32px;
  background: #E5E7EB;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9CA3AF;
  font-size: 14px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  padding: 24px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.modal-header h2 { font-size: 1.5rem; font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted);
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-weight: 600; margin-bottom: 8px; font-size: 0.9rem;
}
.form-input {
  width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 1rem;
}
.btn-submit {
  width: 100%; background: #10B981; color: white; border: none; padding: 12px; border-radius: 6px; font-weight: 600; font-size: 1rem; cursor: pointer; margin-top: 8px;
}


/* Breadcrumbs */
.breadcrumb-nav {
  margin: 24px 0 0 0;
  font-size: 0.85rem;
  font-weight: 500;
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  list-style: none;
}
.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  padding: 0 8px;
  color: var(--text-muted);
}
.breadcrumb-item a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb-item a:hover {
  color: var(--text-primary);
}
.breadcrumb-item.active {
  color: var(--text-primary);
}

/* Legal Consent Modal */
.legal-consent-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.legal-consent-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.legal-consent-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  padding: 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.legal-consent-overlay.show .legal-consent-modal {
  transform: translateY(0);
}

.legal-consent-modal h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.legal-consent-modal .legal-alert {
  background: rgba(239, 68, 68, 0.1);
  border-left: 4px solid #ef4444;
  padding: 16px;
  border-radius: 0 8px 8px 0;
  margin: 0;
}

.legal-consent-modal p {
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  font-size: 15px;
}

.legal-consent-actions {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  justify-content: flex-end;
}

.legal-btn-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.legal-btn-cancel:hover {
  background: var(--bg-hover);
}

.legal-btn-agree {
  background: #2563EB;
  border: none;
  color: white;
  padding: 12px 32px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.legal-btn-agree:hover {
  background: #1D4ED8;
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

/* Legal Consent Banner */
.legal-consent-banner {
  position: fixed;
  bottom: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 800px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.legal-consent-banner.show {
  bottom: 24px;
}

.legal-banner-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.legal-banner-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.legal-banner-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.legal-banner-text a {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 600;
}

.legal-banner-text a:hover {
  text-decoration: underline;
}

.legal-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legal-btn-agree-banner {
  background: #2563EB;
  border: none;
  color: white;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.legal-btn-agree-banner:hover {
  background: #1D4ED8;
}

.legal-btn-close-banner {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.legal-btn-close-banner:hover {
  color: var(--text-primary);
}

/* Q&A Teaser styling */
.qa-teaser {
  background: #EFF6FF;
  border-radius: 16px;
  padding: 48px;
  text-align: center;
  border: 1px solid #BFDBFE;
}

[data-theme="dark"] .qa-teaser {
  background: rgba(37, 99, 235, 0.05);
  border-color: rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .qa-teaser h2 {
  color: #3b82f6 !important;
}

[data-theme="dark"] .qa-teaser p {
  color: #cbd5e1 !important;
}

@media (max-width: 768px) {
  .legal-consent-banner {
    flex-direction: column;
    align-items: stretch;
    bottom: -300px;
    left: 0;
    transform: none;
    width: 100%;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
    padding: 20px;
    gap: 16px;
  }
  
  .legal-consent-banner.show {
    bottom: 0;
  }

  .legal-banner-actions {
    justify-content: flex-end;
  }
}

/* ==========================================
   MINIMALIST THEME OVERRIDES FOR CATALOGS/SUBPAGES
   ========================================== */

/* Overrides for tool cards */
.test-card, .diagnostics-grid .test-card, .tool-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
  transition: all 0.3s ease !important;
}

.test-card:hover, .diagnostics-grid .test-card:hover, .tool-card:hover {
  border-color: var(--border-active) !important;
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12) !important;
}

.test-icon, .test-card-header i, .tool-icon-large {
  color: var(--text-primary) !important;
  transition: transform 0.3s ease !important;
}

.test-card:hover .test-icon, .tool-card:hover .tool-icon-large {
  transform: scale(1.1) !important;
}

.test-title, .tool-title {
  color: var(--text-primary) !important;
}

.test-desc, .tool-desc {
  color: var(--text-secondary) !important;
}

.test-action, .btn-open {
  color: var(--text-primary) !important;
  font-weight: 700 !important;
  transition: gap 0.2s !important;
  background-color: transparent !important;
  border: none !important;
}

.test-card:hover .test-action {
  gap: 10px !important;
}

/* Overrides for brand/heading icons */
.text-accent, i.text-accent {
  color: var(--text-primary) !important;
}

/* Overrides for buttons */
.btn-primary, .btn-run-all {
  background: var(--text-primary) !important;
  color: var(--bg-card) !important;
  border: 1px solid var(--text-primary) !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  transition: opacity 0.2s, background-color 0.2s !important;
}

.btn-primary:hover, .btn-run-all:hover {
  background: var(--text-primary) !important;
  opacity: 0.9 !important;
}

.btn-run {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
  transition: all 0.2s !important;
}

.btn-run:hover {
  border-color: var(--border-active) !important;
  color: var(--text-primary) !important;
  background: var(--bg-hover) !important;
}

/* Health cards and info banners */
.health-score-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important;
}

.health-score-circle {
  color: var(--text-primary) !important;
}

.device-info-banner {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  color: var(--text-primary) !important;
}

/* Breadcrumbs & Text rules */
.breadcrumb-item a {
  color: var(--text-muted) !important;
  text-decoration: none !important;
  font-weight: 500 !important;
}

.breadcrumb-item a:hover {
  color: var(--text-primary) !important;
}

.breadcrumb-item.active {
  color: var(--text-secondary) !important;
  font-weight: 600 !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

hr {
  border-color: var(--border) !important;
  opacity: 1 !important;
}


