/* All Markdown — shared site stylesheet.
   Visual identity is locked (see CLAUDE.md): IBM Plex Mono for chrome, IBM Plex
   Sans for documents, hairline borders, no shadows, "conversion green" accent. */

:root {
  --bg: #F2F3EF;
  --surface: #FFFFFF;
  --surface-2: #F6F8F4;
  --ink: #1A1F1B;
  --muted: #676C68;
  --border: #E1E4DE;
  --accent: #0B7A53;
  --accent-soft: #E3F2EA;
  --on-accent: #FFFFFF;
  --success: #0E8A5F;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'IBM Plex Sans', -apple-system, Segoe UI, sans-serif;
  color-scheme: light;
}
html.dark {
  --bg: #121512;
  --surface: #1A1E1B;
  --surface-2: #222722;
  --ink: #E8EBE7;
  --muted: #8C918C;
  --border: #2B302B;
  --accent: #4CD6A0;
  --accent-soft: #1C3A2C;
  --on-accent: #082B1D;
  --success: #3ECF8E;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
button {
  font: 500 12.5px/1 var(--mono);
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 11px;
  cursor: pointer;
  white-space: nowrap;
}
button:hover { background: var(--surface-2); }
button:focus-visible, a:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
button.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
button.primary:hover { filter: brightness(1.08); }
button.ghost { border-color: var(--border); background: var(--surface); }
button.ghost:hover { background: var(--surface-2); }

/* noscript fallback — kept here so the page needs no inline <style>,
   which is what lets the CSP drop 'unsafe-inline' from style-src. */
noscript p { padding: 16px; font-family: var(--mono); max-width: 60ch; line-height: 1.6; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Skip link — visible only when focused. */
.skip {
  position: absolute; left: 8px; top: -60px; z-index: 200;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: 6px;
  font: 500 12.5px var(--mono); padding: 8px 12px; text-decoration: none;
  transition: top 0.12s ease;
}
.skip:focus { top: 8px; }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand { font: 500 13px var(--mono); letter-spacing: -0.2px; padding-right: 4px; user-select: none; }
.brand em { color: var(--accent); font-style: normal; }
.tabstrip {
  flex: 1;
  list-style: none;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.tabstrip::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  max-width: 210px;
  border: 1px solid transparent;
  border-radius: 6px;
  flex: 0 0 auto;
}
.tab .tname {
  font: 400 12px/1 var(--mono);
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 6px 0 0 6px;
  padding: 7px 4px 7px 10px;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.tab .tname:hover { background: none; }
.tab.active { background: var(--accent-soft); }
.tab.active .tname { color: var(--ink); }
.tab .close {
  border: 0; padding: 7px 8px 7px 4px; font: 400 12px/1 var(--mono);
  color: var(--muted); background: none; border-radius: 0 6px 6px 0; cursor: pointer;
}
/* Coarse pointers need a target you can actually hit; 24px is the AA floor. */
@media (pointer: coarse) {
  .tab .close { min-width: 32px; min-height: 32px; padding: 7px 10px; }
  .tab .tname { padding-top: 9px; padding-bottom: 9px; }
}
.tab .close:hover { color: var(--ink); background: none; }
.topbar .actions { display: flex; gap: 6px; align-items: center; }

/* ---------- toolbar ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.seg button { border-radius: 0; border: 0; padding: 6px 13px; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--accent-soft); color: var(--ink); }
.toolbar .right { display: flex; gap: 6px; align-items: center; }

/* ---------- export menu ---------- */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px;
  display: none;
  z-index: 40;
}
.menu.open { display: block; }
.menu button { display: block; width: 100%; text-align: left; font-weight: 400; padding: 8px 10px; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 4px; }
.menu .hint { color: var(--muted); font-size: 11px; padding: 4px 10px 6px; }

/* ---------- sync waitlist (brief update 1, §7) ---------- */
/* A ghost button with a small "soon" dot, and a popover anchored under it.
   Never a modal: it shares .menu-wrap's positioning with the export menu. */
.sync { position: relative; }
.soon-dot {
  position: absolute; top: 3px; right: 3px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.popover {
  position: absolute; right: 0; top: calc(100% + 6px);
  width: 290px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px; z-index: 40;
  font: 400 13px/1.6 var(--sans);
}
.popover[hidden] { display: none; }
.popover h2 { font: 500 14px var(--mono); margin: 0 0 8px; }
.popover p { margin: 0 0 12px; color: var(--muted); }
.popover input {
  width: 100%; box-sizing: border-box; margin-bottom: 8px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--border); border-radius: 7px;
  padding: 9px 10px; font: 400 13px var(--sans);
}
.popover form button { width: 100%; }
.popover .print { font: 400 11px var(--mono); margin: 10px 0 0; }
.popover .sync-status { font-size: 12px; margin: 8px 0 0; color: var(--muted); }
/* Errors go to full-contrast ink rather than a red, for two reasons: the
   palette is locked, and one red that passes AA on both the light and dark
   surfaces does not exist without adding a token per theme. The toast uses the
   same neutral treatment, so this is the house convention, not a shortcut. */
.popover .sync-status.bad { color: var(--ink); font-weight: 500; }
.popover .sync-status:empty { display: none; }
.linky {
  border: 0; background: none; padding: 6px 0 0;
  font: 400 11.5px var(--mono); color: var(--muted); text-decoration: underline;
}
.linky:hover { background: none; color: var(--accent); }

/* ---------- workspace ---------- */
/* overflow:hidden keeps the off-canvas TOC's transform from widening the
   page box — it added 290px of horizontal overflow on small screens. */
.main { flex: 1; display: flex; min-height: 0; position: relative; overflow: hidden; }
.pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.divider { width: 1px; background: var(--border); flex: 0 0 auto; }
.editor-pane textarea {
  flex: 1;
  width: 100%;
  border: 0;
  resize: none;
  background: var(--bg);
  color: var(--ink);
  font: 400 13.5px/1.75 var(--mono);
  padding: 28px clamp(18px, 4vw, 44px);
  outline: none;
  caret-color: var(--accent);
}
.preview-pane { background: var(--surface); overflow-y: auto; }
/* width:100% is load-bearing: .preview-pane is a column flex container, and
   `margin: 0 auto` on a flex item makes it shrink-to-fit on the cross axis.
   Without it the wrapper sizes to its widest unwrapped child (a long h1),
   overflowing the pane on narrow screens. */
.preview-inner { width: 100%; max-width: 74ch; margin: 0 auto; padding: 36px clamp(18px, 4vw, 44px) 90px; }
body[data-mode="write"] .preview-pane, body[data-mode="write"] .divider { display: none; }
body[data-mode="read"] .editor-pane, body[data-mode="read"] .divider { display: none; }

/* ---------- rendered markdown ---------- */
.md { font-family: var(--sans); font-size: 16px; line-height: 1.75; color: var(--ink); }
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3, .md h4 { font-weight: 600; line-height: 1.3; margin: 1.6em 0 0.6em; scroll-margin-top: 20px; }
.md h1 { font-size: 30px; letter-spacing: -0.5px; padding-bottom: 0.35em; border-bottom: 1px solid var(--border); }
.md h2 { font-size: 22px; letter-spacing: -0.3px; }
.md h3 { font-size: 18px; }
.md h4 { font-size: 16px; }
.md p, .md ul, .md ol, .md table, .md blockquote, .md pre { margin: 0 0 1.05em; }
.md ul, .md ol { padding-left: 1.6em; }
.md li + li { margin-top: 0.3em; }
.md li.task { list-style: none; margin-left: -1.45em; }
.md li.task input { margin-right: 0.55em; accent-color: var(--accent); }
.md a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.md blockquote { border-left: 3px solid var(--accent); padding: 2px 0 2px 16px; color: var(--muted); }
.md code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1.5px 5px; }
.md pre { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 15px 16px; overflow-x: auto; }
.md pre code { background: none; border: 0; padding: 0; font-size: 13px; line-height: 1.65; display: block; }
.md pre .copy-code {
  position: absolute; top: 7px; right: 7px;
  font: 500 11px var(--mono);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 5px; padding: 4px 8px; color: var(--muted);
  opacity: 0; cursor: pointer;
}
.md pre:hover .copy-code, .md pre .copy-code:focus-visible { opacity: 1; }
.md pre .copy-code:hover { color: var(--ink); }
.md table { border-collapse: collapse; width: 100%; font-size: 15px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border); padding: 7px 12px; text-align: left; }
.md th { background: var(--surface-2); font-weight: 600; }
.md img { max-width: 100%; border-radius: 8px; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

/* ---------- table of contents ---------- */
.toc {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(290px, 82vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 18px 16px;
  overflow-y: auto;
  transform: translateX(100%);
  /* visibility keeps the closed panel out of the tab order; it transitions
     discretely, so links stay reachable for the whole slide-in. */
  visibility: hidden;
  transition: transform 0.18s ease, visibility 0.18s;
  z-index: 30;
}
.toc.open { transform: none; visibility: visible; }
.toc h2 { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin-bottom: 12px; }
.toc a { display: block; font: 400 12.5px/1.5 var(--mono); color: var(--ink); text-decoration: none; padding: 5px 8px; border-radius: 5px; }
.toc a:hover { background: var(--surface-2); }
.toc a.d2 { padding-left: 22px; color: var(--muted); }
.toc a.d3 { padding-left: 36px; color: var(--muted); }
.toc .empty { color: var(--muted); font-size: 12px; }

/* ---------- status bar ---------- */
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 11.5px;
  color: var(--muted);
}
.statusbar .local { display: flex; align-items: center; gap: 7px; }
.statusbar .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); flex: 0 0 auto; }
.statusbar .stats { white-space: nowrap; }

/* ---------- drop overlay (signature) ---------- */
.drop {
  position: fixed; inset: 0; z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
}
.drop.on { display: flex; }
.drop .glyph { font: 500 clamp(90px, 22vw, 170px)/1 var(--mono); opacity: 0.95; }
.drop .big { font: 500 clamp(16px, 3vw, 21px)/1.4 var(--mono); }
/* 0.9, not 0.75: white at 75% over the light accent is only 3.75:1, below AA
   for 13px text. At 0.9 it is 4.67:1 and still reads as a subline. */
.drop .sub { font: 400 13px var(--mono); opacity: 0.9; margin-top: 6px; }

.fm-note {
  display: inline-block;
  font: 400 11.5px var(--mono);
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 18px;
}

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 52px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: var(--bg);
  font: 500 12px var(--mono);
  padding: 9px 15px; border-radius: 7px;
  max-width: min(90vw, 460px); text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 90;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 760px) {
  .brand span.full { display: none; }
  body[data-mode="split"] .editor-pane { display: none; }
  body[data-mode="split"] .divider { display: none; }
  .statusbar .stats { display: none; }
}

/* Below ~620px the action buttons alone are wider than the viewport, which
   pushed Export off-screen (body has overflow:hidden, so it could not be
   scrolled back). Give the tab strip its own row and tighten the buttons. */
@media (max-width: 620px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  /* Scoped to .topbar: an unscoped `.brand { order }` also reorders the
     content-page site header, pushing the brand behind the nav. */
  .topbar .brand { order: 1; }
  .topbar .actions { order: 2; margin-left: auto; gap: 4px; }
  /* The tab row is reserved from first paint. Hiding it while empty meant the
     topbar grew a row the moment the app booted, pushing the entire page down
     — the largest single layout shift on mobile. */
  .topbar .tabstrip { order: 3; flex: 1 0 100%; min-height: 30px; }
  .topbar .actions button { padding: 7px 9px; }
  #btn-new { padding: 7px 8px; }
}
@media (max-width: 380px) {
  #btn-open .full { display: none; }   /* "Open files" -> "Open" */
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- print = the PDF export ---------- */
@media print {
  html, body { height: auto; overflow: visible; background: #fff; }
  .topbar, .toolbar, .statusbar, .editor-pane, .divider, .toc, .drop, .toast, .skip { display: none !important; }
  .main { display: block; }
  .preview-pane { display: block !important; overflow: visible; }
  .preview-inner { max-width: none; padding: 0; }
  .md { font-size: 12.5pt; color: #000; }
  .md pre, .md code { border-color: #ddd; background: #f6f6f6; }
  .md pre .copy-code { display: none; }
  .md a { color: #1a2fae; }
  .md h1, .md h2, .md h3 { break-after: avoid; }
  .md pre, .md table, .md blockquote { break-inside: avoid; }
  @page { margin: 2cm; }
}

/* ---------- 404 ---------- */
body.page-404 { overflow: auto; display: block; }
.notfound {
  max-width: 46ch;
  margin: 0 auto;
  padding: clamp(48px, 14vh, 140px) 24px;
  text-align: center;
}
.notfound .glyph { font: 500 clamp(64px, 16vw, 110px)/1 var(--mono); color: var(--accent); }
.notfound h1 { font: 500 clamp(19px, 4vw, 24px)/1.35 var(--mono); margin: 18px 0 14px; letter-spacing: -0.3px; }
.notfound .lead { font: 400 13.5px/1.7 var(--mono); color: var(--muted); margin-bottom: 26px; }
.notfound .cta {
  display: inline-block;
  font: 500 13px var(--mono);
  background: var(--accent); color: var(--on-accent);
  border-radius: 7px; padding: 11px 18px; text-decoration: none;
}
.notfound .cta:hover { filter: brightness(1.08); }

/* ==========================================================================
   Content and tool pages (Astro-generated). The app above owns a fixed,
   overflow-hidden viewport; these pages scroll normally.
   ========================================================================== */
body:not([data-mode]) { display: block; overflow: auto; height: auto; min-height: 100%; }

.sitebar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.sitebar .brand { text-decoration: none; color: var(--ink); }
.sitenav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.sitenav a {
  font: 400 12.5px var(--mono); color: var(--muted); text-decoration: none;
  padding: 7px 10px; border-radius: 6px;
}
.sitenav a:hover { background: var(--surface-2); color: var(--ink); }

.page { max-width: 76ch; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 72px; }

.crumbs { padding: 20px 0 4px; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; font: 400 12px var(--mono); color: var(--muted); }
.crumbs li + li::before { content: '/'; margin-right: 6px; color: var(--border); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

.prose { font-family: var(--sans); font-size: 16.5px; line-height: 1.72; }
.prose h1 {
  font: 600 clamp(27px, 5vw, 36px)/1.2 var(--sans);
  letter-spacing: -0.7px; margin: 26px 0 18px;
}
.prose h2 {
  font: 600 21px/1.3 var(--sans); letter-spacing: -0.3px;
  margin: 2.2em 0 0.7em; padding-top: 0.5em; border-top: 1px solid var(--border);
}
.prose h3 { font: 600 17px/1.35 var(--sans); margin: 1.7em 0 0.5em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.05em; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li + li { margin-top: 0.35em; }
.prose a { color: var(--accent); text-underline-offset: 2px; }
.prose code {
  font-family: var(--mono); font-size: 0.86em; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 5px; padding: 1.5px 5px;
}
.prose pre {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
  padding: 14px 16px; overflow-x: auto; margin: 0 0 1.05em;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: 13px; line-height: 1.6; }
.prose .lead { font-size: 17.5px; color: var(--muted); margin-bottom: 1.5em; }
.prose table.ref { border-collapse: collapse; width: 100%; font-size: 14.5px; display: block; overflow-x: auto; }
.prose table.ref th, .prose table.ref td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose table.ref th { background: var(--surface-2); font-weight: 600; }
.prose table.ref code { white-space: pre; }
.prose .soon { color: var(--muted); }
.prose blockquote { border-left: 3px solid var(--accent); padding: 2px 0 2px 16px; color: var(--muted); margin: 0 0 1.05em; }

.cta-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 1.6em; }
.cta {
  display: inline-block; font: 500 13.5px var(--mono);
  background: var(--accent); color: var(--on-accent);
  border-radius: 7px; padding: 12px 18px; text-decoration: none;
}
.cta:hover { filter: brightness(1.08); }
.cta-note { font: 400 12.5px var(--mono); color: var(--muted); }

/* Template gallery cards. auto-fill rather than a fixed count so the row
   reflows to one column on a phone without a media query. */
.tpl-grid {
  list-style: none; padding-left: 0; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin-bottom: 2em;
}
.tpl-card {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 18px; background: var(--surface);
  display: flex; flex-direction: column;
}
.tpl-card h2 { font-size: 17px; margin: 0 0 8px; }
.tpl-card h2 a { text-decoration: none; }
.tpl-card p { color: var(--muted); font-size: 14.5px; margin: 0 0 14px; }
.tpl-card .cta-row { margin-top: auto; margin-bottom: 0; gap: 10px; }
.tpl-card .cta { padding: 9px 14px; font-size: 12.5px; }

.ticks { list-style: none; padding-left: 0; }
.ticks li { padding-left: 1.5em; position: relative; }
.ticks li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: 600; }

/* ---------- live demo ---------- */
.demo {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); margin: 0 0 1.8em; overflow: hidden;
}
.demo-label { font: 400 12px var(--mono); color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--border); margin: 0; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; }
.demo-col { min-width: 0; display: flex; flex-direction: column; }
.demo-col + .demo-col { border-left: 1px solid var(--border); }
.demo-head {
  font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--muted); padding: 9px 14px 7px; margin: 0; display: block;
}
.demo-src {
  flex: 1; width: 100%; border: 0; resize: vertical; min-height: 190px;
  background: var(--bg); color: var(--ink);
  font: 400 13px/1.7 var(--mono); padding: 4px 14px 14px;
  outline-offset: -2px;
}
.demo-out { padding: 4px 14px 16px; font-size: 15px; overflow-x: auto; }
.demo-out > :first-child { margin-top: 0; }
.demo-foot {
  font: 400 11.5px var(--mono); color: var(--muted);
  padding: 10px 14px; border-top: 1px solid var(--border); margin: 0;
}
@media (max-width: 640px) {
  .demo-grid { grid-template-columns: 1fr; }
  .demo-col + .demo-col { border-left: 0; border-top: 1px solid var(--border); }
}

/* ---------- FAQ + siblings ---------- */
.faq dl { margin: 0; }
.faq-item { border-top: 1px solid var(--border); padding: 16px 0; }
.faq dt { font-weight: 600; margin-bottom: 6px; }
.faq dd { margin: 0; color: var(--muted); }

.siblings ul, .guides { list-style: none; padding-left: 0; }
.siblings li, .guides li { border-top: 1px solid var(--border); padding: 12px 0; }
.siblings span, .guides span { color: var(--muted); font-size: 14.5px; }
.guides li { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.guides span { font: 400 12px var(--mono); }

/* ---------- footer ---------- */
.sitefoot {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 26px clamp(16px, 4vw, 40px);
  font: 400 12.5px var(--mono); color: var(--muted);
}
.sitefoot .promise { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.sitefoot .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); flex: 0 0 auto; }
.footnav { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.footnav a { color: var(--muted); text-decoration: none; }
.footnav a:hover { color: var(--accent); }
.sitefoot .umbrella { color: var(--muted); opacity: 0.8; }

.notfound-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 28px; }
.notfound-links a { font: 400 12.5px var(--mono); color: var(--muted); }

/* Table alignment as classes — inline styles cannot apply under our CSP. */
.md .align-left, .prose .align-left, .demo-out .align-left { text-align: left; }
.md .align-center, .prose .align-center, .demo-out .align-center { text-align: center; }
.md .align-right, .prose .align-right, .demo-out .align-right { text-align: right; }

/* ---------- converter widget ---------- */
.converter { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin: 0 0 1.8em; overflow: hidden; }
.conv-drop { border-bottom: 1px solid var(--border); padding: 26px 18px; text-align: center; background: var(--surface-2); }
.conv-drop.over { background: var(--accent-soft); }
.conv-drop-label { font: 500 14px var(--mono); margin-bottom: 8px; }
.conv-or { font: 400 11.5px var(--mono); color: var(--muted); margin-bottom: 10px; }
.conv-hint { font: 400 11.5px var(--mono); color: var(--muted); margin-top: 12px; }
.conv-grid { display: grid; grid-template-columns: 1fr 1fr; }
.conv-col { min-width: 0; display: flex; flex-direction: column; }
.conv-col + .conv-col { border-left: 1px solid var(--border); }
.conv-head { font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); padding: 10px 14px 7px; margin: 0; display: block; }
.conv-input, .conv-output {
  flex: 1; width: 100%; border: 0; resize: vertical; min-height: 150px;
  background: var(--bg); color: var(--ink);
  font: 400 13px/1.7 var(--mono); padding: 4px 14px 14px; outline-offset: -2px;
}
.conv-output { background: var(--surface-2); }
.conv-preview { padding: 4px 14px 16px; font-size: 15px; overflow-x: auto; min-height: 150px; }
.conv-preview > :first-child { margin-top: 0; }
.conv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); }
.conv-status { font: 400 11.5px var(--mono); color: var(--muted); margin: 0; }
.conv-status[data-tone="ok"] { color: var(--accent); }
.conv-status[data-tone="warn"] { color: var(--ink); }
.conv-promise { display: flex; align-items: center; gap: 7px; font: 400 11.5px var(--mono); color: var(--muted); padding: 0 14px 12px; margin: 0; }
.conv-promise .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); flex: 0 0 auto; }
@media (max-width: 640px) {
  .conv-grid { grid-template-columns: 1fr; }
  .conv-col + .conv-col { border-left: 0; border-top: 1px solid var(--border); }
}

/* ---------- formatter options ---------- */
.fmt-options { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); font: 400 12px var(--mono); color: var(--muted); }
.fmt-options label { display: inline-flex; align-items: center; gap: 6px; }
.fmt-options select { font: 400 12px var(--mono); color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 4px 6px; }
.fmt-options input[type=checkbox] { accent-color: var(--accent); }

/* ---------- table generator ---------- */
.tg-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.tg-format { font: 400 12px var(--mono); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.tg-format select, .tg-grid select { font: 400 11.5px var(--mono); color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 3px 5px; }
.tg-grid { overflow-x: auto; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.tg-grid table { border-collapse: collapse; }
.tg-grid th, .tg-grid td { border: 1px solid var(--border); padding: 0; }
.tg-grid th { background: var(--surface-2); padding: 5px; text-align: left; }
.tg-grid input[type=text] {
  border: 0; background: transparent; color: var(--ink);
  font: 400 12.5px var(--mono); padding: 7px 9px; min-width: 130px; width: 100%; outline-offset: -2px;
}
.tg-grid input.tg-header-cell { font-weight: 600; background: var(--surface-2); }
.tg-remove { border: 0; background: none; color: var(--muted); font: 400 13px var(--mono); padding: 6px 9px; cursor: pointer; }
.tg-remove:hover { color: var(--ink); background: none; }
