/* Page shell */
.page {
  display: grid;
  grid-template-rows: var(--header-h) 1fr auto;
  min-height: 100vh;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: 0 var(--space-6);
}
.site-header .brand {
  display: flex; align-items: center; gap: var(--space-4);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-15);
  letter-spacing: -0.01em;
  color: var(--text);
}
.site-header .brand-mark {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(91, 91, 214, 0.35);
}
.site-header .brand-mark svg { display: block; }
.site-header .brand:hover { text-decoration: none; }

.site-nav {
  display: flex; gap: var(--space-1);
  margin-left: auto; align-items: center;
}
.site-nav a {
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-13);
  font-weight: 500;
  line-height: 1;
  transition: background 120ms ease, color 120ms ease;
}
.site-nav a:hover { background: var(--bg-elev-2); text-decoration: none; }
.site-nav a.active { color: var(--text); background: var(--bg-elev-2); }
.site-header .nav-toggle { display: none; }

@media (max-width: 760px) {
  .site-header { padding: 0 var(--space-5); gap: var(--space-4); }
  .site-nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; background: var(--bg-elev);
    border-bottom: 1px solid var(--border); padding: var(--space-4);
    gap: var(--space-2);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    z-index: 20;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 12px; font-size: var(--fs-14); }
  .site-header .nav-toggle { display: inline-flex; margin-left: auto; }
}

/* Main */
.site-main { display: flex; flex-direction: column; min-width: 0; }

/* Tool shell */
.tool {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-h) - var(--footer-h));
}
.tool > .split { flex: 1 1 auto; }
.tool > .editor { flex: 1 1 auto; min-height: 320px; }

.tool-header {
  padding: var(--space-7) var(--space-7) var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.tool-header h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: var(--fs-22); line-height: var(--lh-22); font-weight: var(--fw-22);
  letter-spacing: -0.015em;
}
.tool-header .tagline {
  color: var(--text-muted);
  font-size: var(--fs-14); line-height: 1.5;
  margin: 0;
}
/* Short factual summary block that LLMs / AI search engines can quote verbatim.
   Lives between the tool and the content section as a muted lead-in, so it
   stays indexable without dominating the hero. */
.answer-block {
  max-width: 800px;
  margin: var(--space-7) auto 0;
  padding: 0 var(--space-7);
  color: var(--text-muted);
  font-size: var(--fs-14);
  line-height: 1.6;
  text-align: center;
}
.privacy-pill {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: var(--space-5);
  padding: 4px 10px 4px 8px;
  background: var(--success-soft);
  color: var(--success);
  border-radius: var(--radius-pill);
  font-size: var(--fs-12);
  font-weight: 500;
}
.privacy-pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--success);
}

/* Split pane */
.split {
  --split-left: 50%;
  display: grid;
  grid-template-columns: var(--split-left) 6px minmax(0, 1fr);
  min-height: 0;
  flex: 1;
}
.pane {
  display: grid;
  grid-template-rows: var(--toolbar-h) 1fr;
  min-width: 0;
  background: var(--bg);
}
.pane + .pane { border-left: 1px solid var(--border); }
.split-resizer {
  background: var(--border);
  cursor: col-resize;
  position: relative;
  transition: background 120ms ease;
}
.split-resizer:hover { background: var(--accent); }
.split-resizer::before {
  content: ""; position: absolute;
  top: 50%; left: 50%;
  width: 2px; height: 28px; border-radius: 1px;
  background: var(--border-strong);
  transform: translate(-50%, -50%);
  opacity: 0; transition: opacity 120ms ease;
  will-change: opacity;
}
.split-resizer:hover::before { opacity: 1; background: #fff; }
.split-resizer::after {
  content: ""; position: absolute; inset: 0 -4px;
}

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; grid-template-rows: 1fr auto 1fr; }
  .pane + .pane { border-left: none; border-top: 1px solid var(--border); }
  .split-resizer { display: none; }
}

/* Content sections (FAQ, how-to) */
.content {
  padding: var(--space-8) var(--space-7);
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  content-visibility: auto;
  contain-intrinsic-size: 1px 800px;
}
.content h2 {
  font-size: var(--fs-18); line-height: var(--lh-18); font-weight: var(--fw-18);
  letter-spacing: -0.01em;
  margin: var(--space-8) 0 var(--space-5);
}
.content h3 {
  font-size: var(--fs-15); line-height: var(--lh-15); font-weight: var(--fw-15);
  margin: var(--space-7) 0 var(--space-4);
}
.content p { color: var(--text); margin: 0 0 var(--space-5); font-size: var(--fs-14); line-height: var(--lh-14); }
.content ul, .content ol { padding-left: 1.4em; margin: 0 0 var(--space-5); }
.content li { margin-bottom: 4px; font-size: var(--fs-14); line-height: var(--lh-14); }
.content code { background: var(--bg-elev); padding: 2px 6px; border-radius: var(--radius-xs); font-size: var(--fs-13); }
.content pre { background: var(--bg-elev); padding: var(--space-5); border-radius: var(--radius); overflow: auto; font-size: var(--fs-13); line-height: 1.55; }

/* Ad slots — hidden until populated. AdSense adds .is-filled when ad renders. */
.ad-slot { display: none; }
.ad-slot.is-filled {
  display: flex; align-items: center; justify-content: center;
  min-height: 90px;
  margin: var(--space-7) auto;
  max-width: 100%;
  /* Reserve space to avoid CLS once the ad iframe loads. */
  contain: layout style;
}
.ad-slot.is-filled[data-slot="content"] { max-width: 728px; }
.ad-slot.is-filled[data-slot="sidebar"] { min-height: 250px; max-width: 300px; }
.ad-slot.is-filled[data-slot="footer"] {
  margin: 0;
  position: sticky; bottom: 0; z-index: 5;
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
}
.ad-slot:empty { display: none; }

/* Mobile: smaller banner sizes (50-100px) match the formats AdSense actually
   serves on phones, and the sidebar 300x250 slot is hidden because there is
   no horizontal room for it once the split-pane stacks vertically. */
@media (max-width: 760px) {
  .ad-slot.is-filled { min-height: 60px; margin: var(--space-6) auto; }
  .ad-slot.is-filled[data-slot="content"] { max-width: 100%; }
  .ad-slot.is-filled[data-slot="sidebar"] { display: none; }
  .ad-slot.is-filled[data-slot="footer"] { min-height: 50px; }
}
/* Dev preview: uncomment to see ad slot positions while iterating layout */
/* .ad-slot { display: flex; align-items: center; justify-content: center; background: var(--bg-elev); border: 1px dashed var(--border); color: var(--text-soft); font-size: var(--fs-12); min-height: 90px; margin: var(--space-7) auto; } */

/* Footer */
.site-footer {
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  padding: 12px var(--space-6);
  display: flex; flex-wrap: wrap; gap: var(--space-6);
  align-items: center; justify-content: space-between;
  font-size: var(--fs-12); color: var(--text-muted);
}
.site-footer nav { display: flex; gap: var(--space-6); flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* Page-navigation loader — top progress bar (works everywhere) plus the native
   View Transitions API opt-in (Chromium today, others as they ship support). */
#nav-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover, var(--accent)));
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  z-index: 100;
  pointer-events: none;
  will-change: transform, opacity;
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 180ms ease;
  box-shadow: 0 0 6px color-mix(in oklab, var(--accent) 60%, transparent);
}
#nav-progress.loading { opacity: 1; }
#nav-progress.done {
  opacity: 0;
  transition: opacity 180ms ease 80ms, transform 0s 300ms;
}

@supports (view-transition-name: root) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: jk-fade-out 160ms ease-in both; }
  ::view-transition-new(root) { animation: jk-fade-in 220ms ease-out both; }
}
@keyframes jk-fade-in  { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
@keyframes jk-fade-out { from { opacity: 1; } to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  #nav-progress { transition: opacity 80ms linear; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
</content>
</invoke>