/* Shared site header and footer styles */
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-variable.woff2') format('woff2');
  font-display: swap;
  font-weight: 300 700;
}

@font-face {
  font-family: 'Fira Code';
  src: url('/assets/fonts/fira-code-variable.woff2') format('woff2');
  font-display: swap;
  font-weight: 400 500;
}

:root {
  /* Inform the UA of supported color schemes to reduce default white flash */
  color-scheme: light dark;
  --transition: all 0.2s ease;
  /* Global theme tokens (defaults) */
  --dark-bg: #1e1e1e;
  --dark-card: #2b2a2a;
  --dark-text: #e2e8f0;
  --dark-border: #3f3f4d;
  --light-bg: #f8fafc;
  --light-card: #ffffff;
  --light-text: #1e293b;
  --light-border: #e2e8f0;
  /* Default for link hovers in .tip-box when pages do not set --primary-light */
  --primary-light: #818cf8;
  /* Brand and UI tokens (same across all pages for consistent theme) */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --accent: #f59e0b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --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 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  /* Shared layout tokens (align header/main/footer widths) */
  --dfp-content-max: 1200px;
  --dfp-content-pad: 2rem;
}

/* Fluid media: prevent layout overflow on narrow screens */
img, video, canvas, svg { max-width: 100%; height: auto; }
pre { overflow: auto; }
/* Ensure grid/flex children can shrink without causing horizontal scroll */
* { min-width: 0; }

/* Mobile: prevent page-level horizontal scrolling (keep horizontal scroll inside intended components only) */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }
  body { overscroll-behavior-x: none; }
}

/* During theme boot, disable transitions/animations to avoid flicker */
html.theme-booting *,
html.theme-booting *::before,
html.theme-booting *::after { transition: none !important; animation: none !important; }

/* Ensure background/text colors apply even before page-specific CSS */
html, body { background-color: var(--bg); color: var(--text); }

/* Accessibility: Skip link (visible on focus) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 12px;
  z-index: 10000;
  border-radius: 0 0 8px 0;
  text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus { top: 0; outline: 2px solid #fff; }
/* Fully hide skip link visually unless focused (prevents a 1-2px sliver at the very top) */
.skip-link:not(:focus) {
  position: absolute !important;
  left: 0 !important;
  top: -200vh !important; /* ensure it’s well off-screen */
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  width: 1px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}

/* Global theme mapping (pages may override) */
[data-theme="light"] { --bg: var(--light-bg); --card: var(--light-card); --text: var(--light-text); --border: var(--light-border); }
[data-theme="dark"]  { --bg: var(--dark-bg);  --card: var(--dark-card);  --text: var(--dark-text);  --border: var(--dark-border); }
/* Header */
.header {
  background-color: var(--card);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  /* Prevent subpixel hairline at top on some GPUs/browsers */
  backface-visibility: hidden;
  transform: translateZ(0);
  border-top: 0 !important;
  /* Header sizing/spacing aligns with JSON→CSV baseline */
  /* Reduced vertical padding for a more compact header */
  padding: 0.375rem 2rem; /* 6px vertical */
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* brand | nav (auto width) | actions — ensures nav is centered overall */
  align-items: center;
  column-gap: 1rem; /* consistent spacing between clusters */
  min-height: 44px; /* compact yet accessible tap target */
}

/* Global content container (keeps pages consistent when they use .container) */
.container {
  width: 100%;
  max-width: var(--dfp-content-max);
  margin: 0 auto;
  padding: 0 var(--dfp-content-pad);
}

/* Drawer-only elements are hidden on desktop/tablet */
.nav-drawer-header { display: none; }
.nav-divider { display: none; }

/* Reduce CLS: reserve space before JS injects the shared header/footer (desktop CWV fix) */
#header-placeholder { display: block; min-height: 60px; }
/* Footer from LayoutUtils: avoid :empty — after inject, :empty stops matching and min-height drops (CLS). Same pattern as #newsletter-placeholder. */
#footer-placeholder {
  display: block;
  min-height: 24rem;
  contain: layout;
}
/* Newsletter injects on DOMContentLoaded. Avoid :empty — once children mount, :empty no longer matches and min-height is dropped (CLS). */
#newsletter-placeholder {
  display: block;
  min-height: 24rem;
  contain: layout;
}
body.home #newsletter-placeholder { min-height: 30rem; }
/* Light theme: premium silver header gradient (Apple-like) */
[data-theme="light"] .header {
  background: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%) !important;
  border-bottom: 1px solid rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 .5px 0 rgba(0,0,0,0.03);
}
/* Avoid thin blue focus/tap highlight artifact near the brand logo */
.header .logo { -webkit-tap-highlight-color: transparent; }
/* Suppress default focus ring; we restore visible focus only for keyboard users below */
.header .logo:focus { outline: none !important; box-shadow: none !important; }
.header .logo:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  position: relative;
  min-height: 50px;
}
.logo,
header .logo,
.header .logo,
.article-header .logo { /* Normalize brand across all pages (JSON→CSV as source of truth) */
  display: inline-flex;
  align-items: center;
  gap: 0.45rem !important; /* consistent spacing */
  font-weight: 600 !important;
  font-size: 1rem !important; /* compact, consistent text size */
  line-height: 1 !important;    /* tight alignment */
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.2s;
  margin-left: 0 !important;    /* remove page-specific left margins */
  justify-self: start; /* occupy left grid track */
}
.logo span,
header .logo span,
.header .logo span,
.article-header .logo span {
  font-size: 1rem !important;
  line-height: 1 !important;
  font-weight: 600 !important;
}
/* Fallback normalization when the logo starts with an emoji/span instead of <i> */
.header .logo > :first-child {
  display: inline-block;
  width: 1.1em;
  text-align: center;
  line-height: 1 !important;
  vertical-align: -1px;
}
/* Keep icon size/alignment consistent; override page-level .logo-icon rules */
.logo i,
.logo .fa,
.logo .logo-icon,
header .logo .logo-icon,
.header .logo .logo-icon,
.article-header .logo .logo-icon {
  font-size: 1em !important;  /* icon matches text cap height */
  width: 1.1em !important;
  display: inline-block;
  text-align: center;
  line-height: 1 !important;
  vertical-align: -1px;
}

/* Final guard: force CSV baseline on any page-defined header rules loaded after shared.css */
/* Final guard: enforce the compact CSV baseline regardless of page overrides */
body .header .logo { font-size: 1rem !important; line-height: 1 !important; gap: .45rem !important; font-weight: 600 !important; }
body .header .logo .logo-icon { font-size: 1em !important; width: 1.1em !important; line-height: 1 !important; vertical-align: -1px;   display: inline-block;}
body .header .logo span { font-size: 1rem !important; line-height: 1 !important; font-weight: 600 !important; }
.logo:hover { opacity: 0.9; }
.nav-container {
  /* Desktop/tablet: occupy center lane without overlapping actions */
  position: static;
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0; /* allow grid to shrink; prevents overflow clipping */
  justify-self: center; /* center the nav cluster within the middle grid column */
}
.nav { display: flex; gap: 2rem; align-items: center; justify-content: center; flex-wrap: wrap; }
@media (max-width: 1200px) { .nav { gap: 1.5rem; } }
@media (max-width: 1024px) { .nav { gap: 1rem; } }
.nav-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem; /* unify link size across pages */
  line-height: 1;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: var(--transition);
  white-space: nowrap;
}
.nav-link:hover { color: var(--primary); background-color: var(--bg); }
.nav-link.active { color: var(--primary); font-weight: 600; }
.header-actions { display: flex; gap: 1rem; align-items: center; position: relative; z-index: 2; justify-self: end; }
.header-actions .btn {
  width: 2rem; height: 2rem; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: var(--transition);
  border: 1px solid var(--border) !important; background-color: var(--card) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.header-actions .btn-icon { width: 2rem; height: 2rem; }
.header-actions .btn:hover { background-color: var(--bg) !important; transform: translateY(-1px); }
.header-actions .btn i { font-size: 1.1rem; color: var(--text) !important; display: inline-block; transition: transform .2s ease; }

/* Install / Add to home screen CTA (header) */
.install-app-wrap { position: relative; display: flex; align-items: center; }
.install-app-btn { flex-shrink: 0; }
.install-app-popover {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  min-width: 260px;
  max-width: 320px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 1002;
  padding: 0;
}
.install-app-popover[hidden] { display: none !important; }
.install-app-popover-inner { padding: 1rem 1.25rem; }
.install-app-title { font-weight: 600; font-size: 0.95rem; margin: 0 0 0.5rem; color: var(--text); }
.install-app-popover p { font-size: 0.875rem; line-height: 1.5; margin: 0 0 0.5rem; color: var(--text); opacity: 0.95; }
.install-app-popover .install-app-fallback { margin-bottom: 0.75rem; }
.install-app-tips { list-style: none; padding: 0; margin: 0 0 0.75rem; font-size: 0.85rem; color: var(--text); opacity: 0.9; }
.install-app-tips li { padding: 0.2rem 0; padding-left: 1rem; position: relative; }
.install-app-tips li::before { content: "•"; position: absolute; left: 0; color: var(--primary); }
.install-app-dismiss {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}
.install-app-dismiss:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Mobile menu button - hidden by default on desktop */
.mobile-menu-btn { display: none !important; }

/* Desktop: explicitly hide mobile menu button */
@media (min-width: 768px) {
  .header .mobile-menu-btn,
  .header-actions .mobile-menu-btn,
  .btn.mobile-menu-btn { 
    display: none !important; 
    visibility: hidden !important;
  }
}

/* Mobile: show mobile menu button only on small screens */
@media (max-width: 767px) {
  /* Header grid: when nav is hidden, ensure actions stay right-aligned (logo | actions) */
  .header {
    grid-template-columns: 1fr auto;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    box-sizing: border-box !important;
  }
  .header .logo { grid-column: 1; justify-self: start; }
  .header-actions { grid-column: 2; justify-self: end; }

  .mobile-menu-btn { display: flex !important; visibility: visible !important; }
  /* Mobile: modern right-side drawer + backdrop (common website pattern) */
  .nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    /* Header uses transform -> creates a stacking context. Keep backdrop below header. */
    z-index: 900;
  }
  body.nav-open .nav-backdrop { display: block; }
  body.nav-open { overflow: hidden; }

  .nav-container {
    /* Keep out of flow when closed (prevents body scrollWidth inflation in some browsers) */
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    height: 100vh;
    width: min(260px, 70vw);
    max-width: 70vw;
    box-sizing: border-box;
    background-color: var(--card);
    box-shadow: var(--shadow-md);
    border-left: 1px solid var(--border);
    padding: 0.75rem;
    z-index: 1001;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
  }
  .nav-container.active {
    display: block;
    animation: dfp-mobile-drawer-in 220ms ease;
  }

  @keyframes dfp-mobile-drawer-in {
    from { transform: translateX(110%); }
    to { transform: translateX(0); }
  }

  /* Drawer header row (title + close) */
  .nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.25rem 0.25rem 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
  }
  .nav-drawer-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    opacity: 0.95;
  }
  .nav-close-btn {
    width: 2rem;
    height: 2rem;
  }

  .nav { flex-direction: column; gap: 0.35rem; align-items: stretch; }
  .nav-link {
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    width: 100%;
    text-align: left;
  }

  /* Divider between nav groups */
  .nav-divider {
    display: block;
    height: 1px;
    width: 100%;
    background: var(--border);
    margin: 0.35rem 0;
    opacity: 0.9;
  }

  /* Stronger active-state in drawer */
  .nav-container .nav-link.active {
    background-color: rgba(108,110,189,0.14);
    border: 1px solid rgba(108,110,189,0.28);
  }
}
/* Footer */
.site-footer {
  background-color: var(--card);
  color: var(--text);
  padding: 3rem 0 !important;
  margin-top: auto;
  width: 100%;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.6;
}

/* Light theme: make footer consistent across ALL pages (tools + blog + misc) */
html[data-theme="light"] { --dfp-silver: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%); }
html[data-theme="light"] .site-footer {
  background: var(--dfp-silver) !important;
  border-top: 1px solid rgba(0,0,0,0.08) !important;
  /* Match existing tool/home footer shadow intensity for visual consistency */
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

/* JSON Validator + JSON Formatter: reduce global header height (both themes) */
body.json-validator .header,
body.json-formatter .header {
  /* Original: padding-top/bottom: 1rem (16px) each, min-height: 56px */
  /* New: padding-top/bottom: 0.6875rem (11px) each => total -10px; min-height reduced by 10px */
  /* Further reduce by ~10px total while keeping 44px min for tap targets */
  padding-top: 0.375rem;   /* 6px */
  padding-bottom: 0.375rem;/* 6px */
  min-height: 44px;
}
/* Preferred: centered inner footer container (matches main content width) */
.site-footer .footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px;
  box-sizing: border-box;
}

/* New footer layout: brand row + 4 columns (responsive) */
.site-footer .footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem; /* a touch more breathing room before the divider */
}
.site-footer .footer-brand {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 560px;
}
.site-footer .footer-brand:hover { color: inherit; }
.site-footer .footer-logo {
  font-weight: 750;
  letter-spacing: -0.01em;
  font-size: 1.25rem;
  color: var(--primary);
}
.site-footer .footer-description {
  font-size: 0.95rem;
  opacity: 0.82;
  line-height: 1.5;
  margin: 0;
}
.site-footer .footer-divider {
  height: 1px;
  width: 100%;
  background: var(--border);
  /* Subtle separator (premium look) */
  opacity: 0.25;
  margin: 1.25rem 0 1.75rem;
}

.site-footer .footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 220px;
  column-gap: 24px;
  row-gap: 18px;
  align-items: start;
  margin-bottom: 2rem;
}

/* Light theme: editor/tool card footers use the same premium silver gradient */
html[data-theme="light"] body.json-validator .card > .toolbar,
html[data-theme="light"] body.json-validator .card > .editor-toolbar,
html[data-theme="light"] body.json-validator .editor-card > .toolbar,
html[data-theme="light"] body.json-validator .editor-card > .editor-toolbar,
html[data-theme="light"] body.json-validator .preview-footer,
html[data-theme="light"] body.json-validator .tool-card-footer,
html[data-theme="light"] body.json-validator .side-panel-footer,
html[data-theme="light"] body.json-validator .modal-footer {
  background: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%) !important;
  border-top: none !important; /* avoid double seams with adjacent borders */
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.08); /* subtle top divider */
  /* Ensure footer fills the rounded corners of its parent container without gaps */
  border-bottom-left-radius: inherit !important; /* match parent .card corners */
  border-bottom-right-radius: inherit !important;
  background-clip: padding-box;
  margin-bottom: 0;
  /* Stable height even when empty or with single-line content */
  min-height: 48px;
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
}

/* JSON Validator: normalize tip lines in the right editor footer (remove negative margins) */
html[data-theme="light"] body.json-validator .right-card > .toolbar span { margin-bottom: 0 !important; }
html[data-theme="light"] body.json-validator .right-card > .toolbar > div { margin-top: 0 !important; }
html[data-theme="light"] body.json-validator .right-card > .toolbar span { line-height: 1.1 !important; }
html[data-theme="light"] body.json-validator .left-card > .toolbar .message,
html[data-theme="light"] body.json-validator .right-card > .toolbar .message { margin: .35rem 0 !important; }

/* JSON Validator: make card clip the toolbar corners; use toolbar-scoped overlay that grows with content */
html[data-theme="light"] body.json-validator .left-card,
html[data-theme="light"] body.json-validator .right-card { position: relative; overflow: hidden; }
/* Toolbars themselves are transparent; the gradient is painted by ::before at 100% height */
html[data-theme="light"] body.json-validator .left-card > .toolbar,
html[data-theme="light"] body.json-validator .right-card > .toolbar {
  background: transparent !important;
  border-top: none !important;
  box-shadow: none !important;
  position: relative;
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
  /* mirror page CSS: .toolbar { padding: .75rem 1rem } */
  --jv-toolbar-pad-x: 1rem;
  min-height: 56px;
}
html[data-theme="light"] body.json-validator .left-card > .toolbar::before,
html[data-theme="light"] body.json-validator .right-card > .toolbar::before {
  content: "";
  position: absolute;
  /* Extend across horizontal padding; extra 1px to fully seal edges */
  left: calc(-22px - var(--jv-toolbar-pad-x, 1rem));
  right: calc(-7px - var(--jv-toolbar-pad-x, 1rem));
  bottom: -19px;
  top: 0;
  background: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%);
  border-top: 1px solid rgba(0,0,0,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
  will-change: transform;
  z-index: 0;
  pointer-events: none;
}
/* Keep toolbar content above the ::before layer */
html[data-theme="light"] body.json-validator .left-card > .toolbar > *,
html[data-theme="light"] body.json-validator .right-card > .toolbar > * { position: relative; z-index: 1; }

/* JSON Validator (light): reuse the premium silver across key surfaces */
html[data-theme="light"] body.json-validator { --dfp-silver: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%); }

/* Cards (editor and generic) */
html[data-theme="light"] body.json-validator .card {
  background: var(--dfp-silver) !important;
  border-color: rgba(0,0,0,0.08) !important;
  /* subtle top highlight for a premium feel */
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

/* Stats bar */
html[data-theme="light"] body.json-validator .stats-bar {
  background: var(--dfp-silver) !important;
  border-color: rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

/* FAQ items */
html[data-theme="light"] body.json-validator .yt-faq-item {
  background: var(--dfp-silver) !important;
  border-color: rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

/* SEO cards */
html[data-theme="light"] body.json-validator .seo-card {
  background: var(--dfp-silver) !important;
  border-color: rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

/* Page footer */
html[data-theme="light"] body.json-validator .site-footer {
  background: var(--dfp-silver) !important;
  border-top: 1px solid rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

/* Light theme: Apply the same premium silver look to other tools (JSON Formatter, JSON→XML, JSON→YAML, JSON→CSV, JSON Reader) */
/* Define page-scoped silver variable */
html[data-theme="light"] body.json-formatter,
html[data-theme="light"] body.json-repair,
html[data-theme="light"] body.json-fixer,
html[data-theme="light"] body.json-to-pdf,
html[data-theme="light"] body.json-to-xml,
html[data-theme="light"] body.json-to-yaml,
  html[data-theme="light"] body.json-to-csv,
  html[data-theme="light"] body.csv-to-json,
  html[data-theme="light"] body.json-to-openapi,
  html[data-theme="light"] body.xml-to-json,
  html[data-theme="light"] body.yaml-to-json,
  html[data-theme="light"] body.excel-to-json,
  html[data-theme="light"] body.json-reader { --dfp-silver: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%); }
  html[data-theme="light"] body.json-viewer,
  html[data-theme="light"] body.json-object-viewer,
  html[data-theme="light"] body.json-code-generator { --dfp-silver: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%); }

/* Cards */
  html[data-theme="light"] body.json-formatter .card,
  html[data-theme="light"] body.json-repair .card,
  html[data-theme="light"] body.json-fixer .card,
  html[data-theme="light"] body.json-to-pdf .card,
  html[data-theme="light"] body.json-to-xml .card,
  html[data-theme="light"] body.json-to-yaml .card,
  html[data-theme="light"] body.json-to-csv .card,
  html[data-theme="light"] body.csv-to-json .card,
  html[data-theme="light"] body.json-to-openapi .card,
  html[data-theme="light"] body.xml-to-json .card,
  html[data-theme="light"] body.yaml-to-json .card,
  html[data-theme="light"] body.excel-to-json .card,
  html[data-theme="light"] body.json-reader .card,
  html[data-theme="light"] body.json-viewer .card,
  html[data-theme="light"] body.json-object-viewer .card,
  html[data-theme="light"] body.json-object-viewer .panel,
  html[data-theme="light"] body.json-code-generator .card {
    background: var(--dfp-silver) !important;
    border-color: rgba(0,0,0,0.08) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
  }

/* Card headers - match page header styling */
  html[data-theme="light"] body.json-formatter .card-header,
  html[data-theme="light"] body.json-repair .card-header,
  html[data-theme="light"] body.json-fixer .card-header,
  html[data-theme="light"] body.json-to-pdf .card-header,
  html[data-theme="light"] body.json-to-xml .card-header,
  html[data-theme="light"] body.json-to-yaml .card-header,
  html[data-theme="light"] body.json-to-csv .card-header,
  html[data-theme="light"] body.csv-to-json .card-header,
  html[data-theme="light"] body.json-to-openapi .card-header,
  html[data-theme="light"] body.xml-to-json .card-header,
  html[data-theme="light"] body.yaml-to-json .card-header,
  html[data-theme="light"] body.excel-to-json .card-header,
  html[data-theme="light"] body.json-reader .card-header,
  html[data-theme="light"] body.json-viewer .card-header,
  html[data-theme="light"] body.json-object-viewer .card-header,
  html[data-theme="light"] body.json-object-viewer .panel-header,
  html[data-theme="light"] body.json-code-generator .card-header {
    background: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%) !important;
    border-bottom: 1px solid rgba(0,0,0,0.08) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 .5px 0 rgba(0,0,0,0.03);
  }

/* JSON Fixer: editor footer + SEO card follow the same premium header surface in light theme */
html[data-theme="light"] body.json-fixer .panel-footer,
html[data-theme="light"] body.json-fixer .seo-card {
  background: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%) !important;
  border-color: rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

/* JSON Repair: editor footer, SEO cards, FAQ - match page header styling */
html[data-theme="light"] body.json-repair .panel-footer {
  background: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%) !important;
  border-top: 1px solid rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}
html[data-theme="light"] body.json-repair .seo-card {
  background: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%) !important;
  border-color: rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}
html[data-theme="light"] body.json-repair .yt-faq-item {
  background: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%) !important;
  border-color: rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}
html[data-theme="light"] body.json-repair .summary-card {
  background: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%) !important;
  border-color: rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

/* CSV to JSON: settings panel matches the page header surface in light theme */
html[data-theme="light"] body.csv-to-json .settings-card {
  background: var(--dfp-silver) !important;
  border-color: rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

/* JSON to OpenAPI: settings panel matches the page header surface in light theme */
html[data-theme="light"] body.json-to-openapi .settings-panel {
  background: var(--dfp-silver) !important;
  border-color: rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

/* Excel to JSON: settings panel matches the page header surface in light theme */
html[data-theme="light"] body.excel-to-json .settings-card {
  background: var(--dfp-silver) !important;
  border-color: rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

/* YAML to JSON: settings panel matches the page header surface in light theme */
html[data-theme="light"] body.yaml-to-json .settings-card {
  background: var(--dfp-silver) !important;
  border-color: rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

/* CSV to JSON: light theme controls need stronger contrast on the silver settings surface */
html[data-theme="light"] body.csv-to-json .settings-card .field select,
html[data-theme="light"] body.csv-to-json .settings-card .field input[type="text"]{
  background: rgba(255,255,255,0.78) !important;
  border-color: rgba(0,0,0,0.16) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), 0 1px 2px rgba(0,0,0,0.04);
}
html[data-theme="light"] body.csv-to-json .settings-card .field select:focus,
html[data-theme="light"] body.csv-to-json .settings-card .field input[type="text"]:focus{
  border-color: rgba(99,102,241,0.65) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12), inset 0 1px 0 rgba(255,255,255,0.85) !important;
}

/* YAML to JSON: light theme controls need stronger contrast on the silver settings surface */
html[data-theme="light"] body.yaml-to-json .settings-card .field select,
html[data-theme="light"] body.yaml-to-json .settings-card .field input[type="text"]{
  background: rgba(255,255,255,0.78) !important;
  border-color: rgba(0,0,0,0.16) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), 0 1px 2px rgba(0,0,0,0.04);
}
html[data-theme="light"] body.yaml-to-json .settings-card .field select:focus,
html[data-theme="light"] body.yaml-to-json .settings-card .field input[type="text"]:focus{
  border-color: rgba(99,102,241,0.65) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12), inset 0 1px 0 rgba(255,255,255,0.85) !important;
}

/* XML to JSON: settings panel matches the page header surface in light theme */
html[data-theme="light"] body.xml-to-json .settings-card {
  background: var(--dfp-silver) !important;
  border-color: rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

/* XML to JSON: light theme controls need stronger contrast on the silver settings surface */
html[data-theme="light"] body.xml-to-json .settings-card .field select,
html[data-theme="light"] body.xml-to-json .settings-card .field input[type="text"]{
  background: rgba(255,255,255,0.78) !important;
  border-color: rgba(0,0,0,0.16) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), 0 1px 2px rgba(0,0,0,0.04);
}
html[data-theme="light"] body.xml-to-json .settings-card .field select:focus,
html[data-theme="light"] body.xml-to-json .settings-card .field input[type="text"]:focus{
  border-color: rgba(99,102,241,0.65) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12), inset 0 1px 0 rgba(255,255,255,0.85) !important;
}

/* Feature cards/articles in json-reader - removed duplicate, handled below */

/* JSON Formatter uses .editor-card instead of .card */
html[data-theme="light"] body.json-formatter .editor-card {
  background: var(--dfp-silver) !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
  position: relative;
  overflow: hidden;
}

/* Stats bar */
  html[data-theme="light"] body.json-formatter .stats-bar,
  html[data-theme="light"] body.json-to-pdf .stats-bar,
  html[data-theme="light"] body.json-to-xml .stats-bar,
  html[data-theme="light"] body.json-to-yaml .stats-bar,
  html[data-theme="light"] body.json-to-csv .stats-bar,
  html[data-theme="light"] body.csv-to-json .stats-bar,
  html[data-theme="light"] body.json-to-openapi .stats-bar,
  html[data-theme="light"] body.xml-to-json .stats-bar,
  html[data-theme="light"] body.yaml-to-json .stats-bar,
  html[data-theme="light"] body.excel-to-json .stats-bar,
  html[data-theme="light"] body.json-viewer .stats-bar,
  html[data-theme="light"] body.json-code-generator .stats-bar {
    background: var(--dfp-silver) !important;
    border-color: rgba(0,0,0,0.08) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
  }

  /* Config bar - match card header styling */
  html[data-theme="light"] body.json-code-generator .config-bar {
    background: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%) !important;
    border-color: rgba(0,0,0,0.08) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 .5px 0 rgba(0,0,0,0.03);
  }

  /* Language buttons */
  html[data-theme="light"] body.json-code-generator .lang-btn {
    background: rgba(255,255,255,0.6) !important;
    border-color: rgba(0,0,0,0.12) !important;
  }

  html[data-theme="light"] body.json-code-generator .lang-btn:hover {
    background: rgba(255,255,255,0.8) !important;
    border-color: rgba(0,0,0,0.16) !important;
  }

  html[data-theme="light"] body.json-code-generator .lang-btn.active {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
  }

  /* Config inputs */
  html[data-theme="light"] body.json-code-generator .config-group input[type="text"] {
    background: rgba(255,255,255,0.8) !important;
    border-color: rgba(0,0,0,0.12) !important;
  }

/* FAQ items - Clean white background like CSV to JSON (no silver gradient on SEO sections) */
/* Removed silver gradient - SEO sections should use clean white background in light theme */

/* SEO cards - Clean white background like CSV to JSON (no silver gradient on SEO sections) */
/* Removed silver gradient - SEO sections should use clean white background in light theme */

/* Page footer */
html[data-theme="light"] body.json-formatter .site-footer,
html[data-theme="light"] body.json-to-pdf .site-footer,
html[data-theme="light"] body.json-to-xml .site-footer,
html[data-theme="light"] body.json-to-yaml .site-footer,
html[data-theme="light"] body.json-to-csv .site-footer,
html[data-theme="light"] body.json-to-openapi .site-footer,
html[data-theme="light"] body.json-reader .site-footer,
html[data-theme="light"] body.json-viewer .site-footer,
html[data-theme="light"] body.json-object-viewer .site-footer,
html[data-theme="light"] body.json-code-generator .site-footer {
  background: var(--dfp-silver) !important;
  border-top: 1px solid rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

/* Editor card footers: seamless gradient underlay via toolbar ::before (avoid corner seams) */
html[data-theme="light"] body.json-formatter .left-card,
html[data-theme="light"] body.json-formatter .right-card,
html[data-theme="light"] body.json-to-pdf .left-card,
html[data-theme="light"] body.json-to-pdf .right-card,
html[data-theme="light"] body.json-to-xml .left-card,
html[data-theme="light"] body.json-to-xml .right-card,
html[data-theme="light"] body.json-to-yaml .left-card,
html[data-theme="light"] body.json-to-yaml .right-card,
  html[data-theme="light"] body.json-to-csv .left-card,
  html[data-theme="light"] body.json-to-csv .right-card,
  html[data-theme="light"] body.csv-to-json .left-card,
  html[data-theme="light"] body.csv-to-json .right-card,
  html[data-theme="light"] body.json-to-openapi .left-card,
  html[data-theme="light"] body.json-to-openapi .right-card,
  html[data-theme="light"] body.xml-to-json .left-card,
  html[data-theme="light"] body.xml-to-json .right-card,
  html[data-theme="light"] body.yaml-to-json .left-card,
  html[data-theme="light"] body.yaml-to-json .right-card,
  html[data-theme="light"] body.excel-to-json .left-card,
  html[data-theme="light"] body.excel-to-json .right-card,
  html[data-theme="light"] body.json-viewer .card,
  html[data-theme="light"] body.json-object-viewer .card,
  html[data-theme="light"] body.json-object-viewer .panel,
  html[data-theme="light"] body.json-code-generator .card { position: relative; overflow: hidden; }

/* JSON Formatter editor toolbar underlay */
html[data-theme="light"] body.json-formatter .editor-card > .toolbar {
  background: transparent !important;
  border-top: none !important;
  box-shadow: none !important;
  position: relative;
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
  --jv-toolbar-pad-x: 1rem;
  min-height: 56px;
}
html[data-theme="light"] body.json-formatter .editor-card > .toolbar::before {
  content: "";
  position: absolute;
  left: calc(-22px - var(--jv-toolbar-pad-x, 1rem));
  right: calc(-7px - var(--jv-toolbar-pad-x, 1rem));
  bottom: -19px;
  top: 0;
  background: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%);
  border-top: 1px solid rgba(0,0,0,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
  will-change: transform;
  z-index: 0;
  pointer-events: none;
}
html[data-theme="light"] body.json-formatter .editor-card > .toolbar > * { position: relative; z-index: 1; }

/* JSON Formatter editor header underlay (match footer color) */
html[data-theme="light"] body.json-formatter .editor-card > .editor-header {
  background: transparent !important;
  position: relative;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}
html[data-theme="light"] body.json-formatter .editor-card > .editor-header::before {
  content: "";
  position: absolute;
  left: calc(-22px - var(--jv-toolbar-pad-x, 1rem));
  right: calc(-7px - var(--jv-toolbar-pad-x, 1rem));
  top: -19px;
  bottom: 0;
  background: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  will-change: transform;
  z-index: 0;
  pointer-events: none;
}
html[data-theme="light"] body.json-formatter .editor-card > .editor-header > * { position: relative; z-index: 1; }

/* JSON Formatter and JSON Reader feature cards */
html[data-theme="light"] body.json-formatter .feature-card,
html[data-theme="light"] body.json-reader .feature-card {
  background: var(--dfp-silver) !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), var(--shadow-sm);
}
html[data-theme="light"] body.json-formatter .accordion-item {
  background: var(--dfp-silver) !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

/* JSON Formatter: educational/info cards */
html[data-theme="light"] body.json-formatter .info-section {
  background: var(--dfp-silver) !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), var(--shadow-md) !important;
}

html[data-theme="light"] body.json-formatter .left-card > .toolbar,
html[data-theme="light"] body.json-formatter .right-card > .toolbar,
html[data-theme="light"] body.json-to-xml .left-card > .toolbar,
html[data-theme="light"] body.json-to-xml .right-card > .toolbar,
html[data-theme="light"] body.json-to-yaml .left-card > .toolbar,
html[data-theme="light"] body.json-to-yaml .right-card > .toolbar,
  html[data-theme="light"] body.json-to-csv .left-card > .toolbar,
  html[data-theme="light"] body.json-to-csv .right-card > .toolbar,
  html[data-theme="light"] body.csv-to-json .left-card > .toolbar,
  html[data-theme="light"] body.csv-to-json .right-card > .toolbar,
  html[data-theme="light"] body.json-to-openapi .left-card > .toolbar,
  html[data-theme="light"] body.json-to-openapi .right-card > .toolbar,
  html[data-theme="light"] body.xml-to-json .left-card > .toolbar,
  html[data-theme="light"] body.xml-to-json .right-card > .toolbar,
html[data-theme="light"] body.excel-to-json .left-card > .toolbar,
html[data-theme="light"] body.excel-to-json .right-card > .toolbar,
  html[data-theme="light"] body.json-viewer .card > .toolbar,
  html[data-theme="light"] body.json-object-viewer .card > .toolbar,
  html[data-theme="light"] body.json-object-viewer .panel-toolbar,
  html[data-theme="light"] body.json-code-generator .card > .toolbar {
    background: transparent !important;
    border-top: none !important;
  box-shadow: none !important;
  position: relative;
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
  --jv-toolbar-pad-x: 1rem; /* mirrors page toolbar padding */
  min-height: 56px;
}
html[data-theme="light"] body.json-formatter .left-card > .toolbar::before,
html[data-theme="light"] body.json-formatter .right-card > .toolbar::before,
html[data-theme="light"] body.json-to-xml .left-card > .toolbar::before,
html[data-theme="light"] body.json-to-xml .right-card > .toolbar::before,
html[data-theme="light"] body.json-to-yaml .left-card > .toolbar::before,
html[data-theme="light"] body.json-to-yaml .right-card > .toolbar::before,
  html[data-theme="light"] body.json-to-csv .left-card > .toolbar::before,
  html[data-theme="light"] body.json-to-csv .right-card > .toolbar::before,
  html[data-theme="light"] body.csv-to-json .left-card > .toolbar::before,
  html[data-theme="light"] body.csv-to-json .right-card > .toolbar::before,
  html[data-theme="light"] body.json-to-openapi .left-card > .toolbar::before,
  html[data-theme="light"] body.json-to-openapi .right-card > .toolbar::before,
  html[data-theme="light"] body.xml-to-json .left-card > .toolbar::before,
  html[data-theme="light"] body.xml-to-json .right-card > .toolbar::before,
  html[data-theme="light"] body.json-viewer .card > .toolbar::before,
  html[data-theme="light"] body.json-object-viewer .card > .toolbar::before,
  html[data-theme="light"] body.json-object-viewer .panel-toolbar::before,
  html[data-theme="light"] body.json-code-generator .card > .toolbar::before {
    content: "";
    position: absolute;
  left: calc(-22px - var(--jv-toolbar-pad-x, 1rem));
  right: calc(-7px - var(--jv-toolbar-pad-x, 1rem));
  bottom: -19px;
  top: 0;
  background: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%);
  border-top: 1px solid rgba(0,0,0,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
  will-change: transform;
  z-index: 0;
  pointer-events: none;
}
/* Keep toolbar content above the underlay */
html[data-theme="light"] body.json-formatter .left-card > .toolbar > *,
html[data-theme="light"] body.json-formatter .right-card > .toolbar > *,
html[data-theme="light"] body.json-to-xml .left-card > .toolbar > *,
html[data-theme="light"] body.json-to-xml .right-card > .toolbar > *,
html[data-theme="light"] body.json-to-yaml .left-card > .toolbar > *,
html[data-theme="light"] body.json-to-yaml .right-card > .toolbar > *,
  html[data-theme="light"] body.json-to-csv .left-card > .toolbar > *,
  html[data-theme="light"] body.json-to-csv .right-card > .toolbar > *,
  html[data-theme="light"] body.csv-to-json .left-card > .toolbar > *,
  html[data-theme="light"] body.csv-to-json .right-card > .toolbar > *,
  html[data-theme="light"] body.json-to-openapi .left-card > .toolbar > *,
  html[data-theme="light"] body.json-to-openapi .right-card > .toolbar > *,
  html[data-theme="light"] body.xml-to-json .left-card > .toolbar > *,
  html[data-theme="light"] body.xml-to-json .right-card > .toolbar > *,
  html[data-theme="light"] body.json-viewer .card > .toolbar > *,
  html[data-theme="light"] body.json-object-viewer .card > .toolbar > *,
  html[data-theme="light"] body.json-object-viewer .panel-toolbar > *,
  html[data-theme="light"] body.json-code-generator .card > .toolbar > * { position: relative; z-index: 1; }

/* Home page (light): adopt silver theme for footer and FAQ cards */
html[data-theme="light"] body.home { --dfp-silver: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%); }
html[data-theme="light"] body.home .site-footer {
  background: var(--dfp-silver) !important;
  border-top: 1px solid rgba(0,0,0,0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
/* Home FAQ light theme: same as json-compare (no silver gradient) */
html[data-theme="light"] body.home .faq-section .accordion-item {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(15,23,42,0.06);
}
html[data-theme="light"] body.home .faq-section .accordion-header {
  color: #1e293b;
  background: #ffffff;
}
html[data-theme="light"] body.home .faq-section .accordion-header:hover {
  background: #fafafa;
}
html[data-theme="light"] body.home .faq-section .accordion-item.active .accordion-header {
  background: #ffffff;
}
html[data-theme="light"] body.home .faq-section .accordion-content {
  color: #475569;
  background: #ffffff;
  line-height: 1.7;
}
.site-footer .footer-grid > .footer-column {
  min-width: 0;
  text-align: left;
}
/* make support column a little wider so it doesn't feel detached */
.site-footer .footer-grid > .footer-column.support,
.site-footer .footer-grid > .footer-column:last-child {
  min-width: 200px;
  max-width: 260px;
}
.site-footer .footer-heading {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: left;
}
.site-footer .footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.site-footer .footer-links li {
  margin-bottom: 10px;
}
.site-footer .footer-link {
  color: var(--text);
  opacity: 0.82;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}
.site-footer .footer-link:hover {
  opacity: 1;
  color: var(--primary);
  transform: translateX(1px);
}
.site-footer .footer-cta {
  display: inline-flex;
  margin-top: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--primary);
  opacity: 0.72; /* secondary */
}
.site-footer .footer-cta:hover {
  text-decoration: underline;
  opacity: 1;
}
.site-footer .footer-bottom {
  text-align: left;
  padding-top: 1.5rem !important;
  border-top: 1px solid var(--border);
  /* Subtle separator (premium look) */
  border-top-color: color-mix(in srgb, var(--border) 55%, transparent);
  font-size: 0.92rem;
  opacity: 0.85;
}
.site-footer .footer-bottom p { margin: 0; }
.site-footer .footer-add-home { margin-top: 0.5rem; font-size: 0.9rem; opacity: 0.85; }

@media (max-width: 980px) {
  .site-footer .footer-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 1.5rem 2rem; }
}
@media (max-width: 640px) {
  .site-footer .footer-inner { padding: 0 24px; }
  .site-footer .footer-top { margin-bottom: 1rem; }
  .site-footer .footer-divider { margin: 1rem 0 1.25rem; }
  .site-footer .footer-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  /* Keep copyright left-aligned (same alignment as brand) */
  .site-footer .footer-bottom { text-align: left; }
}

/* Global Share FAB (bottom-right) */
/* Unified across tool pages; avoids per-page duplicates */
/* Match json-compare brand purple regardless of per-page --primary overrides */
:root{
  --dfp-share-primary:#6c6ebd;
  --dfp-share-primary-dark:#4f46e5;
  --dfp-share-ring:rgba(108,110,189,.35);
}
body .toggle-share,
body .dfp-share-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dfp-share-primary);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 1000;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
body .toggle-share:hover,
body .dfp-share-toggle:hover { background: var(--dfp-share-primary-dark); }
body .toggle-share:active,
body .dfp-share-toggle:active { background: var(--dfp-share-primary-dark); }
body .toggle-share:focus-visible,
body .dfp-share-toggle:focus-visible {
  background: var(--dfp-share-primary);
  box-shadow: 0 0 0 3px var(--dfp-share-ring), var(--shadow-md);
}

body .floating-icon-share,
body .dfp-share-bar {
  position: fixed;
  right: 1rem;
  bottom: 4.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .2s, transform .2s;
}
body .floating-icon-share.active,
body .dfp-share-bar.active { opacity: 1; pointer-events: auto; transform: translateY(0); }
body .floating-icon-share a,
body .floating-icon-share button,
body .dfp-share-bar a,
body .dfp-share-bar button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0; /* Reset browser default button padding */
  box-sizing: border-box; /* Ensure width/height include border */
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font: inherit; /* Reset browser default button font */
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
/* Ensure icon glyphs always follow the link color (some pages override <i> styles). */
body .floating-icon-share a i,
body .floating-icon-share button i,
body .dfp-share-bar a i,
body .dfp-share-bar button i { color: inherit !important; }
body .floating-icon-share a:hover,
body .floating-icon-share a:focus-visible,
body .floating-icon-share button:hover,
body .floating-icon-share button:focus-visible,
body .dfp-share-bar a:hover,
body .dfp-share-bar a:focus-visible,
body .dfp-share-bar button:hover,
body .dfp-share-bar button:focus-visible {
  background: var(--dfp-share-primary);
  border-color: var(--dfp-share-primary);
  color: #fff;
  transform: scale(1.05);
}
body .floating-icon-share a:active,
body .floating-icon-share button:active,
body .dfp-share-bar a:active,
body .dfp-share-bar button:active { transform: scale(1.02); }

/* Same for the floating share FAB icon */
body .toggle-share i,
body .dfp-share-toggle i { color: inherit !important; }

body .share-toast {
  position: fixed;
  right: 1rem;
  bottom: 9.5rem;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: .5rem .75rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s, transform .2s;
  /* Must sit above the share FAB and share bar */
  z-index: 1001;
}
body .share-toast.visible,
body .share-toast.show { opacity: 1; transform: translateY(0); }

/* Generic tooltip helper used by share icons */
.tooltip { position: relative; }
.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  left: 120%;
  top: 50%;
  transform: translateY(-50%) scale(0.95);
  background: #333;
  color: #fff;
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease-in-out;
}
.tooltip:hover::after { opacity: 1; transform: translateY(-50%) scale(1); }

/* Responsive buttons: prevent squish/distortion on narrow screens */
.btn, button.btn, a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;   /* keep icon + label together */
  flex-shrink: 0;        /* don't compress below content size */
  min-height: 36px;
  line-height: 1;
}
.btn i { width: 1.1em; text-align: center; }

/* Developer Resources Section Styles */
.dev-resources-section {
  padding: 4rem 0;
  background: var(--bg);
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.resource-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.resource-icon {
  width: 60px;
  height: 60px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.resource-icon i {
  font-size: 1.5rem;
  color: white;
}

.resource-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.resource-description {
  color: var(--muted-text);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.resource-features {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.resource-features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.9rem;
}

.resource-features i {
  color: var(--success);
  font-size: 0.8rem;
}

.resource-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.seo-content {
  max-width: 800px;
  margin: 4rem auto 0;
  padding: 0 1rem;
}

.seo-content h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.seo-content h4 {
  font-size: 1.25rem;
  margin: 2rem 0 1rem;
  color: var(--primary);
}

.seo-content h5 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.seo-content p {
  line-height: 1.7;
  margin-bottom: 1.5rem;
  color: var(--muted-text);
}

.seo-content ul {
  margin: 1rem 0 1.5rem 1.5rem;
}

.seo-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: var(--muted-text);
}

.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.use-case {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.use-case h5 i {
  color: var(--primary);
  margin-right: 0.5rem;
}

.use-case p {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .resources-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .resource-card {
    padding: 1.5rem;
  }
  
  .use-cases-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .resource-links {
    flex-direction: column;
  }
}

.use-cases-section {
  padding: 4rem 0;
  background: var(--card);
}

.use-case-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.use-case-icon {
  width: 60px;
  height: 60px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.use-case-icon i {
  font-size: 1.5rem;
  color: white;
}

.comparison-section {
  padding: 4rem 0;
  background: var(--bg);
}

.comparison-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
  max-width: 900px;
  margin: 3rem auto;
}

.comparison-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.comparison-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.size-display {
  margin: 2rem 0;
}

.size-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

.size-label {
  font-size: 0.9rem;
  color: var(--muted-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.feature-item.positive {
  color: var(--success);
}

.feature-item.negative {
  color: var(--danger);
}

.comparison-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
}

.comparison-arrow i {
  font-size: 2rem;
}

.comparison-arrow span {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.8rem;
}

.cta-section {
  text-align: center;
  margin-top: 3rem;
}

.cta-note {
  margin-top: 1rem;
  color: var(--muted-text);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  /* Mobile/tablet gutter: keep header/main/footer aligned */
  :root { --dfp-content-pad: 1rem; }
  .comparison-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .comparison-arrow {
    transform: rotate(90deg);
  }
  
  .comparison-card {
    padding: 1.5rem;
  }
  
  .size-number {
    font-size: 2rem;
  }
}

/* Common toolbar/button-row containers: allow wrapping instead of squeezing */
.toolbar,
.button-group,
.buttons,
.btn-row,
.button-row,
.header-buttons,
.controls,
.control-row,
.control-group,
.control-bar,
.actions,
.action-bar,
.tab-actions,
.tab-buttons,
.tab-header,
.tab-controls,
.editor-toolbar,
.preview-toolbar,
.panel-tabs,
.tabs,
.tab-row,
.tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  overflow: visible; /* avoid clipping wrapped rows */
}

@media (max-width: 480px) {
  .btn, button.btn, a.btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.95rem;
  }
  /* On very narrow screens, keep wrapping (avoid horizontal scrolling on mobile pages) */
  .toolbar,
  .button-group,
  .buttons,
  .btn-row,
  .button-row,
  .header-buttons,
  .controls,
  .control-row,
  .control-group,
  .control-bar,
  .actions,
  .action-bar,
  .tab-actions,
  .tab-buttons,
  .tab-header,
  .tab-controls,
  .editor-toolbar,
  .preview-toolbar,
  .panel-tabs,
  .tabs,
  .tab-row,
  .tab-strip {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    padding-bottom: 0;
  }
  
  /* Ensure all pages have proper mobile typography */
  .hero-title, h1 {
    font-size: 1.75rem !important;
  }
  
  .hero-subtitle, .section-subtitle {
    font-size: 0.9rem !important;
  }
  
  /* Reduce padding on cards for better space usage */
  .tool-card, .feature-card, .resource-card {
    padding: 1rem !important;
  }
  
  /* Container padding adjustments */
  .container {
    padding: 0 var(--dfp-content-pad) !important;
  }
  
  /* Main content padding */
  .main {
    padding: 1rem 0 !important;
  }
}

/* Mobile stacking: force common grids into a single column on phones */
@media (max-width: 768px) {
  .grid,
  .main-grid,
  .editor-grid,
  .tool-grid,
  .results-grid,
  .comparison-container,
  .resources-grid,
  .use-cases-grid,
  .seo-grid {
    grid-template-columns: 1fr !important;
  }

  /* Blog pages: prevent flex/shrink-to-fit widening in WebKit (fixes slight right-edge clipping) */
  main.blog-container,
  .blog-container {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Prevent inline min-widths from forcing overflow in flex rows (e.g., search inputs) */
  input, select, textarea {
    max-width: 100%;
  }

  /* Blog/articles: make tables usable on mobile (avoid cramped columns) */
  /* Ensure parent containers of tables can scroll horizontally with visual hint */
  .blog-container .infographic,
  .blog-container .strategy-card,
  .blog-container .best-practices,
  .blog-container .tool-card,
  .article-content .infographic,
  .article-content .strategy-card,
  .seo-content .infographic {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Add subtle shadow to hint at scrollable content */
    background:
      linear-gradient(90deg, var(--card) 0%, transparent 8px),
      linear-gradient(90deg, transparent calc(100% - 20px), rgba(0,0,0,0.15) 100%),
      var(--card);
    background-attachment: local, scroll, local;
  }
  
  /* Tables inside: reduce padding for mobile readability, keep natural width */
  .blog-container table.comparison-table,
  .article-content table.comparison-table,
  .seo-content table.comparison-table {
    min-width: 480px;
    width: 100%;
  }
  
  .blog-container table.comparison-table th,
  .blog-container table.comparison-table td,
  .article-content table.comparison-table th,
  .article-content table.comparison-table td,
  .seo-content table.comparison-table th,
  .seo-content table.comparison-table td {
    padding: 0.5rem !important;
    font-size: 0.85rem;
  }
}

/* JSON Viewer: mobile override for inline-styled search input min-width */
@media (max-width: 480px) {
  #searchInput {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
}

/* Enhanced mobile breakpoint for very small screens */
@media (max-width: 375px) {
  /* Small-phone gutter: keep header/main/footer aligned */
  :root { --dfp-content-pad: 0.75rem; }
  .hero-title, h1 {
    font-size: 1.5rem !important;
  }
  
  .btn, button.btn, a.btn {
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
  }
  
  .container {
    padding: 0 var(--dfp-content-pad) !important;
  }
}

/* Global rotation helper for layout toggle icons (fallback to FA utility) */
.dfp-rotate-90 { transform: rotate(90deg) !important; }

/* Layout toggle icon animation (smooth rotate) - base state */
#layoutToggle i,
#layoutToggleHeader i,
.layout-toggle i,
.btn-icon[onclick*="toggleLayout"] i {
  display: inline-block;
  transform: rotate(0deg);
  transform-origin: center center;
  transition: transform 180ms ease-in-out;
  will-change: transform;
}
/* Support inline SVG icons as well */
#layoutToggle svg,
#layoutToggleHeader svg,
.layout-toggle svg,
.btn-icon[onclick*="toggleLayout"] svg {
  display: inline-block;
  transform: rotate(0deg);
  transform-origin: center center;
  transition: transform 180ms ease-in-out;
  will-change: transform;
}
/* Rotation state - applied to icon when layout is vertical */
#layoutToggleHeader i.dfp-rotate-90,
#layoutToggle i.dfp-rotate-90,
.layout-toggle i.dfp-rotate-90,
.btn-icon[onclick*="toggleLayout"] i.dfp-rotate-90,
/* Fallback: if class is on button, rotate its icon */
#layoutToggleHeader.dfp-rotate-90 i,
#layoutToggle.dfp-rotate-90 i,
.layout-toggle.dfp-rotate-90 i,
.btn-icon[onclick*="toggleLayout"].dfp-rotate-90 i {
  transform: rotate(90deg) !important;
}
/* Rotation for SVG variants */
#layoutToggleHeader svg.dfp-rotate-90,
#layoutToggle svg.dfp-rotate-90,
.layout-toggle svg.dfp-rotate-90,
.btn-icon[onclick*="toggleLayout"] svg.dfp-rotate-90,
#layoutToggleHeader.dfp-rotate-90 svg,
#layoutToggle.dfp-rotate-90 svg,
.layout-toggle.dfp-rotate-90 svg,
.btn-icon[onclick*="toggleLayout"].dfp-rotate-90 svg {
  transform: rotate(90deg) !important;
}

@media (prefers-reduced-motion: reduce) {
  #layoutToggle i,
  #layoutToggleHeader i,
  .layout-toggle i,
  .btn-icon[onclick*="toggleLayout"] i {
    transition: none !important;
  }
  #layoutToggle svg,
  #layoutToggleHeader svg,
  .layout-toggle svg,
  .btn-icon[onclick*="toggleLayout"] svg {
    transition: none !important;
  }
  #layoutToggle i,
  #layoutToggleHeader i,
  .layout-toggle i,
  .btn-icon[onclick*="toggleLayout"] i {
    transition: none !important;
  }
}

/* Small badge helper (used for perf notices) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  background: rgba(0,0,0,.08);
  color: var(--text);
  padding: .25rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* FAQ typography unification: use JSON Formatter's FAQ font family/sizing/weights across pages */
.faq-section, .yt-faq { font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
/* FAQ header styling now inherited from .seo-title and .seo-subtitle classes */
/* Q: question toggle button */
.yt-faq-toggle { font-weight: 500; font-size: 1rem !important; }
/* A: answer body */
.yt-faq-answer { font-size: 1rem !important; }

/* JSON Formatter: gradient style for the "Learn About JSON" heading */
html[data-theme="light"] body.json-formatter .info-header h2 {
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================
   Dropdown Menu for Tools Navigation
   ============================================ */
.nav-dropdown {
  position: relative;
}

.dropdown-toggle {
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: background 0.2s;
  font-family: inherit;
  text-decoration: none;
}

.dropdown-toggle:hover {
  background: rgba(0,0,0,0.05);
}

[data-theme="light"] .dropdown-toggle:hover {
  background: rgba(0,0,0,0.03);
}

.dropdown-toggle i {
  font-size: 0.75rem;
  transition: transform 0.3s;
}

.nav-dropdown.active .dropdown-toggle i {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 0.75rem;
  /* Lock typography so tool pages with custom body line-height/font-size don't change dropdown spacing */
  font-size: 16px;
  line-height: normal;
  min-width: 620px;
  max-height: 70vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: none;
  z-index: 1001;
}

.dropdown-menu.show {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

/* Footer CTA inside Tools dropdown */
.dropdown-footer {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0.6rem 0.5rem 0.25rem;
  margin-top: 0.25rem;
  border-top: 1px solid rgba(148,163,184,0.18);
}

.dropdown-menu a.dropdown-all-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.12);
  font-weight: 700;
}

.dropdown-menu a.dropdown-all-tools:hover {
  background: rgba(99, 102, 241, 0.18);
}

.dropdown-section {
  padding: 0.5rem;
  line-height: normal;
}

.dropdown-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
  line-height: normal;
}

.dropdown-menu a {
  display: block;
  padding: 0.4rem 0.5rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.2;
  transition: background 0.2s;
}

.dropdown-menu a:hover {
  background: rgba(108,110,189,0.1);
}

[data-theme="light"] .dropdown-menu a:hover {
  background: rgba(108,110,189,0.08);
}

/* Active/current tool inside Tools dropdown */
.dropdown-menu a.active,
.dropdown-menu a[aria-current="page"] {
  background: rgba(108,110,189,0.14);
  font-weight: 600;
}

[data-theme="light"] .dropdown-menu a.active,
[data-theme="light"] .dropdown-menu a[aria-current="page"] {
  background: rgba(108,110,189,0.10);
}

/* Light theme dropdown */
html[data-theme="light"] .dropdown-menu {
  background: linear-gradient(180deg, #f7f8fa 0%, #eceff3 45%, #e1e6ea 100%);
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.9);
}

/* Mobile dropdown */
@media (max-width: 768px) {
  .dropdown-menu {
    min-width: 100%;
  }
  
  .dropdown-menu.show {
    position: static;
    grid-template-columns: 1fr;
    box-shadow: none;
    border: none;
    padding: 0.5rem 0;
    margin-top: 0;
  }
}

/* ============================================
   SEO CONTENT SECTIONS (v4.0 Standard)
   ============================================ */

.educational-section,
.features-section,
.use-cases-section,
.why-choose-section,
.comparison-section,
.tech-specs-section,
.troubleshooting-section,
.related-tools-section,
.howto-section,
.seo-rich,
.yt-faq {
  box-sizing: border-box;
}

.yt-faq { max-width: 1100px; margin: 3.125rem auto 3.125rem; padding: 0 .5rem; width: 100%; }

.educational-section { max-width: 1100px; margin: 3.125rem auto 0; padding: 0 .5rem; width: 100%; }
.features-section { max-width: 1100px; margin: 3.125rem auto 0; padding: 0 .5rem; width: 100%; }
.use-cases-section { max-width: 1100px; margin: 3.125rem auto 0; padding: 0 .5rem; width: 100%; background: transparent; border: none; }
.why-choose-section { max-width: 1100px; margin: 3.125rem auto 0; padding: 0 .5rem; width: 100%; }
.comparison-section { max-width: 1100px; margin: 3.125rem auto 0; padding: 0 .5rem; width: 100%; }
.tech-specs-section { max-width: 1100px; margin: 3.125rem auto 0; padding: 0 .5rem; width: 100%; }
.troubleshooting-section { max-width: 1100px; margin: 3.125rem auto 0; padding: 0 .5rem; width: 100%; }
.related-tools-section { max-width: 1100px; margin: 3.125rem auto 5rem; padding: 0 .5rem; width: 100%; }
.seo-rich { max-width: 1100px; margin: 3.125rem auto 0; padding: 0 .5rem; width: 100%; }

/* First section after tool layout gets larger top margin */
.educational-section:first-of-type,
.seo-rich:first-of-type { margin-top: 7.5rem; }

.educational-header { text-align: center; margin-bottom: 1.5625rem; }
.howto-header { text-align: center; margin-bottom: 1.5625rem; }
.features-header { text-align: center; margin-bottom: 1.5625rem; }
.use-cases-header { text-align: center; margin-bottom: 1.5625rem; }
.why-choose-header { text-align: center; margin-bottom: 1.5625rem; }
.comparison-header { text-align: center; margin-bottom: 1.5625rem; }
.tech-specs-header { text-align: center; margin-bottom: 1.5625rem; }
.troubleshooting-header { text-align: center; margin-bottom: 1.5625rem; }
.related-tools-header { text-align: center; margin-bottom: 1.5625rem; }
.yt-faq-header { text-align: center; margin-bottom: 1.5625rem; }

/* FAQ List and Items */
.yt-faq-list {
  display: grid;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
}

.yt-faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow .2s ease, border-color .2s ease;
  width: 100%;
}

.yt-faq-item:hover {
  box-shadow: 0 2px 8px rgba(99,102,241,.08);
  border-color: rgba(99,102,241,.3);
}

[data-theme="dark"] .yt-faq-item:hover {
  box-shadow: 0 2px 8px rgba(99,102,241,.15);
}

.yt-faq-toggle {
  width: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
  background: transparent;
  color: var(--text);
  border: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease;
  font-size: 1rem;
}

.yt-faq-toggle:hover {
  background: rgba(99,102,241,.05);
}

[data-theme="dark"] .yt-faq-toggle:hover {
  background: rgba(99,102,241,.08);
}

.yt-faq-toggle i {
  transition: transform .2s ease;
  opacity: .85;
  font-size: .9rem;
  flex-shrink: 0;
  margin-left: 1rem;
}

.yt-faq-item.open .yt-faq-toggle i {
  transform: rotate(180deg);
}

.yt-faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease, padding .25s ease;
  padding: 0 1.25rem;
  opacity: .95;
  line-height: 1.65;
  color: var(--text);
}

.yt-faq-item.open .yt-faq-answer {
  padding: 0 1.25rem 1rem;
}

.seo-title { font-size: 2rem; font-weight: 800; margin-bottom: .5rem; background: linear-gradient(90deg,var(--primary),var(--accent)); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
.seo-subtitle { opacity: .8; font-size: 1.05rem; margin-bottom: 1.5rem; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  padding: .3rem .65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .81rem;
  line-height: 1.4;
  opacity: .9;
  transition: all .25s ease;
  cursor: pointer;
}

.tag:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(99,102,241,.12);
  background: linear-gradient(135deg, var(--card) 0%, rgba(99,102,241,.03) 100%);
}

.tag i {
  color: var(--primary);
  font-size: .91rem;
  transition: transform .25s ease;
}

.tag:hover i {
  transform: scale(1.1);
}

/* Content-area links: natural text by default, underline on hover only */
.blog-content a:not([class*="btn"]):not(.btn),
.article-content a:not([class*="btn"]):not(.btn),
.blog-container .blog-content a:not([class*="btn"]):not(.btn) {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: color .15s ease, text-decoration-color .15s ease;
}
.blog-content a:not([class*="btn"]):not(.btn):hover,
.article-content a:not([class*="btn"]):not(.btn):hover,
.blog-container .blog-content a:not([class*="btn"]):not(.btn):hover {
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.educational-content a,
.use-case-card a,
.howto-step a,
.step-tip a,
.trouble-item a,
.yt-faq-answer a,
.feature-card a,
.why-choose-card a,
.tech-spec-card a,
.tip-box a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .15s ease;
}
.tip-box a {
  font-weight: 600;
  text-underline-offset: 0.18em;
}
.educational-content a:hover,
.use-case-card a:hover,
.howto-step a:hover,
.step-tip a:hover,
.trouble-item a:hover,
.yt-faq-answer a:hover,
.feature-card a:hover,
.why-choose-card a:hover,
.tech-spec-card a:hover {
  color: var(--accent);
}
.tip-box a:hover {
  color: var(--primary-light, var(--accent));
}

.educational-content {
  background: linear-gradient(135deg, var(--card) 0%, rgba(99,102,241,.03) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  text-align: left !important;
}
.educational-content * {
  text-align: left !important;
}
.educational-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent, #f59e0b));
}
.educational-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: .75rem;
  color: var(--primary);
  text-align: left !important;
}
.educational-content p {
  line-height: 1.7;
  margin-bottom: 1rem;
  opacity: .9;
  text-align: left !important;
}
.educational-content p:last-child { margin-bottom: 0; }
#direct-answer {
  font-size: 1.05em;
  line-height: 1.75;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  opacity: 1;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform .2s ease, box-shadow .2s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.feature-icon i { color: #fff; font-size: 1.25rem; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: .5rem; font-weight: 600; }
.feature-card p { opacity: .9; line-height: 1.65; font-size: .95rem; }

.howto-section { max-width: 1100px; margin: 3.125rem auto 0; padding: 0 .5rem; width: 100%; text-align: left !important; }
.howto-section * { text-align: left !important; }
.howto-header { text-align: center !important; }
.howto-header * { text-align: center !important; }
.howto-grid { display: flex; flex-direction: column; }
.howto-step {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1rem;
  text-align: left !important;
}
.howto-step:last-child { margin-bottom: 0; }
.step-number {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}
.step-content { text-align: left !important; }
.step-content h3 { font-size: 1.1rem; margin-bottom: .5rem; font-weight: 600; text-align: left !important; }
.step-content p { opacity: .9; line-height: 1.65; font-size: .95rem; margin-bottom: .5rem; text-align: left !important; }
.step-content p:last-child { margin-bottom: 0; }
.step-tip { background: rgba(99,102,241,.08); padding: .75rem 1rem; border-radius: 8px; border-left: 3px solid var(--primary); text-align: left !important; display: block; margin: 0.5rem 0; }

.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}
.use-case-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  border-left: 3px solid var(--primary);
  transition: transform .2s ease;
}
.use-case-card:hover { transform: translateY(-2px); }
.use-case-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(99,102,241,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .75rem;
}
.use-case-icon i { color: var(--primary); font-size: 1.1rem; }
.use-case-card h3 { font-size: 1rem; margin-bottom: .5rem; font-weight: 600; }
.use-case-card p { opacity: .9; line-height: 1.6; font-size: .9rem; }

.why-choose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}
.why-choose-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: transform .2s ease;
}
.why-choose-card:hover { transform: translateY(-3px); }
.why-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.why-icon i { color: #fff; font-size: 1.35rem; }
.why-choose-card h3 { font-size: 1.1rem; margin-bottom: .5rem; font-weight: 600; }
.why-choose-card p { opacity: .9; line-height: 1.6; font-size: .9rem; }

.comparison-table-wrap { overflow-x: auto; }
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  table-layout: fixed;
}
.comparison-table th:first-child,
.comparison-table td:first-child { width: 30%; }
.comparison-table th, .comparison-table td {
  padding: .85rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.comparison-table th:first-child,
.comparison-table td:first-child { text-align: left; padding-left: 2rem; }
.comparison-table th { background: rgba(99,102,241,.1); font-weight: 600; }
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table .check { color: #10b981; }
.comparison-table .cross { color: #ef4444; opacity: .6; }
.comparison-table .partial { color: var(--accent); }
.comparison-table th:nth-child(2),
.comparison-table td:nth-child(2) {
  background: rgba(99, 102, 241, 0.12);
  border-left: 3px solid rgba(99, 102, 241, 0.6);
  border-right: 1px solid rgba(99, 102, 241, 0.2);
}
.comparison-table th:nth-child(2) {
  background: rgba(99, 102, 241, 0.2);
  font-weight: 700;
}

.tech-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.tech-spec-card {
  background: linear-gradient(135deg, var(--card) 0%, rgba(99,102,241,.03) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.tech-spec-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.tech-spec-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent, #f59e0b));
  opacity: .8;
}
.tech-spec-card-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}
.tech-spec-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99,102,241,.2) 0%, rgba(99,102,241,.1) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tech-spec-icon i { color: var(--primary); font-size: 1.1rem; }
.tech-spec-card h3 { font-size: 1.05rem; margin: 0; font-weight: 600; }
.tech-spec-card ul { list-style: none; padding: 0; margin: 0; }
.tech-spec-card li { 
  padding: .5rem 0; 
  font-size: .9rem; 
  opacity: .9; 
  border-bottom: 1px dashed rgba(128,128,128,.2);
  display: flex;
  align-items: baseline;
  gap: .5rem;
}
.tech-spec-card li::before {
  content: '→';
  color: var(--primary);
  font-size: .75rem;
  opacity: .7;
}
.tech-spec-card li:last-child { border-bottom: none; }

.troubleshooting-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.trouble-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  border-left: 3px solid #d97706;
  transition: transform .2s ease;
}
.trouble-item:hover { transform: translateY(-2px); }
.trouble-item h3 { 
  font-size: .95rem; 
  margin-bottom: .6rem; 
  color: #d97706; 
  display: flex; 
  align-items: center; 
  gap: .5rem;
  font-weight: 600;
}
.trouble-item h3 i { 
  font-size: .8rem;
  width: 20px;
  height: 20px;
  background: rgba(245,158,11,.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.trouble-item p { opacity: .9; line-height: 1.6; font-size: .9rem; }

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
@media (max-width: 640px) {
  .related-tools-grid {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 641px) and (max-width: 900px) {
  .related-tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.related-tool-card{background:var(--card);border:1px solid var(--border);border-radius:14px;padding:1.5rem;text-decoration:none;color:var(--text);transition:all .25s ease;display:flex;flex-direction:column;position:relative;overflow:hidden}
.related-tool-card::after{content:'→';position:absolute;top:1.25rem;right:1.25rem;font-size:1.1rem;color:var(--primary);opacity:0;transform:translateX(-8px);transition:all .25s ease}
.related-tool-card:hover{border-color:var(--primary);transform:translateY(-4px);box-shadow:0 12px 28px rgba(99,102,241,.15);background:linear-gradient(135deg,var(--card) 0%,rgba(99,102,241,.05) 100%)}
.related-tool-card:hover::after{opacity:1;transform:translateX(0)}
.related-tool-icon{width:48px;height:48px;border-radius:12px;background:linear-gradient(135deg,rgba(99,102,241,.2) 0%,rgba(99,102,241,.08) 100%);display:flex;align-items:center;justify-content:center;margin-bottom:1rem;transition:transform .25s ease}
.related-tool-card:hover .related-tool-icon{transform:scale(1.05)}
.related-tool-icon i{color:var(--primary);font-size:1.2rem}
.related-tool-card h3{font-size:1.05rem;margin-bottom:.5rem;font-weight:600;transition:color .25s ease}
.related-tool-card:hover h3{color:var(--primary)}
.related-tool-card p{opacity:.75;line-height:1.6;font-size:.88rem;flex-grow:1}

@media (max-width: 1024px) {
  .troubleshooting-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tech-specs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .troubleshooting-grid {
    grid-template-columns: 1fr;
  }
  .seo-title {
    font-size: 1.5rem;
  }
}
