/* 
  SoporteCero - Design System & Custom Stylesheet
  Optimized for high performance, accessibility (Lighthouse 100%), and default Dark Mode.
*/

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

p, h1, h2, h3, h4, li, a {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

:root {
  /* Color Palette (Slate & Cyan) */
  --bg-color: #0f172a;          /* Deep Slate */
  --card-bg: #1e293b;           /* Card/Surface */
  --card-hover-bg: #273549;     /* Slight highlight on hover */
  --text-primary: #f8fafc;       /* Crisp Light Text */
  --text-secondary: #cbd5e1;     /* Highly legible secondary text */
  --text-muted: #94a3b8;        /* Muted labels (Contrast-friendly) */
  --accent-color: #38bdf8;      /* Vibrant Cyan */
  --accent-hover: #7dd3fc;      /* Lighter Cyan for hover state */
  --accent-transparent: rgba(56, 189, 248, 0.1);
  --border-color: #334155;      /* Border color for elements */
  --border-hover: #475569;
  
  --header-bg: rgba(15, 23, 42, 0.85);
  --footer-bg: #090d16;
  --diagnostic-bg: rgba(15, 23, 42, 0.4);
  --inline-code-bg: rgba(51, 65, 85, 0.25);
  --inline-code-border: rgba(255, 255, 255, 0.08);
  --toc-bg: rgba(30, 41, 59, 0.25);
  --toc-border: #334155;
  
  /* Layout & Spacing */
  --max-width: 1200px;
  --header-height: 70px;
  --transition-speed: 0.2s;
  
  /* System Font Stack - No external requests for high performance */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Viewport Color Scheme Settings */
  color-scheme: dark;
}

[data-theme="light"] {
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --card-hover-bg: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent-color: #0284c7; /* deeper blue for contrast */
  --accent-hover: #0369a1;
  --accent-transparent: rgba(2, 132, 199, 0.1);
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  
  --header-bg: rgba(248, 250, 252, 0.85);
  --footer-bg: #f1f5f9;
  --diagnostic-bg: #f1f5f9;
  --inline-code-bg: #e2e8f0;
  --inline-code-border: #cbd5e1;
  --toc-bg: #f8fafc;
  --toc-border: #e2e8f0;
  
  color-scheme: light;
}

/* Logo Prefix style */
.logo-prefix {
  color: var(--accent-color);
  font-family: var(--font-mono);
  font-weight: 800;
  margin-right: 0.15rem;
}

/* Theme Switcher Button */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) ease;
}

.theme-toggle-btn:hover {
  border-color: var(--accent-color);
  color: var(--text-primary);
  background-color: var(--border-color);
}

.moon-icon {
  display: block;
}

.sun-icon {
  display: none;
}

[data-theme="light"] .moon-icon {
  display: none;
}

[data-theme="light"] .sun-icon {
  display: block;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-primary);
  scroll-behavior: smooth;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

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

/* Accessibility Focus States */
*:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 4px;
}

/* Typography with Fluid Sizing (clamps) */
h1 {
  font-size: clamp(1.8rem, 4vw + 1rem, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.4rem, 2.5vw + 1rem, 2rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h3 {
  font-size: clamp(1.1rem, 1.5vw + 1rem, 1.4rem);
  font-weight: 600;
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

a:hover {
  color: var(--accent-hover);
}

/* Header & Logo */
.header-wrapper {
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background-color: var(--header-bg); /* Frosty translucent effect */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
}

.header-wrapper header {
  max-width: var(--max-width);
  height: var(--header-height);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span.logo-cero {
  color: var(--accent-color);
  font-weight: 300; /* Lighter font weight for premium style */
}

.logo-icon {
  flex-shrink: 0;
  color: var(--text-primary);
  transition: transform var(--transition-speed) ease;
}

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

/* Navigation */
nav {
  margin-left: auto;
  margin-right: 1.5rem;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 0.25rem 0;
}

nav a:hover, nav a.active {
  color: var(--text-primary);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-color);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-speed) ease;
}

nav a:hover::after, nav a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Hero Section */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  text-align: center;
}

.hero h1 {
  margin-bottom: 1.25rem;
}

.hero p {
  max-width: 650px;
  margin: 0 auto 2rem;
  font-size: clamp(1rem, 1.2vw + 0.8rem, 1.25rem);
}

/* Search and Filters */
.search-container {
  max-width: 600px;
  margin: 0 auto 2.5rem;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 1rem 1.25rem 1rem 3rem;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
  outline: none;
}

.search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.category-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.filter-btn {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.6rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.filter-btn:hover {
  border-color: var(--accent-color);
  color: var(--text-primary);
}

.filter-btn.active {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--bg-color);
  font-weight: 600;
}

/* Articles Section & Grid */
.main-content {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.section-title {
  margin-bottom: 2rem;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

/* Article Card Component */
.article-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform var(--transition-speed) ease, border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  will-change: transform;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-color);
  box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.5);
}

.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-category {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.card-title a {
  color: inherit;
}

.card-title a:hover {
  color: var(--accent-color);
}

.card-excerpt {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-tag {
  background-color: var(--border-color);
  color: var(--text-secondary);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

/* Post Detail Styles */
.post-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  height: auto;
  max-width: none;
  padding: 0;
  margin: 0 0 3rem 0;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2rem;
}

.post-header .card-category {
  margin-bottom: 0.5rem;
}

.post-header h1 {
  font-size: clamp(1.6rem, 3.5vw + 0.8rem, 2.2rem);
  line-height: 1.3;
  margin-top: 0.75rem;
  margin-bottom: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.post-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 900px) {
  .post-layout {
    grid-template-columns: 2.25fr 1fr;
    align-items: start;
  }
}

.post-article {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.5rem; /* increased padding */
}

/* Headings Inside Content */
.post-article h2 {
  font-size: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
  padding-bottom: 0.5rem;
}

.post-article h3 {
  font-size: 1.25rem;
  margin-top: 2.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.post-article h4 {
  font-size: 1.1rem;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.post-article p {
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
  line-height: 1.75;
}

/* Lists inside Content */
.post-article ul, .post-article ol {
  margin-bottom: 1.5rem;
  padding-left: 1.75rem;
}

.post-article li {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
}

.post-article li::marker {
  color: var(--accent-color);
  font-weight: 700;
}

/* Diagnostic Box */
.diagnostic-box {
  background-color: var(--diagnostic-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
}

.diagnostic-box h3 {
  margin-bottom: 1.25rem;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
}

.diagnostic-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.diagnostic-table td {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}

.diagnostic-table td:first-child {
  font-weight: 600;
  color: var(--text-secondary);
  width: 35%;
}

.diagnostic-table td:last-child {
  color: var(--text-primary);
}

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

/* Steps list */
.solution-steps {
  margin-bottom: 2.5rem;
}

.steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  padding-left: 0;
  margin-bottom: 2.5rem;
}

.step-item {
  display: flex;
  gap: 1.5rem;
  position: relative;
}

.step-number {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background-color: var(--accent-transparent);
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
}

.step-body {
  padding-top: 0.25rem;
  flex: 1;
}

.step-body h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.step-body p {
  margin-bottom: 1.25rem;
}

/* High Contrast Code Containers */
.code-container {
  background-color: #0b0f19; /* Clean dark background */
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin: 1.5rem 0;
}

.code-header {
  background-color: #111827;
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.code-lang {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.copy-btn {
  background: none;
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  color: var(--text-secondary);
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  font-weight: 600;
}

.copy-btn:hover {
  border-color: var(--accent-color);
  color: var(--text-primary);
  background-color: var(--border-color);
}

.code-container pre {
  margin: 0;
  padding: 1.25rem 1.5rem; /* Ample horizontal padding */
  overflow-x: auto;
}

.code-container code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #e2e8f0; /* White/grey text for contrast */
}

/* Sidebar & Prevention Card */
.post-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.prevention-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.75rem;
}

.prevention-card h3 {
  color: #10b981; /* Green success accent */
  margin-top: 0;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.prevention-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.95rem;
  padding-left: 0;
  margin-bottom: 0;
}

.prevention-list li {
  position: relative;
  padding-left: 1.75rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.prevention-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #10b981;
  font-weight: bold;
}

/* AdSense Placeholders styling */
.adsense-placeholder {
  background-color: rgba(30, 41, 59, 0.3);
  border: 2px dashed rgba(71, 85, 105, 0.5);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 3rem 0; /* increased separation */
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100px;
}

.adsense-placeholder span {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  color: var(--text-muted);
}

/* Footer Section */
.footer-wrapper {
  background-color: var(--footer-bg);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
}

.footer-nav a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-nav a:hover {
  color: var(--accent-color);
}

.footer-disclaimer {
  max-width: 700px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.footer-copyright {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Search results info */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1.5rem;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  color: var(--text-secondary);
}

.no-results h3 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .header-wrapper {
    height: 100px !important;
  }
  .header-wrapper header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    height: 60px !important;
    padding: 0 1rem !important;
    position: relative !important;
    gap: 0.75rem !important;
  }
  
  nav ul {
    gap: 1.25rem;
  }
  
  .hero {
    padding: 2rem 1rem 1.5rem;
  }
  
  .category-filters {
    margin-bottom: 2rem;
  }
  
  .post-article {
    padding: 1rem;
  }
  
  .main-content {
    padding: 0 1rem 2rem;
  }
}

/* Inline code elements */
.post-article :not(pre) > code {
  background-color: var(--inline-code-bg);
  border: 1px solid var(--inline-code-border);
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent-color);
  word-break: break-word;
  white-space: pre-wrap;
}

/* Table of Contents */
.toc-container {
  background-color: var(--toc-bg);
  border: 1px solid var(--toc-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
}

.toc-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.toc-item {
  font-size: 0.95rem;
  font-weight: 600;
}

.toc-item a {
  color: var(--accent-color);
  transition: color var(--transition-speed) ease;
}

.toc-item a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.toc-subitem {
  font-size: 0.9rem;
  padding-left: 1.25rem;
  color: var(--text-secondary);
  position: relative;
}

.toc-subitem::before {
  content: "•";
  position: absolute;
  left: 0.5rem;
  color: var(--text-muted);
}

.toc-subitem a {
  color: var(--text-secondary);
  transition: color var(--transition-speed) ease;
}

.toc-subitem a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

/* Related Solutions Section */
.related-solutions-section {
  margin-top: 4rem;
  border-top: 1px solid var(--border-color);
  padding-top: 3rem;
  width: 100%;
}

.related-solutions-section h2 {
  font-size: 1.6rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.related-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: transform var(--transition-speed) ease, border-color var(--transition-speed) ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.related-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-color);
}

.related-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.related-card-title a {
  color: var(--text-primary);
  transition: color var(--transition-speed) ease;
}

.related-card-title a:hover {
  color: var(--accent-color) !important;
}

/* Mobile Responsive Improvements & Tap Targets Usability */
@media (max-width: 768px) {
  /* Layout Stacking */
  .post-layout {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }
  
  .post-article {
    padding: 1rem;
    width: 100%;
  }
  
  .post-sidebar {
    width: 100%;
    margin-top: 2rem;
  }

  /* Typography Scales */
  .post-header h1, h1 {
    font-size: 1.6rem !important;
    line-height: 1.2 !important;
  }
  
  h2, .post-article h2, .section-title {
    font-size: 1.3rem !important;
  }
  
  h3, .post-article h3, .diagnostic-box h3 {
    font-size: 1.1rem !important;
  }

  /* The Diagnostics Table Fix */
  .diagnostic-table,
  .diagnostic-table tbody,
  .diagnostic-table tr,
  .diagnostic-table td {
    display: block;
    width: 100%;
  }
  
  .diagnostic-table tr {
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
    padding-bottom: 0.5rem;
  }
  
  .diagnostic-table tr:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }
  
  .diagnostic-table td {
    border-bottom: none;
    padding: 0.25rem 0;
  }
  
  .diagnostic-table td:first-child {
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
  }

  /* List Alignment */
  .post-article ul, .post-article ol {
    padding-left: 1.25rem;
    margin-left: 0;
  }

  /* Prevent CLS (Cumulative Layout Shift) on ad containers */
  .adsense-placeholder {
    margin: 2rem 0;
    padding: 1rem;
    min-height: auto;
    max-height: 250px;
    height: 150px; /* Fixed fluid height on mobile to reserve ad slot */
  }

  /* Safe touchscreen scrolling for code blocks */
  .code-container pre {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding: 1rem;
  }

  .code-container code {
    white-space: pre;
    word-break: normal;
    word-wrap: normal;
  }

  /* Tap Targets Accessibility for Mobile Usability (Lighthouse standard >= 44px) */
  .filter-btn {
    padding: 0.75rem 1.5rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .copy-btn {
    min-height: 44px;
    padding: 0.6rem 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .footer-nav li a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
  }

  /* Mobile Header Overhaul */
  .logo {
    font-size: 1.2rem !important;
    gap: 0.35rem !important;
  }
  
  .logo-icon {
    width: 20px !important;
    height: 20px !important;
  }

  .theme-toggle-btn {
    width: 32px !important;
    height: 32px !important;
  }

  nav {
    position: absolute !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    height: 40px !important;
    background-color: var(--header-bg) !important;
    border-top: 1px solid var(--border-color) !important;
    border-bottom: 1px solid var(--border-color) !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 1rem !important;
    margin: 0 !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  
  nav::-webkit-scrollbar {
    display: none !important;
  }

  nav ul {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 1.25rem !important;
    width: max-content !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
  }

  nav ul li {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
  }

  nav a {
    font-size: 0.85rem !important;
    min-height: 38px !important;
    padding: 0 0.5rem !important;
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
  }

  .toc-list li {
    margin-bottom: 0.5rem;
  }

  .toc-list li a {
    display: block;
    padding: 0.6rem 0;
    min-height: 44px;
    box-sizing: border-box;
  }

  /* Centered mobile footer overrides */
  footer {
    padding: 2.5rem 1rem !important;
    gap: 1.25rem !important;
  }

  .footer-nav {
    flex-direction: column !important;
    gap: 0.75rem !important;
    align-items: center !important;
    padding: 0 !important;
  }

  .footer-nav li a {
    min-height: auto !important;
    padding: 0.25rem 1rem !important;
    display: inline-block !important;
  }

  .footer-disclaimer {
    font-size: 0.75rem !important;
    line-height: 1.6 !important;
    margin: 0.5rem 0 !important;
  }

  .footer-copyright {
    font-size: 0.8rem !important;
  }
}

