/* Druckarchiv — workshop aluminium, with the green textured plate as the one loud element. */

:root {
  --bg: #e4e6e1;
  --surface: #f3f4f0;
  --surface-2: #eaece7;
  --ink: #1b1f23;
  --ink-2: #3a4148;
  --muted: #646b72;
  --line: #cdd0ca;
  --line-strong: #b5b9b2;
  --accent: #3f9a55;
  --accent-deep: #2e7d42;
  --accent-ink: #1d6431;
  --accent-wash: #dcefdf;
  --ok: #2f7a4a;
  --ok-wash: #e1eee4;
  --bad: #a8321f;
  --bad-wash: #f5e2dc;
  --warn: #7f5200;
  --warn-wash: #f5e8cc;
  --stage: #d6d9d3;
  --stage-ink: #1b1f23;
  --shadow: 0 1px 0 rgb(255 255 255 / 0.7) inset, 0 1px 2px rgb(27 31 35 / 0.06);
  --shadow-lift: 0 10px 30px -12px rgb(27 31 35 / 0.28);

  --font-display: 'Archivo Variable', 'Archivo', system-ui, sans-serif;
  --font-body: 'Archivo Variable', 'Archivo', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --sidebar: 256px;

  /* textured plate: fine noise over a green gradient */
  --pei-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.04 0 0 0 0 0.22 0 0 0 0 0.09 0 0 0 0.75 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  --pei: var(--pei-noise), radial-gradient(120% 90% at 35% 25%, #6fbf7c 0%, #3f9a55 58%, #2f8546 100%);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #121416;
    --surface: #1a1d20;
    --surface-2: #212529;
    --ink: #e7e8e4;
    --ink-2: #c4c8c3;
    --muted: #979ea5;
    --line: #2d3236;
    --line-strong: #40464c;
    --accent: #5cbf72;
    --accent-deep: #45a35b;
    --accent-ink: #8ad89a;
    --accent-wash: #1b2e21;
    --ok: #74c08f;
    --ok-wash: #1b2b21;
    --bad: #f08b77;
    --bad-wash: #3a211c;
    --warn: #e6b65c;
    --warn-wash: #33291a;
    --stage: #1c1f22;
    --stage-ink: #e7e8e4;
    --shadow: 0 1px 0 rgb(255 255 255 / 0.03) inset, 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow-lift: 0 14px 34px -14px rgb(0 0 0 / 0.7);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #121416;
  --surface: #1a1d20;
  --surface-2: #212529;
  --ink: #e7e8e4;
  --ink-2: #c4c8c3;
  --muted: #979ea5;
  --line: #2d3236;
  --line-strong: #40464c;
  --accent: #5cbf72;
  --accent-deep: #45a35b;
  --accent-ink: #8ad89a;
  --accent-wash: #1b2e21;
  --ok: #74c08f;
  --ok-wash: #1b2b21;
  --bad: #f08b77;
  --bad-wash: #3a211c;
  --warn: #e6b65c;
  --warn-wash: #33291a;
  --stage: #1c1f22;
  --stage-ink: #e7e8e4;
  --shadow: 0 1px 0 rgb(255 255 255 / 0.03) inset, 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-lift: 0 14px 34px -14px rgb(0 0 0 / 0.7);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 420;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

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

[hidden] {
  display: none !important;
}

.muted {
  color: var(--muted);
}

/* ---------- icons ---------- */

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--xs { width: 12px; height: 12px; stroke-width: 2.2; }
.icon--sm { width: 15px; height: 15px; }
.icon--lg { width: 30px; height: 30px; stroke-width: 1.4; }
.icon--xl { width: 44px; height: 44px; stroke-width: 1.3; }
.icon--ok { color: var(--ok); vertical-align: -3px; }

/* ---------- layout ---------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.main {
  min-width: 0;
  padding: 22px clamp(16px, 3vw, 40px) 64px;
  outline: none;
}

/* ---------- sidebar ---------- */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 14px 18px 18px;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}

.brand {
  display: grid;
  gap: 4px;
  padding: 0 6px;
}

.wordmark {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 820;
  font-size: 19px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.05;
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.nav {
  display: grid;
  gap: 1px;
  align-content: start;
}

.eyebrow {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 680;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav__eyebrow {
  padding: 14px 8px 6px;
}
.nav > .nav__eyebrow:first-child {
  padding-top: 0;
}

.nav__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-right: 8px;
}

.link {
  border: 0;
  background: none;
  padding: 0;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.link:hover {
  color: var(--ink);
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink-2);
}
.nav__item:hover {
  background: var(--surface);
  color: var(--ink);
}
.nav__item[aria-current='page'] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow);
}

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

.nav__count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.nav__glyph {
  display: grid;
  place-items: center;
  width: 16px;
  color: var(--accent-ink);
}
.nav__glyph .icon {
  width: 15px;
  height: 15px;
}

.nav__add {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 7px 8px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.nav__add:hover {
  color: var(--ink);
  border-color: var(--muted);
}
.nav__add .icon {
  width: 15px;
  height: 15px;
}

.tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 6px;
}
.tags-nav .nav__eyebrow {
  padding-top: 0;
}

.sidebar__foot {
  margin-top: auto;
  padding: 12px 8px 0;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.account {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 12px;
}
.account__name {
  flex-basis: 100%;
  color: var(--ink-2);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- login ---------- */

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.auth__card {
  width: min(400px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
.auth__plate {
  height: 92px;
  background: var(--pei);
  background-size: 180px 180px, cover;
  box-shadow: 0 -1px 0 rgb(8 48 20 / 0.35) inset;
  position: relative;
}
.auth__plate::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgb(8 48 20 / 0.09) 1px, transparent 1px), linear-gradient(90deg, rgb(8 48 20 / 0.09) 1px, transparent 1px);
  background-size: 23px 23px;
}
.auth__mark {
  display: block;
  margin: 22px 24px 0;
  font-size: 22px;
}
.auth__lead {
  margin: 8px 24px 0;
  color: var(--ink-2);
  font-size: 14px;
}
.auth__card > .btn {
  margin: 18px 24px 24px;
}
.auth__form {
  display: grid;
  gap: 14px;
  padding: 18px 24px 24px;
}
.auth__submit {
  min-height: 40px;
}
.auth__error {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bad-wash);
  color: var(--bad);
  font-size: 13px;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
}
.check input {
  accent-color: var(--accent-deep);
  width: 16px;
  height: 16px;
}

/* filament spool: coloured ring with a hub */
.spool {
  --c: #999;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 4.5px solid var(--c);
  background: radial-gradient(circle, var(--surface) 0 34%, color-mix(in srgb, var(--c) 55%, var(--ink)) 35% 48%, var(--surface) 49%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 70%, black) inset;
}
.spool--sm {
  width: 12px;
  height: 12px;
  border-width: 3.5px;
  background: var(--surface);
  box-shadow: none;
}
.spool--lg {
  width: 30px;
  height: 30px;
  border-width: 8px;
  align-self: center;
}
.spool--empty {
  border-style: dashed;
  border-width: 1.5px;
  border-color: var(--muted);
  background: none;
  box-shadow: none;
}

/* ---------- controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 560;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow);
  transition: background-color 0.15s, border-color 0.15s;
}
.btn:hover {
  border-color: var(--muted);
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn--primary {
  border-color: var(--accent-deep);
  background: var(--pei);
  background-size: 180px 180px, cover;
  color: #072512;
  text-shadow: 0 1px 0 rgb(215 255 222 / 0.4);
  box-shadow: 0 1px 0 rgb(215 255 222 / 0.5) inset, 0 1px 2px rgb(8 48 20 / 0.25);
}
.btn--primary:hover {
  border-color: #1f5f30;
  filter: brightness(1.04);
}

.btn--danger {
  border-color: var(--bad);
  background: var(--bad);
  color: #fff;
}

.btn--ghost {
  border-color: transparent;
  background: none;
  box-shadow: none;
}
.btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--line);
}

.btn--danger-text {
  color: var(--bad);
}

.btn--small {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 13px;
}
.btn--small .icon {
  width: 15px;
  height: 15px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink-2);
  cursor: pointer;
  text-decoration: none;
}
.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
}
.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
  background: none;
  border-color: transparent;
}
.icon-btn--small {
  width: 26px;
  height: 26px;
}
.icon-btn--danger:hover {
  color: var(--bad);
}
.icon-btn[aria-pressed='true'] {
  background: var(--accent-wash);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent-ink);
}
.icon-btn--fav[aria-pressed='true'] .icon {
  fill: var(--accent);
  stroke: var(--accent-deep);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}
.textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.45;
}
.select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23646b72' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  cursor: pointer;
}
.input::placeholder,
.textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 80%, transparent);
}

.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
}
.seg button {
  min-height: 28px;
  padding: 3px 11px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  white-space: nowrap;
}
.seg button:hover {
  color: var(--ink);
}
.seg button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
}
.tag button {
  display: inline-grid;
  place-items: center;
  margin-right: -4px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.tag button:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.tag--filter {
  cursor: pointer;
}
.tag--filter:hover {
  border-color: var(--muted);
  color: var(--ink);
}
.tag--filter[aria-pressed='true'],
.tag--active {
  border-color: var(--accent-deep);
  background: var(--accent-wash);
  color: var(--accent-ink);
}
.tag--active {
  cursor: pointer;
  font-size: 13px;
}

kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface-2);
}

/* ---------- list ---------- */

.list-head {
  display: grid;
  gap: 22px;
  margin-bottom: 22px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.toolbar .select {
  width: auto;
}

.search {
  flex: 1 1 280px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
}
.search:focus-within {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--ink);
}

.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
}

.display {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: 122%;
  font-weight: 780;
  font-size: clamp(30px, 4.2vw, 50px);
  line-height: 1;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.count {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 26px 20px;
}
.grid--empty {
  display: block;
}

.card {
  position: relative;
  min-width: 0;
}

.card__link {
  display: grid;
  gap: 9px;
  text-decoration: none;
  border-radius: var(--radius);
}
.card__link:focus-visible {
  outline-offset: 4px;
}

.card__plate {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--pei);
  background-size: 180px 180px, cover;
  box-shadow: 0 0 0 1px rgb(8 48 20 / 0.35) inset, 0 2px 0 rgb(215 255 222 / 0.18) inset;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s;
}
.card__plate::after {
  /* 10 mm grid as on the plate */
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgb(8 48 20 / 0.09) 1px, transparent 1px), linear-gradient(90deg, rgb(8 48 20 / 0.09) 1px, transparent 1px);
  background-size: 10% 10%;
  pointer-events: none;
}
.card__link:hover .card__plate {
  transform: translateY(-3px);
  box-shadow: 0 0 0 1px rgb(8 48 20 / 0.45) inset, var(--shadow-lift);
}

.card__plate img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8%;
  filter: drop-shadow(0 10px 10px rgb(6 40 16 / 0.35));
}

.card__plate img.is-photo {
  object-fit: cover;
  padding: 0;
  filter: none;
}

.card__empty {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  height: 100%;
  color: rgb(6 40 16 / 0.7);
  font-size: 12px;
  text-align: center;
}

.card__formats,
.card__printed {
  position: absolute;
  z-index: 2;
  bottom: 8px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgb(27 31 35 / 0.78);
  color: #f1ede2;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  backdrop-filter: blur(4px);
}
.card__formats {
  left: 8px;
}
.card__formats i {
  font-style: normal;
  color: #8ad89a;
}
.card__printed {
  right: 8px;
}

.card__name {
  margin: 0;
  font-size: 15px;
  font-weight: 620;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -4px 0 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__fav {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgb(27 31 35 / 0.55);
  color: #f1ede2;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  backdrop-filter: blur(4px);
}
.card:hover .card__fav,
.card__fav:focus-visible,
.card__fav[aria-pressed='true'] {
  opacity: 1;
}
.card__fav[aria-pressed='true'] .icon {
  fill: #8ad89a;
  stroke: #8ad89a;
}
@media (hover: none) {
  .card__fav {
    opacity: 1;
  }
}

.empty {
  max-width: 520px;
  padding: 40px 0;
  color: var(--ink-2);
}
.empty p {
  margin: 8px 0 18px;
}
.empty__title {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
}
.empty--first {
  display: grid;
  justify-items: start;
  max-width: 640px;
}
.empty__plate {
  display: grid;
  place-items: center;
  width: min(340px, 100%);
  aspect-ratio: 1.6;
  margin-bottom: 22px;
  border-radius: var(--radius);
  background: var(--pei);
  background-size: 180px 180px, cover;
  color: rgb(6 40 16 / 0.65);
  box-shadow: 0 0 0 1px rgb(8 48 20 / 0.35) inset, var(--shadow-lift);
}

/* ---------- detail ---------- */

.crumbs a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: -6px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.crumbs a:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.detail__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 0 18px;
}

.detail__name {
  flex: 1;
  min-width: 0;
  margin-left: -8px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  font-family: var(--font-display);
  font-stretch: 118%;
  font-weight: 760;
  font-size: clamp(24px, 3.2vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
}
.detail__name:hover {
  border-color: var(--line);
}
.detail__name:focus {
  outline: none;
  border-color: var(--accent-deep);
  background: var(--surface);
}

.detail__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 22px;
  align-items: start;
}

.stage {
  position: sticky;
  top: 16px;
  height: min(72vh, 760px);
  min-height: 360px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--stage);
  box-shadow: 0 0 0 1px var(--line) inset;
  color: var(--stage-ink);
}
.stage:fullscreen {
  height: 100vh;
  border-radius: 0;
}

.stage__canvas {
  position: absolute;
  inset: 0;
}
.viewer-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.viewer-canvas:active {
  cursor: grabbing;
}
.stage__fallback {
  position: absolute;
  inset: 10%;
  width: 80%;
  height: 80%;
  object-fit: contain;
  opacity: 0.85;
}

.stage__top,
.stage__bottom {
  position: absolute;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.stage__top {
  top: 12px;
  flex-wrap: wrap;
}
.stage__bottom {
  bottom: 12px;
  justify-content: space-between;
}
.stage__top > *,
.stage__bottom > * {
  pointer-events: auto;
}

.seg--dark,
.plate-pick,
.stage__tools,
.readout:not(:empty) {
  border: 1px solid rgb(255 255 255 / 0.08);
  background: rgb(27 31 35 / 0.72);
  color: #f1ede2;
  backdrop-filter: blur(8px);
}
.seg--dark {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg--dark button {
  color: rgb(241 237 226 / 0.7);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seg--dark button:hover {
  color: #fff;
}
.seg--dark button[aria-pressed='true'] {
  background: rgb(255 255 255 / 0.14);
  color: #fff;
  box-shadow: none;
}

.plate-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 0 10px;
  border-radius: 8px;
}
.plate-pick select {
  min-height: 34px;
  border: 0;
  background: none;
  color: inherit;
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
}
.plate-pick option {
  color: var(--ink);
  background: var(--surface);
}

.stage__tools {
  display: flex;
  gap: 2px;
  margin-left: auto;
  padding: 3px;
  border-radius: 9px;
}
.icon-btn--stage {
  color: rgb(241 237 226 / 0.8);
}
.icon-btn--stage:hover {
  background: rgb(255 255 255 / 0.12);
  border-color: transparent;
  color: #fff;
}
.icon-btn--stage[aria-pressed='true'] {
  background: rgb(138 216 154 / 0.22);
  border-color: transparent;
  color: #a8e6b4;
}

/* assembly toolbar under the stage's top row */
.asm-bar {
  position: absolute;
  top: 56px;
  left: 12px;
  right: 12px;
  display: grid;
  gap: 6px;
  justify-items: start;
  pointer-events: none;
}
.asm-bar > * {
  pointer-events: auto;
}
.asm-bar__label {
  padding: 3px 10px;
  border-radius: 6px;
  background: rgb(27 31 35 / 0.72);
  color: #f1ede2;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(8px);
}
.asm-bar__top {
  pointer-events: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.asm-bar__top > * {
  pointer-events: auto;
}
.asm-bar__mode {
  display: inline-flex;
  padding: 3px;
  border: 1px solid rgb(255 255 255 / 0.08);
  border-radius: 9px;
  background: rgb(27 31 35 / 0.72);
  backdrop-filter: blur(8px);
}
.asm-bar__mode button {
  min-height: 30px;
  padding: 3px 12px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: rgb(241 237 226 / 0.75);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.asm-bar__mode button:hover {
  color: #fff;
}
.asm-bar__mode button[aria-pressed='true'] {
  background: rgb(138 216 154 / 0.25);
  color: #a8e6b4;
}
.asm-bar__label--fits {
  background: #f5c542;
  color: #2a2205;
}
.asm-bar__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgb(255 255 255 / 0.08);
  border-radius: 9px;
  background: rgb(27 31 35 / 0.72);
  backdrop-filter: blur(8px);
}
.asm-bar__tools button {
  min-height: 30px;
  padding: 3px 9px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: rgb(241 237 226 / 0.85);
  font-size: 12.5px;
  font-weight: 560;
  cursor: pointer;
  white-space: nowrap;
}
.asm-bar__tools button:hover:not(:disabled) {
  background: rgb(255 255 255 / 0.12);
  color: #fff;
}
.asm-bar__tools button:disabled {
  opacity: 0.4;
  cursor: default;
}
.asm-bar__tools button[aria-pressed='true'] {
  background: rgb(138 216 154 / 0.22);
  color: #a8e6b4;
}
.asm-bar__sep {
  width: 1px;
  height: 18px;
  margin: 0 3px;
  background: rgb(255 255 255 / 0.15);
}

.asm__hint {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
}
.asm__files {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}
.asm__files .check span {
  overflow-wrap: anywhere;
}
.asm__parts {
  display: grid;
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
  padding: 2px;
  list-style: none;
}
.asm__part {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.asm__part[aria-current='true'] {
  background: var(--accent-wash);
}
.asm__part input {
  accent-color: var(--accent-deep);
  width: 16px;
  height: 16px;
  flex: none;
}
.asm__pick {
  flex: 1;
  min-width: 0;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.asm__part[aria-current='true'] .asm__pick {
  color: var(--accent-ink);
  font-weight: 600;
}
.asm__clear {
  justify-self: start;
}

.readout {
  padding: 6px 10px;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.readout:empty {
  display: none;
}

.stage__status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  pointer-events: none;
}
.stage__status > span:not(.spinner) {
  max-width: 420px;
}
.stage__status--info {
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.stage__status--error {
  color: var(--bad);
}

.spinner {
  width: 26px;
  height: 26px;
  border: 2.5px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

/* ---------- panel ---------- */

.panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.panel__slot {
  display: grid;
  min-width: 0;
}
.panel__slot:empty {
  display: none;
}

.panel__sec {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.eyebrow__file {
  margin-left: 6px;
  font-family: var(--font-mono);
  font-stretch: 100%;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.fit {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}
.fit > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.fit strong {
  font-weight: 650;
}
.fit span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.fit .icon {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  stroke-width: 2;
}
.fit--ok {
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
  background: var(--ok-wash);
}
.fit--ok .icon,
.fit--ok strong {
  color: var(--ok);
}
.fit--bad {
  border-color: color-mix(in srgb, var(--bad) 35%, transparent);
  background: var(--bad-wash);
}
.fit--bad .icon,
.fit--bad strong {
  color: var(--bad);
}

.specs {
  display: grid;
  gap: 6px;
  margin: 0;
}
.specs > div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px;
}
.specs dt {
  color: var(--muted);
  font-size: 13px;
}
.specs dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.specs--quiet dd {
  color: var(--ink-2);
}

.plates {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.plates li {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.plates__n {
  font-weight: 600;
  font-size: 14px;
}
.plates__v {
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-align: right;
}

.swatches {
  display: inline-flex;
  gap: 4px;
}
.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.25) inset;
}

.spec-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.spec-line__k {
  width: 104px;
  color: var(--muted);
}

.note {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--ink-2);
}
.thumbsec {
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}
.thumbsec__img {
  display: grid;
  place-items: center;
  width: 84px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--pei);
  background-size: 180px 180px, cover;
  color: rgb(6 40 16 / 0.6);
}
.thumbsec__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumbsec__body {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.thumbsec__src {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.thumbsec__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.estimate {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
}
.estimate__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.estimate__row strong {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 15px;
}
.estimate__hint {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.note code {
  font-family: var(--font-mono);
  font-size: 12px;
}
.note--warn {
  display: flex;
  gap: 8px;
  background: var(--warn-wash);
  color: var(--warn);
}
.note--warn .icon {
  margin-top: 2px;
}

.printed {
  grid-template-columns: 1fr auto;
  align-items: center;
}
.printed__count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  line-height: 1.3;
}
.printed__count input {
  width: 3.2ch;
  min-width: 2ch;
  padding: 0;
  border: 0;
  border-bottom: 1px dashed var(--line-strong);
  background: none;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 26px;
  text-align: right;
  -moz-appearance: textfield;
}
.printed__count input::-webkit-inner-spin-button,
.printed__count input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}
.printed__count .muted {
  font-size: 12px;
}

.field {
  display: grid;
  gap: 6px;
}
.field__label {
  font-size: 13px;
  font-weight: 560;
  color: var(--ink-2);
}
.field__label .muted {
  font-weight: 420;
}
.field__select {
  position: relative;
  display: flex;
  align-items: center;
}
.field__select .spool {
  position: absolute;
  left: 11px;
  pointer-events: none;
}
.field__select .select {
  padding-left: 32px;
}

.tags-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.tags-edit:focus-within {
  border-color: var(--accent-deep);
}
.tags-edit__chips {
  display: contents;
}
.tags-edit input {
  flex: 1 1 120px;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  padding: 2px;
  font-size: 14px;
}

.files {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.files__row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.files__row:first-child {
  border-top: 0;
}
.files__img {
  width: 34px;
  height: 34px;
  border-radius: 5px;
  object-fit: cover;
}
.files__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
}
.files__info {
  display: grid;
  min-width: 0;
}
.files__name {
  font-size: 14px;
  font-weight: 540;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.files__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.files__actions {
  display: flex;
}
.files__actions .icon-btn {
  width: 30px;
  height: 30px;
}

/* ---------- dialogs ---------- */

.dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.45);
}
.dialog--small {
  width: min(420px, calc(100vw - 32px));
}
.dialog::backdrop {
  background: rgb(18 20 22 / 0.45);
  backdrop-filter: blur(2px);
}
.dialog[open] {
  animation: dialog-in 0.18s ease-out;
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
}

.dialog__body {
  display: grid;
  gap: 16px;
  padding: 20px;
}
.dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -4px -6px -4px 0;
}
.dialog__title {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: 115%;
  font-weight: 740;
  font-size: 20px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.dialog__text {
  margin: 0;
  color: var(--ink-2);
}
.dialog__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.dialog__total {
  margin-right: auto;
  font-family: var(--font-mono);
  font-size: 12px;
}

.pending {
  display: grid;
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  border-block: 1px solid var(--line);
}
.pending li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.pending__ext {
  padding: 1px 0;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-align: center;
}
.pending__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.pending__size {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}
.choice legend {
  margin-bottom: 6px;
  padding: 0;
}
.choice__opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.choice__opt:has(input:checked) {
  border-color: var(--accent-deep);
  background: var(--accent-wash);
}
.choice__opt input {
  margin-top: 4px;
  accent-color: var(--accent-deep);
}
.choice__opt > span {
  display: grid;
  font-size: 14px;
}
.choice__opt strong {
  font-weight: 600;
}
.choice__opt .muted {
  font-size: 12.5px;
}

.progress {
  --p: 0;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}
.progress span {
  --p: 0;
  display: block;
  height: 100%;
  width: calc(var(--p) * 100%);
  background: var(--accent);
  transition: width 0.2s;
}

.theme-list {
  display: grid;
  gap: 6px;
  max-height: 46vh;
  overflow-y: auto;
  margin: 0;
  padding: 2px;
  list-style: none;
}
.theme-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 36px auto 34px;
  align-items: center;
  gap: 8px;
}
.theme-row--new {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.theme-row__count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}
.theme-row__move {
  display: flex;
}

.color-pick {
  --c: #999;
  position: relative;
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 8px solid var(--c);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line-strong);
  cursor: pointer;
}
.color-pick input {
  position: absolute;
  inset: -8px;
  width: 30px;
  height: 30px;
  opacity: 0;
  cursor: pointer;
}
.color-pick:focus-within {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

/* ---------- drop overlay & toasts ---------- */

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(18 20 22 / 0.5);
  backdrop-filter: blur(3px);
  pointer-events: none;
}
.drop-overlay__plate {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  width: min(520px, 100%);
  aspect-ratio: 1.5;
  border-radius: 18px;
  background: var(--pei);
  background-size: 180px 180px, cover;
  color: #072512;
  box-shadow: 0 0 0 2px rgb(215 255 222 / 0.5) inset, 0 40px 80px -20px rgb(0 0 0 / 0.6);
  text-align: center;
  animation: plate-in 0.2s ease-out;
}
@keyframes plate-in {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
}
.drop-overlay__title {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-stretch: 122%;
  font-weight: 780;
  font-size: 24px;
}
.drop-overlay__hint {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  opacity: 0.8;
}

.toasts {
  position: fixed;
  z-index: 60;
  inset: auto auto 20px 50%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  overflow: visible;
  color: inherit;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(480px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 9px;
  background: #1f2327;
  color: #f1ede2;
  font-size: 14px;
  box-shadow: 0 12px 30px -10px rgb(0 0 0 / 0.5);
  pointer-events: auto;
  animation: toast-in 0.2s ease-out;
  transition: opacity 0.3s, transform 0.3s;
}
.toast > span {
  overflow-wrap: anywhere;
}
.toast--error {
  background: #7d2516;
}
.toast--warn {
  background: #4a3a17;
}
.toast--out {
  opacity: 0;
  transform: translateY(6px);
}
.toast--progress {
  display: grid;
  min-width: 260px;
}
.toast--progress .progress {
  background: rgb(255 255 255 / 0.15);
}
.toast__link {
  color: #a8e6b4;
  font-weight: 600;
  white-space: nowrap;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .detail__body {
    grid-template-columns: minmax(0, 1fr);
  }
  .stage {
    position: relative;
    top: 0;
    height: min(62vh, 560px);
  }
}

@media (max-width: 820px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: static;
    height: auto;
    gap: 10px;
    padding: 14px 16px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    grid-auto-flow: column;
    justify-content: start;
    align-items: baseline;
    gap: 10px;
    padding: 0;
  }
  .nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin: 0 -16px;
    padding: 2px 16px 6px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar {
    display: none;
  }
  .nav__item {
    flex: none;
    min-height: 32px;
    border: 1px solid var(--line);
    background: var(--surface);
  }
  .nav__label {
    overflow: visible;
  }
  .nav__eyebrow,
  .nav__head .eyebrow,
  .sidebar__stats {
    display: none;
  }
  /* account line sits right under the wordmark */
  .brand {
    order: 0;
  }
  .sidebar__foot {
    order: 1;
    margin: -4px 0 0;
    padding: 0;
    border: 0;
  }
  .nav {
    order: 2;
  }
  .tags-nav {
    order: 3;
  }
  .account {
    margin: 0;
    gap: 12px;
  }
  .account__name {
    flex-basis: auto;
    font-weight: 500;
    color: var(--muted);
  }
  .tagcloud {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -16px;
    padding: 0 16px 4px;
    scrollbar-width: none;
  }
  .tagcloud .tag {
    flex: none;
  }
  .nav__head {
    flex: none;
    order: 99;
    padding: 0;
  }
  .nav__head .link {
    min-height: 32px;
    padding: 0 10px;
  }
  .nav__add {
    flex: none;
    order: 100;
    margin: 0;
    white-space: nowrap;
  }
  .main {
    padding: 16px 16px 48px;
  }
  .toolbar .seg {
    order: 3;
  }
  .search {
    flex-basis: 100%;
  }
  .search kbd {
    display: none;
  }
  .toolbar .btn--primary {
    margin-left: auto;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 18px 12px;
  }
  .detail__head {
    flex-wrap: wrap;
  }
  .detail__name {
    flex-basis: 100%;
  }
  .detail__actions {
    margin-left: auto;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .theme-row {
    grid-template-columns: 30px minmax(0, 1fr) auto 30px;
  }
  .theme-row__count {
    display: none;
  }
  .stage__bottom {
    flex-wrap: wrap;
  }
  #file-switch {
    max-width: 100%;
  }
}

@media (max-width: 420px) {
  .brand__sub {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
