* { box-sizing: border-box; }

:root {
  --bg: #020617;
  --bg-light: #020617;
  --card-bg: #0b1120;
  --primary: #2563eb;
  --primary-soft: #1d4ed8;
  --border: #1f2937;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --radius-lg: 10px;
  --app-header-height: 56px;
  --tool-sticky-bg: #0b1120;
  --tool-sticky-shadow: 0 10px 24px rgba(2, 6, 23, 0.32);
  --tool-card-content-offset: 0px;
  --tool-card-viewport-offset: 260px;
  --tool-card-max-start: 840px;
  --sidebar-width: 220px;
  --right-rail-width: 180px;
  --right-rail-gap: 18px;
  --right-rail-top: 88px;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #020617 0, #020617 35%, #020617 100%);
  color: var(--text-main);
}

/* ========= LAYOUT SHELL + SIDEBAR ========= */

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* The pre-paint init script can only set classes on <html> (no <body> yet),
   so every collapsed rule is mirrored on html.sidebar-collapsed. Without this
   the sidebar paints expanded and then snaps closed once JS mirrors the class
   onto <body> — a horizontal layout shift on every page load. */
body.sidebar-collapsed .sidebar,
html.sidebar-collapsed .sidebar {
  display: none;
}
body.sidebar-collapsed,
html.sidebar-collapsed body {
  --sidebar-width: 0px;
}
body.sidebar-collapsed main,
html.sidebar-collapsed main {
  max-width: none;
  width: 100%;
}
body.sidebar-collapsed .sidebar-reveal-btn,
html.sidebar-collapsed .sidebar-reveal-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}


.sidebar {
  width: 220px;
  background: #020617;
  border-right: 1px solid #111827;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
}

.sidebar-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  min-width: 0;
  flex: 1;
}

.logo-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 15px;
  font-weight: 600;
  color: #60a5fa;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.logo-title {
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
}

.logo-sub {
  font-size: 11px;
  color: #9ca3af;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  font-size: 13px;
  overflow-y: auto;
  padding-right: 4px;
  flex: 1;
}

.sidebar-footer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid #111827;
}

.sidebar-footer-title {
  margin-top: 0;
}

.sidebar-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #e2e8f0;
  margin: 10px 4px 4px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid #111827;
}

.sidebar-nav .sidebar-section-title:nth-of-type(5n+1) {
  background: rgba(59, 130, 246, 0.36);
  border-color: rgba(59, 130, 246, 0.6);
}

.sidebar-nav .sidebar-section-title:nth-of-type(5n+2) {
  background: rgba(34, 197, 94, 0.34);
  border-color: rgba(34, 197, 94, 0.6);
}

.sidebar-nav .sidebar-section-title:nth-of-type(5n+3) {
  background: rgba(234, 179, 8, 0.32);
  border-color: rgba(234, 179, 8, 0.6);
}

.sidebar-nav .sidebar-section-title:nth-of-type(5n+4) {
  background: rgba(249, 115, 22, 0.32);
  border-color: rgba(249, 115, 22, 0.6);
}

.sidebar-nav .sidebar-section-title:nth-of-type(5n) {
  background: rgba(239, 68, 68, 0.32);
  border-color: rgba(239, 68, 68, 0.6);
}

.sidebar-link {
  padding: 6px 8px;
  border-radius: 6px;
  color: #9ca3af;
  text-decoration: none;
  display: block;
}

.sidebar-link:hover {
  background: #0b1120;
  color: #e5e7eb;
}

.sidebar-link-active {
  background: #0b1120;
  color: #f9fafb;
  font-weight: 500;
  border-left: 2px solid #2563eb;
}

.sidebar-toggle-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.92);
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.28);
  transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.sidebar-toggle-btn:hover {
  background: #0f172a;
  transform: translateY(-1px);
}

.sidebar-toggle-btn span {
  font-size: 18px;
  line-height: 1;
}

.sidebar-collapse-btn {
  margin-top: 2px;
}

.sidebar-reveal-btn {
  position: fixed;
  left: 10px;
  top: 50%;
  transform: translateY(-50%) translateX(-8px);
  z-index: 35;
  opacity: 0;
  pointer-events: none;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#app-header-root {
  min-height: var(--app-header-height);
  background: rgba(15,23,42,0.98);
  color: #fff;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #111827;
  position: sticky;
  top: 0;
  z-index: 20;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

body[data-header-type="tool"] #app-header-root,
body[data-header-type="home"] #app-header-root {
  position: static;
  top: auto;
}

.header-ad-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 14px 0;
  /* Reserve the exact slot height so a late ad fill never shifts the page (CLS) */
  min-height: 98px;
}

.header-ad-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex;
  justify-content: flex-start;
  align-items: start;
}

.header-ad-inner .jvt-header-ad {
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 90px;
  display: block !important;
  overflow: visible;
}

.header-ad-inner .jvt-header-ad iframe,
.header-ad-inner .jvt-header-ad > div {
  width: 100% !important;
  max-width: 100% !important;
}

.tool-footer-ad-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 10px;
  padding: 0 14px;
  min-height: 280px;
}

.tool-footer-ad-inner {
  width: 100%;
  margin: 0;
  min-height: 280px;
  display: flex;
  justify-content: flex-start;
  align-items: start;
}

/* Reserve the height AdSense actually uses, so content below the ad does not
   get pushed down when it arrives. Field CrUX had CLS 0.31 (the only failing
   Core Web Vital) while lab runs reported 0.000 — headless browsers are never
   served ads, so the shift is invisible in a lab test.
   Measured on the live site, 3 runs per width:
     >=1280px -> 280px    769-1279px -> 248px    phones -> ~=viewport width
   The values are what AdSense sizes the slot to; under-reserving was costing
   190px of shift on desktop and 300px+ on phones, on every load. */
.tool-footer-ad-inner .jvt-tool-footer-ad {
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 280px;
  display: block !important;
  overflow: visible;
}

/* 769-1279px: AdSense picks a shorter unit here (measured 248px at 820 and
   1024). Without this the base 280px would over-reserve by 32px — harmless for
   CLS, but it is 32px of visible blank. */
@media (max-width: 1279px) {
  .tool-footer-ad-container,
  .tool-footer-ad-inner,
  .tool-footer-ad-inner .jvt-tool-footer-ad {
    min-height: 248px;
  }
}

.tool-footer-ad-inner .jvt-tool-footer-ad iframe,
.tool-footer-ad-inner .jvt-tool-footer-ad > div {
  width: 100% !important;
  max-width: 100% !important;
}

.right-rail-ad-container {
  display: none;
}

.right-rail-ad-inner {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.right-rail-ad-inner .jvt-right-rail-ad {
  width: 100%;
  min-height: 600px;
  display: block !important;
  overflow: visible;
}

.right-rail-ad-inner .jvt-right-rail-ad iframe,
.right-rail-ad-inner .jvt-right-rail-ad > div {
  width: 100% !important;
  max-width: 100% !important;
}

body.fullscreen-active .tool-footer-ad-container {
  display: none !important;
}

body.fullscreen-active .right-rail-ad-container {
  display: none !important;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.brand-sub {
  font-size: 11px;
  opacity: 0.75;
}
.header-badge {
  margin-top: 0;
  font-size: 10px;
  color: #2563eb;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid rgba(37,99,235,0.35);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(37,99,235,0.08);
  text-decoration: none;
  display: inline-flex;
}
body.light-mode .header-badge,
html.light-mode .header-badge {
  color: #2563eb;
  border-color: rgba(37,99,235,0.45);
  background: rgba(37,99,235,0.12);
}
.header-home-link { text-decoration: none; }
.header-home-link:hover { text-decoration: none; }

.nav-links {
  display: flex;
  gap: 14px;
  font-size: 13px;
  align-items: center;
}

.nav-links a {
  color: #cbd5f5;
  text-decoration: none;
  opacity: 0.9;
}

.nav-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 6px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: calc(100vh - 48px);
}

/* Blog/article pages: left-align the reading column next to the sidebar instead
   of centering it in the leftover flex space. Without this, wide screens get a
   large empty band between the sidebar and the article text. */
body[data-header-type="blog"] main {
  margin: 0;
  max-width: 920px;
}
@media (min-width: 1100px) {
  body[data-header-type="blog"] main {
    padding-left: 40px;
  }
}

/* TOOL CARD – full-height app look */

.tool-card {
  border-radius: var(--radius-lg);
  border: 1px solid #111827;
  background: radial-gradient(circle at top left, #0f172a 0, #020617 55%);
  padding: 10px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: auto;
  min-height: 0;
  position: relative;
}

/* Tool pages: keep the editor card within the viewport */
body[data-header-type="tool"] .tool-card {
  --tool-card-content-offset: 0px;
  min-height: clamp(
    420px,
    calc(100vh - var(--tool-card-viewport-offset) + var(--tool-card-content-offset)),
    calc(var(--tool-card-max-start) + var(--tool-card-content-offset))
  );
  max-height: calc(100vh - var(--tool-card-viewport-offset) + var(--tool-card-content-offset));
  overflow: hidden;
}

body[data-header-type="tool"] .tool-card.tool-card-has-sticky,
body[data-header-type="tool"] .tool-card:has(.tool-sticky-panel),
body[data-header-type="home"] .tool-card.tool-card-has-sticky,
body[data-header-type="home"] .tool-card:has(.tool-sticky-panel) {
  overflow: visible;
}

body[data-header-type="tool"] .tool-card:has(.diff-card) {
  --tool-card-content-offset: 120px;
  max-height: none;
  overflow: visible;
}

/* When option expanders are open, allow the card to grow */
body.options-expanded[data-header-type="tool"] .tool-card,
body[data-header-type="tool"] .tool-card:has(.tool-options details[open]) {
  max-height: none;
  overflow: visible;
}

/* Tool pages with large option panels: allow the card to stretch */
body[data-header-type="tool"][data-toolcard="stretch"] .tool-card {
  max-height: none;
  overflow: visible;
}

body[data-header-type="tool"] .tool-card .editor-layout {
  flex: 1;
  min-height: 260px;
  height: auto;
  max-height: none;
}

body[data-header-type="tool"] .tool-card .editor-box {
  flex: 1;
  min-height: 0;
}

body[data-header-type="tool"] .tool-card .toolbar {
  padding: 4px 6px;
}

@media (min-width: 901px) {
  body[data-header-type="tool"] .tool-card.tool-card-has-sticky .tool-sticky-panel,
  body[data-header-type="tool"] .tool-card .tool-sticky-panel,
  body[data-header-type="home"] .tool-card.tool-card-has-sticky .tool-sticky-panel,
  body[data-header-type="home"] .tool-card .tool-sticky-panel {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 12;
    width: 100%;
    flex: 0 0 auto;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0 8px;
    margin: 0;
    background: var(--tool-sticky-bg);
    box-shadow: var(--tool-sticky-shadow);
  }

  body[data-header-type="tool"] .tool-card .tool-sticky-panel > .toolbar,
  body[data-header-type="tool"] .tool-card .tool-sticky-panel > .tool-options,
  body[data-header-type="tool"] .tool-card .tool-sticky-panel > .tool-options-toggle-row,
  body[data-header-type="home"] .tool-card .tool-sticky-panel > .toolbar,
  body[data-header-type="home"] .tool-card .tool-sticky-panel > .tool-options,
  body[data-header-type="home"] .tool-card .tool-sticky-panel > .tool-options-toggle-row {
    margin: 0;
  }
}

@media (min-width: 1680px) {
  /* Reserve the rail column from first paint. This used to require the
     .has-right-rail-ad class, which JS only adds after load — so main painted
     full width and then snapped narrower (a horizontal layout shift on every
     wide-screen load). The space is now always reserved at this breakpoint. */
  body[data-header-type="tool"] main,
  body[data-header-type="home"] main {
    max-width: min(
      1400px,
      calc(100vw - var(--sidebar-width) - var(--right-rail-width) - (2 * var(--right-rail-gap)))
    );
    margin-left: 0;
    margin-right: auto;
  }

  body.has-right-rail-ad[data-header-type="tool"] .right-rail-ad-container,
  body.has-right-rail-ad[data-header-type="home"] .right-rail-ad-container {
    display: block;
    position: fixed;
    top: var(--right-rail-top);
    right: var(--right-rail-gap);
    width: var(--right-rail-width);
    z-index: 16;
  }
}

/* Blog articles use the empty desktop column for the existing sidebar ad.
   Reserve its width before the ad script runs so the article does not shift. */
@media (min-width: 1440px) and (min-height: 720px) {
  body[data-header-type="blog"] main {
    max-width: calc(100% - 336px);
  }

  body.has-right-rail-ad[data-header-type="blog"] .right-rail-ad-container {
    display: block;
    position: fixed;
    top: var(--right-rail-top);
    right: 18px;
    width: 300px;
    z-index: 4;
    background: rgba(148, 163, 184, 0.06);
  }

  body[data-header-type="blog"] .right-rail-ad-label {
    display: block;
    height: 20px;
    text-align: center;
    font-size: 11px;
    line-height: 20px;
    color: var(--text-muted);
  }
}

body.fullscreen-active .tool-sticky-panel {
  position: static !important;
  top: auto !important;
}

/* JSON Compare needs full-page flow; allow sections to expand */
body[data-header-subtitle="Compare JSON"] .tool-card {
  min-height: 0;
  max-height: none;
  overflow: visible;
}

body[data-header-subtitle="Compare JSON"] .tool-card .editor-layout {
  height: auto;
  max-height: none;
}

.tool-card.fullscreen {
  position: fixed;
  inset: 8px;
  width: auto;
  height: calc(100dvh - 16px);
  min-height: calc(100dvh - 16px) !important;
  max-height: calc(100dvh - 16px) !important;
  margin: 0;
  max-width: none;
  z-index: 999;
  overflow: hidden !important;
}

body[data-header-type="tool"] .tool-card.fullscreen {
  display: flex;
  flex-direction: column;
}

body[data-header-type="tool"] .tool-card.fullscreen .editor-layout {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
}

body[data-header-type="tool"] .tool-card.fullscreen .editor-pane,
body[data-header-type="tool"] .tool-card.fullscreen .editor-box {
  min-height: 0;
}

body.fullscreen-active { overflow: hidden; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 2px;
  border-bottom: 1px solid #111827;
}

.tool-options {
  border: 1px solid #111827;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(2, 6, 23, 0.6);
}

.tool-options.options-collapsible {
  position: relative;
}

.tool-options.options-collapsible.options-collapsed {
  max-height: var(--collapsed-height, 140px);
  overflow: hidden;
}

.tool-options-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.tool-options-toggle {
  padding: 3px 10px;
  font-size: 12px;
}

.tool-options.compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px 12px;
  align-items: start;
}

.tool-options.compact-grid .option-row {
  display: contents;
}

.tool-options .option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: flex-start;
}

.tool-options .option-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #cbd5f5;
  min-width: 0;
}

body[data-header-subtitle="CSV → JSON Converter"] .tool-options .csv-json-options-grid .option-field.compact {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

body[data-header-subtitle="CSV → JSON Converter"] .tool-options .csv-json-options-grid .option-field.compact label {
  margin: 0;
  line-height: 1.2;
}

body[data-header-subtitle="CSV → JSON Converter"] .tool-options .csv-json-options-grid .option-field.compact input[type="checkbox"] {
  min-width: 0;
  padding: 0;
}

.tool-options .option-field input:not([type="checkbox"]):not([type="radio"]) {
  background: #0b1220;
  border: 1px solid #1f2937;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  min-width: 150px;
  width: 100%;
}

.tool-options .option-field select {
  width: 100%;
}

.tool-options .option-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #cbd5f5;
}

.tool-options .option-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd5f5;
}

.tool-options .option-field.compact {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start !important;
  gap: 6px !important;
}

.tool-options .option-field.compact label {
  margin: 0;
  line-height: 1.2;
}

.tool-options input[type="checkbox"],
.tool-options input[type="radio"] {
  margin: 0;
  padding: 0;
  min-width: 0;
  width: auto;
}

.tool-options .option-title {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
}

.pojo-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.pojo-top {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 12px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.pojo-input,
.pojo-output {
  min-height: 0;
}

.pojo-options {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.pojo-input .editor-box {
  min-height: 360px;
}

.pojo-output .editor-box {
  min-height: 320px;
}

.pojo-options .tool-options {
  width: 100%;
  min-height: 100%;
  max-height: none;
  overflow: visible;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-overlay.is-open {
  display: flex;
}

.modal-card {
  background: #0b1220;
  color: #e2e8f0;
  width: min(1100px, 92vw);
  max-height: 85vh;
  border-radius: 12px;
  border: 1px solid #1f2937;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #1f2937;
  background: #0f172a;
}

.modal-header h2 {
  font-size: 16px;
  margin: 0;
}

.modal-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal-body {
  padding: 12px 14px;
  overflow: auto;
}

.code-preview {
  background: #0b1220;
  color: #e2e8f0;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 12px;
  white-space: pre-wrap;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .pojo-top {
    grid-template-columns: 1fr;
  }
  .app-main {
    padding-right: 0;
  }
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.btn {
  border-radius: 7px;
  border: 1px solid #1f2937;
  padding: 5px 11px;
  font-size: 13px;
  background: #020617;
  color: #e5e7eb;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn.primary {
  background: linear-gradient(90deg,#2563eb,#1d4ed8);
  border-color: #1d4ed8;
  color: #ffffff;
}

.btn.small {
  padding: 3px 8px;
  font-size: 12px;
}

.btn:hover {
  filter: brightness(1.05);
}

#btn-fullscreen {
  position: relative;
  overflow: hidden;
  border-color: #059669;
  background: linear-gradient(110deg, #059669 0%, #34d399 48%, #059669 100%);
  background-size: 200% 100%;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 18px rgba(5, 150, 105, 0.18);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease, border-color .16s ease;
}

#btn-fullscreen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.10) 32%, rgba(255, 255, 255, 0.38) 50%, rgba(255, 255, 255, 0.10) 68%, transparent 100%);
  transform: translateX(-135%);
  animation: jvtFullscreenShimmer 2.6s ease-in-out infinite;
  pointer-events: none;
}

#btn-fullscreen:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 12px 22px rgba(5, 150, 105, 0.24);
}

body.fullscreen-active #btn-fullscreen {
  border-color: #ea580c;
  background: linear-gradient(110deg, #c2410c 0%, #fb923c 46%, #c2410c 100%);
  background-size: 200% 100%;
  box-shadow: 0 10px 22px rgba(249, 115, 22, 0.18);
}

body.fullscreen-active #btn-fullscreen::after {
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.10) 32%, rgba(255, 255, 255, 0.34) 50%, rgba(255, 255, 255, 0.10) 68%, transparent 100%);
}

@keyframes jvtFullscreenShimmer {
  0% { transform: translateX(-135%); }
  55% { transform: translateX(135%); }
  100% { transform: translateX(135%); }
}

@media (prefers-reduced-motion: reduce) {
  #btn-fullscreen,
  #btn-fullscreen::after {
    animation: none !important;
  }
}

select {
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid #1f2937;
  font-size: 13px;
  background: #020617;
  color: #e5e7eb;
}

/* JSONEditor ships 16–18px search buttons; use a 24px target so the controls
   meet Lighthouse's minimum pointer-target size. */
.jsoneditor-search button,
.jsoneditor-search button.jsoneditor-refresh {
  width: 24px;
  min-width: 24px;
  height: 24px;
}

label {
  font-size: 12px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

::selection {
  background: rgba(59, 130, 246, 0.25);
  color: inherit;
}

::-moz-selection {
  background: rgba(59, 130, 246, 0.25);
  color: inherit;
}

.editor-layout {
  display: flex;
  gap: 8px;
  flex: 1;
  min-height: 480px;
  height: calc(100vh - 190px);
  max-height: calc(100vh - 190px);
  margin-top: 4px;
}

.editor-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.editor-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.editor-pane-title {
  font-weight: 600;
  color: #e5e7eb;
}

.editor-pane-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sql-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.sql-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.45fr);
  gap: 12px;
  min-height: 0;
  flex: 1;
  align-items: stretch;
}

.sql-input,
.sql-output {
  min-height: 0;
}

.sql-options {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.sql-options .tool-options {
  width: 100%;
  max-height: none;
  overflow: visible;
  min-height: 100%;
}

body[data-header-subtitle="JSON to SQL"] .sql-options {
  align-self: start;
}

body[data-header-subtitle="JSON to SQL"] .sql-options .tool-options {
  min-height: 0;
  height: auto;
  padding: 6px 8px;
}

body[data-header-subtitle="JSON to SQL"] .sql-options .tool-options.compact-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px 10px;
}

body[data-header-subtitle="JSON to SQL"] .sql-options .tool-options.compact-grid .option-group {
  grid-column: 1 / -1;
}

body[data-header-subtitle="JSON Sample Generator"] .sql-options .tool-options {
  min-height: 0;
  height: auto;
}

body[data-header-subtitle="JSON Sample Generator"] .sql-options {
  align-self: start;
}

body[data-header-subtitle="JSON Sample Generator"] .sql-top .editor-box {
  min-height: 260px;
}

.sql-bottom {
  display: flex;
  min-height: 0;
  flex: 0.8;
}

.sql-bottom .editor-box {
  min-height: 220px;
}

.option-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.size-graph-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.size-graph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.size-graph-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.size-graph-search {
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  min-width: 220px;
}
.size-graph-sort {
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
}
.size-graph-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.size-graph-filter input {
  width: 70px;
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
}
.size-graph-actions {
  display: inline-flex;
  gap: 6px;
}
.size-graph-selected {
  font-size: 12px;
  color: var(--text-muted);
}

.size-graph-header h2 {
  margin: 0;
  font-size: 14px;
  color: var(--text-primary);
}

.size-graph-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.size-graph {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  max-height: 360px;
  overflow-y: auto;
}

.size-graph-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(140px, 2fr) 70px 80px;
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.size-graph-row.header {
  position: static;
  background: var(--bg-surface);
  z-index: 2;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.size-graph-row.header .size-graph-bar {
  background: transparent;
}
.size-graph-row.header .size-graph-fill {
  display: none;
}
.size-graph-row.header .size-graph-toggle {
  visibility: hidden;
}
.size-graph-row:hover {
  background: rgba(37, 99, 235, 0.08);
}

.size-graph-row:first-child {
  border-top: none;
}

.size-graph-row.hidden {
  display: none;
}

.size-graph-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding-left: calc(var(--indent, 0) * 14px);
}
.size-graph-path {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
}
.size-graph-copy {
  margin-left: 6px;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.size-graph-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-primary);
}

.size-graph-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.18);
  position: relative;
  overflow: hidden;
}

.size-graph-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.size-graph-percent,
.size-graph-size {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: right;
}

.size-graph-toggle {
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.size-graph-toggle.spacer {
  cursor: default;
}

.size-graph-empty {
  padding: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.size-graph-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.size-graph-modal-body > .size-graph-card {
  margin-bottom: 4px;
}

.size-graph-modal-body > .size-graph-card + .diff-card {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.size-graph-modal-body > .diff-card {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.size-graph-modal-body > .diff-card + .diff-card {
  margin-top: -4px;
}

.size-graph-modal .size-graph {
  max-height: 360px;
}

@media (max-width: 720px) {
  .sql-top {
    grid-template-columns: 1fr;
  }

  .sql-bottom .editor-box {
    min-height: 200px;
  }

  .size-graph-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .size-graph-percent,
  .size-graph-size {
    text-align: left;
  }
}

.editor-menu {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
}

.editor-box {
  flex: 1 1 auto;
  border-radius: 8px;
  border: 1px solid #111827;
  overflow: hidden;
  min-height: 220px;
  background: #020617;
}

#editor-left,
#editor-right {
  width: 100%;
  height: 100%;
}

.resize-handle {
  height: 10px;
  cursor: row-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: var(--text-muted);
  -webkit-user-select: none;
  user-select: none;
  margin-top: 4px;
}

.resize-bar {
  width: 44px;
  height: 3px;
  border-radius: 999px;
  background: #1f2937;
}

.status {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.status.error { color: #ef4444; }

/* Compact hero/info below tool */

.hero {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px solid #0f172a;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10px;
  background: rgba(37,99,235,0.12);
  color: #60a5fa;
  font-weight: 500;
  width: fit-content;
}

h1 {
  font-size: 20px;
  margin: 0;
  line-height: 1.25;
}

.hero-sub {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 720px;
  margin-top: 0;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.hero-meta span::before { content: "• "; }
.hero-meta span:first-child::before { content: ""; }

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.5fr);
  gap: 10px;
  margin-top: 8px;
}

.info-card {
  border-radius: var(--radius-lg);
  border: 1px solid #111827;
  background: #020617;
  padding: 9px 11px;
  font-size: 12px;
  color: var(--text-muted);
}

.info-card h2 {
  font-size: 14px;
  margin: 0 0 4px;
  color: var(--text-main);
}

.info-card h3 {
  font-size: 13px;
  margin-top: 8px;
  margin-bottom: 3px;
  color: var(--text-main);
}

.form-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  width: min(820px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.form-field input,
.form-field textarea {
  background: #0b1220;
  border: 1px solid #1f2937;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  width: 100%;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.info-card ul {
  padding-left: 18px;
  margin: 3px 0 6px;
}

footer {
  border-top: 1px solid #111827;
  margin-top: 12px;
  padding: 9px 12px 12px;
  font-size: 11px;
  color: #6b7280;
  text-align: center;
}

footer a {
  color: #9ca3af;
  text-decoration: none;
}

footer a:hover { text-decoration: underline; }

/* Responsive sidebar collapse */
@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-right: none;
    border-bottom: 1px solid #111827;
    position: static;
  }

  .sidebar-topbar {
    align-items: center;
  }

  .sidebar-collapse-btn {
    margin-top: 0;
  }

  .sidebar-reveal-btn {
    top: 72px;
    transform: translateX(-8px);
  }

  body.sidebar-collapsed .sidebar-reveal-btn {
    transform: translateX(0);
  }

  .sidebar-nav {
    flex-direction: row;
    gap: 6px;
  }

  .sidebar-link {
    padding: 4px 6px;
    font-size: 12px;
  }

  .tool-card {
    height: auto;
    min-height: 25%;
  }

  .editor-layout {
    flex-direction: column;
    min-height: 1420px;
    height: calc(100vh - 300px);
    max-height: calc(100vh - 300px);
  }

  .editor-box {
    min-height: 560px;
  }
}

@media (max-width: 768px) {
  :root {
    --tool-card-content-offset: 0px;
    --tool-card-viewport-offset: 220px;
    --tool-card-max-start: 640px;
  }
  /* The old 50px here was the main source of field CLS: AdSense sizes this
     slot to roughly the viewport width on phones, so reserving 50px meant a
     300px+ jump on every load. Phones are handled by the max-width:500px rule
     at the end of this file; this value covers 501-768px. */
  .tool-footer-ad-inner .jvt-tool-footer-ad {
    min-height: 248px;
  }
  body[data-header-type="tool"] .tool-card:has(.diff-card) {
    --tool-card-content-offset: 88px;
  }
  /* Header banner is desktop-only: on phones it was the LCP element and the
     main CLS source. Mobile is monetised via AdSense anchor overlays, and
     layout-header.js skips the ad request entirely at this breakpoint.
     Hiding the container also removes the reserved gap, so there is no
     empty space where the banner used to be. */
  #header-ad-container,
  .header-ad-container {
    display: none;
  }
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  #app-header-root { min-height: 85px; }

  main {
    padding: 6px 8px 18px;
  }

  h1 { font-size: 18px; }

  .info-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* CSV table preview on JSON → CSV page */
.csv-table-container {
  width: 100%;
  height: 100%;
  overflow: auto;
}

.csv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.csv-table th,
.csv-table td {
  border-bottom: 1px solid #111827;
  padding: 4px 8px;
  text-align: left;
  white-space: nowrap;
}

.csv-table th {
  color: #e5e7eb;
  background: #020617;
}

.csv-table tr:nth-child(even) td {
  background: rgba(15,23,42,0.5);
}


/* Fix toolbar to full width */
.tool-card {
  width: 100%;
  height: auto;
}

.tool-card .toolbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 6px;
  box-sizing: border-box;
}



.app-main,
main {
  width: 100%;
}

/* Prevent inner elements from shrinking */
.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}


/* Make toolbar always full-width and prevent uneven wrapping */
.tool-card .toolbar {
  flex-wrap: nowrap !important;
  justify-content: space-between !important;
  width: 100%;
}

.tool-card .toolbar-group {
  flex-wrap: nowrap !important;
}

@media (max-width: 900px) {
  .tool-card .toolbar,
  .tool-card .toolbar-group {
    flex-wrap: wrap !important;
  }

  .tool-card .toolbar-group {
    min-width: 0;
  }

  .footer-links {
    flex-wrap: wrap;
    min-width: 0;
    max-width: 100%;
  }
}


/* JWT Decoder right side layout */
.jwt-columns {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}

.jwt-panel {
  flex: 1;
  min-height: 0;
  border-radius: 6px;
  border: 1px solid #111827;
  padding: 4px 6px;
  background: #020617;
  display: flex;
  flex-direction: column;
}

.jwt-panel-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  margin-bottom: 2px;
}

#editor-header,
#editor-payload {
  flex: 1;
  min-height: 0;
}


/* Blog layout */

.blog-body {
  background: #020617;
  color: #e5e7eb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.blog-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.blog-header {
  margin-bottom: 24px;
}

.blog-brand-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: #38bdf8;
  text-decoration: none;
}

.blog-brand-title:hover {
  text-decoration: underline;
}

.blog-brand-sub {
  display: block;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 2px;
}

.blog-breadcrumb {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #94a3b8;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.blog-breadcrumb a {
  color: #38bdf8;
  text-decoration: none;
}

.blog-breadcrumb a:hover {
  text-decoration: underline;
}

.blog-breadcrumb-current {
  color: #e5e7eb;
  font-weight: 500;
}

.blog-hero {
  margin-top: 24px;
}

.blog-hero h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
  color: #e5e7eb;
}

.blog-hero p {
  font-size: 0.95rem;
  color: #cbd5e1;
}

/* Blog list & cards */

.blog-main {
  margin-top: 24px;
}

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

.blog-card {
  background: #020617;
  border-radius: 10px;
  border: 1px solid #1e293b;
  padding: 16px 18px;
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.blog-card h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.blog-card h2 a {
  color: #e5e7eb;
  text-decoration: none;
}

.blog-card h2 a:hover {
  color: #38bdf8;
}

.blog-card p {
  margin: 0;
  font-size: 0.95rem;
  color: #cbd5e1;
}

.blog-card:hover {
  background: #0f172a;
  border-color: #38bdf8;
  transform: translateY(-2px);
}

.blog-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid #1e293b;
  font-size: 0.85rem;
  color: #94a3b8;
}

/* Mobile tweaks */
@media (max-width: 640px) {
  .blog-container {
    padding: 16px 12px 32px;
  }

  .blog-hero h1 {
    font-size: 1.4rem;
  }
}


/* Article navigation links on blog posts */
.article-nav {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #1e293b;
}

.article-nav-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.article-nav-link {
  font-size: 0.9rem;
  color: #38bdf8;
  text-decoration: none;
}

.article-nav-link:hover {
  text-decoration: underline;
}


/* Blog article related links */
.article-related {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #1e293b;
}

.article-related h2 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: #e5e7eb;
}

.article-related ul {
  list-style: disc;
  margin-left: 18px;
  color: #cbd5e1;
}

.article-related a {
  color: #38bdf8;
  text-decoration: none;
}

.article-related a:hover {
  text-decoration: underline;
}

/* Blog search on index page */
.blog-search-box {
  margin-top: 16px;
  margin-bottom: 16px;
}

.blog-search-input {
  width: 100%;
  max-width: 420px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #1e293b;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.9rem;
}

.blog-search-input::placeholder {
  color: #64748b;
}


/* Home page blog teaser */
.home-blog-teaser {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #1e293b;
}

.home-blog-header h2 {
  font-size: 1.15rem;
  margin: 0 0 4px;
  color: #e5e7eb;
}

.home-blog-header p {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.home-blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.home-blog-card {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #1e293b;
  background: #020617;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.home-blog-card h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.home-blog-card h3 a {
  color: #e5e7eb;
  text-decoration: none;
}

.home-blog-card h3 a:hover {
  color: #38bdf8;
}

.home-blog-card p {
  margin: 0;
  font-size: 0.86rem;
  color: #cbd5e1;
}

.home-blog-card:hover {
  background: #0f172a;
  border-color: #38bdf8;
  transform: translateY(-2px);
}


/* Blog teaser button */
.home-blog-viewall {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.home-blog-button {
  display: inline-block;
  padding: 10px 22px;
  background: #2563eb;
  color: #ffffff;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: 0.2s ease;
}

.home-blog-button:hover {
  background: #1e40af;
  transform: translateY(-2px);
}


/* Blog article meta */
.article-meta {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 12px;
}


/* Editor stats (chars/size/lines/nodes) */
.editor-stats{
  display:flex;
  flex-wrap:nowrap;
  gap:10px 14px;
  align-items:flex-start;
  justify-content:space-between;
  font-size:12px;
  color:#cbd5e1;
  padding:6px 10px;
  border:1px solid #1e293b;
  border-radius:8px;
  background:#020617;
  margin:6px 0 10px;
}

.editor-stats .stats-left,
.editor-stats .stats-right{
  display:flex;
  flex-wrap:wrap;
  gap:10px 14px;
  align-items:center;
}

.editor-stats .stats-left{
  flex:1 1 auto;
  min-width:0;
}

.editor-stats .stats-right{
  flex:0 0 auto;
  margin-left:auto;
  flex-wrap:nowrap;
  align-self:flex-start;
}

.editor-stats b{
  color:#94a3b8;
  font-weight:600;
}

.editor-stats .stats-pill{
  display:inline-flex;
  gap:6px;
  align-items:center;
}

.editor-stats .stats-warn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid #7c2d12;
  background:rgba(124,45,18,0.25);
  color:#fdba74;
  font-weight:600;
}

.editor-stats .stats-bad{
  border-color:#7f1d1d;
  background:rgba(127,29,29,0.25);
  color:#fecaca;
}

.editor-stats button.stats-copy{
  appearance:none;
  border:1px solid #1e293b;
  background:#0f172a;
  color:#e5e7eb;
  padding:5px 10px;
  border-radius:8px;
  font-size:12px;
  cursor:pointer;
  transition:0.2s ease;
}

.editor-stats button.stats-copy:hover{
  border-color:#38bdf8;
  transform:translateY(-1px);
}

/* Header theme toggle button */
.nav-links .nav-btn {
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 6px 10px;
  font-size: 12px;
  background: var(--bg);
  color: var(--text-main);
  cursor: pointer;
  min-width: 78px;
}
.nav-links .nav-btn:hover {
  filter: brightness(1.08);
}

/* Light mode theme */
body.light-mode, html.light-mode {
  --bg: #f8fafc;
  --bg-light: #ffffff;
  --card-bg: #ffffff;
  --primary: #2563eb;
  --primary-soft: #1d4ed8;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #475569;
  --tool-sticky-bg: #ffffff;
  --tool-sticky-shadow: 0 10px 24px rgba(148, 163, 184, 0.16);
}

body.light-mode, html.light-mode {
  background: var(--bg);
  color: var(--text-main);
}

body.light-mode, html.light-mode .sidebar {
  background: var(--card-bg);
}

body.light-mode, html.light-mode header {
  background: rgba(241,245,249,0.98);
  border-bottom: 1px solid var(--border);
}

body.light-mode, html.light-mode .tool-card {
  background: var(--card-bg);
  border-color: var(--border);
}

body.light-mode, html.light-mode .tool-options {
  background: #f8fafc;
  border-color: var(--border);
}

body.light-mode, html.light-mode .tool-options .option-field,
body.light-mode, html.light-mode .tool-options .option-group label {
  color: #334155;
}

body.light-mode, html.light-mode .tool-options .option-title {
  color: #0f172a;
}

body.light-mode, html.light-mode .tool-options .option-field input:not([type="checkbox"]):not([type="radio"]) {
  background: #ffffff;
  border-color: var(--border);
  color: #0f172a;
}

body.light-mode, html.light-mode .pojo-options .tool-options {
  background: #f8fafc;
}

body.light-mode, html.light-mode .modal-card {
  background: #ffffff;
  color: #0f172a;
  border-color: var(--border);
}

body.light-mode, html.light-mode .modal-header {
  background: #f1f5f9;
  border-color: var(--border);
}

body.light-mode, html.light-mode .code-preview {
  background: #ffffff;
  color: #0f172a;
  border-color: var(--border);
}

body.light-mode, html.light-mode .editor-box {
  border-color: var(--border);
  background: #ffffff;
}

body.light-mode, html.light-mode .editor-stats {
  background: #ffffff;
  border-color: var(--border);
  color: #0f172a;
}

body.light-mode, html.light-mode .editor-stats b {
  color: #334155;
}

body.light-mode, html.light-mode .editor-stats .stats-warn {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

body.light-mode, html.light-mode .editor-stats .stats-bad {
  border-color: #f87171;
  background: #fef2f2;
  color: #991b1b;
}

body.light-mode, html.light-mode .editor-stats button.stats-copy {
  background: #ffffff;
  border-color: var(--border);
  color: #0f172a;
  font-weight: 600;
}

body.light-mode, html.light-mode .editor-stats button.stats-copy:hover {
  background: #f8fafc;
  color: #0f172a;
}

body.light-mode, html.light-mode .btn:not(.primary) {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text-main);
}

body.light-mode, html.light-mode .btn.primary {
  background: linear-gradient(90deg,#2563eb,#1d4ed8);
  border-color: #1d4ed8;
  color: #ffffff;
}

body.light-mode, html.light-mode .btn.primary {
  color: #ffffff;
}

body.light-mode, html.light-mode .sidebar-link:hover,
body.light-mode, html.light-mode .sidebar-link-active {
  background: #f1f5f9;
  color: var(--text-main);
}



/* =========================================================
   GLOBAL LIGHT MODE – Diff / Code / Result Readability FIX
   Applies to ALL pages (Compare, JSON Viewer, Tools)
   ========================================================= */
body.light-mode, html.light-mode {
  --text-main: #0f172a;
  --text-muted: #64748b;
}

/* Diff result containers */
body.light-mode, html.light-mode .diff-output {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e5e7eb !important;
}

/* Diff rows & text */
body.light-mode, html.light-mode .diff-row {
  color: #0f172a !important;
}

body.light-mode, html.light-mode .diff-line {
  color: #0f172a !important;
}

/* Line number gutter */
body.light-mode, html.light-mode .diff-lineno {
  color: #64748b !important;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
}

/* Modern highlight colors (DiffNow-like) */
body.light-mode, html.light-mode .diff-row.changed {
  background: #fff7cc;
}

body.light-mode, html.light-mode .diff-row.added {
  background: #e6fbe8;
}

body.light-mode, html.light-mode .diff-row.removed {
  background: #ffecec;
}

/* Inline character highlights */
body.light-mode, html.light-mode .diff-char-added {
  background: #bbf7d0;
  color: #065f46;
}

body.light-mode, html.light-mode .diff-char-removed {
  background: #fecaca;
  color: #7f1d1d;
}

/* Active diff row */
body.light-mode, html.light-mode .diff-row.active {
  outline: none;
}

/* Ace editor light consistency */
body.light-mode, html.light-mode .ace_editor {
  background: #ffffff !important;
  color: #0f172a !important;
}

body.light-mode, html.light-mode .ace_gutter {
  background: #f8fafc !important;
  color: #64748b !important;
  border-right: 1px solid #e2e8f0;
}


/* =========================================================
   LIGHT MODE – Header/Sidebar text color fixes
   ========================================================= */
body.light-mode, html.light-mode header,
body.light-mode, html.light-mode .app-header,
body.light-mode, html.light-mode #app-header-root {
  color: var(--text-main);
}

body.light-mode, html.light-mode header .brand,
body.light-mode, html.light-mode header .brand a,
body.light-mode, html.light-mode header .brand-title,
body.light-mode, html.light-mode header .brand-subtitle,
body.light-mode, html.light-mode .header-title,
body.light-mode, html.light-mode .header-subtitle {
  color: var(--text-main) !important;
}

body.light-mode, html.light-mode header .brand-subtitle,
body.light-mode, html.light-mode .header-subtitle {
  color: var(--text-muted) !important;
}

body.light-mode, html.light-mode .nav-links a {
  color: var(--text-main) !important;
  opacity: 0.9;
}

body.light-mode, html.light-mode .nav-links a:hover {
  opacity: 1;
}

/* Sidebar text */
body.light-mode, html.light-mode .sidebar {
  background: var(--card-bg) !important;
  color: var(--text-main) !important;
  border-right: 1px solid var(--border);
}

body.light-mode, html.light-mode .sidebar .sidebar-title,
body.light-mode, html.light-mode .sidebar .sidebar-section-title {
  color: var(--text-muted) !important;
  background: #f1f5f9;
  border-color: var(--border);
}

body.light-mode, html.light-mode .sidebar .sidebar-section-title:nth-of-type(5n+1) {
  background: #dbeafe;
  border-color: #bfdbfe;
}

body.light-mode, html.light-mode .sidebar .sidebar-section-title:nth-of-type(5n+2) {
  background: #dcfce7;
  border-color: #bbf7d0;
}

body.light-mode, html.light-mode .sidebar .sidebar-section-title:nth-of-type(5n+3) {
  background: #fef9c3;
  border-color: #fde68a;
}

body.light-mode, html.light-mode .sidebar .sidebar-section-title:nth-of-type(5n+4) {
  background: #ffedd5;
  border-color: #fed7aa;
}

body.light-mode, html.light-mode .sidebar .sidebar-section-title:nth-of-type(5n) {
  background: #fee2e2;
  border-color: #fecaca;
}

body.light-mode, html.light-mode .form-field input,
body.light-mode, html.light-mode .form-field textarea {
  background: #ffffff;
  border-color: var(--border);
  color: #0f172a;
}

body.light-mode, html.light-mode .sidebar a,
body.light-mode, html.light-mode .sidebar .sidebar-link {
  color: var(--text-main) !important;
  opacity: 0.92;
}

body.light-mode, html.light-mode .sidebar a:hover,
body.light-mode, html.light-mode .sidebar .sidebar-link:hover {
  opacity: 1;
  background: #f1f5f9;
}

body.light-mode, html.light-mode .sidebar .sidebar-link-active {
  background: #eaf2ff; /* subtle blue */
  color: #1d4ed8 !important;
}

/* If logo icon is SVG using currentColor */
body.light-mode, html.light-mode .sidebar .brand-logo,
body.light-mode, html.light-mode header .brand-logo {
  color: var(--text-main) !important;
}


/* =========================================================
   LIGHT MODE – Tool page content text visibility (GLOBAL)
   Fixes faded instructions/labels across all tools/pages
   ========================================================= */
body.light-mode, html.light-mode main,
body.light-mode, html.light-mode .app-main,
body.light-mode, html.light-mode .tool-card {
  color: var(--text-main) !important;
}

body.light-mode, html.light-mode .tool-card p,
body.light-mode, html.light-mode .tool-card li,
body.light-mode, html.light-mode .tool-card span,
body.light-mode, html.light-mode .tool-card label,
body.light-mode, html.light-mode .tool-card small,
body.light-mode, html.light-mode .tool-card .compare-subtitle,
body.light-mode, html.light-mode .tool-card .compare-status {
  color: var(--text-main) !important;
  opacity: 1 !important;
}

/* muted helper text */
body.light-mode, html.light-mode .tool-card .help-text,
body.light-mode, html.light-mode .tool-card .subtitle,
body.light-mode, html.light-mode .tool-card .muted,
body.light-mode, html.light-mode .tool-card .diff-summary,
body.light-mode, html.light-mode .compare-status,
body.light-mode, html.light-mode footer {
  color: var(--text-muted) !important;
  opacity: 1 !important;
}

/* Editor pane headers / titles / mode labels */
body.light-mode, html.light-mode .editor-pane-title,
body.light-mode, html.light-mode .editor-pane-header,
body.light-mode, html.light-mode .editor-menu,
body.light-mode, html.light-mode .editor-pane-header-stats,
body.light-mode, html.light-mode .mode-label,
body.light-mode, html.light-mode .toolbar,
body.light-mode, html.light-mode .toolbar-group {
  color: var(--text-main) !important;
}

/* If any page uses very low opacity for captions */
body.light-mode, html.light-mode [style*="opacity: 0"],
body.light-mode, html.light-mode [style*="opacity:0"] {
  opacity: 1 !important;
}


/* =========================================================
   LIGHT MODE – Blog pages (index + posts)
   ========================================================= */
body.light-mode, html.light-mode .blog-hero {
  border-bottom: 1px solid var(--border) !important;
}
body.light-mode, html.light-mode .blog-hero h1 {
  color: var(--text-main) !important;
}
body.light-mode, html.light-mode .blog-hero p {
  color: var(--text-muted) !important;
}

/* Blog cards / lists: force light surfaces */
body.light-mode, html.light-mode .blog-card,
body.light-mode, html.light-mode .blog-post-card,
body.light-mode, html.light-mode .post-card,
body.light-mode, html.light-mode .blog-list a.blog-card {
  background: #ffffff !important;
  border: 1px solid var(--border) !important;
  color: var(--text-main) !important;
}

/* Titles + excerpts inside cards */
body.light-mode, html.light-mode .blog-card h2,
body.light-mode, html.light-mode .blog-card h3,
body.light-mode, html.light-mode .blog-card .title,
body.light-mode, html.light-mode .blog-post-card h1,
body.light-mode, html.light-mode .blog-post-card h2,
body.light-mode, html.light-mode .blog-post-card h3 {
  color: var(--text-main) !important;
}
body.light-mode, html.light-mode .blog-card p,
body.light-mode, html.light-mode .blog-card .excerpt,
body.light-mode, html.light-mode .blog-card .desc {
  color: var(--text-muted) !important;
}

/* Blog footer */
body.light-mode, html.light-mode .blog-footer {
  border-top: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
}

/* If any blog page uses hardcoded dark "card" class */
body.light-mode, html.light-mode .card {
  background: #ffffff !important;
  border-color: var(--border) !important;
  color: var(--text-main) !important;
}


/* =========================================================
   LIGHT MODE – Logo text visibility (header + sidebar)
   ========================================================= */
body.light-mode, html.light-mode .brand,
body.light-mode, html.light-mode .brand *,
body.light-mode, html.light-mode .sidebar-brand,
body.light-mode, html.light-mode .sidebar-brand *,
body.light-mode, html.light-mode .brand-text,
body.light-mode, html.light-mode .brand-name,
body.light-mode, html.light-mode .brand-desc {
  color: var(--text-main) !important;
}

body.light-mode, html.light-mode .brand-desc,
body.light-mode, html.light-mode .sidebar-brand small,
body.light-mode, html.light-mode .sidebar-brand .muted {
  color: var(--text-muted) !important;
}


/* =========================================================
   LIGHT MODE – Sidebar logo + top bar stats visibility
   ========================================================= */
body.light-mode, html.light-mode .sidebar-logo .logo-title {
  color: var(--text-main) !important;
  font-weight: 700;
}
body.light-mode, html.light-mode .sidebar-logo .logo-sub {
  color: var(--text-muted) !important;
}

/* Top stats/header bars in tools (keep readable) */
body.light-mode, html.light-mode .pane-meta,
body.light-mode, html.light-mode .meta,
body.light-mode, html.light-mode .editor-pane .meta,
body.light-mode, html.light-mode .editor-pane .meta * {
  color: #e5e7eb !important; /* these bars stay dark */
  opacity: 1 !important;
}


/* =========================================================
   LIGHT MODE – Status text + Ace active-line highlight fixes
   ========================================================= */

/* Tool status lines (e.g., "Auto-updated right panel ✓") */
body.light-mode, html.light-mode .status,
body.light-mode, html.light-mode .status-bar,
body.light-mode, html.light-mode .tool-status,
body.light-mode, html.light-mode .status-text,
body.light-mode, html.light-mode #status,
body.light-mode, html.light-mode #status-left,
body.light-mode, html.light-mode #status-right,
body.light-mode, html.light-mode .bottom-status,
body.light-mode, html.light-mode .footer-status {
  color: var(--text-muted) !important;
  opacity: 1 !important;
}

/* If status sits on dark background, ensure contrast */
body.light-mode, html.light-mode .status.dark,
body.light-mode, html.light-mode .status-bar.dark,
body.light-mode, html.light-mode .tool-status.dark {
  color: #e2e8f0 !important;
}

/* Ace editor: active row highlight should be light (not black) */
body.light-mode, html.light-mode .ace_marker-layer .ace_active-line {
  background: rgba(250, 204, 21, 0.22) !important; /* soft amber */
}
body.light-mode, html.light-mode .ace_gutter-active-line {
  background: rgba(250, 204, 21, 0.22) !important;
}
body.light-mode, html.light-mode .ace_editor .ace_selected-word {
  border: 1px solid rgba(37, 99, 235, 0.35) !important;
}

/* Keep text readable in highlighted line */
body.light-mode, html.light-mode .ace_editor,
body.light-mode, html.light-mode .ace_editor * {
  color: #0f172a;
}


/* =========================================================
   LIGHT MODE – Dark stat/copy bars text visibility fix
   (e.g., "Left Chars / Size / Lines / Copy stats" bars)
   ========================================================= */
body.light-mode, html.light-mode .stats-bar,
body.light-mode, html.light-mode .stats,
body.light-mode, html.light-mode .stats-row,
body.light-mode, html.light-mode .editor-stats,
body.light-mode, html.light-mode .pane-stats,
body.light-mode, html.light-mode .panel-stats {
  color: #e2e8f0 !important; /* readable on dark bars */
}

body.light-mode, html.light-mode .stats-bar *,
body.light-mode, html.light-mode .stats *,
body.light-mode, html.light-mode .stats-row *,
body.light-mode, html.light-mode .editor-stats *,
body.light-mode, html.light-mode .pane-stats *,
body.light-mode, html.light-mode .panel-stats * {
  color: #e2e8f0 !important;
  opacity: 1 !important;
}

/* Ensure the "Copy stats" button text is visible */
body.light-mode, html.light-mode .stats-bar .btn,
body.light-mode, html.light-mode .stats .btn,
body.light-mode, html.light-mode .editor-stats .btn,
body.light-mode, html.light-mode .pane-stats .btn,
body.light-mode, html.light-mode .panel-stats .btn,
body.light-mode, html.light-mode button.copy-stats,
body.light-mode, html.light-mode #btn-copy-stats,
body.light-mode, html.light-mode .btn-copy-stats {
  color: #e2e8f0 !important;
}


/* =========================================================
   LIGHT MODE – Stats bar auto-updated metric values visibility
   Forces values/numbers inside dark stat bars to be readable
   ========================================================= */
body.light-mode, html.light-mode .stats-bar .value,
body.light-mode, html.light-mode .stats-bar .stat-value,
body.light-mode, html.light-mode .stats-bar .metric-value,
body.light-mode, html.light-mode .stats-bar .count,
body.light-mode, html.light-mode .stats-bar .num,
body.light-mode, html.light-mode .stats-bar strong,
body.light-mode, html.light-mode .stats-bar b,
body.light-mode, html.light-mode .stats .value,
body.light-mode, html.light-mode .stats .stat-value,
body.light-mode, html.light-mode .stats .metric-value,
body.light-mode, html.light-mode .editor-stats .value,
body.light-mode, html.light-mode .editor-stats .stat-value,
body.light-mode, html.light-mode .pane-stats .value,
body.light-mode, html.light-mode .pane-stats .stat-value,
body.light-mode, html.light-mode .panel-stats .value,
body.light-mode, html.light-mode .panel-stats .stat-value {
  color: #e2e8f0 !important;
  opacity: 1 !important;
}

/* If any metric numbers use inline styles, override them */
body.light-mode, html.light-mode .stats-bar span[style*="color"],
body.light-mode, html.light-mode .stats span[style*="color"],
body.light-mode, html.light-mode .editor-stats span[style*="color"],
body.light-mode, html.light-mode .pane-stats span[style*="color"],
body.light-mode, html.light-mode .panel-stats span[style*="color"] {
  color: #e2e8f0 !important;
}

/* Labels can remain slightly muted, but still readable */
body.light-mode, html.light-mode .stats-bar .label,
body.light-mode, html.light-mode .stats-bar .stat-label,
body.light-mode, html.light-mode .stats-bar .metric-label {
  color: #cbd5e1 !important;
  opacity: 1 !important;
}


/* =========================================================
   LIGHT MODE – Override earlier generic text rules inside editor stats bars
   (Prevents black text in dark stats bars due to .tool-card span overrides)
   ========================================================= */
body.light-mode, html.light-mode .editor-stats,
body.light-mode, html.light-mode .editor-stats * {
  color: #e2e8f0 !important;
  opacity: 1 !important;
}

body.light-mode, html.light-mode .editor-stats b {
  color: #cbd5e1 !important; /* labels slightly muted */
}

body.light-mode, html.light-mode .editor-stats .stats-copy {
  color: #e2e8f0 !important;
}

body.light-mode, html.light-mode .editor-stats button.stats-copy {
  color: #0f172a !important;
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

body.light-mode, html.light-mode .editor-stats button.stats-copy:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
}


/* =========================================================
   LIGHT MODE – Blog post page (main.article) should be white
   ========================================================= */
body.light-mode, html.light-mode main.article,
body.light-mode, html.light-mode main.article > article,
body.light-mode, html.light-mode main.article article {
  background: #ffffff !important;
  color: #0f172a !important;
}

body.light-mode, html.light-mode main.article header h1,
body.light-mode, html.light-mode main.article h1,
body.light-mode, html.light-mode main.article h2,
body.light-mode, html.light-mode main.article h3 {
  color: #0f172a !important;
}

body.light-mode, html.light-mode main.article p,
body.light-mode, html.light-mode main.article li,
body.light-mode, html.light-mode main.article .hero-sub,
body.light-mode, html.light-mode main.article .article-meta {
  color: #334155 !important;
  opacity: 1 !important;
}

body.light-mode, html.light-mode main.article a {
  color: #2563eb !important;
}
body.light-mode, html.light-mode main.article a:hover {
  color: #1d4ed8 !important;
}

/* Code blocks on blog posts */
body.light-mode, html.light-mode main.article pre,
body.light-mode, html.light-mode main.article code {
  background: #f8fafc !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
}

/* Related/nav sections inside posts */
body.light-mode, html.light-mode .article-nav,
body.light-mode, html.light-mode .article-related,
body.light-mode, html.light-mode .article-nav-inner {
  border-top-color: #e2e8f0 !important;
}
body.light-mode, html.light-mode .article-related h2 {
  color: #0f172a !important;
}
body.light-mode, html.light-mode .article-related a {
  color: #2563eb !important;
}

/* =========================================================
   LIGHT MODE – FORCE stats values visibility (absolute)
   ========================================================= */
body.light-mode, html.light-mode .editor-stats,
body.light-mode, html.light-mode .editor-stats *,
body.light-mode, html.light-mode .stats-bar,
body.light-mode, html.light-mode .stats-bar *,
body.light-mode, html.light-mode .pane-stats,
body.light-mode, html.light-mode .pane-stats *,
body.light-mode, html.light-mode .panel-stats,
body.light-mode, html.light-mode .panel-stats * {
  color: #e5e7eb !important;
  opacity: 1 !important;
}

body.light-mode, html.light-mode #leftChars,
body.light-mode, html.light-mode #leftSize,
body.light-mode, html.light-mode #leftLines,
body.light-mode, html.light-mode #leftNodes,
body.light-mode, html.light-mode #rightChars,
body.light-mode, html.light-mode #rightSize,
body.light-mode, html.light-mode #rightLines,
body.light-mode, html.light-mode #rightNodes {
  color: #e5e7eb !important;
  font-weight: 500 !important;
}

/* Light mode: keep inline editor menu buttons readable inside stats bar */
body.light-mode, html.light-mode .editor-stats .stats-inline-menu .btn,
body.light-mode, html.light-mode .editor-stats .editor-menu .btn {
  color: #0f172a !important;
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

body.light-mode, html.light-mode .editor-stats .stats-inline-menu .btn:hover,
body.light-mode, html.light-mode .editor-stats .editor-menu .btn:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
}


/* UI polish: keep stats under pane title */
.editor-stats{margin:8px 0 0 0;}

/* UI polish: keep Mode selector in the stats row (compact header) */
.editor-pane-header .editor-menu { display:none !important; }
.editor-stats .stats-right { display:flex; align-items:center; gap:10px; }
.editor-stats .stats-inline-menu { display:flex !important; align-items:center; gap:6px; }
.editor-stats .stats-inline-menu label { display:flex; align-items:center; gap:6px; margin:0; }
.editor-stats .stats-inline-menu select { height:30px; padding:4px 10px; border-radius:10px; }



/* === Compact UI: hide Left/Right editor titles (stats already indicate side) === */
.editor-pane-header .editor-pane-title,
.editor-pane-header span,
.editor-pane-header h3,
.editor-pane-header h4 {
  display: none !important;
}

.editor-pane-header {
  min-height: 6px;
  padding: 0;
  border-bottom: none;
}



/* === Tight UI: remove gap between toolbar and stats === */
.editor-stats {
  margin-top: 0 !important;
}



/* === Ultra-tight: remove any remaining gap above stats === */
.toolbar { margin-bottom: 0 !important; }
.tool-card .toolbar + .editor-layout { margin-top: 0 !important; }
.editor-layout { margin-top: 0 !important; }

/* Header container kept for stats anchoring, but visually collapsed */
.editor-pane-header {
  min-height: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

/* Stats bar flush */
.editor-stats { margin-top: 0 !important; }



/* === SEO content blocks (AdSense-friendly) === */
.tool-seo-content{
  margin-top: 18px;
  padding: 16px 16px;
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 16px;
  background: rgba(2,6,23,.35);
}
body:not(.dark) .tool-seo-content{ background: #fff; }

.tool-seo-content h1{ margin: 0 0 10px 0; font-size: 20px; }
.tool-seo-content h2{ margin: 0 0 10px 0; font-size: 20px; }
.tool-seo-content h3{ margin: 14px 0 8px 0; font-size: 16px; }
.tool-seo-content p{ margin: 8px 0; line-height: 1.6; }
.tool-seo-content ul, .tool-seo-content ol{ margin: 8px 0 8px 18px; }
.tool-seo-content a{ text-decoration: underline; }
.tool-seo-content .tool-figure{
  margin: 12px 0 16px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,.25);
  background: rgba(15,23,42,.18);
}
.tool-seo-content .tool-figure img{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,.25);
}
.tool-seo-content .tool-figure figcaption{
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
body:not(.dark) .tool-seo-content .tool-figure{
  background: #f8fafc;
}
body:not(.dark) .tool-seo-content .tool-figure img{
  border-color: #e2e8f0;
}
.tool-seo-note{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(99,102,241,.25);
  background: rgba(99,102,241,.10);
}
.tool-seo-note a + a::before{
  content: ", ";
}
.tool-seo-note a + a{
  margin-left: 4px;
}

.related-tools ul{
  list-style: disc;
  padding-left: 20px;
  margin: 8px 0;
}
.related-tools li{
  margin: 6px 0;
}


/* === SEO content blocks: dark-mode text visibility fix === */
.tool-seo-content{ color: rgba(226,232,240,0.92); }
.tool-seo-content h2, .tool-seo-content h3{ color: rgba(241,245,249,0.96); }
.tool-seo-content p, .tool-seo-content li{ color: rgba(226,232,240,0.92); }
.tool-seo-content code{ color: rgba(248,250,252,0.96); background: rgba(148,163,184,0.12); padding: 0 6px; border-radius: 6px; }
.tool-seo-content a{ color: rgba(147,197,253,0.98); }
body:not(.dark) .tool-seo-content,
body:not(.dark) .tool-seo-content p,
body:not(.dark) .tool-seo-content li{ color: #0f172a; }
body:not(.dark) .tool-seo-content h2, body:not(.dark) .tool-seo-content h3{ color: #0b1220; }
body:not(.dark) .tool-seo-content code{ color: #0f172a; background: #e2e8f0; }

.tool-seo-content pre{
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,.25);
  background: rgba(2,6,23,.45);
  color: rgba(226,232,240,0.98);
  overflow: auto;
  width: 100%;
  box-sizing: border-box;
}
.tool-seo-content pre code{
  background: transparent;
  color: inherit;
  padding: 0;
}
body:not(.dark) .tool-seo-content pre{
  background: #f8fafc;
  color: #0f172a;
  border-color: #e2e8f0;
}


/* === Align SEO content to left (fix center offset) === */
.tool-seo-content{
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: none !important;
  text-align: left !important;
}
.tool-seo-content h2,
.tool-seo-content h3,
.tool-seo-content p,
.tool-seo-content ul,
.tool-seo-content ol{
  text-align: left !important;
}


/* SEO blocks: sub-question headings */
.tool-seo-content h4{ margin: 10px 0 6px 0; font-size: 14px; font-weight: 700; color: rgba(241,245,249,0.96); }
body:not(.dark) .tool-seo-content h4{ color: #0b1220; }

/* JSON to CSV guide: readability and layout polish */
#csv-export-guide{
  scroll-margin-top: 88px;
}
#csv-export-guide h1{
  margin: 0 0 10px 0;
  font-size: 35px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: rgba(248,250,252,0.98);
}
#csv-export-guide .guide-lead{
  font-size: 19px;
  line-height: 1.68;
  font-weight: 500;
}
#csv-export-guide h2{
  position: relative;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid rgba(148,163,184,.25);
}
#csv-export-guide h2::before{
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 82px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(56,189,248,.95), rgba(99,102,241,.75));
}
#csv-export-guide h2:first-of-type{
  margin-top: 20px;
}
#csv-export-guide .guide-kicker-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 12px;
}
#csv-export-guide .guide-kicker{
  padding: 12px;
  border: 1px solid rgba(148,163,184,.28);
  border-radius: 12px;
  background: rgba(15,23,42,.22);
}
#csv-export-guide .guide-kicker h3{
  margin: 0 0 6px 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: rgba(186,230,253,0.95);
}
#csv-export-guide .guide-kicker p{
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}
#csv-export-guide .guide-toc{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 18px;
}
#csv-export-guide .guide-toc a{
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.35);
  background: rgba(15,23,42,.18);
  color: rgba(226,232,240,0.95);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
#csv-export-guide .guide-toc a:hover{
  background: rgba(30,41,59,.35);
  border-color: rgba(125,211,252,.55);
  color: rgba(248,250,252,0.98);
}
#csv-export-guide .guide-table-wrap{
  margin: 10px 0 14px;
  border: 1px solid rgba(148,163,184,.28);
  border-radius: 12px;
  overflow-x: auto;
  background: rgba(15,23,42,.14);
}
#csv-export-guide table{
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
}
#csv-export-guide th,
#csv-export-guide td{
  padding: 11px 12px;
  border-bottom: 1px solid rgba(148,163,184,.22);
  text-align: left;
  vertical-align: top;
}
#csv-export-guide thead th{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  background: rgba(30,41,59,.35);
}
#csv-export-guide tbody tr:last-child td{
  border-bottom: none;
}
#csv-export-guide .faq-item{
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,.28);
  background: rgba(15,23,42,.18);
}
#csv-export-guide .faq-item h3{
  margin: 0 0 6px 0;
}
#csv-export-guide .faq-item p{
  margin: 0;
}
body:not(.dark) #csv-export-guide h1{
  color: #0b1220;
}
body:not(.dark) #csv-export-guide h2{
  border-top-color: #e2e8f0;
}
body:not(.dark) #csv-export-guide h2::before{
  background: linear-gradient(90deg, #0284c7, #4f46e5);
}
body:not(.dark) #csv-export-guide .guide-kicker{
  background: #f8fafc;
  border-color: #dbe3ef;
}
body:not(.dark) #csv-export-guide .guide-kicker h3{
  color: #0f766e;
}
body:not(.dark) #csv-export-guide .guide-toc a{
  color: #1e293b;
  background: #f8fafc;
  border-color: #d7dfeb;
}
body:not(.dark) #csv-export-guide .guide-toc a:hover{
  color: #0f172a;
  background: #eff6ff;
  border-color: #93c5fd;
}
body:not(.dark) #csv-export-guide .guide-table-wrap{
  background: #ffffff;
  border-color: #dbe3ef;
}
body:not(.dark) #csv-export-guide thead th{
  background: #f8fafc;
}
body:not(.dark) #csv-export-guide th,
body:not(.dark) #csv-export-guide td{
  border-bottom-color: #e2e8f0;
}
body:not(.dark) #csv-export-guide .faq-item{
  background: #f8fafc;
  border-color: #dbe3ef;
}
@media (max-width: 980px){
  #csv-export-guide h1{ font-size: 30px; }
  #csv-export-guide .guide-kicker-grid{
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px){
  #csv-export-guide .guide-lead{
    font-size: 17px;
  }
  #csv-export-guide .guide-toc a{
    font-size: 12px;
    padding: 6px 9px;
  }
}

/* === Unified layout spacing (after removing hero sections) === */
main{ padding-top: 12px; }

/* Content text color guard (readability) */
.tool-content, .home-content, .seo-block-home, .info-card, main.article{
  color: var(--content-body, var(--text-secondary));
}

/* Content tables (type-mapping / comparison) on tool pages */
.tool-seo-content .tool-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 18px;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}
.tool-seo-content .tool-table thead th {
  text-align: left;
  background: rgba(37, 99, 235, 0.08);
  font-weight: 600;
}
.tool-seo-content .tool-table th,
.tool-seo-content .tool-table td {
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 8px 10px;
  vertical-align: top;
}

/* Phones: AdSense sizes the footer slot to roughly the viewport width
   (measured 360->360, 390->368, 430->428, three runs each). Reserving a flat
   pixel value cannot track that, so scale with the viewport and cap it before
   it reaches tablet widths, where the slot is 248px instead. Placed last so it
   wins over the max-width:768px rule above. */
@media (max-width: 500px) {
  .tool-footer-ad-container,
  .tool-footer-ad-inner,
  .tool-footer-ad-inner .jvt-tool-footer-ad {
    min-height: min(100vw, 480px);
  }
}
