/* Nabu Casa press kits — site styles */

:root {
  color-scheme: light;

  /* Neutrals from the nabucasa.com palette: white, light gray #f0f1f1,
     gray #ecebe7, taupe #8f8e82 and charcoal #1f1f1c. The stronger border
     and muted text sit between taupe and its neighbours, so outlines and
     small text stay legible. */
  --bg: #ffffff;
  --bg-sunken: #f0f1f1;
  --bg-raised: #ffffff;
  --bg-hover: #ecebe7;
  --border: #ecebe7;
  --border-strong: #cfcec7;

  --text: #1f1f1c;
  --text-muted: #5f5e56;
  --text-faint: #8f8e82;

  --accent: #03a9f4;
  --accent-hover: #0288d1;
  --accent-contrast: #ffffff;
  --accent-wash: #e6f6fe;

  /* Filled buttons use the nabucasa.com brand orange; hover is its
     --color-highlight shade. Same in both themes. */
  --button: #ec7523;
  --button-hover: #c05811;
  --button-contrast: #ffffff;

  /* Icons share the button orange, on a pale orange wash. */
  --icon: #ec7523;
  --icon-wash: #fdeee3;

  --amber: #b06f00;
  --amber-wash: #fdf3e0;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(31, 31, 28, .05), 0 1px 3px rgba(31, 31, 28, .06);
  --shadow-lg: 0 8px 24px rgba(31, 31, 28, .10);

  --font: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --header-h: 60px;
  --bar-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    /* Charcoal #1f1f1c and its warm-grey steps, with gray #ecebe7 text. */
    --bg: #1f1f1c;
    --bg-sunken: #181816;
    --bg-raised: #262623;
    --bg-hover: #2f2f2b;
    --border: #34342f;
    --border-strong: #4a4943;

    --text: #ecebe7;
    --text-muted: #b5b4ab;
    --text-faint: #8f8e82;

    --accent: #38bdf8;
    --accent-hover: #6acdfa;
    --accent-contrast: #0b1015;
    --accent-wash: #12303f;

    --icon-wash: #3a2617;

    --amber: #f0b458;
    --amber-wash: #33280f;

    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 3px rgba(0, 0, 0, .25);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .45);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #1f1f1c;
  --bg-sunken: #181816;
  --bg-raised: #262623;
  --bg-hover: #2f2f2b;
  --border: #34342f;
  --border-strong: #4a4943;

  --text: #ecebe7;
  --text-muted: #b5b4ab;
  --text-faint: #8f8e82;

  --accent: #38bdf8;
  --accent-hover: #6acdfa;
  --accent-contrast: #0b1015;
  --accent-wash: #12303f;

  --icon-wash: #3a2617;

  --amber: #f0b458;
  --amber-wash: #33280f;

  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 3px rgba(0, 0, 0, .25);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select { font: inherit; color: inherit; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: 20px;
}

/* ---------- header ---------- */

header.site {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

header.site .wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand svg { width: 22px; height: 22px; color: var(--icon); flex: none; }

.spacer { flex: 1 1 auto; }

.search {
  position: relative;
  flex: 0 1 300px;
  min-width: 0;
}
.search input {
  width: 100%;
  padding: 7px 11px 7px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  outline: none;
}
.search input:focus { border-color: var(--accent); background: var(--bg); }
.search svg {
  position: absolute;
  left: 9px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--text-faint);
  pointer-events: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  cursor: pointer;
  flex: none;
}
.icon-btn:hover { background: var(--bg-hover); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- hero / breadcrumb ---------- */

.hero {
  padding-block: 44px 30px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sunken);
}
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.022em;
  font-weight: 700;
}
.hero p {
  margin: 0;
  max-width: 62ch;
  color: var(--text-muted);
  font-size: 16px;
}

.crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.crumb a { color: var(--text-muted); }
.crumb a:hover { color: var(--accent); }

main { padding-block: 30px 80px; }

/* ---------- kit cards ---------- */

.kit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}

.kit-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.kit-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  text-decoration: none;
}

.kit-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  max-width: 100%;
  background: var(--bg-sunken);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

/* Pinned backdrops for transparent logo covers, which would otherwise
   disappear against whichever theme the viewer is using. */
.kit-thumb.tile-light { background: #f0f1f1; }
.kit-thumb.tile-dark  { background: #1f1f1c; }

.badge {
  position: absolute;
  top: 10px; left: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--amber-wash);
  border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
  color: var(--amber);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .01em;
  line-height: 1.4;
  white-space: nowrap;
}
.badge.inline {
  position: static;
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
  font-size: 13px;
  padding: 4px 11px;
}
.kit-card.is-flagged .kit-thumb img { opacity: .82; }

/* Tiles that leave the site say so, rather than looking like a kit page. */
.kit-card.is-external .kit-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--icon);
  font-weight: 500;
}
.kit-card.is-external .kit-meta .ext { width: 13px; height: 13px; flex: none; }
/* The element itself has to be constrained, not just its content: object-fit
   only lays the picture out inside whatever box the element already has, and a
   percentage height does not resolve against a box sized by aspect-ratio. Four
   insets on an absolutely positioned image give a definite box in both axes. */
.kit-thumb img {
  position: absolute;
  top: 14px;
  left: 14px;
  width: calc(100% - 28px);
  height: calc(100% - 28px);
  object-fit: contain;
}

.kit-body { padding: 14px 16px 16px; }
.kit-body h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}
.kit-meta {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- section ---------- */

.section {
  margin-bottom: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 16px;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border);
}
.section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.008em;
}
.section-head .count {
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); text-decoration: none; }
.btn svg { width: 14px; height: 14px; }
.btn.primary {
  background: var(--button);
  border-color: var(--button);
  color: var(--button-contrast);
  font-weight: 600;
}
.btn.primary:hover { background: var(--button-hover); border-color: var(--button-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn.ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- asset grid ---------- */

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 14px;
  padding: 16px;
}

/* Clipped sections keep the rest of the grid in the DOM but hidden — a
   display:none image is never fetched, so the extra cards cost nothing until
   "Show more" reveals them. */
.asset-grid.is-clipped .asset:nth-child(n+11) { display: none; }

.more-wrap {
  padding: 0 16px 16px;
  margin-top: -4px;
}

/* Full-width and in the button colour so the hidden images are hard to miss. */
.more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border: 0;
  border-radius: var(--radius);
  background: var(--button);
  color: var(--button-contrast);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background .15s, box-shadow .15s;
}
.more-btn:hover { background: var(--button-hover); box-shadow: var(--shadow-lg); }
.more-btn:focus-visible { outline: 3px solid var(--accent-wash); outline-offset: 2px; }
.more-btn::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
  transition: transform .15s;
}
.more-btn[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }

.asset {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.asset:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.asset.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-wash); }

.asset-preview {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  max-width: 100%;
  background:
    repeating-conic-gradient(var(--bg-sunken) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
  cursor: pointer;
  position: relative;
}
/* Same reasoning as .kit-thumb img. */
.asset-preview img {
  position: absolute;
  top: 8px;
  left: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  object-fit: contain;
  display: block;
}

/* Light-on-transparent artwork is invisible on the default tile, so assets
   meant for dark backgrounds get a dark one. */
.asset-preview.on-dark {
  background:
    repeating-conic-gradient(#34342f 0% 25%, #2a2a26 0% 50%) 50% / 16px 16px;
}

/* A missing file falls back to the generic file tile rather than a broken image. */
.asset-preview img.broken { display: none; }
.asset-preview img.broken + .asset-file { display: grid; }
.asset-preview .asset-file.fallback { display: none; }

.asset-file {
  display: grid;
  place-items: center;
  height: 100%;
  gap: 6px;
  color: var(--text-muted);
  background: var(--bg-sunken);
}
.asset-file svg { width: 30px; height: 30px; }
.asset-file span {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.asset-info {
  padding: 8px 10px 10px;
  border-top: 1px solid var(--border);
}
.asset-name {
  font-size: 12.5px;
  line-height: 1.35;
  word-break: break-word;
  margin-bottom: 3px;
}
.asset-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.asset-sub .dl { margin-left: auto; color: var(--text-muted); }

.pick {
  position: absolute;
  top: 7px; left: 7px;
  z-index: 2;
  width: 19px; height: 19px;
  accent-color: var(--accent);
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s;
}
.asset:hover .pick, .pick:focus-visible, .asset.selected .pick { opacity: 1; }

@media (hover: none) { .pick { opacity: 1; } }

/* ---------- documents ---------- */

.doc-list { padding: 8px 16px 16px; }

.doc {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.doc:last-child { border-bottom: 0; }

.doc-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--icon-wash);
  color: var(--icon);
}
.doc-icon svg { width: 17px; height: 17px; }

.doc-main { flex: 1 1 180px; min-width: 0; }
.doc-title { font-weight: 550; font-size: 14px; overflow-wrap: anywhere; }
.doc-sub { font-size: 12.5px; color: var(--text-faint); }

.doc-actions { display: flex; gap: 6px; flex: none; flex-wrap: wrap; }

/* ---------- selection bar ---------- */

.selbar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  visibility: hidden;
  transform: translate(-50%, calc(100% + 32px));
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  max-width: calc(100vw - 32px);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-raised);
  box-shadow: var(--shadow-lg);
  transition: transform .22s cubic-bezier(.2, .8, .3, 1), visibility .22s;
}
.selbar.show { transform: translate(-50%, 0); visibility: visible; }
.selbar .n { font-size: 13.5px; font-weight: 550; white-space: nowrap; }
.selbar .sz { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ---------- misc ---------- */

.notice {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 26px;
  border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent);
  border-radius: var(--radius);
  background: var(--amber-wash);
  font-size: 13.5px;
  line-height: 1.5;
}
.notice svg { width: 17px; height: 17px; flex: none; color: var(--amber); margin-top: 1px; }

.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--text-muted);
}

/* ---------- viewer ---------- */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  /* Without an explicit column the grid sizes to its widest content (the
     unwrapped file name in the bar), which pushes the whole viewer past the
     edge of a phone screen. */
  grid-template-columns: minmax(0, 1fr);
  background: var(--bg);
}
.viewer[hidden] { display: none; }

/* when promoted to real full screen the element becomes the viewport */
.viewer:fullscreen { width: 100vw; height: 100vh; }

.viewer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sunken);
}

/* The primary way out of the viewer — deliberately a labelled button rather
   than another icon in the row of icons on the right. */
.back-btn {
  flex: none;
  gap: 7px;
  padding: 7px 14px 7px 11px;
  font-weight: 600;
  background: var(--button);
  border-color: var(--button);
  color: var(--button-contrast);
}
.back-btn:hover { background: var(--button-hover); border-color: var(--button-hover); }
.back-btn svg { width: 16px; height: 16px; }

.viewer-id { min-width: 0; display: flex; flex-direction: column; }
.viewer-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.viewer-meta {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.viewer-tools {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex: none;
}
.viewer-tools .icon-btn:disabled { opacity: .35; cursor: not-allowed; }

.viewer-body { overflow: auto; }

.viewer-body.is-video {
  display: grid;
  place-items: center;
  padding: 20px;
  background: #0d0f12;
}
.viewer-body.is-video video {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-sm);
  background: #000;
}

/* video tile in the asset grid */
.asset-preview.is-video .play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .58);
  color: #fff;
  pointer-events: none;
  transition: background .15s, transform .15s;
}
.asset-preview.is-video .play svg { width: 18px; height: 18px; margin-left: 2px; }
.asset:hover .asset-preview.is-video .play {
  background: rgba(0, 0, 0, .74);
  transform: translate(-50%, -50%) scale(1.06);
}

.viewer-body.is-image {
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    repeating-conic-gradient(var(--bg-sunken) 0% 25%, var(--bg) 0% 50%) 50% / 22px 22px;
}
.viewer-body.is-image.on-dark {
  background:
    repeating-conic-gradient(#34342f 0% 25%, #2a2a26 0% 50%) 50% / 22px 22px;
}
.viewer-body.is-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.viewer-body.is-pdf { padding: 0; }
.viewer-body.is-pdf iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.viewer-body.is-doc { background: var(--bg); }

/* ---------- rendered markdown ---------- */

.md-doc {
  max-width: 74ch;
  margin: 0 auto;
  padding: 34px 20px 80px;
  font-size: 15.5px;
  line-height: 1.65;
  overflow-wrap: break-word;
}
.md-doc > :first-child { margin-top: 0; }

.md-doc h1, .md-doc h2, .md-doc h3, .md-doc h4, .md-doc h5, .md-doc h6 {
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 1.9em 0 .6em;
  font-weight: 680;
}
.md-doc h1 { font-size: 1.75em; }
.md-doc h2 { font-size: 1.4em; }
.md-doc h3 { font-size: 1.18em; }
.md-doc h4 { font-size: 1.04em; }

.md-doc p { margin: 0 0 1.05em; }
.md-doc ul, .md-doc ol { margin: 0 0 1.05em; padding-left: 1.45em; }
.md-doc li { margin-bottom: .4em; }
.md-doc li > ul, .md-doc li > ol { margin: .4em 0 0; }

.md-doc blockquote {
  margin: 0 0 1.05em;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}
.md-doc blockquote p:last-child { margin-bottom: 0; }

.md-doc img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.4em auto;
  border-radius: var(--radius-sm);
}

.md-doc hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

.md-doc code {
  font-family: var(--mono);
  font-size: .88em;
  padding: .15em .38em;
  border-radius: 4px;
  background: var(--bg-hover);
}
.md-doc pre {
  overflow-x: auto;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
}
.md-doc pre code { background: none; padding: 0; }

.md-plain {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 13px;
}

/* tables — both our pipe tables and pandoc's raw HTML fallback */
.md-doc .md-table, .md-doc table { max-width: 100%; }
.md-doc .md-table { overflow-x: auto; margin: 0 0 1.3em; }
.md-doc table {
  border-collapse: collapse;
  width: 100%;
  font-size: .95em;
  margin: 0 0 1.3em;
}
.md-doc th, .md-doc td {
  border: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}
.md-doc th { background: var(--bg-sunken); font-weight: 620; }
.md-doc td > p:last-child, .md-doc th > p:last-child { margin-bottom: 0; }
.md-doc td > h1, .md-doc td > h2, .md-doc td > h3, .md-doc td > h4 { margin-top: .2em; }

/* Google Docs exports pin each picture to a fixed width and height. Keep the
   real proportions, and give a picture that sits beside text in a table a
   fair share of the row, or the text squeezes it into a sliver. */
.md-doc img[style] { height: auto !important; }
.md-doc td:has(> img:only-child) { width: 32%; }

.md-loading { color: var(--text-muted); }

.doc-title.as-link {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  font-weight: 550;
  font-size: 14px;
}
.doc-title.as-link:hover { color: var(--accent); text-decoration: underline; }

footer.site {
  border-top: 1px solid var(--border);
  padding-block: 22px 34px;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--bg-sunken);
}
footer.site .wrap { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

.sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .hero { padding-block: 30px 22px; }

  /* documents */
  .md-doc { padding: 22px 16px 64px; font-size: 15px; }
  .md-doc h1 { font-size: 1.55em; }
  .md-doc a { overflow-wrap: anywhere; }
  /* Docs exports lay out "text | product photo" as a two-cell table; on a
     phone stack the cells so neither is squeezed. */
  .md-doc tr:has(> td > img:only-child) > td { display: block; width: auto; }
  .md-doc tr:has(> td > img:only-child) > td + td { border-top: 0; }
  .md-doc td:has(> img:only-child) img { max-width: 260px; margin: .4em auto; }
  .md-doc th, .md-doc td { padding: 7px 8px; }
  /* a data table that still doesn't fit scrolls on its own, not the page */
  .md-doc table:has(> thead) { display: block; overflow-x: auto; }
  .viewer-bar { gap: 8px; padding: 8px 10px; }
  .viewer-tools { gap: 4px; }
  .search { flex-basis: 150px; }
  .asset-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding: 12px; }
  .doc-actions { width: 100%; }
}
