/* ===================================================================== *
 * FluidCAD Hub
 *
 * The tokens are fluidcad.io's --fc-* set with the same values, so a hub
 * page and a docs page sit side by side without a seam. Two colors carry
 * meaning and nothing else does:
 *
 *   --fc-live    FluidCAD blue: live, or clickable
 *   --fc-picked  the viewport's selection gold: yours (likes, lists, the
 *                matched search term)
 *
 * The hub adds a danger and a success color for the CLI result states.
 * Every text pair is AA in both themes (4.5:1 body, 3:1 large and UI).
 * ===================================================================== */

:root {
  color-scheme: light;

  --fc-bg: oklch(100% 0 0);
  --fc-bg-sunken: oklch(97.5% 0.004 254);
  --fc-bg-raised: oklch(100% 0 0);
  --fc-bg-hover: oklch(96.5% 0.006 254);
  --fc-line: oklch(90% 0.008 254);
  --fc-line-strong: oklch(82% 0.012 254);

  --fc-ink: oklch(24% 0.022 256);
  --fc-ink-muted: oklch(47% 0.024 256);
  --fc-ink-faint: oklch(55% 0.024 256);

  --fc-live: oklch(54.6% 0.2152 262.9);
  --fc-live-hover: oklch(48% 0.2152 262.9);
  --fc-live-ink: oklch(100% 0 0);
  --fc-live-wash: oklch(54.6% 0.2152 262.9 / 0.08);
  --fc-live-ring: oklch(54.6% 0.2152 262.9 / 0.22);

  --fc-picked: oklch(82.1% 0.1585 75.5);
  --fc-picked-ink: oklch(52% 0.13 62);
  --fc-picked-wash: oklch(82.1% 0.1585 75.5 / 0.3);

  --fc-danger: oklch(53% 0.19 27);
  --fc-danger-wash: oklch(53% 0.19 27 / 0.08);
  --fc-success: oklch(50% 0.12 150);
  --fc-success-wash: oklch(50% 0.12 150 / 0.1);

  /* A thumbnail tile is the app's sunken surface: the geometry sits on the
     same ground it does in the viewport. */
  --fc-tile: oklch(96.5% 0.005 254);

  --fc-font-sans: 'Chivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fc-font-mono: 'Chivo Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --fs-micro: 0.75rem;
  --fs-small: 0.8125rem;
  --fs-ui: 0.875rem;
  --fs-body: 0.9375rem;
  --fs-prose: 1rem;
  --fs-sub: 1.0625rem;
  --fs-head: 1.25rem;
  --fs-name: 1.625rem;
  --fs-title: 1.875rem;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  --wrap: 78rem;
  --gutter: clamp(16px, 0.6rem + 2vw, 32px);
  --topbar-h: 56px;

  --shadow-lift: 0 1px 1px oklch(24% 0.022 256 / 0.06), 0 3px 5px oklch(24% 0.022 256 / 0.07),
    0 8px 12px oklch(24% 0.022 256 / 0.06);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --quick: 160ms;
  --settle: 220ms;

  --z-raised: 10;
  --z-sticky: 20;
  --z-popover: 40;
  --z-toast: 50;
}

/* Dark, from the system unless the visitor chose light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --fc-bg: oklch(23.5% 0 0);
    --fc-bg-sunken: oklch(20.9% 0 0);
    --fc-bg-raised: oklch(27% 0 0);
    --fc-bg-hover: oklch(26.5% 0.002 254);
    --fc-line: oklch(32% 0.004 254);
    --fc-line-strong: oklch(40% 0.006 254);
    --fc-ink: oklch(96% 0.003 254);
    --fc-ink-muted: oklch(76% 0.008 254);
    --fc-ink-faint: oklch(63.5% 0.01 254);
    --fc-live: oklch(69.3% 0.1647 254);
    --fc-live-hover: oklch(76% 0.15 254);
    --fc-live-ink: oklch(15% 0.01 254);
    --fc-live-wash: oklch(69.3% 0.1647 254 / 0.12);
    --fc-live-ring: oklch(69.3% 0.1647 254 / 0.3);
    --fc-picked-ink: oklch(82.1% 0.1585 75.5);
    --fc-picked-wash: oklch(82.1% 0.1585 75.5 / 0.26);
    --fc-danger: oklch(70% 0.16 25);
    --fc-danger-wash: oklch(70% 0.16 25 / 0.12);
    --fc-success: oklch(74% 0.14 155);
    --fc-success-wash: oklch(74% 0.14 155 / 0.12);
    --fc-tile: oklch(27.5% 0.003 254);
    --shadow-lift: 0 1px 1px oklch(0% 0 0 / 0.34), 0 3px 6px oklch(0% 0 0 / 0.3), 0 10px 16px oklch(0% 0 0 / 0.28);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --fc-bg: oklch(23.5% 0 0);
  --fc-bg-sunken: oklch(20.9% 0 0);
  --fc-bg-raised: oklch(27% 0 0);
  --fc-bg-hover: oklch(26.5% 0.002 254);
  --fc-line: oklch(32% 0.004 254);
  --fc-line-strong: oklch(40% 0.006 254);
  --fc-ink: oklch(96% 0.003 254);
  --fc-ink-muted: oklch(76% 0.008 254);
  --fc-ink-faint: oklch(63.5% 0.01 254);
  --fc-live: oklch(69.3% 0.1647 254);
  --fc-live-hover: oklch(76% 0.15 254);
  --fc-live-ink: oklch(15% 0.01 254);
  --fc-live-wash: oklch(69.3% 0.1647 254 / 0.12);
  --fc-live-ring: oklch(69.3% 0.1647 254 / 0.3);
  --fc-picked-ink: oklch(82.1% 0.1585 75.5);
  --fc-picked-wash: oklch(82.1% 0.1585 75.5 / 0.26);
  --fc-danger: oklch(70% 0.16 25);
  --fc-danger-wash: oklch(70% 0.16 25 / 0.12);
  --fc-success: oklch(74% 0.14 155);
  --fc-success-wash: oklch(74% 0.14 155 / 0.12);
  --fc-tile: oklch(27.5% 0.003 254);
  --shadow-lift: 0 1px 1px oklch(0% 0 0 / 0.34), 0 3px 6px oklch(0% 0 0 / 0.3), 0 10px 16px oklch(0% 0 0 / 0.28);
}

/* ===== Base ===== */

[hidden] {
  display: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--fc-bg);
  color: var(--fc-ink);
  font-family: var(--fc-font-sans);
  font-size: var(--fs-body);
  line-height: 1.55;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 650;
  text-wrap: balance;
}

p {
  margin: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--fc-live);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

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

button {
  cursor: pointer;
}

code,
kbd,
pre,
.mono {
  font-family: var(--fc-font-mono);
  font-size: 0.92em;
}

/* Text selection is the viewport's selection highlight. */
::selection {
  background: var(--fc-picked-wash);
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--fc-live);
  outline-offset: 2px;
  border-radius: 4px;
}

hr {
  border: 0;
  border-top: 1px solid var(--fc-line);
  margin: var(--sp-2) 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: var(--z-toast);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  background: var(--fc-live);
  color: var(--fc-live-ink);
  font-weight: 600;
}

.skip:focus {
  top: var(--sp-2);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ===== Icons ===== */

.i {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.i.i-fill {
  fill: currentColor;
  stroke: none;
}

.ficon {
  display: inline-grid;
  place-items: center;
  flex: none;
  color: var(--fc-ink-muted);
}

.ficon svg {
  width: 16px;
  height: 16px;
}

/* ===== Buttons ===== */

.btn {
  --btn-h: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: var(--btn-h);
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: none;
  font-size: var(--fs-ui);
  font-weight: 560;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background-color var(--quick) var(--ease),
    border-color var(--quick) var(--ease),
    color var(--quick) var(--ease);
}

.btn:hover {
  text-decoration: none;
}

.btn .i {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--fc-live);
  color: var(--fc-live-ink);
}

.btn-primary:hover {
  background: var(--fc-live-hover);
}

.btn-secondary {
  background: var(--fc-bg);
  border-color: var(--fc-line-strong);
  color: var(--fc-ink);
}

.btn-secondary:hover {
  background: var(--fc-bg-hover);
}

.btn-ghost {
  color: var(--fc-ink-muted);
}

.btn-ghost:hover {
  background: var(--fc-bg-hover);
  color: var(--fc-ink);
}

.btn-danger {
  background: var(--fc-bg);
  border-color: var(--fc-line-strong);
  color: var(--fc-ink);
}

.btn-danger:hover {
  border-color: var(--fc-danger);
  color: var(--fc-danger);
  background: var(--fc-danger-wash);
}

.btn-sm {
  --btn-h: 32px;
  padding: 0 10px;
  font-size: var(--fs-small);
}

.btn-lg {
  --btn-h: 42px;
  padding: 0 18px;
  font-size: var(--fs-body);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: var(--btn-h);
  padding: 0;
}

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn:active:not(:disabled) {
  transform: translateY(0.5px);
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn[data-loading] .btn-icon-slot {
  display: none;
}

.btn:not([data-loading]) .spinner {
  display: none;
}

/* ===== Fields ===== */

.field {
  display: grid;
  gap: 6px;
}

.label {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--fc-ink);
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-3);
}

.label-row a {
  font-size: var(--fs-small);
}

.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--fc-line-strong);
  border-radius: var(--r-sm);
  background: var(--fc-bg);
  color: var(--fc-ink);
  font-size: var(--fs-body);
  transition:
    border-color var(--quick) var(--ease),
    box-shadow var(--quick) var(--ease);
}

.input::placeholder {
  color: var(--fc-ink-faint);
  opacity: 1;
}

.input:hover {
  border-color: var(--fc-ink-faint);
}

.input:focus {
  outline: none;
  border-color: var(--fc-live);
  box-shadow: 0 0 0 3px var(--fc-live-ring);
}

.input[aria-invalid='true'] {
  border-color: var(--fc-danger);
}

.input[aria-invalid='true']:focus {
  box-shadow: 0 0 0 3px var(--fc-danger-wash);
}

.input-affix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--fc-line-strong);
  border-radius: var(--r-sm);
  background: var(--fc-bg);
  transition:
    border-color var(--quick) var(--ease),
    box-shadow var(--quick) var(--ease);
}

.input-affix:focus-within {
  border-color: var(--fc-live);
  box-shadow: 0 0 0 3px var(--fc-live-ring);
}

.input-affix .affix {
  display: grid;
  place-items: center;
  padding: 0 0 0 12px;
  color: var(--fc-ink-faint);
  font-family: var(--fc-font-mono);
  font-size: var(--fs-ui);
}

.input-affix .input {
  border: 0;
  background: none;
  box-shadow: none;
  padding-left: 2px;
  font-family: var(--fc-font-mono);
  font-size: var(--fs-ui);
}

.input-affix .input:focus {
  box-shadow: none;
}

.input-affix .reveal {
  border: 0;
  background: none;
  padding: 0 10px;
  color: var(--fc-ink-faint);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.input-affix .reveal:hover {
  color: var(--fc-ink);
}

.hint {
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.hint code {
  color: var(--fc-ink);
}

.field-error {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: var(--fs-small);
  color: var(--fc-danger);
}

.field-error .i {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

/* A handle the hub said is free: a fact, so neutral ink, not a colour. */
.handle-status {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.handle-status .i {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--fc-ink-muted);
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--fc-line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-size: var(--fs-micro);
  color: var(--fc-ink-muted);
  line-height: 1;
}

/* Checkbox: a real input, drawn over. Checked filters are blue (a control);
   checked lists are gold (yours). */
.check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 0 var(--sp-2);
  margin-inline: calc(var(--sp-2) * -1);
  border-radius: var(--r-sm);
  font-size: var(--fs-ui);
  color: var(--fc-ink);
  cursor: pointer;
  user-select: none;
}

.check:hover {
  background: var(--fc-bg-hover);
}

.check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.check-box {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: none;
  border: 1.5px solid var(--fc-line-strong);
  border-radius: 4px;
  background: var(--fc-bg);
  color: var(--fc-live-ink);
  transition:
    background-color var(--quick) var(--ease),
    border-color var(--quick) var(--ease);
}

.check-box .i {
  width: 12px;
  height: 12px;
  stroke-width: 3;
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity var(--quick) var(--ease),
    transform var(--settle) var(--ease);
}

.check input:checked + .check-box {
  background: var(--fc-live);
  border-color: var(--fc-live);
}

.check input:checked + .check-box .i {
  opacity: 1;
  transform: none;
}

.check input:focus-visible + .check-box {
  outline: 2px solid var(--fc-live);
  outline-offset: 2px;
}

.check.check-picked input:checked + .check-box {
  background: var(--fc-picked);
  border-color: var(--fc-picked);
  color: oklch(24% 0.05 70);
}

.check-label {
  flex: 1;
  min-width: 0;
}

.check-count {
  font-family: var(--fc-font-mono);
  font-size: var(--fs-micro);
  color: var(--fc-ink-faint);
}

.check .i.check-lock {
  width: 14px;
  height: 14px;
  color: var(--fc-ink-faint);
}

/* Toggle switch (list privacy) */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-ui);
  cursor: pointer;
}

.switch input {
  appearance: none;
  width: 32px;
  height: 18px;
  margin: 0;
  border-radius: 999px;
  background: var(--fc-line-strong);
  position: relative;
  cursor: pointer;
  transition: background-color var(--quick) var(--ease);
}

.switch input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--fc-bg);
  box-shadow: 0 1px 2px oklch(0% 0 0 / 0.2);
  transition: transform var(--settle) var(--ease);
}

.switch input:checked {
  background: var(--fc-live);
}

.switch input:checked::after {
  transform: translateX(14px);
}

/* ===== Avatars ===== */

.av {
  --av-size: 28px;
  /* The live blue's hue unless the page sets one per person. */
  --av-h: 254;
  display: inline-grid;
  place-items: center;
  width: var(--av-size);
  height: var(--av-size);
  flex: none;
  border-radius: 50%;
  background: oklch(90% 0.04 var(--av-h));
  color: oklch(34% 0.07 var(--av-h));
  font-size: calc(var(--av-size) * 0.4);
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1;
}

:root[data-theme='dark'] .av {
  background: oklch(36% 0.05 var(--av-h));
  color: oklch(90% 0.04 var(--av-h));
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .av {
    background: oklch(36% 0.05 var(--av-h));
    color: oklch(90% 0.04 var(--av-h));
  }
}

.av-xs {
  --av-size: 18px;
  font-size: 8px;
}

.av-sm {
  --av-size: 28px;
}

.av-md {
  --av-size: 40px;
}

.av-lg {
  --av-size: 84px;
}

/* ===== Top bar ===== */

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: color-mix(in oklab, var(--fc-bg) 94%, transparent);
  border-bottom: 1px solid var(--fc-line);
}

@supports (backdrop-filter: blur(1px)) {
  .topbar {
    background: color-mix(in oklab, var(--fc-bg) 86%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
  }
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  height: var(--topbar-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--fc-ink);
  font-weight: 650;
  font-size: var(--fs-body);
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
}

.brand-hub {
  font-weight: 400;
  color: var(--fc-ink-muted);
}

.search {
  position: relative;
  flex: 1;
  max-width: 36rem;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 11px;
  width: 16px;
  height: 16px;
  color: var(--fc-ink-faint);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 36px;
  padding: 0 36px 0 34px;
  border: 1px solid var(--fc-line);
  border-radius: var(--r-sm);
  background: var(--fc-bg-sunken);
  font-size: var(--fs-ui);
  transition:
    border-color var(--quick) var(--ease),
    background-color var(--quick) var(--ease),
    box-shadow var(--quick) var(--ease);
}

.search input::placeholder {
  color: var(--fc-ink-faint);
  opacity: 1;
}

.search input:hover {
  border-color: var(--fc-line-strong);
}

.search input:focus {
  outline: none;
  background: var(--fc-bg);
  border-color: var(--fc-live);
  box-shadow: 0 0 0 3px var(--fc-live-ring);
}

.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-kbd {
  position: absolute;
  right: 8px;
  pointer-events: none;
}

.search input:focus ~ .search-kbd,
.search input:not(:placeholder-shown) ~ .search-kbd {
  display: none;
}

.topnav {
  display: flex;
  gap: var(--sp-1);
}

.topnav a {
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-size: var(--fs-ui);
  font-weight: 500;
  color: var(--fc-ink-muted);
}

.topnav a:hover {
  color: var(--fc-ink);
  background: var(--fc-bg-hover);
  text-decoration: none;
}

.topnav a[aria-current='page'] {
  color: var(--fc-ink);
}

.topbar-end {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
}

.theme-toggle .i {
  display: none;
}

.theme-toggle[data-mode='system'] .t-system,
.theme-toggle[data-mode='light'] .t-light,
.theme-toggle[data-mode='dark'] .t-dark,
.theme-toggle:not([data-mode]) .t-system {
  display: block;
}

.account {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 6px 0 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--fc-ink-faint);
}

.account:hover {
  background: var(--fc-bg-hover);
}

.account .i {
  width: 14px;
  height: 14px;
}

body[data-auth='guest'] .member-only,
body:not([data-auth='guest']) .guest-only {
  display: none !important;
}

[data-chrome='min'] .topbar {
  position: static;
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
}

/* ===== Popovers and menus ===== */

.pop {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: var(--sp-2);
  min-width: 240px;
  max-width: min(340px, calc(100vw - 24px));
  border: 1px solid var(--fc-line);
  border-radius: var(--r-md);
  background: var(--fc-bg-raised);
  color: var(--fc-ink);
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity var(--quick) var(--ease),
    transform var(--settle) var(--ease),
    overlay var(--settle) allow-discrete,
    display var(--settle) allow-discrete;
}

.pop:popover-open {
  opacity: 1;
  transform: none;
}

@starting-style {
  .pop:popover-open {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.menu-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-2) var(--sp-3);
}

.menu-name {
  font-weight: 600;
  font-size: var(--fs-ui);
}

.menu-handle {
  font-family: var(--fc-font-mono);
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 0 var(--sp-2);
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--fc-ink);
  font-size: var(--fs-ui);
  text-align: left;
}

.menu-item .i {
  width: 16px;
  height: 16px;
  color: var(--fc-ink-muted);
}

.menu-item:hover,
.menu-item:focus-visible {
  background: var(--fc-bg-hover);
  text-decoration: none;
  outline-offset: -2px;
}

/* ===== Footer ===== */

.footer {
  margin-top: var(--sp-16);
  border-top: 1px solid var(--fc-line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3) var(--sp-6);
  padding-block: var(--sp-6);
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-5);
}

.footer a {
  color: var(--fc-ink-muted);
}

.footer a:hover {
  color: var(--fc-ink);
}

[data-chrome='min'] .footer {
  margin-top: 0;
  border-top: 0;
}

/* ===== Shared bits ===== */

.pkg-scope {
  color: var(--fc-ink-muted);
  font-weight: 450;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--fc-line);
  border-radius: 999px;
  background: var(--fc-bg);
  font-family: var(--fc-font-mono);
  font-size: var(--fs-micro);
  color: var(--fc-ink-muted);
}

a.chip:hover {
  border-color: var(--fc-line-strong);
  color: var(--fc-ink);
  text-decoration: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

mark {
  background: var(--fc-picked-wash);
  color: inherit;
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--fc-picked-wash);
}

/* Command box: what you'd type, with a copy button. */
.cmd {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 40px;
  padding: 6px 4px 6px 12px;
  border: 1px solid var(--fc-line);
  border-radius: var(--r-sm);
  background: var(--fc-bg-sunken);
  font-family: var(--fc-font-mono);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.cmd code {
  flex: 1;
  min-width: 0;
  font-size: inherit;
  overflow-wrap: anywhere;
}

.cmd-prompt {
  color: var(--fc-ink-faint);
  user-select: none;
  margin-right: 0.6ch;
}

.cmd .tok-kw {
  color: var(--fc-ink-muted);
}

.cmd .tok-str {
  color: var(--fc-ink);
}

.copy {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  align-self: flex-start;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--fc-ink-faint);
  transition:
    background-color var(--quick) var(--ease),
    color var(--quick) var(--ease);
}

.copy:hover {
  background: var(--fc-bg-hover);
  color: var(--fc-ink);
}

.copy .i {
  width: 16px;
  height: 16px;
  grid-area: 1 / 1;
  transition:
    opacity var(--quick) var(--ease),
    transform var(--settle) var(--ease);
}

.copy .copy-done {
  opacity: 0;
  transform: scale(0.6);
  color: var(--fc-live);
}

.copy[data-copied] .copy-idle {
  opacity: 0;
  transform: scale(0.6);
}

.copy[data-copied] .copy-done {
  opacity: 1;
  transform: none;
}

.copy-tip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--fc-ink);
  color: var(--fc-bg);
  font-family: var(--fc-font-sans);
  font-size: var(--fs-micro);
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition:
    opacity var(--quick) var(--ease),
    transform var(--settle) var(--ease);
}

.copy[data-copied] .copy-tip {
  opacity: 1;
  transform: none;
}

/* Like button */
.like-icon {
  position: relative;
  display: grid;
  place-items: center;
}

.like-icon .i {
  grid-area: 1 / 1;
  transition:
    opacity var(--quick) var(--ease),
    transform var(--settle) var(--ease);
}

.like-icon .i-fill {
  opacity: 0;
  color: var(--fc-picked);
  transform: scale(0.85);
}

[aria-pressed='true'] > .like-icon .i-fill {
  opacity: 1;
  transform: none;
}

[aria-pressed='true'] > .like-icon .i:not(.i-fill) {
  opacity: 0;
}

[data-like][data-pop] .like-icon .i-fill {
  animation: like-land 320ms var(--ease);
}

@keyframes like-land {
  0% {
    transform: scale(0.7);
  }
  45% {
    transform: scale(1.18);
  }
  100% {
    transform: scale(1);
  }
}

.like-mini {
  position: relative;
  z-index: var(--z-raised);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 8px;
  margin-left: -8px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--fc-ink-muted);
  font-family: var(--fc-font-mono);
  font-size: var(--fs-micro);
}

.like-mini .i {
  width: 15px;
  height: 15px;
}

.like-mini:hover {
  background: var(--fc-bg-hover);
  color: var(--fc-ink);
}

.like-mini[aria-pressed='true'] {
  color: var(--fc-picked-ink);
}

/* ===== Result rows (browse, profile, lists) ===== */

/* Rows bleed past the column so the hover fill has room, while the
   separators stay on the column's edges. */
.rows,
.list-rows {
  margin: 0 calc(var(--sp-3) * -1);
  padding: 0;
  list-style: none;
}

.rows::before,
.list-rows::before {
  content: '';
  display: block;
  height: 1px;
  margin: 0 var(--sp-3);
  background: var(--fc-line);
}

.panel > .rows::before,
.panel > .list-rows::before {
  display: none;
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: var(--sp-5);
  align-items: start;
  padding: var(--sp-4) var(--sp-3);
  border-radius: var(--r-md);
  background: linear-gradient(var(--fc-line), var(--fc-line)) no-repeat var(--sp-3) 100% / calc(100% - var(--sp-3) * 2) 1px;
  transition: background-color var(--quick) var(--ease);
}

.row:hover {
  background-color: var(--fc-bg-hover);
}

.row[hidden] {
  display: none;
}

.row-thumb {
  width: 96px;
  height: 96px;
  border-radius: var(--r-md);
  background: var(--fc-tile);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  transition: transform 420ms var(--ease);
}

.row:hover .row-thumb img {
  transform: scale(1.04);
}

.row-body {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding-top: 2px;
}

.row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-family: var(--fc-font-mono);
  font-size: var(--fs-body);
  font-weight: 560;
  letter-spacing: -0.01em;
}

.row-link {
  color: var(--fc-ink);
}

.row-link:hover {
  text-decoration: none;
}

/* The whole row is the link; controls in it sit above on their own layer. */
.row-link::after {
  content: '';
  position: absolute;
  inset: 0;
}

.row-link:focus-visible {
  outline: none;
}

.row:has(.row-link:focus-visible) {
  outline: 2px solid var(--fc-live);
  outline-offset: -2px;
  border-radius: var(--r-sm);
}

.row:hover .row-link > span:last-child {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.row-ver {
  font-family: var(--fc-font-mono);
  font-size: var(--fs-small);
  font-weight: 400;
  color: var(--fc-ink-faint);
}

.row-desc {
  max-width: 68ch;
  color: var(--fc-ink-muted);
  font-size: var(--fs-ui);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.row-contents {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 2px;
}

.fchips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px 0 6px;
  border: 1px solid var(--fc-line);
  border-radius: var(--r-sm);
  background: var(--fc-bg);
  font-size: var(--fs-micro);
  color: var(--fc-ink);
  white-space: nowrap;
}

.fchip-more {
  padding: 0 8px;
  font-family: var(--fc-font-mono);
  color: var(--fc-ink-muted);
}

.row-count {
  font-size: var(--fs-small);
  color: var(--fc-ink-faint);
}

.row-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  padding-top: 0;
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
  white-space: nowrap;
}

.row-meta .like-mini {
  margin: -2px -8px 0 0;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--fc-font-mono);
  font-size: var(--fs-micro);
}

.meta-item .i {
  width: 15px;
  height: 15px;
  color: var(--fc-ink-faint);
}

.meta-by {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meta-sep {
  color: var(--fc-ink-faint);
}

.row-remove {
  position: relative;
  z-index: var(--z-raised);
  margin-right: -10px;
}

/* ===== Browse ===== */

.browse {
  display: grid;
  align-content: start;
  grid-template-columns: 13.5rem minmax(0, 1fr);
  gap: var(--sp-10);
  padding-top: var(--sp-8);
}

.rail {
  position: sticky;
  top: calc(var(--topbar-h) + var(--sp-8));
  align-self: start;
  display: grid;
  gap: var(--sp-6);
}

.rail-toggle {
  display: none;
}

.facet {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.facet legend,
.facet-title {
  padding: 0;
  margin-bottom: var(--sp-2);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--fc-ink);
}

.facet ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.facet-note {
  margin-top: var(--sp-1);
  font-size: var(--fs-micro);
  color: var(--fc-ink-faint);
  line-height: 1.45;
}

.rail-publish {
  padding-top: var(--sp-5);
  border-top: 1px solid var(--fc-line);
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
  display: grid;
  gap: var(--sp-2);
}

.rail-publish code {
  display: block;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--fc-bg-sunken);
  border: 1px solid var(--fc-line);
  color: var(--fc-ink);
  font-size: var(--fs-micro);
  overflow-wrap: anywhere;
}

.results-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.results-title {
  font-size: var(--fs-title);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.results-title q {
  quotes: '\201C' '\201D';
}

.results-sub {
  margin-top: 6px;
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.results-sub .mono {
  color: var(--fc-ink);
}

.results-tools {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: none;
}

.sort {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
  flex: none;
}

.select {
  appearance: none;
  height: 32px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--fc-line-strong);
  border-radius: var(--r-sm);
  background:
    var(--fc-bg)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 8px center / 14px;
  color: var(--fc-ink);
  font-size: var(--fs-small);
  font-weight: 500;
  cursor: pointer;
}

.select:hover {
  border-color: var(--fc-ink-faint);
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: calc(var(--sp-2) * -1) 0 var(--sp-4);
}

.active-filters:empty {
  display: none;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 6px 0 10px;
  border: 1px solid var(--fc-live-ring);
  border-radius: 999px;
  background: var(--fc-live-wash);
  color: var(--fc-ink);
  font-size: var(--fs-micro);
  font-weight: 500;
}

.filter-pill .i {
  width: 13px;
  height: 13px;
  color: var(--fc-ink-muted);
}

.filter-pill:hover .i {
  color: var(--fc-ink);
}

.clear-filters {
  border: 0;
  background: none;
  color: var(--fc-live);
  font-size: var(--fs-micro);
  font-weight: 500;
  padding: 0 6px;
}

.clear-filters:hover {
  text-decoration: underline;
}

/* Empty states teach the next action. */
.empty {
  display: grid;
  justify-items: start;
  gap: var(--sp-3);
  padding: var(--sp-10) 0 var(--sp-6);
  max-width: 34rem;
}

.empty[hidden] {
  display: none;
}

.empty-title {
  font-size: var(--fs-head);
  letter-spacing: -0.01em;
}

.empty p {
  color: var(--fc-ink-muted);
}

.empty ul {
  margin: 0;
  padding-left: 1.1em;
  color: var(--fc-ink-muted);
  display: grid;
  gap: 4px;
}

.empty .cmd {
  width: 100%;
  margin-top: var(--sp-2);
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

/* Skeleton rows while results load. */
.skeleton {
  display: none;
}

body[data-state='loading'] .skeleton {
  display: block;
}

body[data-state='loading'] [data-rows],
body[data-state='loading'] .results-sub-count {
  display: none;
}

.sk-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: var(--sp-5);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--fc-line);
}

.sk {
  border-radius: 4px;
  background: linear-gradient(90deg, var(--fc-bg-sunken) 0%, var(--fc-bg-hover) 50%, var(--fc-bg-sunken) 100%) 0 0 / 200% 100%;
  animation: sk 1.4s linear infinite;
}

.sk-thumb {
  width: 96px;
  height: 96px;
  border-radius: var(--r-md);
}

.sk-lines {
  display: grid;
  gap: 10px;
  align-content: start;
  padding-top: 4px;
}

.sk-line {
  height: 12px;
}

@keyframes sk {
  to {
    background-position: -200% 0;
  }
}

/* ===== Package page ===== */

.pkg {
  display: grid;
  align-content: start;
  grid-template-columns: minmax(0, 1fr) 20rem;
  grid-template-areas:
    'head head'
    'main side';
  gap: var(--sp-8) var(--sp-12);
  padding-top: var(--sp-6);
}

.pkg-head {
  grid-area: head;
  display: grid;
  gap: var(--sp-3);
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.crumbs a {
  color: var(--fc-ink-muted);
}

.crumbs a:hover {
  color: var(--fc-ink);
}

.crumbs .i {
  width: 14px;
  height: 14px;
  color: var(--fc-ink-faint);
}

.pkg-titlebar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4) var(--sp-6);
}

.pkg-name {
  font-family: var(--fc-font-mono);
  font-size: var(--fs-name);
  font-weight: 560;
  line-height: 1.2;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.pkg-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 8px;
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.pkg-facts .ver {
  font-family: var(--fc-font-mono);
  color: var(--fc-ink);
  font-weight: 500;
}

.pkg-facts .tag-latest {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--fc-line-strong);
  border-radius: 999px;
  color: var(--fc-ink-muted);
  font-size: var(--fs-micro);
  font-weight: 500;
}

.pkg-facts .by {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pkg-facts .by a {
  color: var(--fc-ink);
  font-weight: 500;
}

.pkg-desc {
  max-width: 64ch;
  font-size: var(--fs-sub);
  line-height: 1.5;
  color: var(--fc-ink);
  text-wrap: pretty;
}

.pkg-actions {
  display: flex;
  gap: var(--sp-2);
  flex: none;
}

.pkg-actions .count {
  font-family: var(--fc-font-mono);
  font-size: var(--fs-micro);
  font-weight: 400;
  color: var(--fc-ink-muted);
  padding-left: 2px;
}

.pkg-actions [aria-pressed='true'] .count,
.pkg-actions [data-inlist] .count {
  color: inherit;
}

.btn-like[aria-pressed='true'] {
  color: var(--fc-picked-ink);
  border-color: color-mix(in oklab, var(--fc-picked) 60%, var(--fc-line-strong));
}

.btn-like .i {
  width: 16px;
  height: 16px;
}

.btn-list[data-inlist] {
  color: var(--fc-picked-ink);
  border-color: color-mix(in oklab, var(--fc-picked) 60%, var(--fc-line-strong));
}

.btn-list .i-caret {
  width: 14px;
  height: 14px;
  margin-left: -2px;
  color: var(--fc-ink-faint);
}

.pkg-main {
  grid-area: main;
  min-width: 0;
}

.pkg-side,
.side-rest {
  grid-area: side;
  min-width: 0;
  display: grid;
  gap: var(--sp-6);
  align-content: start;
}

.side-rest {
  grid-area: auto;
}

/* Preview: the geometry on the viewport's ground, as the engine drew it. */
.preview {
  position: relative;
  aspect-ratio: 16 / 9.5;
  border-radius: var(--r-lg);
  background: var(--fc-tile);
  overflow: hidden;
}

.preview-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7% 12%;
  transition: opacity var(--settle) var(--ease);
}

.preview-img[data-leaving] {
  opacity: 0;
}

.preview-caption {
  position: absolute;
  left: var(--sp-4);
  bottom: var(--sp-4);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.preview-caption code {
  color: var(--fc-ink);
  font-size: var(--fs-small);
}

.preview-open {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
}

.preview-open.btn-secondary {
  background: var(--fc-bg);
}

.preview-strip {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.preview-thumb {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--fc-tile);
  transition: border-color var(--quick) var(--ease);
}

.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-thumb:hover {
  border-color: var(--fc-line-strong);
}

.preview-thumb[aria-pressed='true'] {
  border-color: var(--fc-live);
  box-shadow: 0 0 0 1px var(--fc-live);
}

/* Tabs */
.tabs {
  position: relative;
  display: flex;
  gap: var(--sp-1);
  margin-top: var(--sp-8);
  border-bottom: 1px solid var(--fc-line);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--fc-ink-muted);
  font-size: var(--fs-ui);
  font-weight: 560;
  white-space: nowrap;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}

.tab:hover {
  color: var(--fc-ink);
}

.tab[aria-selected='true'] {
  color: var(--fc-ink);
}

.tab:focus-visible {
  outline-offset: -2px;
}

.tab-count {
  font-family: var(--fc-font-mono);
  font-size: var(--fs-micro);
  font-weight: 400;
  color: var(--fc-ink-faint);
}

.tab-rule {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: var(--rule-w, 0);
  background: var(--fc-live);
  border-radius: 2px;
  transform: translateX(var(--rule-x, 0));
  transition:
    transform var(--settle) var(--ease),
    width var(--settle) var(--ease);
}

.panel {
  padding-top: var(--sp-8);
}

.panel[hidden] {
  display: none;
}

.panel-lead {
  font-size: var(--fs-ui);
  color: var(--fc-ink-muted);
  margin-bottom: var(--sp-6);
  max-width: 64ch;
}

.panel-lead code,
.side-note code,
.hint code {
  color: var(--fc-ink);
  white-space: nowrap;
}

/* README */
.prose {
  max-width: 68ch;
  font-size: var(--fs-prose);
  line-height: 1.65;
  color: var(--fc-ink);
}

.prose > * + * {
  margin-top: 1em;
}

.prose h2 {
  font-size: var(--fs-head);
  line-height: 1.3;
  margin-top: 2em;
  letter-spacing: -0.01em;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: var(--fs-sub);
  margin-top: 1.6em;
}

.prose p,
.prose li {
  text-wrap: pretty;
}

.prose ul {
  padding-left: 1.2em;
}

.prose li + li {
  margin-top: 0.3em;
}

.prose :not(pre) > code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--fc-bg-sunken);
  border: 1px solid var(--fc-line);
  font-size: 0.86em;
}

.prose pre {
  margin-inline: 0;
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--fc-line);
  border-radius: var(--r-md);
  background: var(--fc-bg-sunken);
  overflow-x: auto;
  font-size: var(--fs-small);
  line-height: 1.65;
}

.prose pre code {
  font-size: inherit;
}

.tok-c {
  color: var(--fc-ink-faint);
}

.tok-k {
  color: var(--fc-ink-muted);
}

.tok-s,
.tok-n {
  color: var(--fc-ink);
}

.prose table,
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-ui);
}

.prose th,
.prose td,
.table th,
.table td {
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--fc-line);
  text-align: left;
  vertical-align: top;
}

.prose th,
.table th {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--fc-ink-muted);
  border-bottom-color: var(--fc-line-strong);
}

.prose td code {
  font-size: 0.86em;
}

/* Feature blocks */
.feats {
  display: grid;
  gap: var(--sp-10);
}

.feat {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: var(--sp-2) var(--sp-4);
}

.feat + .feat {
  padding-top: var(--sp-10);
  border-top: 1px solid var(--fc-line);
}

.feat-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--fc-bg-sunken);
  border: 1px solid var(--fc-line);
  color: var(--fc-ink);
}

.feat-icon svg {
  width: 24px;
  height: 24px;
}

.feat-head {
  display: grid;
  gap: 3px;
  align-content: center;
  min-height: 44px;
}

.feat-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: var(--fs-sub);
  font-weight: 600;
}

.feat-id {
  font-family: var(--fc-font-mono);
  font-size: var(--fs-small);
  font-weight: 400;
  color: var(--fc-ink-muted);
}

.feat-kind {
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.feat-body {
  grid-column: 2;
  display: grid;
  gap: var(--sp-4);
  min-width: 0;
}

.feat-desc {
  color: var(--fc-ink);
  max-width: 64ch;
}

.params {
  table-layout: fixed;
}

.params th:nth-child(1) {
  width: 20%;
}

.params th:nth-child(3) {
  width: 8.5rem;
}

.params th:nth-child(4) {
  width: 22%;
}

.params td:first-child {
  font-family: var(--fc-font-mono);
  font-size: var(--fs-small);
  color: var(--fc-ink);
  white-space: nowrap;
}

.params td {
  color: var(--fc-ink);
}

.params .muted {
  color: var(--fc-ink-muted);
}

.params .def {
  font-family: var(--fc-font-mono);
  font-size: var(--fs-small);
  white-space: nowrap;
}

.params tr:last-child td {
  border-bottom: 0;
}

.opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 8px 0 4px;
  border: 1px solid var(--fc-line);
  border-radius: var(--r-sm);
  font-size: var(--fs-micro);
  color: var(--fc-ink-muted);
  background: var(--fc-bg);
}

.opt svg {
  width: 22px;
  height: 22px;
  color: var(--fc-ink-muted);
}

.opt-default {
  border-color: var(--fc-line-strong);
  color: var(--fc-ink);
}

.opt-default svg {
  color: var(--fc-ink);
}

/* Parts */
.parts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--sp-6);
}

.part-tile {
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  background: var(--fc-tile);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.part-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10%;
}

.part-name {
  margin-top: var(--sp-3);
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 600;
}

.part-name code {
  font-size: var(--fs-small);
  font-weight: 400;
  color: var(--fc-ink-muted);
}

.part-params {
  margin-top: 4px;
  font-family: var(--fc-font-mono);
  font-size: var(--fs-micro);
  color: var(--fc-ink-muted);
}

/* Versions */
.versions td:first-child {
  font-family: var(--fc-font-mono);
  font-size: var(--fs-small);
  font-weight: 500;
  white-space: nowrap;
}

.versions td {
  vertical-align: middle;
}

.versions .muted {
  color: var(--fc-ink-muted);
  font-size: var(--fs-small);
}

.versions .mono {
  font-size: var(--fs-micro);
  color: var(--fc-ink-muted);
}

.versions .change {
  color: var(--fc-ink);
  font-size: var(--fs-small);
}

.versions .copy {
  align-self: center;
}

.versions tr td:last-child {
  width: 1%;
  padding-right: 0;
}

/* Files */
.files {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--fc-line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.file {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 var(--sp-4);
  border-bottom: 1px solid var(--fc-line);
  font-family: var(--fc-font-mono);
  font-size: var(--fs-small);
}

.file:last-child {
  border-bottom: 0;
}

.file .i {
  width: 16px;
  height: 16px;
  color: var(--fc-ink-faint);
}

.file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-dir {
  color: var(--fc-ink-muted);
}

.file-note {
  font-family: var(--fc-font-sans);
  font-size: var(--fs-micro);
  color: var(--fc-ink-faint);
}

.file-size {
  font-size: var(--fs-micro);
  color: var(--fc-ink-faint);
}

.file-group {
  background: var(--fc-bg-sunken);
}

/* Sidebar */
.side-block {
  display: grid;
  gap: var(--sp-2);
  align-content: start;
}

.side-title {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--fc-ink);
}

.side-note {
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.side-note code {
  color: var(--fc-ink);
}

.side-sep {
  border-top: 1px solid var(--fc-line);
  padding-top: var(--sp-6);
}

.trust {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: var(--fs-ui);
}

.trust li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.trust .i {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--fc-ink-muted);
}

.trust .warn .i {
  color: var(--fc-danger);
}

.trust .sub {
  display: block;
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px var(--sp-4);
  margin: 0;
  font-size: var(--fs-ui);
}

.meta dt {
  color: var(--fc-ink-muted);
}

.meta dd {
  margin: 0;
  min-width: 0;
  text-align: right;
  color: var(--fc-ink);
}

.meta dd code {
  font-size: var(--fs-small);
}

.meta .hash {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  max-width: 100%;
}

.meta .hash code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fc-ink-muted);
}

.meta .hash .copy {
  width: 24px;
  height: 24px;
  align-self: center;
}

.publisher {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--fc-ink);
}

.publisher:hover {
  text-decoration: none;
}

.publisher:hover .publisher-name {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.publisher-name {
  font-weight: 600;
  font-size: var(--fs-ui);
}

.publisher-sub {
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.publisher-sub code {
  color: var(--fc-ink-muted);
}

.side-links {
  display: grid;
  gap: 6px;
  font-size: var(--fs-ui);
}

.side-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow-wrap: anywhere;
}

.side-links .i {
  width: 16px;
  height: 16px;
  color: var(--fc-ink-faint);
}

.report {
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.report a {
  color: var(--fc-ink-muted);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--fc-line-strong);
}

.report a:hover {
  color: var(--fc-ink);
}

/* Add-to-list popover */
.lists-pop {
  width: 300px;
  padding: 0;
}

.lists-pop-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3) var(--sp-3) var(--sp-2) var(--sp-4);
  font-size: var(--fs-ui);
  font-weight: 600;
}

.lists-pop-head .btn {
  margin-right: -4px;
}

.lists-pop ul {
  margin: 0;
  padding: 0 var(--sp-2) var(--sp-2) var(--sp-4);
  list-style: none;
}

.lists-pop .check {
  margin-left: calc(var(--sp-2) * -1);
}

.lists-pop form {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border-top: 1px solid var(--fc-line);
}

.lists-pop .input {
  height: 32px;
  font-size: var(--fs-small);
}

.lists-pop-foot {
  padding: 0 var(--sp-4) var(--sp-3);
  font-size: var(--fs-micro);
  color: var(--fc-ink-faint);
}

/* ===== Comments (package page) ===== */

.facts-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--fc-ink-muted);
}

.facts-link .i {
  width: 15px;
  height: 15px;
  color: var(--fc-ink-faint);
}

.facts-link:hover {
  color: var(--fc-ink);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--fc-line-strong);
  border-radius: 999px;
  color: var(--fc-ink-muted);
  font-family: var(--fc-font-sans);
  font-size: var(--fs-micro);
  font-weight: 500;
  white-space: nowrap;
}

.cmts-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3) var(--sp-6);
  margin-bottom: var(--sp-6);
}

.cmts-head .panel-lead {
  margin-bottom: 0;
}

/* Composer: one field with its controls in a bar along the bottom. */
.composer {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: var(--sp-3);
}

.composer-box {
  min-width: 0;
  border: 1px solid var(--fc-line-strong);
  border-radius: var(--r-md);
  background: var(--fc-bg);
  overflow: hidden;
  transition:
    border-color var(--quick) var(--ease),
    box-shadow var(--quick) var(--ease);
}

.composer-box:focus-within {
  border-color: var(--fc-live);
  box-shadow: 0 0 0 3px var(--fc-live-ring);
}

.composer-input {
  display: block;
  width: 100%;
  min-height: 5.25rem;
  max-height: 22rem;
  field-sizing: content;
  resize: none;
  padding: 10px 12px;
  border: 0;
  background: none;
  color: var(--fc-ink);
  font-size: var(--fs-body);
  line-height: 1.55;
}

.composer-input:focus {
  outline: none;
}

.composer-input::placeholder {
  color: var(--fc-ink-faint);
  opacity: 1;
}

.composer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
  padding: 6px 6px 6px 12px;
  border-top: 1px solid var(--fc-line);
  background: var(--fc-bg-sunken);
}

.composer-ver {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.select-sm {
  height: 26px;
  padding: 0 24px 0 8px;
  background-position: right 6px center;
  background-size: 12px;
  font-family: var(--fc-font-mono);
  font-size: var(--fs-micro);
}

.composer-hint {
  flex: 1;
  font-size: var(--fs-micro);
  color: var(--fc-ink-faint);
  white-space: nowrap;
}

.composer-hint code {
  color: var(--fc-ink-muted);
  font-size: 0.95em;
}

.composer-hint kbd {
  min-width: 18px;
  height: 18px;
  font-size: 0.6875rem;
}

.composer-bar > .btn:last-child {
  margin-left: auto;
}

.composer-actions {
  display: flex;
  gap: var(--sp-2);
  margin-left: auto;
}

.composer-guest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4);
  border: 1px solid var(--fc-line);
  border-radius: var(--r-md);
  background: var(--fc-bg-sunken);
  font-size: var(--fs-ui);
  color: var(--fc-ink-muted);
}

.composer-guest .i {
  color: var(--fc-ink-faint);
}

.composer-guest p {
  flex: 1;
  min-width: 14rem;
}

/* Threads */
.cmts {
  margin-top: var(--sp-6);
}

.cmt {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 0 var(--sp-3);
  padding: var(--sp-5) 0;
  border-top: 1px solid var(--fc-line);
}

.cmt-reply {
  padding: var(--sp-4) 0 0;
  border-top: 0;
}

/* A 1px thread line runs down from a comment's avatar past its replies. */
.cmt-av {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cmt:has(> .cmt-main > .cmt-replies > :is(.cmt, .reply-form)) > .cmt-av::after {
  content: '';
  flex: 1;
  width: 1px;
  margin-top: var(--sp-2);
  background: var(--fc-line);
}

.cmt-main {
  min-width: 0;
}

.cmt-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px var(--sp-3);
  min-height: 28px;
  padding-right: 32px;
  position: relative;
}

.cmt-who {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.cmt-author {
  color: var(--fc-ink);
  font-size: var(--fs-ui);
  font-weight: 600;
}

.cmt-handle {
  font-family: var(--fc-font-mono);
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.cmt-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.cmt-ver .mono {
  font-size: var(--fs-micro);
  color: var(--fc-ink-muted);
}

.cmt-more {
  --btn-h: 28px;
  position: absolute;
  top: 0;
  right: -6px;
}

.cmt-body {
  max-width: 68ch;
  margin-top: 2px;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--fc-ink);
  overflow-wrap: anywhere;
}

.cmt-body > * + * {
  margin-top: var(--sp-2);
}

.cmt-body :not(pre) > code {
  padding: 1px 5px;
  border: 1px solid var(--fc-line);
  border-radius: 4px;
  background: var(--fc-bg-sunken);
  font-size: 0.86em;
}

.cmt-body pre {
  margin: var(--sp-3) 0 0;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--fc-line);
  border-radius: var(--r-sm);
  background: var(--fc-bg-sunken);
  overflow-x: auto;
  font-size: var(--fs-small);
  line-height: 1.65;
}

.cmt-body pre code {
  font-size: inherit;
}

.cmt-actions {
  display: flex;
  gap: 2px;
  margin: 6px 0 0 -8px;
}

.cmt-act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--fc-ink-muted);
  font-size: var(--fs-small);
  font-weight: 500;
  transition:
    background-color var(--quick) var(--ease),
    color var(--quick) var(--ease);
}

.cmt-act .i {
  width: 15px;
  height: 15px;
}

.cmt-act:hover:not(:disabled) {
  background: var(--fc-bg-hover);
  color: var(--fc-ink);
}

.cmt-act[aria-pressed='true'] {
  color: var(--fc-picked-ink);
}

.cmt-act:disabled {
  cursor: default;
  opacity: 0.6;
}

.cmt-count {
  font-family: var(--fc-font-mono);
  font-size: var(--fs-micro);
}

.cmt-count:empty {
  display: none;
}

.cmt-edited {
  color: var(--fc-ink-faint);
}

.reply-form,
.edit-form {
  margin-top: var(--sp-3);
}

.reply-form .composer-input,
.edit-form .composer-input {
  min-height: 3.75rem;
}

.cmt-replies:empty {
  display: none;
}

.cmts-more {
  margin-top: var(--sp-2);
}

/* A comment that just landed settles into place. */
.cmt[data-new] {
  animation: cmt-in var(--settle) var(--ease);
}

@keyframes cmt-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.cmt[data-leaving] {
  opacity: 0;
  transition: opacity 180ms var(--ease);
}

/* ===== Auth pages (login, CLI) ===== */

.auth {
  display: grid;
  place-items: start center;
  padding: clamp(24px, 6vh, 72px) var(--gutter) var(--sp-12);
}

.auth-card {
  width: 100%;
  max-width: 24rem;
  display: grid;
  gap: var(--sp-6);
}

.auth-wide {
  max-width: 30rem;
}

.auth-mark {
  width: 44px;
  height: 44px;
}

.auth-title {
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.auth-lead {
  margin-top: var(--sp-2);
  color: var(--fc-ink-muted);
  text-wrap: pretty;
}

.auth-lead strong {
  color: var(--fc-ink);
  font-weight: 600;
}

.auth-lead code {
  color: var(--fc-ink);
}

.auth-form {
  display: grid;
  gap: var(--sp-4);
}

.divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-small);
  color: var(--fc-ink-faint);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--fc-line);
}

.btn-github {
  background: var(--fc-ink);
  color: var(--fc-bg);
}

.btn-github:hover {
  background: color-mix(in oklab, var(--fc-ink) 86%, var(--fc-bg));
}

.btn-github .i {
  width: 18px;
  height: 18px;
}

.auth-switch {
  font-size: var(--fs-ui);
  color: var(--fc-ink-muted);
  text-align: center;
}

.auth-legal {
  font-size: var(--fs-micro);
  color: var(--fc-ink-faint);
  text-align: center;
  line-height: 1.5;
}

.auth-legal a {
  color: var(--fc-ink-muted);
  text-decoration: underline;
  text-decoration-color: var(--fc-line-strong);
  text-underline-offset: 0.18em;
}

.notice {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--fc-line);
  border-radius: var(--r-md);
  background: var(--fc-bg-sunken);
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.notice .i {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--fc-ink-muted);
}

.notice strong {
  color: var(--fc-ink);
  font-weight: 600;
}

.notice-error {
  border-color: color-mix(in oklab, var(--fc-danger) 40%, var(--fc-line));
  background: var(--fc-danger-wash);
  color: var(--fc-ink);
}

.notice-error .i {
  color: var(--fc-danger);
}

.handle-preview b {
  font-family: var(--fc-font-mono);
  font-size: 0.95em;
  color: var(--fc-ink);
  font-weight: 500;
}

[data-mode='signin'] .signup-only,
[data-mode='signup'] .signin-only {
  display: none !important;
}

/* CLI handoff: two ends of one connection. */
.handoff {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.handoff-node {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  border: 1px solid var(--fc-line);
  background: var(--fc-bg-sunken);
  color: var(--fc-ink);
}

.handoff-node .i {
  width: 22px;
  height: 22px;
}

.handoff-node svg.brand-mark {
  width: 26px;
  height: 26px;
}

.handoff-wire {
  position: relative;
  width: 56px;
  height: 2px;
  background-image: linear-gradient(to right, var(--fc-line-strong) 50%, transparent 50%);
  background-size: 8px 2px;
}

.handoff-wire::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fc-live);
  animation: wire 1.8s var(--ease) infinite;
}

@keyframes wire {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translateX(50px);
    opacity: 0;
  }
}

.device {
  margin: 0;
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--fc-line);
  border-radius: var(--r-md);
  background: var(--fc-bg-sunken);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px var(--sp-6);
  font-size: var(--fs-ui);
}

.device dt {
  color: var(--fc-ink-muted);
}

.device dd {
  margin: 0;
  font-family: var(--fc-font-mono);
  font-size: var(--fs-small);
  color: var(--fc-ink);
  overflow-wrap: anywhere;
  padding-top: 1px;
}

.device dd .sub {
  font-family: var(--fc-font-sans);
  color: var(--fc-ink-faint);
}

.grants {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  font-size: var(--fs-ui);
}

.grants li {
  display: flex;
  gap: 10px;
}

.grants .i {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--fc-ink-muted);
}

.grants code {
  font-size: 0.9em;
}

.grants-title {
  font-size: var(--fs-small);
  font-weight: 600;
  margin-bottom: var(--sp-3);
}

.signed-as {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-block: 1px solid var(--fc-line);
  font-size: var(--fs-ui);
}

.signed-as > span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.signed-as code {
  color: var(--fc-ink-muted);
  font-size: var(--fs-small);
}

.signed-as a {
  font-size: var(--fs-small);
}

/* "Use another account" signs out first, so it is a form button that reads as a link. */
.signed-as form {
  display: contents;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--fs-small);
  color: var(--fc-live);
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: var(--sp-3);
}

.expires {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.expires .i {
  width: 15px;
  height: 15px;
  color: var(--fc-ink-faint);
}

.expires time {
  font-family: var(--fc-font-mono);
  color: var(--fc-ink);
  font-variant-numeric: tabular-nums;
}

/* CLI result */
.result-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.result-icon .i {
  width: 26px;
  height: 26px;
  stroke-width: 2;
}

.result-ok .result-icon {
  background: var(--fc-success-wash);
  color: var(--fc-success);
}

.result-bad .result-icon {
  background: var(--fc-danger-wash);
  color: var(--fc-danger);
}

.result-neutral .result-icon {
  background: var(--fc-bg-sunken);
  color: var(--fc-ink-muted);
  border: 1px solid var(--fc-line);
}

.result-ok .result-icon .i {
  animation: draw-in 420ms var(--ease) both;
}

@keyframes draw-in {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}

.term {
  margin: 0;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  border: 1px solid var(--fc-line);
  background: var(--fc-bg-sunken);
  font-family: var(--fc-font-mono);
  font-size: var(--fs-small);
  line-height: 1.75;
  color: var(--fc-ink);
  overflow-x: auto;
}

.term .p {
  color: var(--fc-ink-faint);
  user-select: none;
}

.term .ok {
  color: var(--fc-success);
}

.term .bad {
  color: var(--fc-danger);
}

.term .dim {
  color: var(--fc-ink-muted);
}

.next {
  display: grid;
  gap: var(--sp-2);
}

.next-title {
  font-size: var(--fs-small);
  font-weight: 600;
}

.status-group[hidden] {
  display: none;
}

/* ===== Profile ===== */

.profile-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--sp-2) var(--sp-6);
  align-items: start;
  padding-top: var(--sp-10);
}

.profile-id {
  display: grid;
  gap: 4px;
  padding-top: 6px;
}

.profile-name {
  font-size: var(--fs-title);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.profile-handle {
  font-family: var(--fc-font-mono);
  font-size: var(--fs-body);
  color: var(--fc-ink-muted);
}

.profile-more {
  grid-column: 2 / -1;
}

.profile-bio {
  margin-top: var(--sp-1);
  max-width: 60ch;
  color: var(--fc-ink);
  text-wrap: pretty;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px var(--sp-5);
  margin-top: var(--sp-3);
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.profile-meta span,
.profile-meta a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-meta .i {
  width: 15px;
  height: 15px;
  color: var(--fc-ink-faint);
}

.profile-tally {
  margin-top: var(--sp-3);
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.profile-tally b {
  color: var(--fc-ink);
  font-weight: 600;
  font-family: var(--fc-font-mono);
  font-size: var(--fs-small);
}

.profile .tabs {
  margin-top: var(--sp-8);
}

.profile .panel {
  padding-top: var(--sp-3);
}

/* Lists */
.list-row {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: var(--sp-5);
  align-items: center;
  padding: var(--sp-4) var(--sp-3);
  border-radius: var(--r-md);
  background: linear-gradient(var(--fc-line), var(--fc-line)) no-repeat var(--sp-3) 100% / calc(100% - var(--sp-3) * 2) 1px;
  transition: background-color var(--quick) var(--ease);
}

.list-row:hover {
  background-color: var(--fc-bg-hover);
}

.mosaic {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  width: 112px;
  height: 72px;
  border-radius: var(--r-md);
  overflow: hidden;
}

.mosaic span {
  background: var(--fc-tile);
  display: grid;
  place-items: center;
}

.mosaic span:first-child {
  grid-row: span 2;
}

.mosaic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.list-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-body);
  font-weight: 600;
}

.list-title a {
  color: var(--fc-ink);
}

.list-title a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.list-row:hover .list-title a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.list-title .i {
  width: 14px;
  height: 14px;
  color: var(--fc-ink-faint);
}

.list-desc {
  margin-top: 3px;
  font-size: var(--fs-ui);
  color: var(--fc-ink-muted);
}

.list-meta {
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
  text-align: right;
  white-space: nowrap;
}

.list-meta b {
  font-family: var(--fc-font-mono);
  font-weight: 500;
  color: var(--fc-ink);
  font-size: var(--fs-small);
}

.list-new {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
  max-width: 28rem;
}

/* List page */
.list-head {
  padding-top: var(--sp-6);
  display: grid;
  gap: var(--sp-3);
}

.list-head-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--sp-4);
}

.list-owner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.list-owner a {
  color: var(--fc-ink);
  font-weight: 500;
}

.list-tools {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.list-body {
  margin-top: var(--sp-8);
}

/* ===== Screens index ===== */

.screens {
  padding-top: var(--sp-10);
  max-width: 56rem;
}

.screens h1 {
  font-size: var(--fs-title);
  letter-spacing: -0.02em;
}

.screens-lead {
  margin-top: var(--sp-3);
  color: var(--fc-ink-muted);
  max-width: 64ch;
}

.screen-group {
  margin-top: var(--sp-10);
}

.screen-group h2 {
  font-size: var(--fs-head);
  letter-spacing: -0.01em;
}

.screen-list {
  margin: var(--sp-4) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--fc-line);
}

.screen-list li {
  display: grid;
  grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr);
  gap: var(--sp-6);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--fc-line);
  font-size: var(--fs-ui);
}

.screen-list a {
  font-weight: 560;
}

.screen-list span {
  color: var(--fc-ink-muted);
}

/* ===== Publishing wizard and status (owner pages) ===== */

[data-chrome='task'] .brand-name {
  display: inline;
}

.wiz {
  display: grid;
  align-content: start;
  gap: var(--sp-8);
  padding-top: var(--sp-6);
}

/* The package header without the package page's grid areas. */
.wiz > .pkg-head,
.status-page > .pkg-head {
  grid-area: auto;
}

.wiz-body {
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 1fr);
  gap: var(--sp-10);
  align-items: start;
}

/* Steps: where you are, and every step a link, since each one saves as you go. */
.steps {
  position: sticky;
  top: calc(var(--topbar-h) + var(--sp-8));
  display: grid;
  gap: var(--sp-6);
}

.steps ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 var(--sp-2);
  margin-inline: calc(var(--sp-2) * -1);
  border-radius: var(--r-sm);
  font-size: var(--fs-ui);
  font-weight: 500;
  color: var(--fc-ink-muted);
}

.step:hover {
  background: var(--fc-bg-hover);
  color: var(--fc-ink);
  text-decoration: none;
}

.step-n {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border: 1px solid var(--fc-line-strong);
  border-radius: 50%;
  font-family: var(--fc-font-mono);
  font-size: var(--fs-micro);
  color: var(--fc-ink-muted);
}

.step-n .i {
  display: none;
  width: 13px;
  height: 13px;
  stroke-width: 2.5;
}

.step[data-done] .step-n .step-num {
  display: none;
}

.step[data-done] .step-n .i {
  display: block;
}

.step[aria-current='step'] {
  color: var(--fc-ink);
  font-weight: 600;
}

.step[aria-current='step'] .step-n {
  border-color: var(--fc-live);
  background: var(--fc-live);
  color: var(--fc-live-ink);
}

.steps-note {
  display: flex;
  gap: 8px;
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.steps-note .i {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--fc-ink-faint);
}

.wiz-step {
  display: grid;
  gap: var(--sp-6);
  max-width: 52rem;
}

.wiz-title {
  font-size: var(--fs-head);
  letter-spacing: -0.01em;
}

.wiz-lead {
  margin-top: var(--sp-2);
  max-width: 64ch;
  color: var(--fc-ink-muted);
  text-wrap: pretty;
}

.wiz-lead code {
  color: var(--fc-ink);
}

.wiz-section {
  display: grid;
  gap: var(--sp-3);
}

.wiz-section-title {
  font-size: var(--fs-small);
  font-weight: 600;
}

.wiz-section-title .mono {
  font-weight: 500;
}

.wiz-section-title .count {
  margin-left: 6px;
  font-weight: 400;
  color: var(--fc-ink-faint);
}

.wiz-desc {
  max-width: 64ch;
  color: var(--fc-ink);
  text-wrap: pretty;
}

.wiz-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-4);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--fc-line);
}

.wiz-foot .btn-primary {
  margin-left: auto;
}

.wiz-foot .btn .i {
  width: 16px;
  height: 16px;
}

/* Saved is a fact, not a celebration: neutral ink. */
.saved {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.saved .i {
  width: 15px;
  height: 15px;
  color: var(--fc-ink-faint);
}

/* Contents: one row per feature, part or assembly, read from the manifest. */
.contents {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--fc-line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.contents li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 2px var(--sp-3);
  align-items: start;
  padding: 10px var(--sp-4);
  border-bottom: 1px solid var(--fc-line);
  font-size: var(--fs-ui);
}

.contents li:last-child {
  border-bottom: 0;
}

.contents .ficon,
.contents .i {
  margin-top: 2px;
}

.contents .ficon svg,
.contents .i {
  width: 18px;
  height: 18px;
  color: var(--fc-ink-muted);
}

/* A feature's own icon, from its archive through the file route: an <img>,
   never inlined, so `currentColor` in it is black. The dark theme lifts it. */
.contents .ficon img {
  display: block;
  width: 18px;
  height: 18px;
}

:root[data-theme='dark'] .contents .ficon img {
  filter: invert(1) hue-rotate(180deg);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .contents .ficon img {
    filter: invert(1) hue-rotate(180deg);
  }
}

/* A file that opens through the file route (the admins' review page). */
.file a.file-name {
  color: var(--fc-ink);
}

.file a.file-name:hover {
  color: var(--fc-live);
}

.contents-name {
  font-weight: 600;
}

.contents-name code {
  margin-left: 6px;
  font-size: var(--fs-small);
  font-weight: 400;
  color: var(--fc-ink-muted);
}

.contents-sub {
  grid-column: 2;
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.contents-sub code {
  color: var(--fc-ink);
}

.contents-note {
  font-size: var(--fs-small);
  color: var(--fc-ink-faint);
  white-space: nowrap;
}

.contents .tag {
  margin-left: 6px;
  vertical-align: 1px;
}

.disclose summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-ui);
  font-weight: 560;
  color: var(--fc-live);
  cursor: pointer;
  list-style: none;
}

.disclose summary::-webkit-details-marker {
  display: none;
}

.disclose summary .i {
  width: 16px;
  height: 16px;
  transition: transform var(--settle) var(--ease);
}

.disclose[open] summary .i {
  transform: rotate(90deg);
}

.disclose .files {
  margin-top: var(--sp-3);
}

/* Screenshots */
.drop {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: var(--sp-8) var(--sp-6);
  border: 1px dashed var(--fc-line-strong);
  border-radius: var(--r-md);
  background: var(--fc-bg-sunken);
  text-align: center;
  font-size: var(--fs-ui);
  color: var(--fc-ink);
  cursor: pointer;
  transition:
    border-color var(--quick) var(--ease),
    background-color var(--quick) var(--ease);
}

.drop:hover,
.drop[data-over] {
  border-color: var(--fc-live);
  background: var(--fc-live-wash);
}

.drop:focus-within {
  outline: 2px solid var(--fc-live);
  outline-offset: 2px;
}

.drop > .i {
  width: 26px;
  height: 26px;
  color: var(--fc-ink-muted);
}

.drop-link {
  color: var(--fc-live);
  font-weight: 560;
}

.drop-rules {
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.drop[aria-disabled='true'] {
  cursor: not-allowed;
  border-color: var(--fc-line);
  background: var(--fc-bg-sunken);
}

.drop[aria-disabled='true'] > .i,
.drop[aria-disabled='true'] .drop-main {
  color: var(--fc-ink-faint);
}

/* Two equal ways in: upload files, or capture the package's own models. */
.shot-sources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}

.shot-sources .drop {
  align-content: center;
}

.capture-card {
  border-style: solid;
  color: var(--fc-ink);
}

.capture-card:hover {
  text-decoration: none;
}

.capture-card[aria-expanded='true'] {
  border-color: var(--fc-live);
  background: var(--fc-live-wash);
}

.shots-count {
  margin-top: calc(var(--sp-3) * -1);
}

/* The viewer: the app's viewport and Parameters panel, in a sandboxed frame. */
.capture {
  display: grid;
  border: 1px solid var(--fc-line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.capture-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--fc-line);
  background: var(--fc-bg-sunken);
}

.capture-model .select {
  min-width: 15rem;
  font-family: var(--fc-font-sans);
}

.capture-hint {
  flex: 1;
  font-size: var(--fs-micro);
  color: var(--fc-ink-faint);
}

.capture-views {
  display: flex;
  align-items: center;
  gap: 2px;
}

.capture-views .btn-icon .i {
  width: 16px;
  height: 16px;
}

/* The live view and its parameters side by side; the whole 4:3 view is what Capture takes. */
.capture-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16rem;
  background: var(--fc-bg);
}

.capture-viewport {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--fc-tile);
  cursor: grab;
}

.capture-viewport img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.capture-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--sp-3);
  padding: var(--sp-6);
  text-align: center;
  background: var(--fc-tile);
}

.capture-overlay-dim {
  background: color-mix(in oklab, var(--fc-bg) 72%, transparent);
}

.capture-overlay .hint {
  max-width: 34ch;
}

.capture-overlay-title {
  font-weight: 600;
}

.capture-overlay-icon {
  background: var(--fc-bg);
  border: 1px solid var(--fc-line);
  color: var(--fc-ink-muted);
}

.capture-overlay .spinner {
  width: 22px;
  height: 22px;
  color: var(--fc-ink-muted);
}

.capture-progress {
  width: min(18rem, 70%);
}

.capture-error {
  max-width: 44ch;
  font-size: var(--fs-small);
  color: var(--fc-ink);
  overflow-wrap: anywhere;
}

.capture-error .mono {
  display: block;
  margin-top: 2px;
  color: var(--fc-ink-muted);
}

/* The parameter form: hub HTML built from the model's definitions, never the frame's markup. */
.capture-params {
  display: grid;
  gap: var(--sp-4);
  align-content: start;
  padding: var(--sp-4);
  border-left: 1px solid var(--fc-line);
  background: var(--fc-bg-raised);
}

.capture-params-title {
  font-size: var(--fs-small);
  font-weight: 600;
}

.capture-params-title .mono {
  margin-left: 4px;
  font-weight: 400;
  color: var(--fc-ink-muted);
}

.capture-form,
.param-group {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
  display: grid;
  gap: var(--sp-3);
}

.capture-form:disabled {
  opacity: 0.55;
}

.param-group {
  padding-top: var(--sp-3);
  border-top: 1px solid var(--fc-line);
}

.param-group legend {
  padding: 0;
  margin-bottom: var(--sp-2);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--fc-ink-muted);
}

.capture-param-label {
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--fc-ink);
}

.capture-param-value {
  font-family: var(--fc-font-mono);
  font-size: var(--fs-small);
  color: var(--fc-ink);
}

.capture-params .input,
.capture-params .select-field {
  height: 34px;
  font-size: var(--fs-ui);
}

.capture-params .input-affix .input {
  height: 32px;
}

.input-affix .affix-end {
  padding: 0 12px 0 0;
}

.capture-params .check {
  margin-inline: 0;
  padding: 0;
}

.capture-params .link-button {
  justify-self: start;
}

.range {
  width: 100%;
  margin: 0;
  accent-color: var(--fc-live);
}

.capture-foot {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3);
  border-top: 1px solid var(--fc-line);
  background: var(--fc-bg-sunken);
}

.capture-foot .hint {
  flex: 1;
  max-width: 64ch;
}

.capture-foot .btn {
  margin-left: auto;
}

.capture-foot .btn .i {
  width: 16px;
  height: 16px;
}

.refused {
  margin: var(--sp-2) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.refused li {
  display: grid;
  grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
  gap: var(--sp-3);
}

.refused code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fc-ink);
}

.notice-body {
  flex: 1;
  min-width: 0;
}

.notice-close {
  margin: -6px -8px -6px 0;
}

.shots {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr));
  gap: var(--sp-6) var(--sp-5);
}

.shot {
  display: grid;
  gap: var(--sp-2);
  align-content: start;
}

.shot-tile {
  position: relative;
  border: 1px solid transparent;
}

.shot-tile img {
  position: absolute;
  inset: 0;
  padding: 6%;
}

.shot[data-card] .shot-tile {
  border-color: var(--fc-live);
  box-shadow: 0 0 0 1px var(--fc-live);
}

.shot-pos {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 24px;
  padding: 0 7px 0 3px;
  border-radius: var(--r-sm);
  background: var(--fc-bg);
  border: 1px solid var(--fc-line);
  font-family: var(--fc-font-mono);
  font-size: var(--fs-micro);
  color: var(--fc-ink-muted);
  cursor: grab;
}

.shot-pos .i {
  width: 14px;
  height: 14px;
  color: var(--fc-ink-faint);
}

.shot-card-tag {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  background: var(--fc-bg);
}

.shot:not([data-card]) .shot-card-tag {
  display: none;
}

.shot .input {
  height: 34px;
  font-size: var(--fs-small);
}

.shot-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}

.shot-tools .check {
  margin-right: auto;
  font-size: var(--fs-small);
}

.shot-tools .btn-icon .i {
  width: 16px;
  height: 16px;
}

.shot-meta {
  font-family: var(--fc-font-mono);
  font-size: var(--fs-micro);
  color: var(--fc-ink-faint);
  overflow-wrap: anywhere;
}

.shot[data-uploading] .shot-tile img {
  opacity: 0.45;
}

.progress {
  height: 4px;
  border-radius: 999px;
  background: var(--fc-line);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: var(--done, 0%);
  border-radius: inherit;
  background: var(--fc-live);
  transition: width var(--settle) var(--ease);
}

.shots-compact {
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: var(--sp-4);
}

/* The card choice is a control, so blue: a radio drawn like the checkbox. */
.check-radio .check-box {
  border-radius: 50%;
}

.check-radio .check-box::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fc-live-ink);
  transform: scale(0);
  transition: transform var(--settle) var(--ease);
}

.check-radio input:checked + .check-box::after {
  transform: none;
}

/* Details */
.wiz-form {
  max-width: 34rem;
}

.select-field {
  width: 100%;
  height: 40px;
  padding-left: 12px;
  font-size: var(--fs-body);
  font-weight: 400;
  background-position: right 12px center;
}

.label .opt-label {
  margin-left: 6px;
  font-weight: 400;
  color: var(--fc-ink-faint);
}

/* Release notes: the composer's field, with where the text came from in its bar. */
.notes-box .composer-input {
  min-height: 6.5rem;
}

.notes-source {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-micro);
  color: var(--fc-ink-muted);
}

.notes-source code {
  color: var(--fc-ink);
}

.notes-source .i {
  width: 14px;
  height: 14px;
  color: var(--fc-ink-faint);
}

.notes-count {
  font-family: var(--fc-font-mono);
  font-size: var(--fs-micro);
  color: var(--fc-ink-faint);
  font-variant-numeric: tabular-nums;
  padding-right: 6px;
}

/* Submit: what goes to review, and what is still missing. */
.checklist {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--fc-line);
}

.checklist li {
  display: grid;
  grid-template-columns: 20px 8.5rem minmax(0, 1fr) auto;
  gap: var(--sp-3);
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--fc-line);
  font-size: var(--fs-ui);
}

.checklist .i {
  width: 16px;
  height: 16px;
  align-self: center;
  color: var(--fc-ink-muted);
}

.checklist-name {
  font-weight: 600;
}

.checklist-value {
  min-width: 0;
  color: var(--fc-ink-muted);
  overflow-wrap: anywhere;
}

.checklist-value code {
  color: var(--fc-ink);
}

.checklist a {
  font-size: var(--fs-small);
}

.checklist li[data-missing] .i,
.checklist li[data-missing] .checklist-value {
  color: var(--fc-danger);
}

.wiz-aside {
  font-size: var(--fs-small);
  color: var(--fc-ink-muted);
}

.wiz-aside .link-button {
  font-size: inherit;
}

/* Owner's status page */
.status-page {
  max-width: 52rem;
  display: grid;
  align-content: start;
  gap: var(--sp-8);
  padding-top: var(--sp-6);
}

.status-line {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: start;
}

.status-section {
  display: grid;
  gap: var(--sp-8);
}

.status-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-8);
  align-items: start;
}

.status-cols .meta dd {
  text-align: left;
}

.status-cols .meta .muted {
  color: var(--fc-ink-faint);
}

.status-thumbs {
  flex-wrap: wrap;
  margin-top: 0;
}

.status-thumbs .preview-thumb {
  overflow: hidden;
}

.status-thumbs .preview-thumb img {
  min-height: 0;
}

.status-thumbs .preview-thumb[data-card] {
  border-color: var(--fc-live);
  box-shadow: 0 0 0 1px var(--fc-live);
}

.notice-body p + p {
  margin-top: 6px;
}

.review-note {
  color: var(--fc-ink);
  font-size: var(--fs-ui);
}

/* ===== Responsive ===== */

@media (max-width: 1100px) {
  .pkg {
    grid-template-columns: minmax(0, 1fr) 17.5rem;
    gap: var(--sp-8);
  }
}

@media (max-width: 920px) {
  /* Install moves up under the header; the rest of the sidebar follows
     the readme, two columns while there is room. */
  .pkg {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'head'
      'install'
      'main'
      'rest';
    gap: var(--sp-6);
  }

  .pkg-side {
    display: contents;
  }

  .side-install {
    grid-area: install;
  }

  .side-rest {
    grid-area: rest;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: var(--sp-6) var(--sp-8);
    margin-top: var(--sp-8);
    padding-top: var(--sp-8);
    border-top: 1px solid var(--fc-line);
  }

  .side-rest .side-sep {
    border-top: 0;
    padding-top: 0;
  }

  .browse {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: var(--sp-6);
  }

  .rail[data-open] {
    margin-bottom: var(--sp-5);
  }

  /* The results column dissolves into the page grid so the filter panel
     can open directly under the title row that holds its button. */
  .results {
    display: contents;
  }

  .results > * {
    order: 4;
  }

  .results-head {
    order: 1;
  }

  .rail {
    position: static;
    order: 2;
  }

  .active-filters {
    order: 3;
  }

  .rail-toggle {
    display: inline-flex;
  }

  .rail-panel {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: var(--sp-6);
    padding: var(--sp-5);
    border: 1px solid var(--fc-line);
    border-radius: var(--r-md);
    background: var(--fc-bg-sunken);
  }

  .rail[data-open] .rail-panel {
    display: grid;
  }

  .rail-publish {
    display: none;
  }

  /* The steps become one row above the step, with only the current label. */
  .wiz-body {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-6);
  }

  .steps {
    position: static;
  }

  .steps ol {
    display: flex;
    gap: var(--sp-1);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .step {
    margin: 0;
    padding: 0 10px 0 6px;
    border: 1px solid var(--fc-line);
    border-radius: 999px;
    white-space: nowrap;
  }

  .step:not([aria-current='step']) .step-label {
    display: none;
  }

  .steps-note {
    display: none;
  }

  .status-cols {
    grid-template-columns: minmax(0, 1fr);
  }

}

@media (min-width: 921px) {
  .rail-panel {
    display: grid;
    gap: var(--sp-6);
  }
}

@media (max-width: 760px) {
  .topnav {
    display: none;
  }

  .topbar-inner {
    gap: var(--sp-3);
  }

  .brand-name {
    display: none;
  }

  [data-chrome='min'] .brand-name {
    display: inline;
  }

  .search-kbd {
    display: none;
  }

  .row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: var(--sp-2) var(--sp-4);
  }

  .row-thumb {
    width: 64px;
    height: 64px;
    border-radius: var(--r-sm);
  }

  .row-thumb img {
    padding: 4px;
  }

  .row-meta {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-items: start;
    gap: 4px 14px;
  }

  .row-meta .like-mini {
    margin: 0 0 0 -8px;
    order: 0;
  }

  .fchip-label {
    display: none;
  }

  .fchip {
    padding: 0 6px;
  }

  .results-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .results-title {
    font-size: 1.5rem;
  }

  .pkg-name {
    font-size: 1.375rem;
  }

  .pkg-titlebar {
    align-items: flex-start;
  }

  .pkg-actions {
    width: 100%;
  }

  .pkg-actions .btn {
    flex: 1;
  }

  .preview {
    aspect-ratio: 4 / 3;
  }

  .feat {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: var(--sp-2) var(--sp-3);
  }

  .feat-icon {
    width: 36px;
    height: 36px;
  }

  .feat-head {
    min-height: 36px;
  }

  .feat-body {
    grid-column: 1 / -1;
  }

  .params .col-label,
  .versions .col-size,
  .versions .col-engine {
    display: none;
  }

  .profile-head {
    grid-template-columns: auto minmax(0, 1fr);
    padding-top: var(--sp-6);
  }

  .profile-head .av-lg {
    --av-size: 64px;
  }

  .profile-edit {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .profile-name {
    font-size: 1.5rem;
  }

  .profile-more {
    grid-column: 1 / -1;
  }

  .list-row {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .mosaic {
    width: 84px;
    height: 56px;
  }

  .list-meta {
    grid-column: 2;
    text-align: left;
  }

  .screen-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .auth-actions {
    grid-template-columns: 1fr;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr);
  }

  .composer > .cmt-av {
    display: none;
  }

  .composer-hint {
    display: none;
  }

  .cmt,
  .cmt-reply .cmt {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 0 var(--sp-2);
  }

  .cmt .av-sm {
    --av-size: 24px;
  }

  .auth-actions .btn-primary {
    order: -1;
  }

  .contents li {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .contents-note {
    grid-column: 2;
    white-space: normal;
  }

  .refused li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .shots {
    grid-template-columns: minmax(0, 1fr);
  }

  .shot-sources {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-3);
  }

  .shot-sources .drop {
    padding: var(--sp-5) var(--sp-4);
  }

  .capture-hint {
    display: none;
  }

  .capture-model {
    flex: 1;
  }

  .capture-model .select {
    min-width: 0;
    width: 100%;
  }

  .capture-stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .capture-params {
    border-left: 0;
    border-top: 1px solid var(--fc-line);
  }

  .capture-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .shots-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .checklist li {
    grid-template-columns: 20px minmax(0, 1fr) auto;
  }

  .checklist-value {
    grid-column: 2 / -1;
  }

  .checklist a {
    grid-column: 3;
    grid-row: 1;
  }

  .wiz-foot .saved {
    order: 3;
    width: 100%;
  }

  .status-line {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .topbar-inner {
    flex-wrap: wrap;
    height: auto;
    padding-block: 10px;
    row-gap: 10px;
  }

  .search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .rail {
    top: 0;
  }

  .meta-by .meta-sep,
  .meta-by span:last-child {
    display: none;
  }
}

/* ===== Reduced motion ===== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }

  .row:hover .row-thumb img {
    transform: none;
  }

  .handoff-wire::after {
    display: none;
  }

  .sk {
    animation: none;
  }
}

.input-affix .input.input-sans {
  font-family: var(--fc-font-sans);
  font-size: var(--fs-body);
  padding-left: 12px;
}

.stack {
  display: grid;
  gap: var(--sp-6);
}

.list-head .profile-bio {
  margin-top: var(--sp-2);
}

.list-head .list-owner {
  margin-top: var(--sp-3);
}

/* ===== Toast ===== */

.toast {
  position: fixed;
  left: 50%;
  bottom: var(--sp-6);
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 16px;
  border-radius: var(--r-md);
  background: var(--fc-ink);
  color: var(--fc-bg);
  font-size: var(--fs-ui);
  box-shadow: var(--shadow-lift);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition:
    opacity var(--quick) var(--ease),
    transform var(--settle) var(--ease);
}

.toast[data-show] {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.toast button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid color-mix(in oklab, var(--fc-bg) 30%, transparent);
  border-radius: var(--r-sm);
  background: none;
  color: inherit;
  font-size: var(--fs-small);
  font-weight: 600;
}

.toast button:hover {
  background: color-mix(in oklab, var(--fc-bg) 14%, transparent);
}

.input-affix:has([aria-invalid='true']) {
  border-color: var(--fc-danger);
}
