  /* Sticky footer: short pages (blog index, empty states) would otherwise leave
     the footer floating mid-viewport. main absorbs the slack; the 128px gap
     below the content is untouched on long pages. */
  body { min-height: 100vh; margin: 0; display: flex; flex-direction: column; }
  /* Flex column + margin:auto shrinks main to its content; stretch keeps the
     max-width/auto-margin centering of .main/.pm/#composer intact. */
  body > main { flex: 1 0 auto; width: -webkit-fill-available; width: -moz-available; width: stretch; }
  .topbar { position: sticky; top: 0; z-index: 10; background: var(--bg);
    border-bottom: 1px solid var(--border); padding: 16px 32px;
    display: flex; align-items: center; justify-content: space-between; }
  .brand { color: var(--fg); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
  .brand .mono { display: block; }
  .brandwrap { display: inline-flex; align-items: center; gap: 10px; }
  .domains { position: relative; display: inline-flex; }
  .dom-btn { display: inline-flex; align-items: center; gap: 5px; background: transparent; border: 0;
    cursor: pointer; padding: 3px 4px 3px 6px; margin: 0; font-family: Futura, 'Century Gothic', var(--font-sans);
    font-size: 12px; font-weight: 500; letter-spacing: 0.08em; color: var(--fg-3);
    transition: color var(--dur-fast) var(--ease-out); }
  .dom-btn:hover, .dom-btn[aria-expanded="true"] { color: var(--fg); }
  .dom-caret { transition: transform var(--dur-fast) var(--ease-out); }
  .dom-btn[aria-expanded="true"] .dom-caret { transform: rotate(180deg); }
  .dom-menu { position: absolute; top: calc(100% + 8px); left: -6px; z-index: 20; min-width: 240px;
    background: var(--bg); border: 1px solid var(--border-strong); padding: 4px; }
  .dom-menu[hidden] { display: none; }
  #sec-menu { left: auto; right: -6px; min-width: 140px; }
  #sec-menu .dom-item { flex-direction: row; align-items: center; justify-content: space-between; }
  .dom-item { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; text-decoration: none;
    transition: background var(--dur-fast) var(--ease-out); }
  .dom-item.on { background: var(--bg-2); }
  a.dom-item:hover { background: var(--bg-2); }
  .dom-item.is-soon { cursor: default; }
  .dom-row { display: flex; align-items: center; gap: 8px; }
  .dom-name { font-family: var(--font-mono); font-size: 13px; color: var(--fg); letter-spacing: -0.01em; }
  .dom-item.is-soon .dom-name { color: var(--fg-3); }
  .dom-crane { width: 13px; height: 13px; color: var(--fg-3); flex: none; }
  .dom-desc { font-family: var(--font-sans); font-size: 11px; color: var(--fg-3); }
  nav .section { font-family: var(--font-sans); font-size: 13px; font-weight: 500; color: var(--fg);
    border-bottom: 1px solid var(--accent); padding-bottom: 2px; }
  [id^="i18n-"] { transition: opacity .15s ease; }
  .i18n-fade { opacity: 0; }
  @media (prefers-reduced-motion: reduce) { [id^="i18n-"] { transition: none; } }
  .navright { display: flex; align-items: center; gap: 16px; }
  .nav-admin { display: inline-flex; align-items: center; color: var(--fg-3); }
  .nav-admin:hover { color: var(--fg-2); }
  .nav-admin:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  /* External link in the header (console: cloudflare ↗). Same type as .dom-btn. */
  .nav-ext { display: inline-flex; align-items: center; gap: 3px; padding: 3px 4px; text-decoration: none;
    font-family: Futura, 'Century Gothic', var(--font-sans); font-size: 12px; font-weight: 500;
    letter-spacing: 0.08em; color: var(--fg-3); transition: color var(--dur-fast) var(--ease-out); }
  .nav-ext:hover { color: var(--fg); }
  .nav-ext-arrow { font-family: var(--font-sans); letter-spacing: 0; }
  .lang { display: inline-flex; gap: 6px; font-family: var(--font-mono); font-size: 12px; }
  .lang-btn { background: none; border: 0; color: var(--fg-3); cursor: pointer; font: inherit;
    padding: 6px 5px; margin: -6px -5px; }  /* padding+neg-margin = ≥24px tap area, layout unchanged */
  .lang-btn.on { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent);
    text-decoration-thickness: 1.5px; text-underline-offset: 3px; }  /* accent underline = clear selected state */
  .lang-btn:hover { color: var(--fg-2); }
  /* Theme switch: one button showing the current theme's icon; on change the icons slide past each other. */
  .theme-switch { display: inline-flex; width: 14px; height: 14px; padding: 0; border: 0; background: none;
    color: var(--fg-3); cursor: pointer; overflow: hidden; }
  .theme-switch:hover { color: var(--fg-2); }
  .theme-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; overflow: visible; }
  .ts-track { display: flex; flex-direction: column; transition: transform var(--dur-slow) var(--ease-in-out); }
  .ts-ico { display: flex; align-items: center; justify-content: center; width: 14px; height: 14px; flex: none; }
  .theme-switch.is-dark .ts-track { transform: translateY(-14px); }
  @media (prefers-reduced-motion: reduce) { .ts-track { transition: none; } }
  .sitefoot { margin-top: 128px; padding: 40px 32px; border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    font-family: var(--font-sans); font-size: 12px; color: var(--fg-3); }
  .sitefoot .left { display: flex; align-items: center; gap: 10px; }
  .sitefoot .links { display: flex; gap: 20px; }
  .sitefoot a { color: var(--fg-3); text-decoration: none; }
  .counted { font-size: var(--fs-xs); color: var(--fg-4); }   /* readers-tally notice (post header, blog hero) */
  .sitefoot a:hover { color: var(--fg-2); }
  .soon { color: var(--fg-4); display: inline-flex; align-items: center; gap: 5px; cursor: default; }
  .soon svg { width: 18px; height: 18px; }

  /* Keep the site selector steady across same-origin navigation (it shifts when the brand
     collapses on the homepage). Named snapshots animate across documents; unsupported browsers switch directly. */
  #domains { view-transition-name: site-selector; }
  ::view-transition-group(site-selector) {
    animation-duration: var(--dur-slow);
    animation-timing-function: var(--ease-out);
  }
  @media (prefers-reduced-motion: reduce) {
    ::view-transition-group(site-selector),
    ::view-transition-old(site-selector),
    ::view-transition-new(site-selector) { animation: none; }
  }

/* Shared inline pronunciation/help tooltip. */
.aside {
  border-bottom: 1px dashed var(--border-strong);
  cursor: help;
  position: relative;
}
.aside .tip {
  position: fixed;
  left: var(--tip-x, 50%);
  top: var(--tip-y, 1rem);
  white-space: normal;
  width: max-content;
  max-width: min(18rem, calc(100vw - 1rem));
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  padding: 4px 8px;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 3px));
  pointer-events: none; /* --tip-x/-y = the caught point (chrome.js); tip sits above it. fixed → wrapping/containers don't matter */
  transition:
    opacity var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}
.aside:hover .tip,
.aside:focus .tip {
  opacity: 1;
  transform: translate(-50%, calc(-100% + 1px));
}

@media (max-width: 700px) {
  .topbar { padding-inline: var(--s-5); }
}

.dom-current { color: var(--accent); }

/* Cross-origin navigation cannot use native cross-document view transitions. */
@keyframes site-arrive { from { opacity: 0; } to { opacity: 1; } }
@keyframes site-leave { from { opacity: 1; } to { opacity: 0; } }
html.site-arriving main { animation: site-arrive 220ms ease-out both; }
html.site-leaving main { animation: site-leave 180ms ease-in both; }
@media (prefers-reduced-motion: reduce) {
  html.site-arriving main, html.site-leaving main { animation: none; }
}
