/* The documentation site, drawn with Galpi's values (apps/web/src/styles.css, shell.css):
   Catalyst's zinc, Pretendard, black-and-white controls and a little orange. Light first,
   dark under it; the theme is <html data-theme>, set before the first paint. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --bg-raised: #ffffff;
  --bg-sunken: #f4f4f5;
  --bg-frame: #f4f4f5;
  --fg: #09090b;
  --fg-muted: #52525b;
  --fg-faint: #71717a;
  --border: rgb(9 9 11 / 0.1);
  --border-strong: rgb(9 9 11 / 0.2);
  --border-soft: rgb(9 9 11 / 0.05);
  --accent: #18181b;
  --accent-fg: #ffffff;
  --brand: #d04a02;
  --brand-soft: #fdefe7;
  --mark-galpi: #d04a02;
  --mark-mothership: #d04a02;
  --mark-naru: #d04a02;
  --mark-golden-image: #d04a02;
  --ok: #15803d;
  --ok-soft: rgb(34 197 94 / 0.15);
  --warn: #b45309;
  --warn-soft: rgb(251 191 36 / 0.2);
  --danger: #b91c1c;
  --danger-soft: rgb(239 68 68 / 0.12);
  --info: #1d4ed8;
  --info-soft: rgb(59 130 246 / 0.12);
  --bg-hover: rgb(9 9 11 / 0.05);
  --bg-press: rgb(9 9 11 / 0.09);
  --scrim: rgb(9 9 11 / 0.25);
  --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --card-ring: 0 1px 2px 0 rgb(0 0 0 / 0.05), 0 0 0 1px rgb(9 9 11 / 0.05);
  --scrollbar: rgb(9 9 11 / 0.16);
  --scrollbar-hover: rgb(9 9 11 / 0.32);
  --ring: #a1a1aa;
  --ring-soft: rgb(161 161 170 / 0.3);
  --code-bg: #fafafa;

  --text-2xs: 0.75rem;
  --text-xs: 0.8rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --radius: 12px;
  --radius-sm: 8px;
  --control-h: 32px;
  --sidebar-w: 272px;
  --prose-w: 760px;
  --toc-w: 220px;

  --font: 'Pretendard Variable', Pretendard, Inter, -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, 'JetBrains Mono', Menlo, Consolas, monospace;

  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #18181b;
  --bg-subtle: #1f1f22;
  --bg-raised: #27272a;
  --bg-sunken: #09090b;
  --bg-frame: #09090b;
  --fg: #ffffff;
  --fg-muted: #a1a1aa;
  --fg-faint: #8b8b94;
  --border: rgb(255 255 255 / 0.1);
  --border-strong: rgb(255 255 255 / 0.2);
  --border-soft: rgb(255 255 255 / 0.05);
  --accent: #ffffff;
  --accent-fg: #09090b;
  --brand: #fd5108;
  --brand-soft: #2c1a10;
  --mark-galpi: #fd5108;
  --mark-mothership: #fd5108;
  --mark-naru: #fd5108;
  --mark-golden-image: #fd5108;
  --ok: #4ade80;
  --ok-soft: rgb(34 197 94 / 0.1);
  --warn: #fbbf24;
  --warn-soft: rgb(251 191 36 / 0.1);
  --danger: #f87171;
  --danger-soft: rgb(239 68 68 / 0.1);
  --info: #60a5fa;
  --info-soft: rgb(59 130 246 / 0.1);
  --bg-hover: rgb(255 255 255 / 0.05);
  --bg-press: rgb(255 255 255 / 0.09);
  --scrim: rgb(0 0 0 / 0.5);
  --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.4);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.4);
  --card-ring: 0 0 0 1px rgb(255 255 255 / 0.1);
  --scrollbar: rgb(255 255 255 / 0.16);
  --scrollbar-hover: rgb(255 255 255 / 0.3);
  --ring: #71717a;
  --ring-soft: rgb(113 113 122 / 0.4);
  --code-bg: #1f1f22;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg-frame);
  color: var(--fg);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background-color: var(--scrollbar); background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-hover); }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; } }

.skip { position: absolute; left: -999px; top: 8px; z-index: 50; padding: 0.4rem 0.75rem; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-fg); }
.skip:focus { left: 8px; }

/* ── marks ─────────────────────────────────────────────────────────── */
.mark { width: 24px; height: 24px; flex: none; }
.mark-galpi { color: var(--mark-galpi); }
.mark-mothership { color: var(--mark-mothership); }
.mark-naru { color: var(--mark-naru); }
.mark-golden-image { color: var(--mark-golden-image); }
.mark-family { color: var(--fg); }

/* ── the frame ─────────────────────────────────────────────────────── */
.shell { display: flex; height: 100dvh; overflow: hidden; background: var(--bg-frame); }
.sidebar { width: var(--sidebar-w); flex: none; display: flex; flex-direction: column; min-height: 0; }
.content { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; padding: 8px; }
.shell.list-open .content { padding-left: 0; }
.card { display: flex; flex-direction: column; flex: 1; min-height: 0; border-radius: 10px; background: var(--bg); box-shadow: var(--card-ring); overflow: hidden; }
.scroller { flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: smooth; scroll-padding-top: 16px; }
.scroller:focus { outline: none; }

@media (min-width: 900px) {
  .sidebar { transition: width 0.22s ease, visibility 0s; }
  .shell:not(.list-open) .sidebar { width: 0; overflow: hidden; visibility: hidden; transition: width 0.22s ease, visibility 0s linear 0.22s; }
  .shell:not(.list-open) .content { padding-left: 8px; }
  .sidebar > * { min-width: var(--sidebar-w); }
}

/* The bar over the page: on a phone always, beside the page only while the list is shut. */
.navbar { display: none; align-items: center; gap: 0.5rem; flex: none; height: 52px; padding: 0 0.6rem; border-bottom: 1px solid var(--border-soft); }
.navbar-title { font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navbar-mark { width: 22px; height: 22px; }
.navbar-search { margin-left: auto; }
.shell:not(.list-open) .navbar { display: flex; }
.scrim { display: none; }

@media (max-width: 899.98px) {
  :root { --control-h: 36px; }
  .navbar { display: flex; }
  .content, .shell.list-open .content { padding: 0; }
  .card { border-radius: 0; box-shadow: none; }
  /* The list lies over the page as a floating card, 8px from the edges. */
  .sidebar { position: fixed; z-index: 40; top: 8px; bottom: 8px; left: 8px; width: min(var(--sidebar-w), calc(100vw - 16px)); border-radius: 14px; background: var(--bg-raised); box-shadow: var(--shadow), 0 0 0 1px var(--border); transform: translateX(calc(-100% - 16px)); transition: transform 0.22s ease, visibility 0s linear 0.22s; visibility: hidden; }
  .shell.list-open .sidebar { transform: none; visibility: visible; transition: transform 0.22s ease, visibility 0s; }
  .shell.list-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: var(--scrim); }
  .shell.list-open .navbar { display: flex; }
}

/* ── the sidebar ───────────────────────────────────────────────────── */
.sidebar-head { display: flex; flex-direction: column; gap: 0.35rem; padding: 7px 8px 0.5rem; }
.sidebar-brand { display: flex; align-items: center; gap: 0.25rem; }
.head-buttons { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: var(--control-h); height: var(--control-h); flex: none; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--fg-muted); }
.icon-button:hover { background: var(--bg-hover); color: var(--fg); }
.icon-button:active { background: var(--bg-press); }
.icon { width: 18px; height: 18px; flex: none; }
.panel-icon { width: 20px; height: 20px; }
.theme-toggle .icon { display: none; }
:root[data-theme-pref='light'] .theme-toggle .theme-light,
:root[data-theme-pref='dark'] .theme-toggle .theme-dark,
:root[data-theme-pref='system'] .theme-toggle .theme-system,
:root:not([data-theme-pref]) .theme-toggle .theme-system { display: block; }

.switcher { position: relative; min-width: 0; flex: 1; }
.switcher-button { display: flex; align-items: center; gap: 0.5rem; width: 100%; min-width: 0; padding: 0.3rem 0.4rem; border: 0; border-radius: var(--radius-sm); background: transparent; text-align: left; }
.switcher-button:hover { background: var(--bg-hover); }
.switcher-button[aria-expanded='true'] { background: var(--bg-press); }
.brand-mark { width: 26px; height: 26px; }
.brand-text { display: flex; align-items: baseline; gap: 0.35rem; min-width: 0; }
.brand-name { font-weight: 650; font-size: var(--text-base); letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { color: var(--fg-faint); font-size: var(--text-sm); white-space: nowrap; }
.chev { width: 16px; height: 16px; color: var(--fg-faint); margin-left: auto; }

.search-button { display: flex; align-items: center; gap: 0.5rem; height: 36px; padding: 0 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-raised); color: var(--fg-faint); font-size: var(--text-sm); box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.03); }
.search-button:hover { border-color: var(--border-strong); }
.search-button kbd, .search-field kbd { margin-left: auto; padding: 0 0.35rem; border: 1px solid var(--border); border-radius: 5px; font: 500 var(--text-2xs) / 1.5 var(--mono); color: var(--fg-faint); }

.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 0.5rem 8px; border-top: 1px solid var(--border-soft); }
.nav-group + .nav-group { margin-top: 0.85rem; }
.nav-heading { margin: 0 0.5rem 0.2rem; color: var(--fg-faint); font-size: var(--text-xs); font-weight: 550; }
.sidebar-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.nav-item { position: relative; display: flex; align-items: center; min-height: 34px; padding: 0.35rem 0.5rem; border-radius: var(--radius-sm); color: var(--fg); font-size: var(--text-sm); font-weight: 500; text-decoration: none; line-height: 1.35; }
.nav-item:hover { background: var(--bg-hover); }
.nav-item.active { background: var(--bg-hover); font-weight: 600; }
/* The open item's bar at the list's edge (Catalyst's SidebarItem, as Galpi draws it). */
.nav-item.active::before { content: ''; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 2px; border-radius: 0 2px 2px 0; background: var(--fg); }

.sidebar-foot { display: flex; flex-direction: column; gap: 1px; padding: 0.4rem 8px; border-top: 1px solid var(--border-soft); }
.foot-button { display: flex; align-items: center; gap: 0.6rem; width: 100%; min-height: 34px; padding: 0.35rem 0.5rem; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--fg); font-size: var(--text-sm); font-weight: 500; text-decoration: none; }
.foot-button:hover { background: var(--bg-hover); }
.foot-button .icon { color: var(--fg-faint); }
.version { position: relative; }

/* A Catalyst dropdown. */
.menu { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); min-width: 240px; padding: 4px; border-radius: var(--radius); background: var(--bg-raised); box-shadow: var(--shadow), 0 0 0 1px var(--border); }
.menu-up { top: auto; bottom: calc(100% + 4px); }
.menu-heading { padding: 0.35rem 0.6rem 0.2rem; color: var(--fg-faint); font-size: var(--text-xs); font-weight: 550; }
.menu-item { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.45rem 0.6rem; border-radius: var(--radius-sm); text-decoration: none; }
.menu-item:hover, .menu-item:focus-visible { background: var(--accent); color: var(--accent-fg); outline: none; }
.menu-item:hover .menu-blurb, .menu-item:focus-visible .menu-blurb { color: inherit; opacity: 0.75; }
.menu-item:hover .mark, .menu-item:focus-visible .mark { color: inherit; }
.menu-item.current .menu-name::after { content: ' ✓'; color: var(--fg-faint); }
.menu-mark { width: 20px; height: 20px; margin-top: 1px; }
.menu-text { display: flex; flex-direction: column; min-width: 0; }
.menu-name { font-size: var(--text-sm); font-weight: 600; }
.menu-blurb { font-size: var(--text-xs); color: var(--fg-faint); line-height: 1.4; }

/* ── the page ──────────────────────────────────────────────────────── */
.old-version { padding: 0.55rem 1rem; background: var(--warn-soft); color: var(--fg); font-size: var(--text-sm); text-align: center; }
.page { display: flex; justify-content: center; gap: 48px; padding: 40px 32px 72px; }
.prose { width: 100%; max-width: var(--prose-w); min-width: 0; }
.toc { position: sticky; top: 40px; align-self: flex-start; width: var(--toc-w); flex: none; max-height: calc(100dvh - 120px); overflow-y: auto; font-size: var(--text-sm); }
.toc-title { margin-bottom: 0.5rem; color: var(--fg-faint); font-size: var(--text-xs); font-weight: 550; }
.toc ul { list-style: none; margin: 0; padding: 0 0 0 0.75rem; border-left: 1px solid var(--border); }
.toc li { margin: 0; }
.toc a { display: block; padding: 0.22rem 0; color: var(--fg-muted); text-decoration: none; line-height: 1.4; }
.toc a:hover { color: var(--fg); }
.toc a.current { color: var(--fg); font-weight: 600; }
.toc .toc-l3 a { padding-left: 0.75rem; font-size: var(--text-xs); }
@media (max-width: 1279.98px) { .toc { display: none; } }
@media (max-width: 899.98px) { .page { padding: 24px 16px 56px; } }

.eyebrow { margin: 0 0 0.35rem; color: var(--brand); font-size: var(--text-sm); font-weight: 600; }
.prose h1 { margin: 0 0 0.6rem; font-size: 2rem; line-height: 1.25; letter-spacing: -0.025em; font-weight: 700; }
.lede { margin: 0 0 2rem; color: var(--fg-muted); font-size: 1.075rem; line-height: 1.6; }
.prose h2 { margin: 2.6rem 0 0.8rem; padding-top: 0.2rem; font-size: 1.4rem; line-height: 1.3; letter-spacing: -0.02em; font-weight: 680; }
.prose h3 { margin: 2rem 0 0.6rem; font-size: 1.12rem; line-height: 1.35; letter-spacing: -0.01em; font-weight: 650; }
.prose h4 { margin: 1.5rem 0 0.4rem; font-size: 1rem; font-weight: 650; }
.prose h2:first-child, .prose .lede + h2 { margin-top: 0.5rem; }
.heading-anchor { margin-left: 0.4rem; color: var(--fg-faint); text-decoration: none; opacity: 0; font-weight: 400; }
:is(h2, h3):hover .heading-anchor, .heading-anchor:focus-visible { opacity: 1; }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose li { margin: 0.25rem 0; }
.prose li > ul, .prose li > ol { margin: 0.25rem 0 0.4rem; }
.prose ul, .prose ol { padding-left: 1.35rem; }
.prose li::marker { color: var(--fg-faint); }
.prose strong { font-weight: 650; }
.prose a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-color: var(--fg); }
.prose a.external::after { content: '↗'; margin-left: 0.1em; font-size: 0.8em; color: var(--fg-faint); }
.prose hr { margin: 2rem 0; border: 0; border-top: 1px solid var(--border); }
.prose blockquote { margin: 0 0 1rem; padding: 0.1rem 0 0.1rem 1rem; border-left: 3px solid var(--border-strong); color: var(--fg-muted); }
.prose kbd { padding: 0.05rem 0.35rem; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; font: 500 0.82em var(--mono); }
.prose :not(pre) > code { padding: 0.1rem 0.32rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-sunken); font-family: var(--mono); font-size: 0.86em; word-break: break-word; }
.prose img { max-width: 100%; height: auto; }

/* Framed blocks never touch each other (design-family.md). */
.prose > :is(.code, .table-wrap, .callout, .shot, .cards, .steps, details) { margin-block: 1.25rem; }

/* Code. */
.code { position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--code-bg); overflow: hidden; }
.code-label { padding: 0.35rem 0.85rem; border-bottom: 1px solid var(--border-soft); color: var(--fg-faint); font: 500 var(--text-2xs) var(--mono); }
.code pre { margin: 0; padding: 0.8rem 0.95rem; overflow-x: auto; font: 0.84rem/1.6 var(--mono); background: transparent !important; tab-size: 2; }
.code code { font-family: inherit; }
.shiki span { color: var(--shiki-light); }
:root[data-theme='dark'] .shiki span { color: var(--shiki-dark); }
.copy-button { position: absolute; top: 6px; right: 6px; height: 26px; padding: 0 0.5rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-raised); color: var(--fg-muted); font-size: var(--text-2xs); opacity: 0; transition: opacity 0.15s; }
.code:hover .copy-button, .copy-button:focus-visible { opacity: 1; }
@media (hover: none) { .copy-button { opacity: 1; } }

/* Tables (Catalyst's). */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); line-height: 1.5; }
.prose th { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--border); background: var(--bg-subtle); color: var(--fg-muted); font-weight: 600; text-align: left; white-space: nowrap; }
.prose td { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose td code { white-space: nowrap; }

/* Callouts. */
.callout { padding: 0.75rem 1rem; border-radius: var(--radius-sm); border: 1px solid transparent; }
.callout-title { margin-bottom: 0.2rem; font-size: var(--text-sm); font-weight: 650; }
.callout-body > :last-child { margin-bottom: 0; }
.callout-body { font-size: 0.95rem; }
.callout-note { background: var(--info-soft); }
.callout-note .callout-title { color: var(--info); }
.callout-tip { background: var(--ok-soft); }
.callout-tip .callout-title { color: var(--ok); }
.callout-warning { background: var(--warn-soft); }
.callout-warning .callout-title { color: var(--warn); }
.callout-danger { background: var(--danger-soft); }
.callout-danger .callout-title { color: var(--danger); }

/* Steps: an ordered list with numbered circles on a line. */
.steps > ol { list-style: none; counter-reset: step; padding-left: 0; margin: 0; }
.steps > ol > li { position: relative; counter-increment: step; margin: 0; padding: 0 0 1.25rem 2.6rem; }
.steps > ol > li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 999px; background: var(--bg-sunken); box-shadow: 0 0 0 1px var(--border); font-size: var(--text-sm); font-weight: 650; }
.steps > ol > li::after { content: ''; position: absolute; left: calc(0.85rem - 0.5px); top: 2rem; bottom: 0.3rem; width: 1px; background: var(--border); }
.steps > ol > li:last-child { padding-bottom: 0.25rem; }
.steps > ol > li:last-child::after { display: none; }
.steps > ol > li > :first-child { margin-top: 0.1rem; }
.steps .code, .steps .shot, .steps .table-wrap { margin: 0.6rem 0 0.4rem; }

/* Screenshots. */
.shot { margin: 1.5rem 0; }
.shot-zoom { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); cursor: zoom-in; line-height: 0; }
.shot img { display: block; width: 100%; height: auto; }
.shot .shot-dark { display: none; }
:root[data-theme='dark'] .shot .shot-light { display: none; }
:root[data-theme='dark'] .shot .shot-dark { display: block; }
.shot figcaption { margin-top: 0.55rem; color: var(--fg-faint); font-size: var(--text-sm); text-align: center; }
.shot-placeholder { display: grid; place-items: center; aspect-ratio: 16 / 10; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--fg-faint); font: var(--text-sm) var(--mono); }
.lightbox { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: var(--scrim); backdrop-filter: blur(2px); cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--bg); }

/* Cards (the home pages): each link is a card. */
.cards > ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.cards > ul > li { margin: 0; }
.cards > ul > li > a, .cards > ul > li > p > a { display: flex; flex-direction: column; gap: 0.25rem; height: 100%; padding: 1rem 1.1rem; border-radius: var(--radius); background: var(--bg); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); text-decoration: none; transition: box-shadow 0.15s; }
.cards > ul > li > :is(a, p > a):hover { box-shadow: var(--shadow), 0 0 0 1px var(--border-strong); }
.cards > ul > li p { margin: 0; height: 100%; }
.cards strong { font-size: 1rem; }
.cards em { font-style: normal; color: var(--fg-muted); font-size: var(--text-sm); line-height: 1.5; }

/* Product tiles on the family home. */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin: 1.5rem 0 2rem; }
.product { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.15rem 1.2rem 1.2rem; border-radius: var(--radius); background: var(--bg); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); text-decoration: none !important; transition: box-shadow 0.15s; }
.product:hover { box-shadow: var(--shadow), 0 0 0 1px var(--border-strong); }
.product-head { display: flex; align-items: center; gap: 0.6rem; }
.product-head .mark { width: 30px; height: 30px; }
.product-name { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.product-ko { color: var(--fg-faint); font-size: var(--text-sm); }
.product-line { margin: 0 !important; font-weight: 600; }
.product-body { margin: 0 !important; color: var(--fg-muted); font-size: var(--text-sm); line-height: 1.55; }
.product-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 0.35rem; }
.product-tags span { padding: 0.05rem 0.5rem; border-radius: 999px; background: var(--bg-sunken); color: var(--fg-muted); font-size: var(--text-2xs); font-weight: 550; }

.hero { margin: 0 0 1.5rem; }
.hero-marks { display: flex; gap: 10px; margin-bottom: 1.1rem; }
.hero-marks .mark { width: 34px; height: 34px; }

/* A diagram drawn inline (SVG with the site's colours). */
.diagram { margin: 1.5rem 0; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-subtle); overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 640px; height: auto; }
.diagram text { font-family: var(--font); fill: var(--fg); }
.diagram .d-box { fill: var(--bg); stroke: var(--border-strong); }
.diagram .d-faint { fill: var(--fg-faint); }
.diagram .d-line { stroke: var(--fg-faint); fill: none; }
.diagram .d-arrow { fill: var(--fg-faint); }

/* <details> drawn with a bordered chevron, not the browser's triangle. */
.prose details { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.6rem 0.9rem; }
.prose details > summary { cursor: pointer; list-style: none; font-weight: 600; }
.prose details > summary::-webkit-details-marker { display: none; }
.prose details > summary::before { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 0.6rem 2px 0.1rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; }
.prose details[open] > summary::before { transform: rotate(45deg); }
.prose details[open] > summary { margin-bottom: 0.6rem; }

/* Previous / next. */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 3rem; }
.pager-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 1rem; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--border); text-decoration: none !important; }
.pager-link:hover { box-shadow: 0 0 0 1px var(--border-strong); background: var(--bg-subtle); }
.pager-link.next { justify-content: flex-end; text-align: right; grid-column: 2; }
.pager-link > span { display: flex; flex-direction: column; min-width: 0; }
.pager-dir { color: var(--fg-faint); font-size: var(--text-xs); }
.pager-title { font-weight: 600; font-size: var(--text-sm); }
.pager .icon { color: var(--fg-faint); }
@media (max-width: 599.98px) { .pager { grid-template-columns: 1fr; } .pager-link.next { grid-column: 1; } }

/* ── search (a Catalyst dialog) ────────────────────────────────────── */
.search { width: min(640px, calc(100vw - 32px)); max-height: min(70dvh, 560px); margin: 12vh auto auto; padding: 0; border: 0; border-radius: var(--radius); background: var(--bg-raised); color: var(--fg); box-shadow: var(--shadow), 0 0 0 1px var(--border); overflow: hidden; }
.search[open] { display: flex; flex-direction: column; }
.search::backdrop { background: var(--scrim); }
.search-field { display: flex; align-items: center; gap: 0.6rem; padding: 0 0.9rem; border-bottom: 1px solid var(--border); color: var(--fg-faint); }
.search-field input { flex: 1; height: 52px; border: 0; outline: none; background: transparent; color: var(--fg); font: inherit; font-size: var(--text-base); }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-results { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.search-results:empty { display: none; }
.search-results li a { display: block; padding: 0.55rem 0.7rem; border-radius: var(--radius-sm); text-decoration: none; }
.search-results li a:hover, .search-results li a[aria-selected='true'] { background: var(--bg-hover); }
.sr-title { font-weight: 600; font-size: var(--text-sm); }
.sr-section { margin-left: 0.4rem; color: var(--fg-faint); font-size: var(--text-xs); font-weight: 500; }
.sr-excerpt { margin-top: 0.15rem; color: var(--fg-muted); font-size: var(--text-xs); line-height: 1.5; }
.sr-excerpt mark { background: var(--brand-soft); color: var(--fg); border-radius: 3px; padding: 0 1px; }
.search-note { padding: 0.35rem 0.7rem 0.2rem; color: var(--fg-faint); font-size: var(--text-xs); }
.search-empty { padding: 1rem; color: var(--fg-faint); font-size: var(--text-sm); text-align: center; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translateX(-50%); padding: 0.5rem 0.9rem; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-fg); font-size: var(--text-sm); box-shadow: var(--shadow); }
.toast[hidden] { display: none; }

/* ── 404 (a centred card, as the sign-in pages) ───────────────────── */
.center-page { display: grid; place-items: center; min-height: 100dvh; padding: 16px; }
.center-card { width: min(420px, 100%); padding: 28px; border-radius: 16px; background: var(--bg); box-shadow: var(--card-ring); }
.center-brand { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; font-weight: 650; }
.center-brand .mark { width: 26px; height: 26px; }
.center-card h1 { margin: 0 0 0.4rem; font-size: 1.35rem; }
.center-card h2 { margin: 1.5rem 0 0.4rem; font-size: 1.1rem; }
.center-card p { margin: 0 0 0.8rem; color: var(--fg-muted); font-size: var(--text-sm); }
.nf-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nf-list a { display: flex; align-items: center; gap: 0.55rem; padding: 0.4rem 0.5rem; border-radius: var(--radius-sm); text-decoration: none; font-size: var(--text-sm); font-weight: 550; }
.nf-list a:hover { background: var(--bg-hover); }
.nf-list .mark { width: 20px; height: 20px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .sidebar, .navbar, .toc, .pager, .copy-button { display: none !important; }
  .shell, .card, .scroller { display: block; height: auto; overflow: visible; box-shadow: none; }
  body { background: #fff; }
}

/* Screenshots side by side (the family's sign-in screens). */
.shot-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 1.25rem 0; }
.shot-pair .shot { margin: 0; }
