/*
 * Python Parts: the site's styles, in STEVE Studio's design language (tokens.css; the button, field, menu, badge,
 * card and thumbnail styles follow web/src/ui/ui.module.css and the Open dialog's document grid).
 */

/* Fonts: the files STEVE Studio bundles (@fontsource-variable/inter and jetbrains-mono 5.3.0), self-hosted. */
@font-face {
  font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(vendor/fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(vendor/fonts/inter-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono Variable'; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url(vendor/fonts/jetbrains-mono-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono Variable'; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url(vendor/fonts/jetbrains-mono-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Base ------------------------------------------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text-1);
  background: var(--page);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
main { flex: 1; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 650; letter-spacing: -0.015em; line-height: 1.2; }
h1 { font-size: var(--fs-h1); letter-spacing: -0.022em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
img { max-width: 100%; }
code, kbd, pre, .mono { font-family: var(--font-mono); }
code { font-size: 0.92em; }
:not(pre) > code { padding: 1px 5px; border-radius: var(--r-xs); background: var(--surface-2); border: 1px solid var(--line-1); }
[hidden] { display: none !important; }
svg.icon { flex-shrink: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: var(--accent-glow); color: var(--text-1); }
* { scrollbar-width: thin; scrollbar-color: var(--bg-5) transparent; }
.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 { position: absolute; left: 12px; top: -48px; z-index: 1000; padding: 8px 14px; border-radius: var(--r-md); background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.skip:focus { top: 10px; text-decoration: none; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
.caps { font-size: 11px; font-weight: 650; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-3); }
kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
  font-family: var(--font-sans); font-size: 11px; font-weight: 550; color: var(--text-2); background: var(--bg-4);
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: var(--r-xs); line-height: 1;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.97) translateY(-3px); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.8); } }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Top bar ---------------------------------------------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--page) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line-1);
}
.topbar-inner { height: var(--topbar-h); display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text-1); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 9px; box-shadow: 0 0 0 1px var(--line-2); }
.wordmark { font-size: 13px; font-weight: 700; letter-spacing: 0.2em; white-space: nowrap; }
.topnav { display: flex; align-items: center; gap: 2px; }
.topnav a { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border-radius: var(--r-md); color: var(--text-2); font-weight: 550; font-size: var(--fs-small); }
.topnav a:hover { color: var(--text-1); background: var(--bg-4); text-decoration: none; }
.topnav a[aria-current='page'] { color: var(--text-1); background: var(--surface-2); }
.topsearch { position: relative; flex: 1; max-width: 520px; margin: 0 auto; }
.topsearch .input { height: 36px; padding-left: 36px; padding-right: 36px; border-radius: var(--r-lg); background: var(--surface-2); }
.topsearch > .icon { position: absolute; left: 12px; top: 10px; color: var(--text-3); pointer-events: none; }
.topsearch kbd { position: absolute; right: 9px; top: 8px; pointer-events: none; }
.topsearch .input:focus ~ kbd { display: none; }
.topactions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.avatar {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 40%, var(--bg-4)), var(--bg-4));
  color: var(--text-1); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; border: 1px solid var(--line-3);
  text-transform: uppercase;
}
button.avatar:hover, button.avatar[aria-expanded='true'] { border-color: var(--accent); }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; border-radius: 18px; }

body[data-page='search'] .topsearch { visibility: hidden; }
@media (max-width: 720px) { body[data-page='search'] .topsearch { display: none; } }

/* Typeahead under the top search */
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; padding: 6px;
  border-radius: var(--r-lg); background: var(--bg-overlay); backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--line-3); box-shadow: var(--shadow-4); animation: pop-in var(--t-base) var(--ease-out);
}
.suggest a { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-md); color: var(--text-1); }
.suggest a:hover, .suggest a[aria-selected='true'] { background: var(--accent-soft); text-decoration: none; }
.suggest .thumb { width: 44px; flex-shrink: 0; border-radius: 6px; border: 1px solid var(--line-2); }
.suggest .thumb::after { display: none; }
.suggest b { display: block; font-size: var(--fs-small); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest small { display: block; font-size: var(--fs-tiny); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .all { justify-content: center; color: var(--link); font-size: var(--fs-small); font-weight: 550; border-top: 1px solid var(--line-1); margin-top: 4px; border-radius: 0 0 var(--r-md) var(--r-md); }
.suggest .none { padding: 10px; color: var(--text-3); font-size: var(--fs-small); }
.suggest > div { min-width: 0; }

/* Menus ------------------------------------------------------------------------------------------------------------ */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; min-width: 236px; padding: 5px;
  border-radius: var(--r-lg); background: var(--bg-overlay); backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--line-3); box-shadow: var(--shadow-4); animation: pop-in var(--t-base) var(--ease-out);
  transform-origin: top right;
}
.menu-head { padding: 8px 10px 9px; border-bottom: 1px solid var(--line-2); margin-bottom: 5px; }
.menu-head b { display: block; font-weight: 600; }
.menu-head small { color: var(--text-3); font-size: var(--fs-tiny); }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--text-1); font-size: var(--fs-small); text-align: left; white-space: nowrap;
}
.menu-item .icon { color: var(--text-2); }
.menu-item:hover, .menu-item:focus-visible { background: var(--accent-soft); text-decoration: none; outline: none; }
.menu-item:hover .icon, .menu-item:focus-visible .icon { color: var(--accent); }
.menu-item[aria-checked='true'] .check { visibility: visible; }
.menu-item .check { margin-left: auto; visibility: hidden; color: var(--accent); }
.menu-sep { height: 1px; margin: 5px 4px; background: var(--line-2); }
.menu-label { padding: 7px 10px 4px; }
.menu form { margin: 0; }

/* Buttons ---------------------------------------------------------------------------------------------------------- */
.btn {
  --h: 34px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 14px;
  border-radius: var(--r-md); font-size: var(--fs-small); font-weight: 600; white-space: nowrap; border: 1px solid transparent;
  color: var(--text-1); background: var(--bg-4); text-decoration: none; cursor: pointer; user-select: none;
  transition: background var(--t-fast) var(--ease-standard), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-base), transform var(--t-fast) var(--ease-standard);
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled):not([aria-disabled='true']) { transform: translateY(0.5px) scale(0.985); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.45; cursor: default; }
.btn-sm { --h: 28px; padding: 0 10px; font-size: var(--fs-tiny); gap: 6px; }
.btn-lg { --h: 42px; padding: 0 20px; font-size: var(--fs-body); border-radius: var(--r-lg); }
.btn-block { width: 100%; }
.btn-primary {
  color: var(--accent-ink);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 100%, white 12%), var(--accent));
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.22) inset, 0 1px 2px rgb(0 0 0 / 0.25), 0 0 0 1px color-mix(in srgb, var(--accent) 70%, black 30%);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 100%, white 22%), color-mix(in srgb, var(--accent) 100%, white 8%));
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.25) inset, 0 4px 14px var(--accent-glow), 0 0 0 1px color-mix(in srgb, var(--accent) 70%, black 30%);
}
.btn-secondary { background: var(--bg-4); border-color: var(--line-2); box-shadow: var(--inset-hi); }
:root[data-theme='light'] .btn-secondary { background: var(--surface); border-color: var(--line-3); box-shadow: var(--shadow-1); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-5); border-color: var(--line-3); }
:root[data-theme='light'] .btn-secondary:hover:not(:disabled) { background: var(--bg-3); }
.btn-ghost { color: var(--text-2); background: transparent; }
.btn-ghost:hover:not(:disabled) { color: var(--text-1); background: var(--bg-4); }
.btn-danger { color: #fff; background: color-mix(in srgb, var(--danger) 82%, black 18%); }
.btn-danger:hover:not(:disabled) { background: var(--danger); }
.btn-link { height: auto; padding: 0; background: none; color: var(--link); font-weight: 550; }
.btn-link:hover { text-decoration: underline; }
.btn .spinner { width: 14px; height: 14px; }
.btn[data-busy] .btn-icon { display: none; }
.btn:not([data-busy]) .spinner { display: none; }
.icon-btn {
  --s: 34px; display: inline-grid; place-items: center; width: var(--s); height: var(--s); border-radius: var(--r-md);
  color: var(--text-2); transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.icon-btn:hover:not(:disabled) { color: var(--text-1); background: var(--bg-4); }
.icon-btn:active:not(:disabled) { transform: scale(0.94); }
.icon-btn[aria-pressed='true'] { color: var(--accent); background: var(--accent-soft); }
.icon-btn.sm { --s: 28px; }

.spinner {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid color-mix(in srgb, var(--accent) 22%, transparent); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
.btn-primary .spinner { border-color: color-mix(in srgb, var(--accent-ink) 30%, transparent); border-top-color: var(--accent-ink); }

/* Fields ----------------------------------------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { display: flex; align-items: baseline; gap: 8px; font-size: var(--fs-small); color: var(--text-1); font-weight: 550; }
.field-label small { margin-left: auto; color: var(--text-3); font-weight: 450; font-size: var(--fs-tiny); }
.field-hint { font-size: var(--fs-tiny); color: var(--text-3); }
.field-error { font-size: var(--fs-tiny); color: var(--danger); }
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 11px; border-radius: var(--r-md); background: var(--field);
  border: 1px solid var(--line-2); color: var(--text-1); font-size: var(--fs-body);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.14);
  transition: border-color var(--t-fast), box-shadow var(--t-base), background var(--t-fast);
}
:root[data-theme='light'] .input, :root[data-theme='light'] .select, :root[data-theme='light'] .textarea { border-color: var(--line-3); box-shadow: inset 0 1px 2px rgb(15 25 30 / 0.05); }
.textarea { height: auto; min-height: 88px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
:root[data-theme='light'] .input::placeholder { color: #8b969c; }
.input[aria-invalid='true'] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237d878d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.select option { background: var(--surface); color: var(--text-1); }
.num { position: relative; display: flex; align-items: center; }
.num .input { font-variant-numeric: tabular-nums; padding-right: 44px; }
.num .unit { position: absolute; right: 11px; color: var(--text-3); font-size: var(--fs-tiny); pointer-events: none; }
.input-prefix { position: relative; display: flex; align-items: center; }
.input-prefix > span { position: absolute; left: 11px; color: var(--text-3); pointer-events: none; font-size: var(--fs-body); }
.input-prefix .input { padding-left: var(--prefix-w, 160px); }

/* Switch: a checkbox with role="switch" */
.switch {
  appearance: none; -webkit-appearance: none; position: relative; width: 36px; height: 22px; margin: 0; flex-shrink: 0;
  border-radius: 99px; background: var(--bg-5); border: 1px solid var(--line-2); cursor: pointer;
  transition: background var(--t-base) var(--ease-standard);
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 99px; background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.35); transition: transform var(--t-base) var(--ease-spring);
}
.switch:checked { background: var(--accent); border-color: transparent; }
.switch:checked::after { transform: translateX(14px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: var(--fs-small); color: var(--text-2); line-height: 1.5; }
.check-row input[type='checkbox']:not(.switch) { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }

/* Range slider (Studio's track, range fill and thumb) */
.range {
  appearance: none; -webkit-appearance: none; width: 100%; height: 20px; margin: 0; background: transparent; cursor: pointer;
  --fill: 50%;
}
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--fill), var(--bg-5) var(--fill)); }
.range::-moz-range-track { height: 4px; border-radius: 99px; background: var(--bg-5); }
.range::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--accent); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 99px; background: #fff;
  border: 2px solid var(--accent); box-shadow: 0 1px 4px rgb(0 0 0 / 0.35); transition: transform var(--t-fast);
}
.range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 99px; background: #fff; border: 2px solid var(--accent); box-shadow: 0 1px 4px rgb(0 0 0 / 0.35); }
.range:hover::-webkit-slider-thumb { transform: scale(1.12); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-glow); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--accent-glow); }

/* Segmented control: radio inputs */
.segmented {
  display: inline-flex; flex-wrap: wrap; padding: 2px; gap: 2px; border-radius: var(--r-md); background: var(--bg-1);
  border: 1px solid var(--line-2); box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.18);
}
:root[data-theme='light'] .segmented { background: var(--bg-3); box-shadow: inset 0 1px 2px rgb(15 25 30 / 0.06); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 6px;
  font-size: var(--fs-small); font-weight: 550; color: var(--text-3); border: 1px solid transparent; transition: color var(--t-base), background var(--t-base);
}
.segmented label:hover span { color: var(--text-1); }
.segmented input:checked + span { color: var(--text-1); background: var(--bg-4); border-color: var(--line-3); box-shadow: var(--shadow-1), var(--inset-hi); }
:root[data-theme='light'] .segmented input:checked + span { background: var(--surface); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.segmented.full { display: flex; }
.segmented.full label { flex: 1; }
.segmented.full span { width: 100%; justify-content: center; }

/* Badges and chips ------------------------------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; white-space: nowrap;
  font-size: 11px; font-weight: 650; letter-spacing: 0.04em; color: var(--text-2); background: var(--bg-4); border: 1px solid var(--line-2);
}
.badge .icon { width: 12px; height: 12px; }
.badge.upper { text-transform: uppercase; letter-spacing: 0.06em; font-size: 10.5px; }
.badge[data-tone='steve'] { color: var(--steve-tone); background: var(--accent-softer); border-color: color-mix(in srgb, var(--steve-tone) 28%, transparent); }
.badge[data-tone='cadquery'] { color: var(--cadquery-tone); background: color-mix(in srgb, var(--cadquery-tone) 9%, transparent); border-color: color-mix(in srgb, var(--cadquery-tone) 26%, transparent); }
.badge[data-tone='build123d'] { color: var(--build123d-tone); background: color-mix(in srgb, var(--build123d-tone) 9%, transparent); border-color: color-mix(in srgb, var(--build123d-tone) 26%, transparent); }
.badge[data-tone='openscad'] { color: var(--openscad-tone); background: color-mix(in srgb, var(--openscad-tone) 9%, transparent); border-color: color-mix(in srgb, var(--openscad-tone) 26%, transparent); }
.badge[data-tone='warning'] { color: var(--warning); background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 28%, transparent); }
.badge[data-tone='danger'] { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 28%, transparent); }
.badge[data-tone='success'] { color: var(--success); background: color-mix(in srgb, var(--success) 10%, transparent); border-color: color-mix(in srgb, var(--success) 28%, transparent); }
.badge[data-tone='info'] { color: var(--sel); background: var(--sel-soft); border-color: color-mix(in srgb, var(--sel) 28%, transparent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.dot.pulse { animation: pulse-dot 1s var(--ease-in-out) infinite; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 99px;
  font-size: var(--fs-small); font-weight: 500; color: var(--text-2); background: var(--surface); border: 1px solid var(--line-2);
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.chip:hover { color: var(--text-1); border-color: var(--line-4); text-decoration: none; }
.chip small { color: var(--text-3); font-size: var(--fs-tiny); font-variant-numeric: tabular-nums; }
.chip[aria-current='true'] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-softer); }
.chip.sm { height: 24px; padding: 0 9px; font-size: var(--fs-tiny); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Cards and surfaces ----------------------------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow-1); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; }
.card-head h2, .card-head h3 { font-size: 14px; font-weight: 650; letter-spacing: -0.005em; }
.card-head .icon { color: var(--text-3); }
.card-head .meta { margin-left: auto; font-size: var(--fs-tiny); color: var(--text-3); }
.card-body { padding: 14px 16px 16px; }
.card-foot { padding: 12px 16px; border-top: 1px solid var(--line-1); background: color-mix(in srgb, var(--bg-1) 40%, transparent); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.card + .card { margin-top: 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; font-size: var(--fs-small); margin: 0; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text-1); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.list-rows { list-style: none; margin: 0; padding: 0; }
.list-rows > li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-1); font-size: var(--fs-small); }
.list-rows > li:first-child { border-top: 0; padding-top: 0; }

/* Thumbnails: Studio's viewport backdrop behind a transparent render */
.thumb {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; isolation: isolate; display: block;
  background:
    radial-gradient(120% 90% at 50% 18%, color-mix(in srgb, var(--vp-top) 100%, white 3%) 0%, transparent 65%),
    linear-gradient(180deg, var(--vp-top) 0%, var(--vp-bottom) 100%);
}
.thumb::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(140% 110% at 50% 45%, transparent 55%, rgb(0 0 0 / 0.22) 100%); }
:root[data-theme='light'] .thumb::after { background: radial-gradient(140% 110% at 50% 45%, transparent 60%, rgb(40 60 70 / 0.08) 100%); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.thumb .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-4); }
:root[data-theme='light'] .thumb .placeholder { color: #9aa6ad; }
.thumb .placeholder .icon { opacity: 0.7; }

/* Part cards (the documents grid of STEVE Studio's Open dialog) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 18px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pcard {
  position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: var(--r-xl); background: var(--surface);
  border: 1px solid var(--line-2); box-shadow: var(--shadow-1); color: var(--text-1);
  transition: border-color var(--t-base), box-shadow var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
  animation: card-in 0.3s var(--ease-out) backwards;
}
.pcard:hover { transform: translateY(-2px); border-color: var(--line-3); box-shadow: var(--shadow-2); }
.pcard:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-2); }
.pcard .media { margin: 5px 5px 0; border-radius: calc(var(--r-xl) - 5px); overflow: hidden; }
.pcard .thumb img { padding: 11% 7% 5%; }
.pcard .thumb { transition: transform var(--t-slower) var(--ease-out); }
.pcard:hover .thumb { transform: scale(1.035); }
.pcard .chips { position: absolute; top: 13px; left: 13px; right: 13px; z-index: 2; display: flex; gap: 6px; pointer-events: none; }
.pcard .chips .badge { background: color-mix(in srgb, var(--bg-1) 74%, transparent); backdrop-filter: blur(10px) saturate(1.3); -webkit-backdrop-filter: blur(10px) saturate(1.3); }
:root[data-theme='light'] .pcard .chips .badge { background: color-mix(in srgb, #ffffff 78%, transparent); }
.pcard .chips .badge[data-tone='steve'] { color: var(--steve-tone); }
.pcard .chips .badge[data-tone='cadquery'] { color: var(--cadquery-tone); }
.pcard .chips .badge[data-tone='build123d'] { color: var(--build123d-tone); }
.pcard .chips .badge[data-tone='openscad'] { color: var(--openscad-tone); }
.pcard .chips .right { margin-left: auto; }
.pcard .text { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.pcard .title { font-size: 14px; font-weight: 620; color: var(--text-1); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .title .owner { color: var(--text-3); font-weight: 500; }
.pcard .title a { color: inherit; }
.pcard .title a::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.pcard .title a:hover { text-decoration: none; }
.pcard .title a:focus-visible { outline: none; }
.pcard .summary { font-size: var(--fs-small); color: var(--text-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.pcard .meta { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 6px; font-size: var(--fs-tiny); color: var(--text-3); font-variant-numeric: tabular-nums; }
.pcard .meta span { display: inline-flex; align-items: center; gap: 4px; }
.pcard .meta .icon { width: 13px; height: 13px; }
.pcard .meta .ver { margin-left: auto; font-family: var(--font-mono); font-size: 11px; }
.pcard .title.has-preset a { display: flex; min-width: 0; }
.pcard .title .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .title .ps { flex-shrink: 0; white-space: pre; color: var(--accent); font-variant-numeric: tabular-nums; }
.pcard .title .ps::before { content: ' · '; color: var(--text-3); font-weight: 500; }
.pcard .meta .sizes { color: var(--text-2); }
.pcard .meta span { white-space: nowrap; }
.pcard .meta:has(.sizes) .when { display: none; }
@media (prefers-reduced-motion: reduce) { .pcard { animation: none; } .pcard:hover, .pcard:hover .thumb { transform: none; } }

/* Skeleton cards (live search while it loads) */
.skeleton { position: relative; overflow: hidden; background: var(--bg-3); border-radius: var(--r-md); }
.skeleton::before { content: ''; position: absolute; inset: 0; width: 60%; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text-1) 6%, transparent), transparent); animation: shimmer 1.4s var(--ease-in-out) infinite; }
[aria-busy='true'] .grid { opacity: 0.55; transition: opacity var(--t-base); }

/* Empty states */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 20px; color: var(--text-2); }
.empty-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; color: var(--accent); background: var(--accent-softer); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); margin-bottom: 4px; }
.empty h2, .empty h3 { color: var(--text-1); font-size: 17px; }
.empty p { max-width: 440px; font-size: var(--fs-small); }
.empty .row-wrap { justify-content: center; margin-top: 6px; }

/* Alerts */
.alert { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--surface-2); font-size: var(--fs-small); color: var(--text-1); }
.alert > .icon { margin-top: 1px; }
.alert[data-tone='danger'] { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 32%, transparent); }
.alert[data-tone='danger'] > .icon { color: var(--danger); }
.alert[data-tone='warning'] { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 32%, transparent); }
.alert[data-tone='warning'] > .icon { color: var(--warning); }
.alert[data-tone='info'] { background: var(--accent-softer); border-color: color-mix(in srgb, var(--accent) 28%, transparent); }
.alert[data-tone='info'] > .icon { color: var(--accent); }
.alert[data-tone='success'] > .icon { color: var(--success); }
.alert b { font-weight: 620; }
.alert .body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.findings { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.findings li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.findings code { font-size: 11.5px; color: var(--text-2); }

/* Toasts (Studio's Toasts) */
.toasts { position: fixed; z-index: 900; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 380px; padding: 11px 14px;
  border-radius: var(--r-lg); background: var(--bg-overlay); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--line-3); box-shadow: var(--shadow-3); font-size: var(--fs-small); animation: toast-in var(--t-slow) var(--ease-out);
}
.toast .icon { color: var(--success); }
.toast[data-tone='danger'] .icon { color: var(--danger); }
.toast[data-tone='info'] .icon { color: var(--accent); }

/* Page scaffolding ------------------------------------------------------------------------------------------------- */
.page { padding-top: 32px; padding-bottom: 64px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: var(--fs-h1); }
.page-head p { color: var(--text-2); margin-top: 6px; max-width: 640px; }
.runtime-example h3 { display: flex; align-items: center; gap: 8px; font-size: var(--fs-small); margin-bottom: 4px; }
.runtime-example .field-hint { margin-bottom: 8px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: var(--fs-small); color: var(--text-3); margin-bottom: 10px; flex-wrap: wrap; }
.crumbs a { color: var(--text-2); }
.crumbs .icon { color: var(--text-4); }
.section { margin-top: 48px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: var(--fs-h2); }
.section-head p { color: var(--text-3); font-size: var(--fs-small); }
.section-head .more { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-small); font-weight: 550; white-space: nowrap; }
.prose { max-width: 720px; font-size: 15px; line-height: 1.7; color: var(--text-2); }
.prose h1 { color: var(--text-1); margin-bottom: 12px; }
.prose h2 { color: var(--text-1); margin: 32px 0 10px; font-size: 18px; }
.prose p { margin: 10px 0; }
.prose ul { padding-left: 20px; margin: 10px 0; }
.prose li { margin: 6px 0; }
.prose .lead { font-size: 17px; color: var(--text-1); }

/* Footer */
.footer { margin-top: 32px; border-top: 1px solid var(--line-1); background: color-mix(in srgb, var(--bg-0) 50%, var(--page)); }
:root[data-theme='light'] .footer { background: var(--bg-3); }
.footer-inner { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 32px; padding-top: 36px; padding-bottom: 28px; }
.footer p { color: var(--text-3); font-size: var(--fs-small); margin-top: 10px; max-width: 360px; }
.footer h2 { font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: var(--fs-small); }
.footer ul a { color: var(--text-2); }
.footer ul a:hover { color: var(--text-1); }
.footer-base { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; padding-top: 16px; padding-bottom: 24px; border-top: 1px solid var(--line-1); color: var(--text-3); font-size: var(--fs-tiny); }
.built-with { display: inline-flex; align-items: center; gap: 7px; }
.built-with img { width: 16px; height: 16px; border-radius: 5px; }

/* Home ------------------------------------------------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line-1); }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 70% at 78% 30%, var(--accent-softer), transparent 70%),
    radial-gradient(40% 50% at 10% 0%, color-mix(in srgb, var(--iris) 7%, transparent), transparent 70%);
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0.5;
  background-image: linear-gradient(var(--line-1) 1px, transparent 1px), linear-gradient(90deg, var(--line-1) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(80% 80% at 70% 30%, black, transparent 75%);
  -webkit-mask-image: radial-gradient(80% 80% at 70% 30%, black, transparent 75%);
}
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; padding-top: 64px; padding-bottom: 64px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px 0 10px; border-radius: 99px; font-size: var(--fs-tiny); font-weight: 600; color: var(--accent); background: var(--accent-softer); border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent); }
.hero h1 { font-size: var(--fs-hero); line-height: 1.04; letter-spacing: -0.035em; margin-top: 18px; font-weight: 700; }
.hero h1 em { font-style: normal; background: linear-gradient(100deg, var(--mint), color-mix(in srgb, var(--mint) 55%, var(--azure))); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme='light'] .hero h1 em { background: linear-gradient(100deg, #14805e, #0f6aa8); -webkit-background-clip: text; background-clip: text; }
.hero .lead { margin-top: 18px; font-size: 17px; line-height: 1.6; color: var(--text-2); max-width: 560px; }
.hero-search { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; max-width: 580px; }
.searchbox { position: relative; display: flex; align-items: center; }
.searchbox > .icon { position: absolute; left: 15px; color: var(--text-3); pointer-events: none; }
.searchbox .input { height: 50px; padding-left: 44px; padding-right: 116px; font-size: 15px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-2); }
.searchbox .btn { position: absolute; right: 6px; }
.hero-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hero-filters .select { width: auto; height: 32px; font-size: var(--fs-small); }
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.hero-stats { display: flex; gap: 28px; margin-top: 30px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hero-stats span { font-size: var(--fs-tiny); color: var(--text-3); }
.hero-stats small { font-size: 11px; color: var(--text-3); margin-top: 1px; padding-top: 3px; border-top: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
.hero-lead-stat b { color: var(--accent); }

.showcase { position: relative; }
.showcase-code { position: relative; z-index: 1; width: 86%; border-radius: var(--r-xl); background: var(--code-bg); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); overflow: hidden; }
.window-bar { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-bottom: 1px solid var(--line-1); background: var(--code-gutter); font-size: var(--fs-tiny); color: var(--text-3); }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--bg-5); }
.window-bar span { margin-left: 6px; font-family: var(--font-mono); }
.showcase-code pre { margin: 0; padding: 14px 0; font-size: 12px; line-height: 1.7; overflow: hidden; }
.showcase-code pre span.ln { display: block; padding: 0 16px; white-space: pre; }
.showcase-render { position: absolute; z-index: 2; right: 0; bottom: -36px; width: 56%; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line-3); box-shadow: var(--shadow-4); background: var(--surface); }
.showcase-render .thumb { aspect-ratio: 4 / 3; }
.showcase-render .cap { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: var(--fs-tiny); color: var(--text-2); border-top: 1px solid var(--line-1); }
.showcase-render .cap b { color: var(--text-1); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.showcase-render .cap .badge { margin-left: auto; }
.showcase-params { position: absolute; z-index: 3; left: 6%; bottom: -54px; display: flex; gap: 6px; flex-wrap: wrap; max-width: 46%; }
.showcase-params .chip { background: var(--bg-overlay); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-2); font-family: var(--font-mono); font-size: 11.5px; }
.showcase-params .chip b { color: var(--accent); font-weight: 600; }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.step { padding: 18px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-1); }
.step-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: var(--accent-softer); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); margin-bottom: 12px; }
.step h3 { font-size: 15px; margin-bottom: 6px; }
.step p { font-size: var(--fs-small); color: var(--text-2); }
.step .n { float: right; font-family: var(--font-mono); font-size: 11px; color: var(--text-4); }
.cta-band { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 28px; border-radius: var(--r-xl); border: 1px solid var(--line-2); background: radial-gradient(80% 140% at 100% 0%, var(--accent-softer), transparent 60%), var(--surface); box-shadow: var(--shadow-1); }
.cta-band h2 { font-size: 20px; }
.cta-band p { color: var(--text-2); margin-top: 6px; max-width: 620px; font-size: var(--fs-small); }
.cta-band .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* Search ----------------------------------------------------------------------------------------------------------- */
.search-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 32px; align-items: start; }
.facets { display: flex; flex-direction: column; gap: 22px; padding-bottom: 12px; }
.facet h2 { font-size: 11px; font-weight: 650; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; display: flex; align-items: center; }
.facet h2 a { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 550; font-size: var(--fs-tiny); }
.facet-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.facet-list a { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 9px; border-radius: var(--r-md); color: var(--text-2); font-size: var(--fs-small); }
.facet-list a:hover { background: var(--bg-4); color: var(--text-1); text-decoration: none; }
:root[data-theme='light'] .facet-list a:hover { background: var(--bg-3); }
.facet-list a[aria-current='true'] { color: var(--text-1); background: var(--accent-soft); font-weight: 550; }
.facet-list a[aria-current='true'] .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.facet-list .box { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line-4); display: grid; place-items: center; color: transparent; flex-shrink: 0; }
.facet-list .box .icon { width: 11px; height: 11px; stroke-width: 3; }
.facet-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet-list small { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: var(--fs-tiny); }
.facet-note { font-size: var(--fs-tiny); color: var(--text-3); padding: 2px 9px 0 33px; line-height: 1.4; }
.results-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.results-bar .count { font-size: var(--fs-small); color: var(--text-2); }
.results-bar .count b { color: var(--text-1); font-weight: 650; }
.results-bar .sort { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.results-bar .sort label { font-size: var(--fs-small); color: var(--text-3); white-space: nowrap; }
.results-bar .sort .select { width: auto; height: 32px; font-size: var(--fs-small); }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.active-filters .chip .icon { width: 13px; height: 13px; color: var(--text-3); }
.search-head { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.search-head .searchbox { flex: 1; }
.search-head .searchbox .input { height: 44px; padding-right: 16px; box-shadow: var(--shadow-1); }
.filters-toggle { display: none; }
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 32px; }
.pager .current { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: var(--fs-small); }
.pager .of { color: var(--text-3); font-size: var(--fs-small); padding: 0 6px; }

/* Part page -------------------------------------------------------------------------------------------------------- */
.part-head { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; padding-top: 24px; padding-bottom: 20px; }
.part-title { flex: 1; min-width: 280px; }
.part-title h1 { font-size: 30px; letter-spacing: -0.025em; overflow-wrap: anywhere; }
.part-title h1 .owner { color: var(--text-3); font-weight: 500; }
.part-title h1 .owner a { color: inherit; }
.part-title h1 .owner a:hover { color: var(--text-1); text-decoration: none; }
.part-title .summary { color: var(--text-2); font-size: 15px; margin-top: 8px; max-width: 760px; }
.part-title .badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; align-items: center; }
.part-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.version-pill { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--text-2); padding: 0 8px; height: 22px; display: inline-flex; align-items: center; border-radius: 6px; background: var(--bg-4); border: 1px solid var(--line-2); }
.star-btn[aria-pressed='true'] { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.star-btn[aria-pressed='true'] .icon { fill: currentColor; }
.star-btn .n { font-variant-numeric: tabular-nums; color: var(--text-3); font-weight: 550; padding-left: 8px; margin-left: 2px; border-left: 1px solid var(--line-2); }

.part-layout { display: grid; grid-template-columns: minmax(0, 1fr) 372px; grid-template-areas: "viewer side" "main side"; grid-template-rows: auto 1fr; gap: 20px; align-items: start; }
.part-viewer { grid-area: viewer; min-width: 0; }
.part-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; gap: 0; }
.part-side { grid-area: side; display: flex; flex-direction: column; gap: 14px; }
.part-side .card + .card { margin-top: 0; }

/* 3D viewer (Studio's viewport: backdrop, vignette, progress bar, busy chip) */
.viewer {
  position: relative; height: clamp(380px, 62vh, 640px); border-radius: var(--r-xl); overflow: hidden; isolation: isolate;
  border: 1px solid var(--line-2); box-shadow: var(--shadow-1); touch-action: none;
  background:
    radial-gradient(120% 90% at 50% 18%, color-mix(in srgb, var(--vp-top) 100%, white 3%) 0%, transparent 65%),
    linear-gradient(180deg, var(--vp-top) 0%, var(--vp-bottom) 100%);
}
.viewer::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1; background: radial-gradient(140% 110% at 50% 45%, transparent 55%, rgb(0 0 0 / 0.28) 100%); }
:root[data-theme='light'] .viewer::after { background: radial-gradient(140% 110% at 50% 45%, transparent 60%, rgb(40 60 70 / 0.08) 100%); }
.viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; outline: none; }
.viewer .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 0; transition: opacity var(--t-slow); }
.viewer[data-ready] .poster { opacity: 0; pointer-events: none; }
.viewer-status { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-2); font-size: var(--fs-small); text-align: center; padding: 24px; pointer-events: none; }
.viewer-status .icon { color: var(--text-4); }
.viewer-tools {
  position: absolute; z-index: 3; top: 150px; right: 14px; display: flex; flex-direction: column; gap: 2px; padding: 3px;
  border-radius: var(--r-lg); background: color-mix(in srgb, var(--bg-1) 72%, transparent); border: 1px solid var(--line-2);
  backdrop-filter: blur(12px) saturate(1.3); -webkit-backdrop-filter: blur(12px) saturate(1.3); box-shadow: var(--shadow-2);
}
:root[data-theme='light'] .viewer-tools { background: color-mix(in srgb, #ffffff 80%, transparent); }
.viewer-tools .sep { height: 1px; margin: 2px 4px; background: var(--line-2); }
.viewer-label { position: absolute; z-index: 3; top: 14px; left: 16px; display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
.viewer-label b { font-size: 11.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-1); }
.viewer-label span { font-size: 11px; color: var(--text-3); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.viewer-hint { position: absolute; z-index: 3; left: 84px; bottom: 12px; font-size: 11px; color: var(--text-3); pointer-events: none; }
.viewer-tools .projection .persp, .viewer-tools .projection[aria-pressed='true'] .ortho { display: none; }
.viewer-tools .projection[aria-pressed='true'] .persp { display: block; }

/* STEVE Studio's view cube (viewport/ViewCube.module.css) */
.view-cube { position: absolute; top: 14px; right: 14px; z-index: 6; display: flex; gap: 4px; transition: opacity var(--t-slow); }
.vc-stage { position: relative; width: 118px; height: 118px; cursor: grab; touch-action: none; }
.vc-stage[data-dragging] { cursor: grabbing; }
.vc-stage[data-dragging] .vc-cell { cursor: grabbing; }
.vc-shadow { position: absolute; left: 50%; top: 50%; width: 104px; height: 104px; margin: -52px; border-radius: 50%; background: radial-gradient(closest-side, rgb(255 255 255 / 0.05), transparent 75%); pointer-events: none; }
.vc-cube { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; }
.vc-face {
  position: absolute; backface-visibility: hidden; display: grid; place-items: center; border-radius: 7px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--bg-5) 92%, white 8%), var(--bg-4));
  border: 1px solid var(--line-4); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.04), inset 0 0 14px rgb(0 0 0 / 0.25);
}
:root[data-theme='light'] .vc-face { background: linear-gradient(160deg, #ffffff, #e9edf0); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.8), inset 0 0 12px rgb(20 30 40 / 0.06); }
.vc-face[data-active] { border-color: var(--ws-strong); box-shadow: inset 0 0 0 1px var(--ws-strong), inset 0 0 16px var(--ws-soft); }
.vc-face[data-active] .vc-label { color: var(--ws); }
.vc-face:has(.vc-cell[data-kind='face'][data-hover]) .vc-label { color: var(--ws-ink); }
.vc-label { position: relative; z-index: 1; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); pointer-events: none; }
.vc-grid { position: absolute; inset: 0; display: grid; grid-template-columns: 13px 1fr 13px; grid-template-rows: 13px 1fr 13px; }
.vc-cell { border-radius: 3px; transition: background var(--t-fast); cursor: pointer; }
.vc-cell[data-hover] { background: var(--ws-strong); box-shadow: 0 0 10px var(--ws-glow); }
.vc-cell[data-kind='face'][data-hover] { background: color-mix(in srgb, var(--ws-strong) 88%, transparent); box-shadow: none; }
.vc-controls { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; }
.vc-control {
  width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--text-3);
  background: color-mix(in srgb, var(--bg-2) 70%, transparent); border: 1px solid var(--line-2); backdrop-filter: blur(6px);
  transition: color var(--t-fast), background var(--t-fast);
}
.vc-control:hover { color: var(--text-1); background: var(--bg-4); }
/* Triad (viewport/Viewport.module.css .triad) */
.triad { position: absolute; left: 10px; bottom: 10px; z-index: 5; pointer-events: none; overflow: visible; filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.4)); }
/* Standard views menu (ViewTools) */
.view-menu {
  position: absolute; z-index: 7; top: 150px; right: 58px; min-width: 170px; display: flex; flex-direction: column; padding: 4px;
  border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-2);
}
.view-menu[hidden] { display: none; }
.view-menu-label { padding: 6px 8px 4px; font-size: var(--fs-tiny); color: var(--text-3); }
.view-menu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px; border-radius: var(--r-md); font-size: var(--fs-small); color: var(--text-1); text-align: left; }
.view-menu button:hover, .view-menu button:focus-visible { background: var(--bg-4); outline: none; }
/* Section analysis (CommandPanels SectionPanel), compact over the view */
.section-panel {
  position: absolute; z-index: 6; right: 14px; bottom: 14px; width: 236px; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px;
  border-radius: var(--r-lg); background: color-mix(in srgb, var(--bg-1) 86%, transparent); border: 1px solid var(--line-2);
  backdrop-filter: blur(12px) saturate(1.3); -webkit-backdrop-filter: blur(12px) saturate(1.3); box-shadow: var(--shadow-2); font-size: var(--fs-small);
}
.section-panel[hidden] { display: none; }
:root[data-theme='light'] .section-panel { background: color-mix(in srgb, #ffffff 88%, transparent); }
.sp-head { display: flex; align-items: center; gap: 8px; }
.sp-head b { font-weight: 600; }
.sp-head .icon-btn { margin-left: auto; }
.sp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-2); }
.sp-seg { display: flex; padding: 2px; gap: 2px; border-radius: var(--r-md); background: var(--bg-3); border: 1px solid var(--line-2); }
.sp-seg [data-axis='x'] { --c: var(--axis-x); } .sp-seg [data-axis='y'] { --c: var(--axis-y); } .sp-seg [data-axis='z'] { --c: var(--axis-z); }
.sp-seg button { width: 30px; height: 22px; border-radius: 5px; font-weight: 700; font-size: 12px; color: var(--c); }
.sp-seg button[aria-checked='true'] { background: var(--bg-5); box-shadow: var(--shadow-1); }
.sp-num { display: flex; align-items: center; width: 118px; height: 26px; border-radius: var(--r-md); background: var(--bg-3); border: 1px solid var(--line-2); overflow: hidden; }
.sp-num i { font-style: normal; font-weight: 700; font-size: 11px; padding: 0 6px; color: var(--c, var(--axis-z)); }
.sp-num input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text-1); font: inherit; font-variant-numeric: tabular-nums; padding-right: 6px; }
.sp-num input:focus { outline: none; }
.sp-num:focus-within { border-color: var(--accent); }
.sp-slider { width: 100%; accent-color: var(--accent); }
.sp-hint { font-size: var(--fs-tiny); color: var(--text-3); }
.section-panel .btn { align-self: flex-start; }
.viewer-progress { position: absolute; z-index: 4; top: 0; left: 0; right: 0; height: 2px; overflow: hidden; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.viewer-progress i { position: absolute; inset: 0 auto 0 0; width: 40%; background: linear-gradient(90deg, transparent, var(--accent), transparent); box-shadow: 0 0 12px var(--accent); animation: shimmer 1.25s var(--ease-in-out) infinite; }
.busy-chip {
  position: absolute; z-index: 4; top: 14px; left: 50%; translate: -50% 0; display: flex; align-items: center; gap: 9px;
  height: 32px; padding: 0 14px; border-radius: 99px; font-size: var(--fs-small); font-weight: 550; color: var(--text-1);
  background: var(--bg-overlay); border: 1px solid var(--line-3); box-shadow: var(--shadow-3); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  white-space: nowrap;
}
.busy-chip[data-tone='error'] { color: var(--danger); }
.busy-chip[data-tone='done'] .icon { color: var(--success); }

/* Parameters panel */
.params { display: flex; flex-direction: column; gap: 16px; }
.param .row-top { display: flex; align-items: baseline; gap: 8px; }
.param-help { font-size: var(--fs-tiny); color: var(--text-3); margin-top: -2px; }
.param-num { display: grid; grid-template-columns: minmax(0, 1fr) 116px; gap: 12px; align-items: center; }
.param-bool { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.param-range { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-4); margin-top: -2px; font-variant-numeric: tabular-nums; }
:root[data-theme='light'] .param-range { color: var(--text-3); }
.param[data-changed] .field-label::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); align-self: center; }
.build-row { display: flex; flex-direction: column; gap: 10px; }
.build-row .row { gap: 8px; }
.build-row .btn-primary { flex: 1; }
.build-status { display: flex; align-items: center; gap: 8px; min-height: 20px; font-size: var(--fs-small); color: var(--text-2); }
.build-status[data-tone='error'] { color: var(--danger); }
.build-status[data-tone='done'] { color: var(--success); }
.signin-callout { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--r-lg); background: var(--accent-softer); border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent); font-size: var(--fs-small); color: var(--text-1); }
.signin-callout p { color: var(--text-2); }

/* Preset picker: a part's named sizes above its parameters (part.js). A popover under the field; a sheet on phones. */
.preset-field { position: relative; display: flex; flex-direction: column; gap: 6px; padding-bottom: 16px; border-bottom: 1px solid var(--line-1); }
.preset-trigger {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 10px 6px 7px; text-align: left;
  border-radius: var(--r-md); background: var(--field); border: 1px solid var(--line-2); color: var(--text-1);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.14); transition: border-color var(--t-fast), box-shadow var(--t-base);
}
:root[data-theme='light'] .preset-trigger { border-color: var(--line-3); box-shadow: inset 0 1px 2px rgb(15 25 30 / 0.05); }
.preset-trigger:hover { border-color: var(--line-3); }
:root[data-theme='light'] .preset-trigger:hover { border-color: var(--line-4); }
.preset-trigger:focus-visible, .preset-trigger[aria-expanded='true'] { outline: none; border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 3px var(--accent-soft); }
.preset-icon { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 7px; color: var(--accent); background: var(--accent-soft); transition: color var(--t-fast), background var(--t-fast); }
.preset-trigger[data-custom] .preset-icon { color: var(--text-3); background: var(--bg-4); }
:root[data-theme='light'] .preset-trigger[data-custom] .preset-icon { background: var(--bg-3); }
.preset-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.preset-text b { font-size: 14px; font-weight: 620; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-text small { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-text small:empty { display: none; }
.preset-trigger[data-custom] .preset-text b { color: var(--text-2); font-weight: 560; }
.preset-trigger .chev { color: var(--text-3); flex-shrink: 0; }
.preset-pop {
  position: absolute; left: 0; right: 0; top: calc(100% - 10px); z-index: 60; display: flex; flex-direction: column;
  max-height: min(468px, 68vh); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-3);
  box-shadow: var(--shadow-4); overflow: hidden; animation: pop-in var(--t-base) var(--ease-out); transform-origin: top center;
}
.preset-pop-head { display: none; }
.preset-search { position: relative; display: flex; align-items: center; padding: 8px; border-bottom: 1px solid var(--line-2); flex-shrink: 0; }
.preset-search > .icon { position: absolute; left: 19px; color: var(--text-3); pointer-events: none; }
.preset-search .input { padding-left: 34px; padding-right: 76px; }
.preset-search .input::-webkit-search-cancel-button { display: none; }
.preset-count { position: absolute; right: 19px; font-size: var(--fs-tiny); color: var(--text-3); font-variant-numeric: tabular-nums; pointer-events: none; }
.preset-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 6px 6px; outline: none; scroll-padding: 34px 0 6px; }
.preset-group {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: baseline; gap: 8px; padding: 10px 8px 5px; margin: 0 -6px;
  padding-left: 14px; padding-right: 14px; background: var(--surface); font-size: 11px; font-weight: 650; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-3); box-shadow: 0 1px 0 var(--line-1); margin-bottom: 2px;
}
.preset-group small { margin-left: auto; font-weight: 500; letter-spacing: 0; font-variant-numeric: tabular-nums; color: var(--text-4); }
:root[data-theme='light'] .preset-group small { color: var(--text-3); }
.preset-option {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 10px; border-radius: var(--r-sm); cursor: pointer;
  font-size: var(--fs-small); color: var(--text-1); user-select: none;
}
.preset-option .t { font-weight: 560; font-variant-numeric: tabular-nums; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-option .s { margin-left: auto; font-size: 11.5px; color: var(--text-3); white-space: nowrap; flex-shrink: 0; }
.preset-option .check { flex-shrink: 0; color: var(--accent); visibility: hidden; }
.preset-option[data-current] .check { visibility: visible; }
.preset-option[data-current] .t { color: var(--accent); }
.preset-option[data-active] { background: var(--accent-soft); }
.preset-option[data-active] .s { color: var(--text-2); }
.preset-none { padding: 18px 12px; font-size: var(--fs-small); color: var(--text-3); text-align: center; }
.preset-foot { display: flex; gap: 14px; padding: 7px 12px; border-top: 1px solid var(--line-1); font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.preset-foot kbd { margin-right: 3px; }
.preset-backdrop { position: fixed; inset: 0; z-index: 90; background: rgb(0 0 0 / 0.45); animation: fade-in var(--t-base) var(--ease-out); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
@media (max-width: 720px) {
  .preset-pop {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 91; max-height: 78vh; height: 78vh;
    border-radius: 16px 16px 0 0; border-bottom: 0; animation: sheet-in var(--t-slow) var(--ease-out);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .preset-pop-head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 6px 16px; flex-shrink: 0; }
  .preset-pop-head::before { content: ''; position: absolute; top: 6px; left: 50%; translate: -50% 0; width: 36px; height: 4px; border-radius: 4px; background: var(--line-3); }
  .preset-pop-head b { font-size: 15px; font-weight: 650; }
  .preset-pop-head small { color: var(--text-3); font-size: var(--fs-tiny); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .preset-close { margin-left: auto; }
  .preset-search { border-bottom-color: var(--line-1); }
  .preset-search .input { height: 40px; font-size: 16px; }
  .preset-option { min-height: 44px; font-size: 14px; }
  .preset-foot { display: none; }
}

/* Downloads */
.downloads { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dl {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-lg); border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text-1); min-width: 0; transition: border-color var(--t-fast), background var(--t-fast);
}
:root[data-theme='light'] .dl { background: var(--surface); }
.dl:hover { border-color: var(--line-4); text-decoration: none; background: var(--bg-4); }
:root[data-theme='light'] .dl:hover { background: var(--bg-3); }
.dl .ext { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-5); color: var(--text-2); flex-shrink: 0; }
.dl[data-kind='code'] .ext { color: var(--iris); background: color-mix(in srgb, var(--iris) 10%, transparent); }
.dl[data-kind='bundle'] .ext { color: var(--amber); background: color-mix(in srgb, var(--amber) 11%, transparent); }
.dl b { display: block; font-size: var(--fs-small); font-weight: 620; }
.dl small { display: block; font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl > span { min-width: 0; }
.dl[aria-disabled='true'] { opacity: 0.5; pointer-events: none; }
.dl-note { font-size: var(--fs-tiny); color: var(--text-3); margin-top: 10px; display: flex; gap: 6px; align-items: flex-start; }
.open-steve { margin-bottom: 10px; }

/* Publisher card */
.publisher-card { display: flex; align-items: center; gap: 12px; }
.publisher-card b { display: block; font-weight: 620; }
.publisher-card small { color: var(--text-3); font-size: var(--fs-tiny); }
.publisher-card .btn { margin-left: auto; }

/* Tabs (in-page sections: About, Code, README, Versions) */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); margin-bottom: 0; overflow-x: auto; scrollbar-width: none; }
.tabs [role='tab'] {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 14px; color: var(--text-3);
  font-weight: 560; font-size: var(--fs-small); white-space: nowrap; border-radius: var(--r-md) var(--r-md) 0 0;
}
.tabs [role='tab']:hover { color: var(--text-1); }
.tabs [role='tab'][aria-selected='true'] { color: var(--text-1); }
.tabs [role='tab'][aria-selected='true']::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tabs .count { font-size: 11px; color: var(--text-3); background: var(--bg-4); padding: 1px 6px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.tab-panel { padding-top: 18px; }
.tab-panel:focus-visible { outline: none; }

/* Code viewer (templates/_code_view.html, static/codeview.js; Studio's code colours) */
.codeview { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.file-tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
  padding: 2px; margin: 0 -2px;
}
.file-tabs::-webkit-scrollbar { display: none; }
.file-tabs [role='tab'] {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: var(--r-md);
  border: 1px solid var(--line-2); background: var(--surface-1, var(--bg-2)); color: var(--text-2); white-space: nowrap;
  font-family: var(--font-mono); font-size: 12.5px; scroll-snap-align: start; transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.file-tabs [role='tab'] .icon { color: var(--text-3); }
.file-tabs [role='tab']:hover { color: var(--text-1); background: var(--bg-4); }
.file-tabs [role='tab'][aria-selected='true'] { color: var(--text-1); border-color: var(--accent); background: var(--accent-soft); }
.file-tabs [role='tab'][aria-selected='true'] .icon { color: var(--accent); }
.file-tabs [role='tab']:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.code {
  position: relative; border-radius: var(--r-xl); border: 1px solid var(--line-2); background: var(--code-bg); overflow: clip; box-shadow: var(--shadow-1);
}
.code[hidden] { display: none; }
/* The header stays in view while a long file scrolls by (below the site's top bar). */
.code-bar {
  position: sticky; top: var(--topbar-h); z-index: 2; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 6px 4px 12px;
  border-bottom: 1px solid var(--line-1); background: var(--code-gutter); font-size: var(--fs-small);
}
.code-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.code-title .icon { flex-shrink: 0; color: var(--text-3); }
.code-bar .name { flex-shrink: 0; font-family: var(--font-mono); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.code-bar .meta { min-width: 0; }
.code-bar .meta { color: var(--text-3); font-size: var(--fs-tiny); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-bar .actions { margin-left: auto; display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.code-bar .btn[aria-pressed='true'] { color: var(--accent); background: var(--accent-soft); }
.code-bar .btn[data-copied] { color: var(--success, var(--accent)); }
.code-seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--r-md); background: var(--bg-3); border: 1px solid var(--line-2); margin-right: 4px; }
.code-seg button { height: 24px; padding: 0 9px; border-radius: 5px; font-size: 12px; color: var(--text-2); }
.code-seg button[aria-pressed='true'] { background: var(--bg-5); color: var(--text-1); box-shadow: var(--shadow-1); }
.code-scroll {
  overflow: auto; max-height: min(72vh, 760px); overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: var(--line-4) transparent;
}
.code-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.code-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.code-scroll::-webkit-scrollbar-thumb { background: var(--line-4); border-radius: 10px; border: 2px solid var(--code-bg); }
.code-scroll::-webkit-scrollbar-corner { background: transparent; }
/* A line runs past the right edge: a fade there says the code scrolls sideways. */
.code[data-more]::after {
  content: ''; position: absolute; top: 45px; right: 0; bottom: 0; width: 28px; pointer-events: none; z-index: 1;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--code-bg) 92%, transparent));
}
.code-scroll table { border-collapse: collapse; width: max-content; min-width: 100%; font-family: var(--font-mono); font-size: 13px; line-height: 1.6; }
.code-scroll td { padding: 0; vertical-align: top; }
.code-scroll td.ln {
  position: sticky; left: 0; z-index: 1; width: 1%; min-width: 2.6em; padding: 0 10px 0 8px; text-align: right; color: var(--text-4);
  user-select: none; background: var(--code-gutter); font-variant-numeric: tabular-nums; font-size: 12px; border-right: 1px solid var(--line-1);
}
:root[data-theme='light'] .code-scroll td.ln { color: #a2acb2; }
.code-scroll td.src { padding: 0 16px 0 12px; white-space: pre; color: var(--tok-prop); tab-size: 4; }
.codeview[data-wrap] .code-scroll table { width: 100%; table-layout: auto; }
.codeview[data-wrap] .code-scroll td.src { white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; }
.code-scroll tr:first-child td { padding-top: 10px; }
.code-scroll tr:last-child td { padding-bottom: 12px; }
.code-scroll tr:hover td.src { background: var(--code-line); }
.code-md { padding: 18px 22px 22px; max-width: none; }
.code-md pre { white-space: pre; }
.codeview[data-wrap] .code-md pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.tok-kw { color: var(--tok-kw); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-fn { color: var(--tok-fn); }
.tok-cm { color: var(--tok-cm); font-style: italic; }
.tok-bi { color: var(--tok-bi); }
.tok-dec { color: var(--tok-dec); }
.tok-prop { color: var(--tok-prop); }
.tok-op { color: var(--tok-op); }
pre.block { margin: 0; padding: 14px 16px; border-radius: var(--r-lg); background: var(--code-bg); border: 1px solid var(--line-2); font-size: 12.5px; line-height: 1.6; overflow: auto; color: var(--tok-prop); }
pre.log { max-height: 420px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }

/* Rendered README (sanitized Markdown) */
.md { font-size: 15px; line-height: 1.7; color: var(--text-2); max-width: 820px; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h3, .md h4, .md h5, .md h6 { color: var(--text-1); margin: 26px 0 8px; }
.md h3 { font-size: 20px; } .md h4 { font-size: 17px; } .md h5, .md h6 { font-size: 15px; }
.md p, .md ul, .md ol, .md blockquote, .md table, .md pre { margin: 12px 0; }
.md ul, .md ol { padding-left: 22px; }
.md blockquote { padding: 2px 16px; border-left: 3px solid var(--line-3); color: var(--text-3); }
.md pre { padding: 14px 16px; border-radius: var(--r-lg); background: var(--code-bg); border: 1px solid var(--line-2); overflow: auto; font-size: 12.5px; color: var(--tok-prop); }
.md pre code { background: none; border: 0; padding: 0; }
.md table { border-collapse: collapse; display: block; overflow: auto; font-size: var(--fs-small); }
.md th, .md td { border: 1px solid var(--line-2); padding: 6px 10px; text-align: left; }
.md th { background: var(--surface-2); color: var(--text-1); }
.md hr { border: 0; border-top: 1px solid var(--line-2); margin: 24px 0; }
.md .md-image { display: inline-flex; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); font-size: var(--fs-small); border: 1px dashed var(--line-3); }
.about-text { white-space: pre-line; color: var(--text-2); font-size: 15px; line-height: 1.7; max-width: 820px; }

/* Versions timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding-bottom: 18px; }
.timeline li::before { content: ''; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--line-2); }
.timeline li:last-child::before { display: none; }
.timeline .node { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 2px solid var(--line-3); margin-top: 1px; }
.timeline li[data-current] .node { border-color: var(--accent); background: var(--accent-soft); }
.timeline li[data-current] .node::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline .head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.timeline .head a { font-family: var(--font-mono); font-weight: 650; font-size: 13.5px; color: var(--text-1); }
.timeline .head time { font-size: var(--fs-tiny); color: var(--text-3); }
.timeline .changes { margin-top: 5px; font-size: var(--fs-small); color: var(--text-2); white-space: pre-line; }
.compact-versions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.compact-versions li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line-1); font-size: var(--fs-small); }
.compact-versions li:first-child { border-top: 0; padding-top: 0; }
.compact-versions a { font-family: var(--font-mono); font-weight: 600; color: var(--text-1); }
.compact-versions li[data-current] a { color: var(--accent); }
.compact-versions time { margin-left: auto; color: var(--text-3); font-size: var(--fs-tiny); }

.check-card .verdict { display: flex; align-items: center; gap: 10px; }
.check-card .verdict .ok { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
.check-card .verdict b { display: block; font-size: var(--fs-small); }
.check-card .verdict small { color: var(--text-3); font-size: var(--fs-tiny); }

details.disclosure > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: var(--fs-small); font-weight: 550; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .chev { transition: transform var(--t-base) var(--ease-out); color: var(--text-3); }
details.disclosure[open] > summary .chev { transform: rotate(90deg); }
details.disclosure > summary:hover { color: var(--text-1); }
details.disclosure .inside { margin-top: 12px; }

/* Request removal */
.removal-row { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-small); }
.removal-row > .icon { color: var(--text-3); margin-top: 2px; }
.removal-row a { font-weight: 600; }
.removal-row small { display: block; color: var(--text-3); font-size: var(--fs-tiny); margin-top: 2px; }
.case-line { display: inline-flex; gap: 8px; align-items: center; font-size: var(--fs-small); color: var(--text-2); padding: 6px 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line-2); }
.case-line code { background: none; border: 0; padding: 0; }

/* Publisher and account ---------------------------------------------------------------------------------------- */
.profile-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 24px; border-radius: var(--r-xl); border: 1px solid var(--line-2); background: radial-gradient(70% 160% at 100% 0%, var(--accent-softer), transparent 60%), var(--surface); box-shadow: var(--shadow-1); margin-bottom: 28px; }
.profile-head h1 { font-size: 26px; }
.profile-head p { color: var(--text-3); font-size: var(--fs-small); margin-top: 4px; }
.profile-stats { margin-left: auto; display: flex; gap: 28px; }
.profile-stats div { display: flex; flex-direction: column; align-items: flex-end; }
.profile-stats b { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.profile-stats span { font-size: var(--fs-tiny); color: var(--text-3); }
.narrow { max-width: 560px; margin: 0 auto; }
.settings-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 10px; border-radius: var(--r-md); color: var(--text-2); font-size: var(--fs-small); font-weight: 550; }
.settings-nav a:hover { background: var(--bg-4); color: var(--text-1); text-decoration: none; }
:root[data-theme='light'] .settings-nav a:hover { background: var(--bg-3); }
.settings-nav a[aria-current='true'] { background: var(--accent-soft); color: var(--text-1); }
.settings-nav a[aria-current='true'] .icon { color: var(--accent); }
.set-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line-1); }
.set-row:first-child { border-top: 0; padding-top: 0; }
.set-row .label { flex: 1; min-width: 0; }
.set-row .label b { display: block; font-size: var(--fs-small); font-weight: 600; }
.set-row .label small { display: block; color: var(--text-3); font-size: var(--fs-tiny); margin-top: 2px; }

/* My parts */
.nowrap { white-space: nowrap; }

/* Publish from a script */
.code-snippet { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.snippet-bar { display: flex; align-items: center; justify-content: space-between; font-size: var(--fs-tiny); font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.code-snippet pre.block { white-space: pre; }

/* Account: API tokens */
.token-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.token-form .grow { flex: 1 1 220px; }
.token-form .select { width: 150px; }
.token-reveal { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: var(--r-md); background: var(--code-bg); border: 1px solid var(--line-2); }
.token-reveal code { flex: 1; min-width: 0; background: none; border: 0; padding: 0; font-size: 12.5px; color: var(--text-1); overflow-wrap: anywhere; user-select: all; }
.token-list { list-style: none; margin: 4px 0 0; padding: 0; }
.token-list > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-1); }
.token-list .tk-icon { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-3); }
.token-list .tk-main { flex: 1; min-width: 0; }
.token-list .tk-main b { font-size: var(--fs-small); font-weight: 600; overflow-wrap: anywhere; }
.token-list .tk-main small { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 2px; color: var(--text-3); font-size: var(--fs-tiny); }
.token-list form { margin: 0; flex-shrink: 0; }

.mypart { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 0; overflow: hidden; }
.mypart .thumb { height: 100%; aspect-ratio: auto; min-height: 126px; border-right: 1px solid var(--line-1); }
.mypart .main { padding: 16px 18px; min-width: 0; }
.mypart .top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mypart .top h2 { font-size: 16px; }
.mypart .top h2 a { color: var(--text-1); }
.mypart .top .stats { margin-left: auto; display: flex; gap: 14px; font-size: var(--fs-tiny); color: var(--text-3); font-variant-numeric: tabular-nums; }
.mypart .top .stats span { display: inline-flex; align-items: center; gap: 4px; }
.mypart .top .stats .icon { width: 13px; height: 13px; }
.mypart .sum { color: var(--text-2); font-size: var(--fs-small); margin-top: 3px; }
.vtable { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: var(--fs-small); }
.vtable th { text-align: left; font-size: 11px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); padding: 0 10px 6px 0; }
.vtable td { padding: 8px 10px 8px 0; border-top: 1px solid var(--line-1); vertical-align: middle; }
.vtable td:last-child { text-align: right; padding-right: 0; }
.vtable .v { font-family: var(--font-mono); font-weight: 650; color: var(--text-1); }
.vtable .err { display: block; color: var(--danger); font-size: var(--fs-tiny); margin-top: 3px; max-width: 520px; }
.vtable form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.vtable .input { height: 28px; width: 160px; font-size: var(--fs-tiny); }
.mypart + .mypart { margin-top: 14px; }

/* Publish */
.publish-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.steps-nav { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.steps-nav span { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-small); color: var(--text-3); font-weight: 550; }
.steps-nav i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--bg-4); color: var(--text-2); border: 1px solid var(--line-2); }
.steps-nav span[data-active] { color: var(--text-1); }
.steps-nav span[data-active] i { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.steps-nav span[data-done] i { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.steps-nav .line { width: 28px; height: 1px; background: var(--line-3); align-self: center; }
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  min-height: 210px; padding: 28px; border-radius: var(--r-xl); border: 1.5px dashed var(--line-4); background: var(--surface-2);
  color: var(--text-2); transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-base);
}
:root[data-theme='light'] .dropzone { background: var(--bg-1); }
.dropzone[data-over] { border-color: var(--accent); background: var(--accent-softer); box-shadow: 0 0 0 4px var(--accent-soft); }
.dropzone .big { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; color: var(--accent); background: var(--accent-softer); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.dropzone b { color: var(--text-1); font-size: 15px; }
.dropzone small { color: var(--text-3); font-size: var(--fs-tiny); }
.dropzone .pickers { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.file-inputs { display: flex; flex-direction: column; gap: 12px; }
.filelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.filelist li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-2); font-size: var(--fs-small); }
.filelist li .icon:first-child { color: var(--text-3); }
.filelist li code { background: none; border: 0; padding: 0; font-weight: 600; }
.filelist li small { margin-left: auto; color: var(--text-3); font-variant-numeric: tabular-nums; }
.filelist li[data-state='ok'] .state { color: var(--success); }
.filelist li[data-state='bad'] { border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.filelist li[data-state='bad'] .state { color: var(--danger); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-small); color: var(--text-2); }
.checklist li { display: flex; gap: 8px; align-items: center; }
.checklist li .icon { color: var(--text-4); }
.checklist li[data-ok] { color: var(--text-1); }
.checklist li[data-ok] .icon { color: var(--success); }
.card.disclosure .inside { margin-top: 0; padding-top: 0; }
.next-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.next-steps li { display: flex; gap: 12px; align-items: flex-start; }
.next-steps .step-icon { margin: 0; width: 32px; height: 32px; flex-shrink: 0; }
.next-steps b { font-size: var(--fs-small); font-weight: 620; }
.next-steps p { font-size: var(--fs-small); color: var(--text-2); margin-top: 2px; }
.help-list { margin: 0; padding-left: 18px; color: var(--text-2); font-size: var(--fs-small); display: flex; flex-direction: column; gap: 6px; }

/* Admin */
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.tile { padding: 16px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-1); }
.tile span { font-size: var(--fs-tiny); color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.tile b { display: block; font-size: 24px; font-weight: 650; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tile[data-attention] { border-color: color-mix(in srgb, var(--warning) 40%, transparent); }
.tile[data-attention] b { color: var(--warning); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.table th { text-align: left; font-size: 11px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); padding: 0 12px 8px 0; }
.table td { padding: 10px 12px 10px 0; border-top: 1px solid var(--line-1); vertical-align: top; }
.table td.mono, .table .mono { font-size: 12px; color: var(--text-2); }
.table-scroll { overflow-x: auto; position: relative; }
.inline-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.inline-form .input { height: 30px; font-size: var(--fs-small); min-width: 120px; }
.admin-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }

/* Error pages */
.status-page { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 88px 16px 72px; gap: 14px; }
.status-code { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: 0.1em; }
.status-page h1 { font-size: 34px; letter-spacing: -0.025em; }
.status-page p { color: var(--text-2); max-width: 520px; font-size: 15px; }
.status-page .row-wrap { justify-content: center; margin-top: 8px; }
.status-art { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 22px; color: var(--accent); background: var(--accent-softer); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); margin-bottom: 6px; }
.status-art[data-tone='danger'] { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.status-art[data-tone='warning'] { color: var(--warning); background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.status-page .findings { text-align: left; max-width: 640px; margin-top: 6px; }

/* Responsive ------------------------------------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .part-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .grid.cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 44px; padding-bottom: 80px; }
  .showcase { max-width: 620px; }
  .part-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "viewer" "side" "main"; grid-template-rows: auto; }
  .publish-layout, .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .part-side { position: static; }
  .search-layout { grid-template-columns: minmax(0, 1fr); }
  .facets { position: static; max-height: none; display: none; }
  .facets[data-open] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 16px; border-radius: var(--r-xl); border: 1px solid var(--line-2); background: var(--surface); margin-bottom: 18px; }
  .filters-toggle { display: inline-flex; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
  .topnav { display: none; }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; --fs-h1: 24px; --topbar-h: 56px; }
  .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 10px; }
  .topsearch { order: 3; flex-basis: 100%; max-width: none; }
  .topsearch kbd { display: none; }
  .topactions { margin-left: auto; }
  .topactions .publish-btn span { display: none; }
  .topactions .publish-btn { width: 34px; padding: 0; }
  .grid, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .pcard .summary { display: none; }
  .pcard .text { padding: 9px 10px 10px; }
  .pcard .title { font-size: 13px; }
  .pcard .title .owner { display: none; }
  .pcard .chips { top: 10px; left: 10px; right: 10px; }
  .pcard .chips .lic { display: none; }
  .pcard .meta { gap: 8px; }
  .pcard .meta .star-count, .pcard .meta .when { display: none; }
  .hero h1 { font-size: 36px; }
  .hero .lead { font-size: 15px; }
  .searchbox .input { padding-right: 16px; }
  .searchbox .btn { display: none; }
  .showcase-code { width: 100%; }
  .showcase-code pre { font-size: 11px; }
  .showcase-render { width: 62%; right: -4px; bottom: -48px; }
  .showcase-params { display: none; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .cta-band { padding: 20px; }
  .cta-band .actions { margin-left: 0; }
  .section { margin-top: 36px; }
  .section-head { flex-wrap: wrap; }
  .part-head { padding-top: 16px; }
  .part-title { min-width: 0; }
  .part-title h1 { font-size: 24px; }
  .part-actions { width: 100%; }
  .part-actions .btn-primary { flex: 1; }
  .viewer { height: 340px; }
  .viewer-hint { display: none; }
  .view-cube { top: 6px; right: 0; transform: scale(0.78); transform-origin: top right; }
  .vc-controls { display: none; }
  /* The tools run in one row along the top, left of the cube, so they stay clear of the section strip; the label goes under them. */
  .viewer-tools { top: 8px; left: 8px; right: auto; flex-direction: row; }
  .viewer-tools .sep { width: 1px; height: auto; margin: 4px 2px; }
  .view-menu { top: 48px; left: 8px; right: auto; }
  .viewer-label { top: 50px; }
  .triad { transform: scale(0.8); transform-origin: bottom left; }
  /* Phones: the section panel is one row under the model, as Studio's phone ExplodeStrip (phone/Phone.module.css):
     the model's canvas shrinks to make room rather than hide under it. Plane normal, offset slider, flip, close. */
  .viewer[data-section] canvas { height: calc(100% - 56px); }
  .viewer[data-section] .triad { bottom: 66px; }
  .section-panel {
    left: 0; right: 0; bottom: 0; width: auto; min-height: 56px; flex-direction: row; align-items: center; gap: 6px;
    padding: 0 max(2px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); border: 0; border-top: 1px solid var(--line-2);
    border-radius: 0; background: var(--bg-1); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  :root[data-theme='light'] .section-panel { background: var(--bg-1); }
  .sp-head, .sp-row { display: contents; }
  .sp-head b, .sp-row > span, .sp-num, .sp-hint, .sp-flip-label { display: none; }
  .sp-head > .icon { order: 0; flex-shrink: 0; color: var(--ws); }
  .sp-seg { order: 1; flex-shrink: 0; }
  .sp-slider { order: 2; flex: 1; min-width: 0; padding: 10px 6px; }
  .section-panel .btn[data-section='flip'] { order: 3; }
  .section-panel .btn[data-section='flip'], .sp-head .icon-btn { flex-shrink: 0; width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; margin: 0; align-self: center; }
  .sp-head .icon-btn { order: 4; }
  .downloads { grid-template-columns: 1fr 1fr; }
  .facets[data-open] { grid-template-columns: minmax(0, 1fr); }
  .results-bar .sort { margin-left: 0; width: 100%; }
  .results-bar .sort .select { flex: 1; }
  .profile-head { padding: 18px; }
  .profile-stats { margin-left: 0; width: 100%; justify-content: space-between; }
  .profile-stats div { align-items: flex-start; }
  .mypart { grid-template-columns: minmax(0, 1fr); }
  .mypart .thumb { min-height: 0; aspect-ratio: 16 / 9; border-right: 0; border-bottom: 1px solid var(--line-1); }
  .vtable th:nth-child(3), .vtable td:nth-child(3) { display: none; }
  .vtable form .input { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-inner > div:first-child { grid-column: 1 / -1; }
  .page-head .actions { margin-left: 0; }
  .stat-tiles { gap: 10px; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
  .code-bar .meta { display: none; }
  .code-bar { padding: 4px 2px 4px 10px; }
  .code-bar .actions .lbl { display: none; }
  .code-bar .actions .btn { width: 34px; padding: 0; justify-content: center; }
  .code-scroll table { font-size: 12.5px; line-height: 1.55; }
  .code-scroll td.ln { min-width: 2.2em; padding: 0 6px 0 4px; font-size: 11px; }
  .code-scroll td.src { padding: 0 10px 0 8px; }
  .code-md { padding: 14px 14px 18px; font-size: 14.5px; }
  .status-page { padding-top: 56px; }
}
@media (max-width: 380px) {
  .wordmark { letter-spacing: 0.14em; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
.tile b small { font-size: 13px; font-weight: 500; letter-spacing: 0; }
#publish-form .row { flex-wrap: wrap; }
.vtable .field-hint { display: block; margin-top: 3px; }
@media (max-width: 720px) { #publish-form .row .btn { width: 100%; } .steps-nav .line { display: none; } }

/* Takedowns: policy pages, removal forms, case pages, moderation (takedown_pages.py) ---------------------------------- */
/* Long-form legal pages: a sticky "On this page" list beside the text */
.doc-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.doc-toc { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; gap: 2px; }
.doc-toc .caps { padding: 0 10px 6px; }
.doc-toc a { display: flex; align-items: center; gap: 9px; min-height: 32px; padding: 4px 10px; border-radius: var(--r-md); color: var(--text-2); font-size: var(--fs-small); font-weight: 550; }
.doc-toc a:hover { background: var(--bg-4); color: var(--text-1); text-decoration: none; }
:root[data-theme='light'] .doc-toc a:hover { background: var(--bg-3); }
.doc-toc a .icon { color: var(--text-3); }
.doc-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: var(--fs-small); color: var(--text-3); margin-top: 10px; }
.doc-meta span { display: inline-flex; align-items: center; gap: 6px; }
.prose h2[id] { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.prose ol { padding-left: 22px; margin: 10px 0; }
.prose strong { color: var(--text-1); font-weight: 620; }
.prose .alert, .prose .card, .prose .statement { margin: 16px 0; }
.prose .alert { font-size: var(--fs-small); line-height: 1.55; }
.prose .next-steps { margin: 14px 0; }
.prose .next-steps li { margin: 0; }
.prose .next-steps p { margin: 3px 0 0; font-size: var(--fs-small); line-height: 1.55; }
.prose .next-steps b { font-size: 14px; color: var(--text-1); }
.prose .card p, .prose .alert p { margin: 0; }
.prose .actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 6px; }

/* The statutory statements: quoted word for word, set apart and easy to read */
.statement {
  margin: 0; padding: 12px 16px; border-radius: var(--r-lg); border: 1px solid var(--line-2); border-left: 3px solid var(--accent);
  background: var(--surface-2); color: var(--text-1); font-size: 14.5px; line-height: 1.65; quotes: none;
}
:root[data-theme='light'] .statement { background: var(--bg-1); }
.statement cite { display: block; margin-top: 6px; font-style: normal; font-size: var(--fs-tiny); color: var(--text-3); letter-spacing: 0.02em; }
.req-list { list-style: none; counter-reset: req; margin: 14px 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.req-list > li { counter-increment: req; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; align-items: start; margin: 0; }
.req-list > li::before { content: counter(req); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-softer); border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); }
.req-list > li > div { min-width: 0; display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }
.req-list .statement { margin: 2px 0 0; font-size: 14px; }

/* Forms with numbered sections */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.form-side { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; gap: 14px; }
.form-side .card + .card { margin-top: 0; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-stack .card + .card { margin-top: 0; }
.sec-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 11px; font-weight: 700; background: var(--bg-4); color: var(--text-2); border: 1px solid var(--line-2); }
.card-head .sec-n + h2 { margin-left: 0; }
.card-head p { flex-basis: 100%; }
.sec-intro { font-size: var(--fs-small); color: var(--text-2); margin: 0 0 14px; max-width: 640px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.fields .wide { grid-column: 1 / -1; }
.field-label .req { color: var(--text-3); font-weight: 450; font-size: var(--fs-tiny); margin-left: auto; }
.field-label .req[data-required] { color: var(--accent); }
.textarea[aria-invalid='true'], .select[aria-invalid='true'] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.textarea.mono { font-family: var(--font-mono); font-size: 12.5px; }
.field-error { display: flex; gap: 6px; align-items: flex-start; }
.field-error .icon { margin-top: 2px; }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-actions .field-hint { flex: 1; min-width: 220px; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.error-summary ul { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.error-summary a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* Choices: radio or link cards (request type, relationship, category) */
.choices { display: grid; gap: 8px; }
.choices.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-1); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-base); }
:root[data-theme='light'] .choice { background: var(--surface); }
.choice:hover { border-color: var(--line-4); text-decoration: none; }
.choice input[type='radio'], .choice input[type='checkbox'] { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.choice b { display: block; font-size: var(--fs-small); font-weight: 620; }
.choice small { display: block; color: var(--text-3); font-size: var(--fs-tiny); margin-top: 2px; line-height: 1.45; }
.choice:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: var(--accent-softer); box-shadow: 0 0 0 3px var(--accent-softer); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice[aria-invalid='true'] { border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.choice-big { flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--r-xl); box-shadow: var(--shadow-1); }
.choice-big:hover { box-shadow: var(--shadow-2); }
.choice-big h2 { font-size: 17px; }
.choice-big p { color: var(--text-2); font-size: var(--fs-small); }
.choice-big ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: var(--fs-small); display: flex; flex-direction: column; gap: 4px; }
.choice-big .go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: var(--fs-small); color: var(--link); }
.choice-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--accent); background: var(--accent-softer); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.choice-icon[data-tone='iris'] { color: var(--iris); background: color-mix(in srgb, var(--iris) 9%, transparent); border-color: color-mix(in srgb, var(--iris) 24%, transparent); }

/* Attestations: a checkbox and the statement it confirms */
.attest { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
:root[data-theme='light'] .attest { background: var(--bg-1); }
.attest input { width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--accent); }
.attest .text { font-size: 14.5px; line-height: 1.65; color: var(--text-1); }
.attest cite { display: block; margin-top: 6px; font-style: normal; font-size: var(--fs-tiny); color: var(--text-3); }
.attest:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-softer); }
.attest:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.attest[aria-invalid='true'] { border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.attest + .attest { margin-top: 10px; }
.signature .input { font-size: 16px; height: 42px; }

/* Case pages */
.case-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.case-head h1 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.case-head h1 .no { font-family: var(--font-mono); font-weight: 600; color: var(--text-3); font-size: 0.8em; letter-spacing: 0; }
.case-head .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.case-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.case-head .filed { font-size: var(--fs-small); color: var(--text-3); }
.case-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.case-main, .case-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.case-main .card + .card, .case-side .card + .card { margin-top: 0; }
.case-alert { margin-bottom: 18px; }
.case-alert .body > span { color: var(--text-2); }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px 16px; font-size: var(--fs-small); margin: 0; }
.facts dt { color: var(--text-3); }
.facts dd { margin: 0; color: var(--text-1); text-align: right; overflow-wrap: anywhere; }
.facts dd.pre, .pre-line { white-space: pre-line; }
/* A notice or counter-notice as submitted: labels above values, line breaks kept */
.record { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 0; margin: 0; font-size: var(--fs-small); }
.record dt, .record dd { padding: 10px 0; border-top: 1px solid var(--line-1); }
.record dt:first-of-type, .record dd:first-of-type { border-top: 0; padding-top: 0; }
.record dt { color: var(--text-3); padding-right: 16px; }
.record dd { margin: 0; color: var(--text-1); white-space: pre-line; overflow-wrap: anywhere; min-width: 0; }
.record dd .statement { white-space: normal; font-size: 13.5px; }
.record dd .statement + .statement { margin-top: 8px; }
.record dd code { white-space: normal; overflow-wrap: anywhere; }
.url-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; white-space: normal; }
.items { list-style: none; margin: 0; padding: 0; }
.items li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line-1); font-size: var(--fs-small); }
.items li:first-child { border-top: 0; padding-top: 0; }
.items li:last-child { padding-bottom: 0; }
.items .ref { font-family: var(--font-mono); font-weight: 600; color: var(--text-1); overflow-wrap: anywhere; min-width: 0; }
.items .ref .at { color: var(--text-3); font-weight: 500; }
.items .badge { margin-left: auto; }
.items small { flex-basis: 100%; color: var(--text-3); font-size: var(--fs-tiny); }

/* The case's progress (status pages) and the moderation log */
.steps-line { list-style: none; margin: 0; padding: 0; }
.steps-line li { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; }
.steps-line li:last-child { padding-bottom: 0; }
.steps-line li::before { content: ''; position: absolute; left: 10px; top: 24px; bottom: 2px; width: 2px; background: var(--line-2); }
.steps-line li:last-child::before { display: none; }
.steps-line .node { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 2px solid var(--line-3); color: var(--text-3); }
.steps-line .node .icon { width: 12px; height: 12px; stroke-width: 2.6; }
.steps-line li[data-state='done'] .node { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: var(--accent-soft); color: var(--accent); }
.steps-line li[data-state='current'] .node { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px var(--accent-softer); }
.steps-line li[data-tone='warning'] .node { border-color: var(--warning); background: var(--warning-soft); color: var(--warning); box-shadow: none; }
.steps-line li[data-tone='danger'] .node { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.steps-line li[data-state='upcoming'] .node { border-style: dashed; background: transparent; }
.steps-line b { display: block; font-size: var(--fs-small); font-weight: 620; color: var(--text-1); }
.steps-line li[data-state='upcoming'] b { color: var(--text-2); font-weight: 550; }
.steps-line time, .steps-line small { display: block; font-size: var(--fs-tiny); color: var(--text-3); margin-top: 1px; }
.steps-line p { font-size: var(--fs-small); color: var(--text-2); margin-top: 4px; }
.steps-line .detail { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-tiny); color: var(--text-2); }
.steps-line .detail span { overflow-wrap: anywhere; white-space: pre-line; }
.steps-line .detail em { font-style: normal; color: var(--text-3); }
.steps-line .who { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Strikes: x of y, as a small meter */
.strikes { display: flex; align-items: center; gap: 10px; font-size: var(--fs-small); }
.strikes .pips { display: inline-flex; gap: 4px; }
.strikes .pips i { width: 18px; height: 6px; border-radius: 99px; background: var(--bg-5); }
.strikes .pips i[data-on] { background: var(--warning); }
.strikes[data-tone='danger'] .pips i[data-on] { background: var(--danger); }
.strikes b { font-variant-numeric: tabular-nums; }

/* DNS record to add (verification) */
.dns-record { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 0; border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; font-size: var(--fs-small); }
.dns-record > * { padding: 10px 12px; border-top: 1px solid var(--line-1); display: flex; align-items: center; min-width: 0; }
.dns-record > :nth-child(-n+3) { border-top: 0; }
.dns-record .k { color: var(--text-3); background: var(--surface-2); }
.dns-record code { background: none; border: 0; padding: 0; font-size: 12.5px; overflow-wrap: anywhere; color: var(--text-1); }
.dns-record .c { justify-content: flex-end; padding: 6px 8px; }

/* Part page: trust and notices */
.display-title { margin-top: 6px; font-size: 15px; font-weight: 600; color: var(--text-1); }
.part-notices { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.part-notice { display: inline-flex; align-items: flex-start; gap: 8px; align-self: flex-start; max-width: 100%; padding: 6px 12px; border-radius: var(--r-md); font-size: var(--fs-small); color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line-2); }
.part-notice .icon { color: var(--text-3); margin-top: 2px; }

/* My parts: removal cases */
.cases-card .card-body { padding-top: 10px; }
.case-ref { font-family: var(--font-mono); font-weight: 650; color: var(--text-1); white-space: nowrap; }
.table .targets { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.table .stack-sm { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.table td .badge { vertical-align: middle; }
.filter-bar { display: flex; gap: 10px 16px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.mod-actions { display: flex; flex-direction: column; gap: 10px; }
.mod-actions .btn { justify-content: flex-start; white-space: normal; height: auto; min-height: var(--h); padding-top: 7px; padding-bottom: 7px; text-align: left; line-height: 1.35; }
.btn-danger-soft { color: var(--danger); }
.btn-danger-soft:hover:not(:disabled) { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.mod-actions .group { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line-1); }
.mod-actions .group:first-child { border-top: 0; padding-top: 0; }
.mod-actions .row { flex-wrap: wrap; }
.mod-actions .row .input { flex: 1; min-width: 140px; }
.code-mini { max-height: 320px; overflow: auto; }

.segmented .seg-link { position: relative; display: inline-flex; }
.segmented .seg-link:hover { text-decoration: none; }
.segmented .seg-link:hover span { color: var(--text-1); }
.segmented .seg-link[aria-current='page'] span { color: var(--text-1); background: var(--bg-4); border-color: var(--line-3); box-shadow: var(--shadow-1), var(--inset-hi); }
:root[data-theme='light'] .segmented .seg-link[aria-current='page'] span { background: var(--surface); }
fieldset.bare { border: 0; margin: 0; padding: 0; min-width: 0; }
.section-tight { margin-top: 16px; }
.error-summary { margin-bottom: 0; }

.narrow-wide { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.narrow-wide .card + .card { margin-top: 0; }
.status-page.compact { padding: 8px 0 8px; }
.case-links li { flex-wrap: wrap; }
.case-links .link-text { flex: 1; min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
.case-links .row { margin-left: auto; }

.narrow-wide.left { margin: 0; }
.items .push { margin-left: auto; }
a.tile-link { color: var(--text-1); transition: border-color var(--t-fast), box-shadow var(--t-base); }
a.tile-link:hover { text-decoration: none; border-color: var(--line-4); box-shadow: var(--shadow-2); }

@media (max-width: 1000px) {
  .doc-layout, .form-layout, .case-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line-1); }
  .doc-toc .caps { flex-basis: 100%; }
  .doc-toc a { min-height: 30px; font-size: var(--fs-tiny); padding: 3px 9px; border: 1px solid var(--line-2); border-radius: 99px; }
  .doc-toc a .icon { display: none; }
  .form-side { position: static; }
}
@media (max-width: 720px) {
  .fields, .choices.two { grid-template-columns: minmax(0, 1fr); }
  .record { grid-template-columns: minmax(0, 1fr); }
  .record dt { padding-bottom: 2px; }
  .record dd { border-top: 0; padding-top: 0; }
  .record dd:first-of-type { padding-top: 0; }
  .case-head .actions { margin-left: 0; }
  .statement, .attest .text { font-size: 14px; }
  .dns-record { grid-template-columns: minmax(0, 1fr) auto; }
  .dns-record .k { grid-column: 1 / -1; padding-bottom: 2px; background: none; border-top: 1px solid var(--line-1); font-size: var(--fs-tiny); }
  .dns-record > :nth-child(-n+3) { border-top: 0; }
  .dns-record > :first-child { border-top: 0; }
  .dns-record > :nth-child(2), .dns-record > :nth-child(3) { border-top: 0; }
  .token-form .field:not(.grow) { flex: 1 1 140px; }
  .token-form .select { width: 100%; }
  .token-list > li { align-items: flex-start; }
}

/* Materials (part page About card): a swatch, the material's name, its category, finish and density, and the mass */
.materials-info { display: flex; flex-direction: column; gap: 10px; }
.material-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.material-list li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.material-list .swatch { flex-shrink: 0; width: 26px; height: 26px; border-radius: 99px; box-shadow: 0 0 0 1px var(--line-2); }
.material-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.material-text b { font-size: var(--fs-small); font-weight: 600; color: var(--text-1); overflow-wrap: anywhere; }
.material-text small { font-size: 11.5px; color: var(--text-3); }
.material-ids summary { cursor: pointer; font-size: var(--fs-small); color: var(--text-1); padding: 3px 0; }
.material-ids summary small { color: var(--text-3); margin-left: 4px; }
.material-ids ul { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 3px; max-height: 240px; overflow: auto; }
.material-ids li { font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }
.material-ids li code { color: var(--text-1); }

/* Account → Content screen: refused and held uploads */
.screen-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.screen-list li { display: flex; flex-direction: column; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line-1); }
.screen-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.screen-list .inline-form { flex-wrap: wrap; }
.screen-list .inline-form .input { flex: 1 1 220px; }

/* Code first: the 3D view and the code side by side above the fold (stacked on narrower screens), the code's licence
   and attribution at its head. */
/* The part page: the model beside its parameters (change a value, see the part), then the code at the page's full width
   (a file as a code host shows one), then Overview and Versions. */
.part-hero { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 20px; align-items: start; margin-bottom: 24px; }
.part-hero .part-viewer { min-width: 0; grid-area: auto; }
.part-hero .part-side { grid-area: auto; }
.part-hero.solo { grid-template-columns: minmax(0, 1fr); }
.part-code { min-width: 0; margin-bottom: 24px; }
.part-code .code-scroll, .part-code .code-md { max-height: min(78vh, 960px); overflow: auto; }
.code-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 32px; font-size: var(--fs-small); color: var(--text-2); }
.code-head .who { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.code-head .who a { color: var(--text-1); font-weight: 600; }
.code-head .pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--bg-2); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.code-head .pill b { color: var(--text-1); font-weight: 600; }
.code-head .pill a { color: inherit; }
.code-head .actions { margin-left: auto; display: flex; gap: 4px; }
.part-layout.code-first { grid-template-columns: minmax(0, 1fr) 372px; grid-template-areas: "main side"; grid-template-rows: auto; }

/* Line anchors (#L10, #L10-L20) and the parameter <-> code links */
.code-scroll td.ln { cursor: pointer; }
.code-scroll td.ln:hover { color: var(--text-1); }
.code-scroll tr[data-hl] td.src { background: color-mix(in srgb, var(--warning, #e5b454) 16%, transparent); }
.code-scroll tr[data-hl] td.ln { color: var(--text-1); background: color-mix(in srgb, var(--warning, #e5b454) 22%, var(--code-gutter)); }
.code-scroll tr[data-param] td.ln { box-shadow: inset 2px 0 0 var(--accent); }
.code-scroll tr[data-param-hl] td.src { background: var(--accent-soft); }
.code-scroll tr[data-param-hl] td.ln { color: var(--accent); }
.param[data-code-hl] { border-radius: var(--r-md); box-shadow: 0 0 0 2px var(--accent-soft); background: var(--accent-softer); }
.param .param-code { margin-left: auto; color: var(--text-4); display: inline-flex; padding: 2px; border-radius: 4px; }
.param .param-code:hover { color: var(--accent); background: var(--accent-soft); }
.code-bar [data-line-link][hidden] { display: none; }

/* Use this part */
.use-card .use-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 12px; }
.use-card .use-steps li { counter-increment: step; display: flex; flex-direction: column; gap: 6px; padding-left: 28px; position: relative; font-size: var(--fs-small); }
.use-card .use-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-4); color: var(--text-2); font-size: 11px; font-weight: 700; }
.use-card .use-steps small, .use-card .inside > small { color: var(--text-3); font-size: var(--fs-tiny); line-height: 1.5; }
.snippet { position: relative; }
.snippet pre {
  margin: 0; padding: 9px 40px 9px 11px; border-radius: var(--r-md); background: var(--code-bg); border: 1px solid var(--line-2);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.5; color: var(--tok-prop); white-space: pre-wrap; overflow-wrap: anywhere;
}
.snippet .icon-btn { position: absolute; top: 4px; right: 4px; }
.use-steve { align-self: flex-start; }
.raw-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.raw-list li { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12.5px; }
.raw-list li a { display: inline-flex; align-items: center; gap: 6px; }
.raw-list li small { font-family: var(--font-sans, inherit); color: var(--text-3); font-size: var(--fs-tiny); }

/* Versions: compare links; the compare page's diffs */
.timeline .compare-link { font-size: var(--fs-tiny); margin-left: 6px; }
.compare-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 6px 0 12px; }
.compare-head h1 { display: flex; align-items: center; gap: 10px; font-size: var(--fs-h2, 24px); margin: 0; }
.compare-pick { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.compare-pick .select { width: auto; min-width: 110px; }
.compare-summary { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; color: var(--text-2); margin: 0 0 16px; }
.compare-summary .changes { color: var(--text-3); }
.add { color: var(--success); } .del { color: var(--danger, #e5484d); }
.diff { margin-bottom: 16px; }
.diff .code-scroll { max-height: none; }
.diff tr.hunk td { background: var(--bg-3); color: var(--text-3); padding-top: 4px; padding-bottom: 4px; }
.diff tr[data-kind='add'] td.src { background: color-mix(in srgb, var(--success) 13%, transparent); }
.diff tr[data-kind='del'] td.src { background: color-mix(in srgb, var(--danger, #e5484d) 13%, transparent); }
.diff tr[data-kind='add'] td.ln { background: color-mix(in srgb, var(--success) 16%, var(--code-gutter)); }
.diff tr[data-kind='del'] td.ln { background: color-mix(in srgb, var(--danger, #e5484d) 16%, var(--code-gutter)); }
.diff td.src .mark { display: inline-block; width: 1.2em; color: var(--text-4); user-select: none; }
.diff td.ln { cursor: default; }

@media (max-width: 1100px) {
  .part-hero { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 860px) {
  .part-hero { grid-template-columns: minmax(0, 1fr); }
  .part-layout.code-first { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "side"; }
  .part-code .code-scroll, .part-code .code-md { max-height: min(72vh, 760px); }
}
@media (max-width: 720px) {
  .part-hero { gap: 14px; margin-bottom: 14px; }
  .code-head { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; }
  .code-head::-webkit-scrollbar { display: none; }
  .code-head .pill { height: 22px; padding: 0 8px; font-size: 11.5px; flex-shrink: 0; }
  .code-head .actions { flex-shrink: 0; }
  .code-head .actions .lbl { display: none; }
  .compare-pick { margin-left: 0; width: 100%; }
}
