/* bloxdev.gg, built on the tokens in DESIGN.md.

   Three canvases: indigo navy for the hero, white for the body, deep teal for the closing
   band. One typeface, Inter Variable, at the in-between weights 460 and 540. Radius steps up
   with the size of the thing: 6 for inputs, 8 for buttons, 12 for cards, 16 for the dialog.
   The models bring the colour; the interface stays indigo, violet, teal and warm grey.
   The one colour added to the system is a red for errors and deleting.
   --ink-faint is below readable contrast on white, so it is kept for placeholders and
   struck-through text; anything a person needs to read uses --ink-mute or darker. */

@font-face {
  font-family: "Inter";
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-variable.woff2") format("woff2");
}

:root {
  --primary: #1b1938;
  --primary-deep: #0e0c1f;
  --on-primary: #ffffff;
  --ink: #292827;
  --ink-mute: #73706d;
  --ink-faint: #9a9794;
  --canvas: #ffffff;
  --canvas-soft: #fafaf8;
  --violet-soft: #c9b4fa;
  --teal-deep: #0e3030;
  --teal-mid: #155555;
  --hairline: #e8e4dd;
  --hairline-dark: #3f3a52;
  --on-dark-mute: #bcbac9;
  --on-dark-faint: #8f8ca6;
  --error: #9b2c2c;
  --error-soft: #fbefee;
  --teal-soft: #e7f0ef;

  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-full: 9999px;
  --lift-1: 0 1px 3px rgba(0, 0, 0, 0.08);
  --lift-2: 0 8px 24px rgba(0, 0, 0, 0.12);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 32px);
  --column: 1100px;
  --edge: max(var(--gutter), calc((100vw - var(--column)) / 2));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 460 16px/1.5 var(--font);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: clamp(36px, 24px + 2.2vw, 48px); font-weight: 460; line-height: 0.96; letter-spacing: -0.0275em; }
h2 { font-size: 22px; font-weight: 460; line-height: 1.1; letter-spacing: -0.315px; }
h3 { font-size: 20px; font-weight: 460; line-height: 1.2; letter-spacing: -0.4px; }
p { margin: 0; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
img, video { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--r-xs); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--canvas); padding: 8px 12px; z-index: 50; border-radius: var(--r-md); }
.skip:focus { left: 8px; }
.hint { color: var(--ink-mute); font-size: 14px; line-height: 1.4; max-width: 68ch; }
.hint--lead strong { color: var(--ink); font-weight: 700; }
.hint--lead strong a { color: inherit; }
.optional { color: var(--ink-mute); font-size: 14px; font-weight: 460; margin-left: 4px; letter-spacing: 0; }

/* ---- navigation: light by default, dark over the library hero -------------------- */

.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px var(--edge);
  background: var(--canvas); border-bottom: 1px solid var(--hairline);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-size: 20px; font-weight: 600; letter-spacing: -0.4px; line-height: 1;
}
.wordmark__tld { color: var(--ink-faint); font-weight: 460; }
.wordmark .g1 { fill: var(--primary); }
.wordmark .g2 { fill: #8f73e6; }
.wordmark .g3 { fill: var(--teal-mid); }
.bar__nav { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 28px); }
.bar__nav > a:not(.btn) { color: var(--ink-mute); text-decoration: none; }
.bar__nav > a:not(.btn):hover, .bar__nav > a[aria-current="page"] { color: var(--ink); }
.bar__nav form { margin: 0; }
.bar .linkbtn { color: var(--ink-mute); text-decoration: none; }
.bar .linkbtn:hover { color: var(--ink); }

.page-library .bar {
  position: absolute; inset: 0 0 auto 0; z-index: 3;
  background: transparent; border-bottom: 0;
}
.page-library .wordmark { color: var(--on-primary); }
.page-library .wordmark__tld { color: var(--on-dark-mute); }
.page-library .wordmark .g1 { fill: var(--on-primary); }
.page-library .wordmark .g2 { fill: var(--violet-soft); }
.page-library .wordmark .g3 { fill: #5fb3b3; }
.page-library .bar__nav > a:not(.btn), .page-library .bar .linkbtn { color: var(--on-dark-mute); }
.page-library .bar__nav > a:not(.btn):hover,
.page-library .bar__nav > a[aria-current="page"],
.page-library .bar .linkbtn:hover { color: var(--on-primary); }
.page-library .bar .btn--primary { background: var(--violet-soft); border-color: var(--violet-soft); color: var(--primary); border-radius: var(--r-full); }
.page-library .bar :focus-visible { outline-color: var(--violet-soft); }

/* ---- buttons ---------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 12px 20px;
  background: var(--canvas); color: var(--ink);
  border: 1px solid var(--hairline-dark); border-radius: var(--r-md);
  font: 700 16px/1 var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--canvas-soft); }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn--primary:hover, .btn--primary:active { background: var(--primary-deep); border-color: var(--primary-deep); }
.btn--pill { background: var(--violet-soft); border-color: var(--violet-soft); color: var(--primary); border-radius: var(--r-full); }
.btn--pill:hover { background: #d8c8fc; border-color: #d8c8fc; }
.btn--onteal { background: var(--canvas); border-color: var(--canvas); color: var(--teal-deep); }
.btn--onteal:hover { background: var(--teal-soft); }
.btn--danger { border-color: var(--error); color: var(--error); }
.btn--danger:hover { background: var(--error-soft); }
.btn--small { min-height: 36px; padding: 9px 14px; font-size: 14px; font-weight: 600; }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); font: inherit;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em;
}
.linkbtn:hover { text-decoration-thickness: 2px; }

/* ---- flashes ---------------------------------------------------------------------- */

.flashes { max-width: calc(var(--column) + 2 * var(--gutter)); margin: 24px auto 0; padding: 0 var(--gutter); display: grid; gap: 8px; }
.flash { background: var(--teal-soft); color: var(--teal-deep); border-radius: var(--r-md); padding: 12px 16px; font-weight: 540; }
.flash--warn { background: var(--canvas-soft); color: var(--ink); border: 1px solid var(--hairline); }

/* ---- library hero: indigo canvas, violet-sky wash, a model as the portrait --------- */

.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: var(--on-primary);
  padding: 152px var(--edge) 88px;
}
.hero__sky {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse 46% 70% at 80% 42%, rgba(150, 190, 255, 0.5) 0%, rgba(201, 180, 250, 0.3) 42%, rgba(201, 180, 250, 0) 76%),
    radial-gradient(ellipse 40% 55% at 100% 100%, rgba(95, 80, 190, 0.5) 0%, rgba(95, 80, 190, 0) 70%);
}
/* The portrait: a listing's idle loop, edge to edge vertically and stopping mid-canvas. */
.hero__subject {
  position: absolute; z-index: -1; top: 0; bottom: 0; right: 0;
  aspect-ratio: 1; height: 100%; overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 42%);
  mask-image: linear-gradient(to right, transparent 0%, #000 42%);
}
.hero__subject video, .hero__subject img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.12); transform-origin: 50% 100%;
}
/* Twilight: pull the Studio daylight toward the indigo it sits on. */
.hero__subject::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(27, 25, 56, 0.9) 0%, rgba(27, 25, 56, 0) 26%),
    linear-gradient(200deg, rgba(160, 140, 240, 0.55) 0%, rgba(27, 25, 56, 0.72) 100%);
  mix-blend-mode: multiply;
}
.hero__inner { position: relative; max-width: 620px; }
.hero h1 { font-size: clamp(40px, 26px + 3.4vw, 64px); font-weight: 540; line-height: 0.96; letter-spacing: 0; }
.hero__lede { color: var(--on-dark-mute); margin-top: 20px; max-width: 46ch; font-size: 18px; font-weight: 540; letter-spacing: -0.135px; }
.searchbox { display: flex; gap: 10px; margin-top: 32px; max-width: 560px; }
.searchbox input[type="search"] {
  flex: 1; min-width: 0; min-height: 48px; padding: 10px 16px;
  border: 1px solid transparent; border-radius: var(--r-md);
  background: var(--canvas); color: var(--ink); font: 460 16px var(--font);
}
.searchbox input::placeholder { color: var(--ink-faint); }
.searchbox input:focus-visible { outline: 2px solid var(--violet-soft); outline-offset: 2px; }
.searchbox .btn { min-height: 48px; padding-inline: 24px; }
.searchbox .btn:focus-visible { outline-color: var(--violet-soft); }
.hero__credit { margin-top: 20px; color: var(--on-dark-faint); font-size: 14px; }
.hero__credit a { color: var(--on-dark-mute); }
.hero__credit a:focus-visible { outline-color: var(--violet-soft); }

/* ---- library body ----------------------------------------------------------------- */

.shelf {
  max-width: calc(var(--column) + 2 * var(--gutter)); margin: 0 auto; padding: 64px var(--gutter) 96px;
  display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 48px; align-items: start;
}
/* On a wide screen the filters are always open, so their toggle is only shown on small ones. */
.filters__toggle > summary { display: none; font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; }
.filters__toggle > summary::-webkit-details-marker { display: none; }
.facet { border: 0; margin: 0 0 24px; padding: 0; min-width: 0; }
.facet legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 8px; }
.facet__tags { display: flex; flex-wrap: wrap; gap: 6px; }
/* A filter is a pill tab backed by a real checkbox. */
.tick { cursor: pointer; }
.tick span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--hairline); border-radius: var(--r-full);
  background: var(--canvas); font-size: 14px; font-weight: 600; line-height: 1; text-transform: capitalize;
}
.tick i { font-style: normal; font-weight: 460; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.tick:hover span { border-color: var(--ink-faint); }
.tick input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tick input:checked + span i { color: var(--on-dark-mute); }
.tick input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.facet__more { margin-top: 6px; }
.facet__more > summary { cursor: pointer; color: var(--ink-mute); font-size: 14px; padding: 4px 0; }
.facet__more[open] > summary { display: none; }
.filters__empty { color: var(--ink-mute); font-size: 14px; }
.js .filters__apply { display: none; }

.results__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.results__head h2 { font-size: 28px; font-weight: 540; line-height: 1.14; letter-spacing: -0.63px; }
.results__head a { font-size: 14px; color: var(--ink-mute); }
.results[aria-busy="true"] .grid { opacity: 0.5; }

.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 24px;
}
.card {
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
  background: var(--canvas); color: var(--ink); text-decoration: none;
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  transition: box-shadow 160ms ease, border-color 160ms ease;
}
.card:hover { box-shadow: var(--lift-2); border-color: transparent; }
.card:focus-visible { border-radius: var(--r-lg); }
/* A still with its video stacked on top. The video stays invisible until it has drawn a
   frame, so there is never a moment with nothing to show. */
.clip { position: absolute; inset: 0; display: block; }
.clip__still, .clip__video { position: absolute; inset: 0; }
.clip__video { opacity: 0; }
.clip__video.is-live { opacity: 1; }

.card__view { position: relative; display: block; aspect-ratio: 1; background: var(--canvas-soft); overflow: hidden; }
.card__view video, .card__view img { width: 100%; height: 100%; object-fit: cover; }
.card__body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 16px 16px 18px; }
.card__title { font-size: 20px; font-weight: 460; line-height: 1.2; letter-spacing: -0.4px; }
.card__summary {
  font-size: 14px; line-height: 1.4; color: var(--ink-mute);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__code { font-size: 12px; font-weight: 540; color: var(--ink-mute); margin-top: auto; padding-top: 6px; }
.card__missed {
  margin-top: auto; padding: 10px 16px; font-size: 12px; font-weight: 540; line-height: 1.4;
  color: var(--ink-mute); background: var(--canvas-soft); border-top: 1px solid var(--hairline);
}
.nocover { display: grid; place-items: center; height: 100%; color: var(--ink-mute); font-size: 14px; }

.empty {
  background: var(--canvas-soft); border-radius: var(--r-lg);
  padding: clamp(32px, 6vw, 64px); display: grid; gap: 12px; justify-items: start;
}
.empty p { color: var(--ink-mute); max-width: 56ch; }
.empty .btn { margin-top: 8px; }

/* ---- closing teal band and footer -------------------------------------------------- */

.closing { background: var(--teal-deep); color: var(--on-primary); padding: clamp(64px, 9vw, 112px) var(--edge); }
.closing__inner { display: grid; gap: 28px; justify-items: start; max-width: 640px; }
.closing h2 { font-size: 28px; font-weight: 540; line-height: 1.14; letter-spacing: -0.63px; }
.closing p { color: #b7cfcf; font-size: 18px; font-weight: 540; letter-spacing: -0.135px; margin-top: -12px; }
.closing :focus-visible { outline-color: var(--canvas); }
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  padding: 32px var(--edge) 40px; color: var(--ink-mute); font-size: 14px; line-height: 1.4;
}
.foot a { color: var(--ink-mute); }
.foot nav { display: flex; gap: 20px; }

/* ---- listing ---------------------------------------------------------------------- */

.page { max-width: calc(var(--column) + 2 * var(--gutter)); margin: 0 auto; padding: 48px var(--gutter) 64px; }
.page--narrow { max-width: 480px; padding-top: clamp(48px, 10vw, 112px); }
.crumb { font-size: 14px; margin-bottom: 20px; }
.crumb a { color: var(--ink-mute); }

.viewer {
  width: min(1120px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 0; border: 0; border-radius: var(--r-xl); background: var(--canvas); color: var(--ink);
  box-shadow: var(--lift-2);
}
.viewer::backdrop { background: rgba(14, 12, 31, 0.6); }
.viewer > form { position: sticky; top: 0; z-index: 2; display: flex; justify-content: flex-end; height: 0; }
.viewer__close {
  margin: 14px; height: 36px; padding: 0 14px; cursor: pointer;
  background: var(--canvas); color: var(--ink); border: 1px solid var(--hairline); border-radius: var(--r-md);
  font: 600 14px/1 var(--font); box-shadow: var(--lift-1);
}
.viewer__close:hover { background: var(--canvas-soft); }
#viewer-body { padding: clamp(20px, 3.4vw, 40px); }

.listing { display: grid; gap: 56px; }
.listing__top { display: grid; grid-template-columns: minmax(240px, 420px) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.listing__view { position: relative; aspect-ratio: 1; background: var(--canvas-soft); border-radius: var(--r-lg); overflow: hidden; }
.listing__view video, .listing__view img { width: 100%; height: 100%; object-fit: cover; }
.listing__intro { display: grid; gap: 16px; justify-items: start; }
.listing__kind { font-size: 14px; color: var(--ink-mute); display: flex; gap: 12px; align-items: center; }
.listing__kind span { color: var(--ink-mute); }
.listing__summary { font-size: 18px; font-weight: 540; letter-spacing: -0.135px; }
.listing__description { color: var(--ink-mute); max-width: 68ch; }
.facts { margin: 8px 0; display: grid; gap: 10px; width: 100%; }
.facts > div { display: grid; grid-template-columns: 104px 1fr; gap: 12px; align-items: baseline; }
.facts dt { font-size: 14px; color: var(--ink-mute); }
.facts dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-block; padding: 6px 12px; border: 1px solid var(--hairline); border-radius: var(--r-full);
  background: var(--canvas); color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1;
  text-decoration: none; text-transform: capitalize;
}
a.chip:hover { border-color: var(--ink-faint); }

.listing__block { display: grid; gap: 16px; }
.listing__blockhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.listing__blockhead h2 { font-size: 28px; font-weight: 540; line-height: 1.14; letter-spacing: -0.63px; }
.listing__blockhead a { font-size: 14px; color: var(--ink-mute); }
.listing__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.sheet { display: block; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--hairline); cursor: zoom-in; }
.sheet img { width: 100%; }
.extras { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.extras img { border-radius: var(--r-md); border: 1px solid var(--hairline); width: 100%; }
.extras p { font-size: 14px; color: var(--ink-mute); margin-top: 6px; }
.prompt {
  margin: 0; padding: 24px 28px; max-height: 520px; overflow: auto;
  background: var(--primary); color: #e4e2f0; border-radius: var(--r-lg);
  font: 13.5px/1.65 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2;
}
.prompt:focus-visible { outline-offset: 3px; }

/* ---- a build: the 3D preview, its facts and how to use it ---------------------------
   The stage is the same mid grey as the makers' reference sheets, so a model's colours
   read the same in both. Its controls sit on the picture, dark until chosen. */

.build { display: grid; gap: 24px; }
.build__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 24px; }
.build__head h1 { margin-top: 12px; }
.stage { position: relative; height: clamp(360px, 62vh, 640px); background: #85868a; border-radius: var(--r-lg); overflow: hidden; }
.stage__canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.stage__canvas:active { cursor: grabbing; }
.stage__canvas[hidden], .stage__message[hidden] { display: none; }
.stage__message { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--on-primary); font-weight: 540; }
.stage__views, .stage__tools { position: absolute; display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; }
.stage__views { left: 0; top: 0; }
.stage__tools { right: 0; bottom: 0; }
.stage__btn {
  min-height: 36px; padding: 8px 12px; border: 0; border-radius: var(--r-md);
  background: rgba(14, 12, 31, 0.74); color: var(--on-primary);
  font: 600 14px/1 var(--font); cursor: pointer;
}
.stage__btn:hover { background: var(--primary-deep); }
.stage__btn[aria-pressed="true"] { background: var(--canvas); color: var(--primary); }
.stage :focus-visible { outline-color: var(--canvas); }
.build__facts dd { display: block; }
.build__steps, .build__problems { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; max-width: 72ch; }
.build code, .connect code { font-family: var(--mono); font-size: 0.92em; }

/* ---- connect: how to point an AI agent at the library ------------------------------ */

.connect { display: grid; gap: 40px; max-width: 760px; }
/* Grid items refuse to shrink below their content, which lets a long command push the page wide. */
.connect > *, .connect > * > *, .connect__ways > * { min-width: 0; }
.connect__lede { font-size: 18px; font-weight: 540; letter-spacing: -0.135px; margin-top: 16px; }
.connect__url {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; background: var(--canvas-soft); border: 1px solid var(--hairline); border-radius: var(--r-lg);
}
.connect__url code { font-size: 16px; overflow-wrap: anywhere; }
.connect__ways { display: grid; gap: 24px; }
.connect__ways h3 { margin-bottom: 8px; }
.connect__ways p { color: var(--ink-mute); max-width: 68ch; }
.connect__ways pre { margin: 12px 0 0; padding: 14px 16px; background: var(--primary); color: var(--on-primary); border-radius: var(--r-md); overflow-x: auto; font: 14px/1.5 var(--mono); }
.connect__tools { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.connect__tools li { display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: baseline; }
.connect__tools code { font-weight: 600; }
.connect__tools span { color: var(--ink-mute); }
@media (max-width: 640px) { .connect__tools li { grid-template-columns: 1fr; gap: 2px; } }

/* ---- badges ----------------------------------------------------------------------- */

.badge { display: inline-block; padding: 4px 10px; border-radius: var(--r-full); font-size: 12px; font-weight: 540; line-height: 1.4; }
.badge--published { color: var(--teal-mid); background: var(--teal-soft); }
.badge--draft { color: var(--ink-mute); background: var(--canvas-soft); box-shadow: inset 0 0 0 1px var(--hairline); }

/* ---- dashboard -------------------------------------------------------------------- */

.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.pagehead .hint { margin-top: 12px; display: flex; gap: 12px; align-items: center; }
.tablewrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table th { text-align: left; font-size: 14px; font-weight: 600; color: var(--ink-mute); padding: 14px 20px; background: var(--canvas-soft); }
.table td { padding: 14px 20px; border-top: 1px solid var(--hairline); vertical-align: middle; }
.table time { color: var(--ink-mute); white-space: nowrap; font-size: 14px; }
.rowlink { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.rowlink img, .rowlink__blank { width: 56px; height: 56px; object-fit: cover; background: var(--canvas-soft); border-radius: var(--r-md); flex: none; }
.rowlink strong { display: block; font-weight: 540; }
.rowlink:hover strong { text-decoration: underline; text-underline-offset: 0.2em; }
.rowlink__meta { color: var(--ink-mute); font-size: 14px; text-transform: capitalize; }
.files { white-space: nowrap; font-size: 14px; }
.files span { margin-right: 12px; }
.files .has { color: var(--ink); }
.files .lacks { color: var(--ink-faint); text-decoration: line-through; }
.rowactions { white-space: nowrap; text-align: right; font-size: 14px; }
.rowactions a { color: var(--ink-mute); }
.rowactions form { display: inline; margin-left: 16px; }

/* ---- listing form ----------------------------------------------------------------- */

.panel {
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: clamp(20px, 3vw, 32px); display: grid; gap: 20px; align-content: start;
}
.panel > h2 + .hint, .panel__head + .hint { margin-top: -12px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.login { gap: 20px; }
.login h1 { font-size: 28px; font-weight: 540; line-height: 1.14; letter-spacing: -0.63px; }
.editor__cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.editor__main, .editor__side { display: grid; gap: 24px; }
.field { display: grid; gap: 6px; align-content: start; }
.field > label { font-size: 14px; font-weight: 600; }
.fieldrow { display: grid; grid-template-columns: minmax(0, 1fr) 180px 150px; gap: 16px; }
.facetgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
input[type="text"], input[type="password"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--hairline); border-radius: var(--r-sm); background: var(--canvas); color: var(--ink);
  font: 460 16px var(--font);
}
input[type="text"]:hover, input[type="password"]:hover, select:hover, textarea:hover { border-color: var(--ink-faint); }
textarea { resize: vertical; line-height: 1.5; }
textarea.code { font: 13.5px/1.65 var(--mono); }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input[type="text"]:focus-visible, input[type="password"]:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); border-radius: var(--r-sm);
}
.formerror { background: var(--error-soft); color: var(--error); border-radius: var(--r-md); padding: 14px 18px; margin-bottom: 24px; font-weight: 540; }
.formerror ul { margin: 6px 0 0; padding-left: 20px; font-weight: 460; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--ink-mute); }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }

/* tag fields (built by admin.js on top of a plain comma-separated input) */
.tagbox {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  min-height: 44px; padding: 6px 8px; border: 1px solid var(--hairline); border-radius: var(--r-sm);
  background: var(--canvas); cursor: text;
}
.tagbox:hover { border-color: var(--ink-faint); }
.tagbox:focus-within { border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: -1px; }
.tagbox input[type="text"] { flex: 1; min-width: 72px; min-height: 28px; border: 0; padding: 2px 4px; outline: 0; }
.tagbox__chip {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--primary); color: var(--on-primary); border-radius: var(--r-full);
  padding: 4px 4px 4px 12px; font-size: 14px; font-weight: 600; line-height: 1.2;
}
.tagbox__chip button {
  background: none; border: 0; color: var(--on-dark-mute); cursor: pointer;
  font: 600 16px/1 var(--font); padding: 2px 7px; border-radius: var(--r-full);
}
.tagbox__chip button:hover { color: var(--on-primary); }
.tagbox__chip button:focus-visible { outline-color: var(--violet-soft); }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; font-weight: 540; color: var(--ink-mute); }
.suggest button {
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-full);
  color: var(--ink-mute); padding: 3px 10px; font: 600 12px/1.4 var(--font); cursor: pointer;
}
.suggest button:hover { border-color: var(--ink-faint); color: var(--ink); }

/* file pickers */
.drop {
  display: grid; gap: 12px; padding: 14px; cursor: pointer;
  border: 1px dashed var(--ink-faint); border-radius: var(--r-md); background: var(--canvas-soft);
}
.drop:hover, .drop.is-over { border-color: var(--primary); background: #f4f1fd; }
.drop:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop__preview { display: block; background: var(--hairline); border-radius: var(--r-sm); overflow: hidden; }
.drop__preview:empty { display: none; }
.drop__preview--square { aspect-ratio: 1; max-width: 200px; }
.drop__preview--wide { aspect-ratio: 16 / 9; }
.drop__preview img { width: 100%; height: 100%; object-fit: cover; }
.drop__text { display: grid; gap: 2px; font-size: 14px; line-height: 1.4; color: var(--ink-mute); }
.drop__text strong { font-weight: 600; color: var(--ink); }
.drop.is-new { border-style: solid; border-color: var(--teal-mid); background: var(--teal-soft); }
.extralist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.extralist li { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: start; }
.extralist img { width: 72px; height: 72px; object-fit: cover; background: var(--canvas-soft); border-radius: var(--r-sm); }
.extralist div { display: grid; gap: 6px; }

.savebar {
  position: sticky; bottom: 16px; z-index: 5; margin-top: 24px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  box-shadow: var(--lift-2); padding: 12px 12px 12px 20px;
}
.savebar__note { font-size: 14px; color: var(--ink-mute); }
.savebar__actions { display: flex; gap: 10px; }
.danger { padding-top: 0; }

/* ---- small screens ---------------------------------------------------------------- */

@media (min-width: 1441px) {
  .hero__subject {
    right: calc((100vw - 1440px) / 2);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 42%, #000 80%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, #000 42%, #000 80%, transparent 100%);
  }
}
@media (max-width: 1040px) {
  .editor__cols { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shelf { grid-template-columns: 1fr; gap: 28px; padding-top: 40px; }
  .filters__toggle > summary {
    display: inline-flex; margin-bottom: 0; padding: 9px 14px; color: var(--ink);
    border: 1px solid var(--hairline-dark); border-radius: var(--r-md);
  }
  .filters__toggle[open] > summary { margin-bottom: 20px; }
  .listing__top { grid-template-columns: 1fr; }
  .listing__view { max-width: 420px; }
  .fieldrow, .facetgrid { grid-template-columns: 1fr; }
  .hero { padding-top: 128px; padding-bottom: 64px; }
  .hero__subject { opacity: 0.55; right: -18%; }
}
@media (max-width: 520px) {
  .hero__subject { display: none; }
  .searchbox { flex-direction: column; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card__body { padding: 12px; }
  .card__title { font-size: 16px; letter-spacing: -0.2px; }
  .card__summary, .card__code { display: none; }
  .facts > div { grid-template-columns: 1fr; gap: 4px; }
  .bar__nav > a:not(.btn)[href="/"] { display: none; }
  .savebar { bottom: 8px; padding: 12px; }
  .savebar__actions { width: 100%; }
  .savebar__actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}
