@font-face {
  font-family: "GeistMono";
  src: url("/fonts/GeistMono-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "GeistMono";
  src: url("/fonts/GeistMono-Medium.otf") format("opentype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "GeistMono";
  src: url("/fonts/GeistMono-Bold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --noir-000: #000000;
  --noir-004: #040404;
  --noir-008: #080808;
  --noir-00c: #0c0c0c;
  --noir-010: #101010;
  --noir-018: #181818;
  --noir-024: #242424;
  --noir-032: #323232;
  --noir-040: #404040;
  --noir-056: #565656;
  --noir-072: #727272;
  --bg: var(--noir-000);
  --bg-1: var(--noir-004);
  --bg-2: var(--noir-008);
  --bg-3: var(--noir-00c);
  --bg-4: var(--noir-010);
  --line: rgba(255,255,255,.06);
  --line-strong: rgba(255,255,255,.14);
  --text: #efefef;
  --text-soft: #b9b9b9;
  --text-dim: #7f7f7f;
  --shadow: 0 28px 72px rgba(0,0,0,.55);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --np-accent: 128;
  --signal-rgb: 188, 188, 188;
  --ease: cubic-bezier(.2,.9,.2,1);
  --topbar-height: 118px;
  --glass: rgba(255,255,255,.03);
  --glass-border: rgba(255,255,255,.06);
  --glass-hover: rgba(255,255,255,.07);
  --glow-soft: 0 0 40px rgba(255,255,255,.03);
  --card-enter-duration: 360ms;
  --card-enter-ease: cubic-bezier(.16,1,.3,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  overflow: hidden;
  font-family: "GeistMono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

/* ── Studio Grid Layout ─────────────────────────────────────────── */

.studio {
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-template-rows: var(--topbar-height) 1fr 28px;
  grid-template-areas:
    "toolbar topbar"
    "toolbar canvas"
    "toolbar statusbar";
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.studio::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(var(--signal-rgb), .06), transparent 42%),
    linear-gradient(90deg, rgba(255,255,255,.015), transparent 12%, transparent 88%, rgba(255,255,255,.015)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.01) 0 1px, transparent 1px 48px);
  opacity: .7;
  transition: opacity 220ms var(--ease), transform 360ms var(--ease), filter 220ms var(--ease);
}

.studio > * {
  position: relative;
  z-index: 1;
}

.studio.is-signaling::before {
  opacity: 1;
  transform: scale(1.015);
  filter: saturate(1.2);
}

/* ── Toolbar (left, 48px) ────────────────────────────────────────── */

.studio-toolbar {
  grid-area: toolbar;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px 10px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.018), transparent),
    rgba(3,3,3,.9);
  border-right: 1px solid var(--line);
}

.tool-btn {
  appearance: none;
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,.02);
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.tool-btn:hover {
  background: rgba(255,255,255,.05);
  color: var(--text-soft);
}
.tool-btn.is-active {
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border-color: rgba(255,255,255,.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
  color: var(--text);
}
.tool-btn::after {
  content: attr(data-tool-label);
  position: absolute;
  left: 56px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text-soft);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms, transform 120ms;
  box-shadow: 0 8px 20px rgba(0,0,0,.3);
}
.tool-btn:hover::after,
.tool-btn:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(2px);
}

.toolbar-sep {
  width: 24px;
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.toolbar-readout {
  margin-top: auto;
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 8px 6px;
  border: 1px solid rgba(255,255,255,.035);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.008)),
    rgba(7,7,7,.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.toolbar-readout-label {
  display: block;
  font-size: 8.5px;
  line-height: 1.15;
  letter-spacing: .04em;
  color: var(--text-soft);
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.toolbar-readout-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
  font-size: 11px;
  color: var(--text);
}

/* ── Topbar ──────────────────────────────────────────────────────── */

.studio-topbar {
  grid-area: topbar;
  background:
    linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,.004)),
    rgba(3,3,3,.9);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 22px;
  min-width: 0;
  min-height: var(--topbar-height);
  row-gap: 12px;
  box-shadow:
    inset 0 -1px 0 rgba(255,255,255,.02),
    0 16px 40px rgba(0,0,0,.22);
}

.topbar-brandlock {
  display: grid;
  gap: 2px;
  align-content: center;
  min-width: 224px;
  padding: 4px 12px 4px 0;
  position: relative;
}

.topbar-brandlock::after {
  content: "";
  position: absolute;
  right: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.12), transparent);
}

.topbar-kicker {
  font-size: 9px;
  letter-spacing: .28em;
  color: var(--text-dim);
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar-brand {
  font-weight: 700;
  font-size: 30px;
  letter-spacing: .08em;
  color: var(--text);
  text-transform: uppercase;
  white-space: nowrap;
  line-height: .96;
  text-shadow: 0 0 24px rgba(var(--signal-rgb), .08);
}

.topbar-brand-note {
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--text-soft);
  text-transform: uppercase;
  white-space: nowrap;
  opacity: .75;
}

.topbar-sep {
  width: 1px;
  height: 36px;
  background: var(--line);
  flex-shrink: 0;
}

.topbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.topbar-btn {
  appearance: none;
  height: 32px;
  min-width: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 120ms, border-color 120ms, color 120ms;
  white-space: nowrap;
}
.topbar-btn:hover:not(:disabled) {
  background: rgba(255,255,255,.04);
  border-color: var(--line-strong);
  color: var(--text-soft);
}
.topbar-btn.is-active {
  background: rgba(255,255,255,.06);
  border-color: var(--line-strong);
  color: var(--text);
}
.topbar-btn:disabled {
  opacity: .35;
  cursor: default;
}

.topbar-label {
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--text-dim);
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar-spacer {
  flex: 1;
  min-width: 8px;
}

.sidebar-toggle {
  margin-left: auto;
}

.mobile-dock-toggle {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 11;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)),
    rgba(7,7,7,.92);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 18px 40px rgba(0,0,0,.38);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 160ms var(--ease), opacity 160ms var(--ease), border-color 120ms var(--ease), background 120ms var(--ease);
}

.mobile-dock-toggle:hover {
  border-color: rgba(255,255,255,.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.02)),
    rgba(10,10,10,.96);
}

.topbar-status-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  order: 20;
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
  overflow: hidden;
  margin-left: 0;
}

.topbar-status-label {
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--text-dim);
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-status {
  flex: 1;
  font-size: 11px;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 180ms var(--ease), text-shadow 180ms var(--ease), transform 180ms var(--ease);
}

.topbar-status.is-hot {
  color: var(--text);
  text-shadow: 0 0 16px rgba(var(--signal-rgb), .22);
  transform: translateY(-1px);
}

.studio.is-dock-open .studio-topbar {
  row-gap: 12px;
}

.studio.is-dock-open .topbar-spacer {
  display: none;
}

/* ── Canvas Area ─────────────────────────────────────────────────── */

.studio-canvas {
  grid-area: canvas;
  background:
    radial-gradient(circle at 50% 44%, rgba(var(--signal-rgb), .05), transparent 48%),
    linear-gradient(180deg, rgba(255,255,255,.012), transparent 16%),
    var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  padding: clamp(18px, 2.2vw, 30px);
}

.studio-dock-scrim {
  position: absolute;
  inset: var(--topbar-height) 0 0 0;
  background: rgba(0,0,0,.46);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  z-index: 8;
  transition: opacity 180ms var(--ease);
}

.studio.is-dock-open .studio-dock-scrim {
  opacity: .18;
  pointer-events: auto;
}

.studio-canvas::before,
.studio-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.studio-canvas::before {
  background:
    radial-gradient(circle at 50% 50%, rgba(var(--signal-rgb), .14), rgba(var(--signal-rgb), .03) 24%, transparent 58%);
  opacity: .16;
  transform: scale(.96);
  transition: opacity 220ms var(--ease), transform 360ms var(--ease), filter 220ms var(--ease);
}

.studio-canvas::after {
  background:
    linear-gradient(90deg, transparent 0%, rgba(var(--signal-rgb), .03) 46%, rgba(var(--signal-rgb), .18) 50%, rgba(var(--signal-rgb), .03) 54%, transparent 100%);
  opacity: 0;
  transform: translateX(-120%);
}

.studio.is-signaling .studio-canvas::before {
  opacity: .52;
  transform: scale(1.02);
  filter: saturate(1.18);
}

.studio.is-signaling .studio-canvas::after {
  opacity: .55;
  animation: studioSweep 620ms var(--ease);
}

.studio.is-trait .studio-canvas::before {
  opacity: .62;
  filter: blur(.3px) saturate(1.05);
}

.studio.is-surprise .studio-canvas::after {
  opacity: .75;
  animation-duration: 760ms;
}

.studio-canvas canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.canvas-stage-shell {
  width: min(100%, 1040px);
  height: min(100%, 1000px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  align-content: center;
  justify-items: center;
  transition: transform 220ms var(--ease);
}

.studio.is-dock-open .canvas-stage-shell {
  transform: translateX(calc(-1 * var(--dock-stage-shift, clamp(84px, 7vw, 128px))));
}

.canvas-stage-head,
.canvas-stage-foot {
  width: min(100%, 920px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.canvas-stage-head {
  padding: 0 22px 0 10px;
  flex-wrap: wrap;
  row-gap: 10px;
}

.canvas-stage-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.canvas-stage-kicker {
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.canvas-stage-title {
  text-align: left;
  font-size: 12px;
  color: var(--text-soft);
  letter-spacing: .04em;
}

.canvas-quickbar {
  display: grid;
  gap: 10px;
  justify-items: start;
  margin-left: auto;
  padding-inline-end: 18px;
  max-width: min(100%, 460px);
}

.canvas-quick-color {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.03);
}

.canvas-quick-label {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.canvas-quick-swatch {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}

.canvas-color-input {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.canvas-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.canvas-color-input::-webkit-color-swatch {
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
}

.canvas-quick-hex {
  width: 92px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.28);
  color: var(--text);
  font: 600 11px/1 var(--font-mono, monospace);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.canvas-quick-paint,
.canvas-start-rail {
  justify-self: end;
}

.canvas-quick-deck {
  min-height: 28px;
}

.studio.is-dock-open .canvas-stage-head,
.studio.is-dock-open .canvas-stage-foot,
.studio.is-dock-open .canvas-stage-surface {
  width: min(100%, 760px);
}

.canvas-stage-surface {
  position: relative;
  width: min(100%, 920px, calc(100vh - 240px));
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 100%;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.004)),
    rgba(0,0,0,.52);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.025),
    inset 0 0 0 1px rgba(255,255,255,.015),
    0 28px 90px rgba(0,0,0,.38);
  overflow: hidden;
}

.canvas-stage-surface::before,
.canvas-stage-surface::after {
  content: "";
  position: absolute;
  inset: 14px;
  pointer-events: none;
  border-radius: 18px;
}

.canvas-stage-surface::before {
  border: 1px solid rgba(255,255,255,.04);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.01);
}

.canvas-stage-surface::after {
  inset: 20px;
  border:
    1px solid transparent;
  background:
    linear-gradient(90deg, rgba(255,255,255,.08), transparent 18%, transparent 82%, rgba(255,255,255,.08)) border-box;
  -webkit-mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .26;
}

.canvas-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 32px;
  text-align: center;
  color: var(--text-dim);
  pointer-events: none;
}

.canvas-empty-kicker {
  font-size: 10px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.canvas-empty strong {
  font-size: clamp(22px, 3vw, 36px);
  letter-spacing: .03em;
  line-height: 1.02;
  color: var(--text);
}

.canvas-empty-copy {
  max-width: 520px;
  margin: 0 auto;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-soft);
}

[hidden] {
  display: none !important;
}

.canvas-stage-foot {
  justify-content: flex-start;
  flex-wrap: wrap;
  padding: 0 8px;
}

.canvas-stage-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 999px;
  background: rgba(255,255,255,.018);
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */

.studio-sidebar {
  position: absolute;
  top: 106px;
  right: 16px;
  bottom: 18px;
  left: auto;
  width: clamp(332px, 29vw, 392px);
  max-height: none;
  z-index: 12;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 18%),
    linear-gradient(90deg, rgba(255,255,255,.01), transparent 14%),
    var(--bg-1);
  border: 1px solid rgba(255,255,255,.06);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.02),
    0 22px 80px rgba(0,0,0,.4);
  transform: translateX(calc(100% + 22px));
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms var(--ease), opacity 180ms var(--ease), box-shadow 220ms var(--ease);
}

.studio-sidebar.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.sidebar-pill {
  display: none;
}

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

.sidebar-hero-copyblock {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.sidebar-hero,
.sidebar-section {
  position: relative;
  border: 1px solid rgba(255,255,255,.045);
  border-radius: 16px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.006));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
  transition: border-color 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease);
}

.sidebar-hero {
  overflow: hidden;
  flex: 0 0 auto;
}

.sidebar-section {
  overflow: visible;
  flex: 0 0 auto;
}

.studio-subheading {
  display: block;
  margin: 0 0 10px;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.gallery-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gallery-refresh {
  appearance: none;
  min-width: 58px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 999px;
  background: rgba(255,255,255,.02);
  color: var(--text-dim);
  font: inherit;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}

.gallery-refresh:hover {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.12);
  color: var(--text-soft);
}

.gallery-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 999px;
  background: rgba(255,255,255,.016);
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: .12em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 120ms, border-color 120ms, color 120ms;
}

.gallery-open-link:hover {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.12);
  color: var(--text-soft);
}

.gallery-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}

.gallery-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 12px;
  background: rgba(255,255,255,.016);
  text-decoration: none;
  color: inherit;
  transition: background 120ms, border-color 120ms, transform 120ms, box-shadow 120ms;
}

.gallery-card:hover {
  background: rgba(255,255,255,.035);
  border-color: rgba(255,255,255,.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,.16);
}

.gallery-card-shell {
  display: grid;
  gap: 6px;
}

.gallery-vote-inline {
  width: 100%;
  justify-content: center;
}

.gallery-vote-inline.is-active {
  border-color: rgba(255,255,255,.18);
  color: var(--text-soft);
}

.gallery-thumb {
  width: 72px;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.32);
  object-fit: cover;
  image-rendering: pixelated;
}

.gallery-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
  align-content: start;
}

.gallery-title {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-soft);
}

.gallery-subline {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: .04em;
}

.gallery-signature {
  color: var(--text-soft);
}

.gallery-palette-strip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.gallery-palette-chip {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,.12);
  flex-shrink: 0;
}

.gallery-palette-count {
  font-size: 9px;
  color: var(--text-dim);
}

.gallery-empty {
  padding: 18px 14px;
  border: 1px dashed rgba(255,255,255,.06);
  border-radius: 10px;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.6;
}

.gallery-color-pair {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.gallery-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.studio-dock-section {
  border-color: rgba(255,255,255,.09);
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01));
  padding: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.025),
    0 10px 30px rgba(0,0,0,.14);
}

.sidebar-section:not(.studio-dock-section) {
  border-color: rgba(255,255,255,.03);
  padding: 10px 12px;
  background: rgba(255,255,255,.008);
  box-shadow: none;
}

.source-section {
  opacity: .94;
}

.sidebar-hero::before,
.sidebar-section::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  pointer-events: none;
}

.sidebar-hero {
  display: grid;
  gap: 6px;
  padding: 14px 14px 12px;
}

.sidebar-hero-kicker {
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.sidebar-hero-title {
  font-size: 20px;
  line-height: 1.08;
  letter-spacing: .02em;
  color: var(--text);
}

.sidebar-hero-copy {
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 60ch;
}

.dock-dismiss {
  appearance: none;
  min-width: 58px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 999px;
  background: rgba(255,255,255,.02);
  color: var(--text-dim);
  font: inherit;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}

.dock-dismiss:hover {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.12);
  color: var(--text-soft);
}

.studio.is-signaling .sidebar-hero,
.studio.is-signaling .sidebar-section {
  border-color: rgba(255,255,255,.08);
  background:
    linear-gradient(180deg, rgba(var(--signal-rgb), .028), rgba(255,255,255,.008) 56%);
}

.studio.is-signaling .studio-dock-section {
  border-color: rgba(var(--signal-rgb), .18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.025),
    0 0 24px rgba(var(--signal-rgb), .04);
}

/* ── Family kicker ─────────────────────────────────────────────── */

.deck-family-kicker {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  margin-bottom: 4px;
  transition: color 180ms var(--ease), text-shadow 180ms var(--ease);
}

.studio.is-signaling .deck-family-kicker {
  color: rgba(var(--signal-rgb), .55);
  text-shadow: 0 0 12px rgba(var(--signal-rgb), .12);
}

/* ── Modifier dividers ─────────────────────────────────────────── */

.modifier-group {
  display: grid;
  gap: 8px;
}

.modifier-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
}

/* ── Variant panel slider card ─────────────────────────────────── */

.no-field-meters {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 10px;
  background: rgba(255,255,255,.01);
}

.no-field-meter-hint {
  grid-column: 1 / -1;
  font-size: 10px;
  line-height: 1.35;
  color: var(--text-dim);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  transition: max-height 280ms var(--ease), opacity 220ms var(--ease), margin 280ms var(--ease);
}

label.no-field-meter:focus-within .no-field-meter-hint {
  max-height: 40px;
  opacity: .7;
  margin-top: -4px;
  margin-bottom: 2px;
}

.sidebar-heading {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: .14em;
  margin-bottom: 10px;
}

.dock-sub-heading {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-top: 16px;
  margin-bottom: 6px;
}

.mini-note {
  font-size: 11px;
  line-height: 1.55;
  color: rgba(255,255,255,.28);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-bottom: 0;
  transition: max-height 280ms var(--ease), opacity 220ms var(--ease), margin-bottom 280ms var(--ease);
}

.modifier-group:hover .mini-note,
.modifier-group:focus-within .mini-note,
.dock-advanced-body:hover > .mini-note,
.dock-advanced-body:focus-within > .mini-note {
  max-height: 60px;
  opacity: 1;
  margin-bottom: 10px;
}

/* mini-notes that live outside modifier-groups stay visible */
.sidebar-hero .mini-note,
.sidebar-section > .mini-note,
.variant-panel .mini-note,
.no-field-panel .mini-note {
  max-height: none;
  overflow: visible;
  opacity: 1;
  margin-bottom: 10px;
}

/* Palette family inline label */
.deck-palette-label {
  font-size: 10px;
  color: rgba(255,255,255,.28);
  letter-spacing: .08em;
  margin-bottom: 6px;
}

/* Color section */
.color-sliders {
  display: grid;
  gap: 6px;
}
.color-slider-row {
  display: grid;
  grid-template-columns: 40px 1fr 48px;
  gap: 6px;
  align-items: center;
}
.color-slider-label {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}
.color-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-3);
  outline: none;
  cursor: pointer;
}
.color-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--bg);
  cursor: pointer;
}
.color-slider-value {
  font-size: 11px;
  color: var(--text-soft);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.color-hex-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}
.color-preview {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
}
.color-hex-input {
  width: 100%;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  letter-spacing: .04em;
}
.color-hex-input:focus-visible {
  outline: none;
  border-color: var(--line-strong);
}

/* Palette swatches */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(24px, 1fr));
  gap: 4px;
}
.palette-swatch {
  appearance: none;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  transition: border-color 120ms, transform 120ms;
}
.palette-swatch:hover {
  border-color: var(--line-strong);
  transform: scale(1.15);
}
.palette-swatch.is-active {
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--text);
}

.palette-swatch.is-source-selected {
  border-color: rgba(255,255,255,.8);
  box-shadow: 0 0 0 2px rgba(255,255,255,.2);
}

.palette-swatch.is-mapped::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.45);
  background: rgba(0,0,0,.35);
}

.palette-swatch {
  position: relative;
}

.palette-curation {
  margin-top: 8px;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  background: rgba(255,255,255,.01);
}

.palette-curation-readout {
  font-size: 10px;
  color: var(--text-soft);
  letter-spacing: .03em;
}

.palette-curation-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

/* Preset tabs */
.preset-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,.008));
}
.preset-tab {
  appearance: none;
  min-height: 32px;
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 9px;
  background: rgba(255,255,255,.01);
  color: var(--text-dim);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms, transform 120ms;
}
.preset-tab:hover {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.09);
  color: var(--text-soft);
  transform: translateY(-1px);
}
.preset-tab.is-active {
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.03));
  border-color: rgba(255,255,255,.18);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 8px 20px rgba(0,0,0,.2);
}

.preset-list {
  display: grid;
  gap: 4px;
}
.preset-btn {
  appearance: none;
  width: 100%;
  text-align: left;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
.preset-btn:hover {
  background: rgba(255,255,255,.03);
  border-color: var(--line-strong);
}

.preset-btn.is-active {
  background: rgba(255,255,255,.06);
  border-color: var(--line-strong);
  color: var(--text);
}

.preset-btn--hero {
  min-height: 44px;
  border-color: rgba(255,255,255,.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.025));
  color: var(--text);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    0 6px 18px rgba(0,0,0,.18);
  transition: background 120ms, border-color 120ms, transform 120ms, box-shadow 120ms;
}

.preset-btn--hero:hover {
  background:
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.035));
  border-color: rgba(255,255,255,.18);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 10px 24px rgba(0,0,0,.22);
}

.preset-btn--signature {
  min-height: 36px;
  border-color: rgba(255,255,255,.09);
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.preset-btn--gallery {
  min-height: 34px;
  border-color: rgba(255,255,255,.075);
  background: rgba(255,255,255,.018);
  color: var(--text-soft);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.preset-btn--gallery:disabled {
  opacity: .45;
  cursor: default;
}

.preset-btn--gallery-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.gallery-signature-field {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.gallery-signature-label {
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.gallery-signature-input {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  background: rgba(255,255,255,.02);
  color: var(--text-soft);
  font: inherit;
  font-size: 12px;
  letter-spacing: .02em;
  padding: 0 10px;
}

.gallery-signature-input:focus {
  outline: none;
  border-color: rgba(255,255,255,.18);
}

.gallery-save-actions {
  display: grid;
  gap: 8px;
  margin: 10px 0 10px;
}

.studio-hero-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.variant-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.006));
}

.role-pair-readout {
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 6px;
  background: rgba(255,255,255,.028);
  color: var(--text-soft);
  font-size: 10px;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.hero-role-pair {
  margin-top: 2px;
  margin-bottom: 8px;
}

.dock-advanced {
  margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 10px;
  background: rgba(255,255,255,.018);
}

.dock-advanced-summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 10px;
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--text-dim);
  text-transform: uppercase;
}

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

.dock-advanced[open] .dock-advanced-summary {
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.dock-advanced-body {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.dock-advanced-body [data-role="dither-controls"] {
  display: grid;
  gap: 8px;
}

.variant-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.variant-action-grid--rail {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.variant-action-grid > .preset-btn {
  min-width: 0;
}

.variant-lock-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.variant-lock-rail .theory-btn {
  flex: 1 1 120px;
}

.variant-rail-grid {
  display: grid;
  gap: 8px;
}

.variant-rail-card {
  appearance: none;
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  background: rgba(255,255,255,.018);
  color: var(--text-soft);
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.variant-rail-card:hover {
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.03);
  transform: translateY(-1px);
}

.variant-rail-card.is-active {
  border-color: rgba(255,255,255,.22);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.variant-rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.variant-rail-strip {
  display: flex;
  gap: 4px;
}

.variant-rail-swatch {
  width: 100%;
  min-width: 0;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
}

.variant-rail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.variant-rail-chip {
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 999px;
  background: rgba(255,255,255,.024);
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.variant-rail-empty {
  padding: 12px;
  border: 1px dashed rgba(255,255,255,.08);
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.5;
}

.no-field-panel {
  gap: 12px;
}

.no-field-guidance {
  margin: -4px 0 2px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.no-field-meter {
  display: grid;
  grid-template-columns: 94px 1fr 52px;
  gap: 8px 8px;
  align-items: center;
}

[data-role="family-modifiers-panel"] {
  display: grid;
  gap: 8px;
}

.no-field-meter-label {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.variant-title {
  font-size: 11px;
  color: var(--text-soft);
  letter-spacing: .04em;
}

.variant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.variant-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: .04em;
}

.theory-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.noise-target-rail {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pop-sheet-style-rail {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pop-sheet-rail {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pop-sheet-style-rail .theory-btn {
  min-width: 0;
  padding: 0 6px;
  font-size: 11px;
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theory-btn {
  appearance: none;
  height: 28px;
  border: 1px solid rgba(255,255,255,.03);
  border-radius: 8px;
  background: transparent;
  color: rgba(255,255,255,.28);
  font: inherit;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}

.theory-btn:hover {
  background: rgba(255,255,255,.03);
  border-color: var(--line-strong);
  color: var(--text-soft);
}

.theory-btn.is-active {
  background: rgba(255,255,255,.06);
  border-color: var(--line-strong);
  color: var(--text);
}

.machine-drawer {
  padding: 0;
}

.machine-drawer-summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

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

.machine-drawer[open] .machine-drawer-summary {
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.machine-drawer-body {
  padding: 10px 12px 12px;
}

/* Server modes */
.server-mode-rail {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}
.server-mode-btn {
  appearance: none;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
.server-mode-btn:hover {
  background: rgba(255,255,255,.03);
  border-color: var(--line-strong);
}
.server-mode-btn.is-active {
  background: rgba(255,255,255,.06);
  border-color: var(--line-strong);
  color: var(--text);
}
.server-mode-btn small {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

.server-block-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.server-block-input {
  width: 100%;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  text-align: center;
  letter-spacing: .06em;
}
.server-block-input:focus-visible {
  outline: none;
  border-color: var(--line-strong);
}

.server-generate-btn {
  appearance: none;
  width: 100%;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01));
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background 120ms, transform 120ms;
}
.server-generate-btn:hover:not(:disabled) {
  background: rgba(255,255,255,.06);
  transform: translateY(-1px);
}
.server-generate-btn:disabled {
  opacity: .4;
  cursor: default;
}

/* Dither controls */
.dither-colors {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.dither-color-btn {
  appearance: none;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
}
.dither-color-btn.is-active {
  border-color: var(--text);
}
.dither-add-btn {
  appearance: none;
  width: 24px;
  height: 24px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dither-add-btn:hover { border-color: var(--line-strong); color: var(--text-soft); }

.dither-strength-row {
  display: grid;
  grid-template-columns: 1fr 36px;
  gap: 6px;
  align-items: center;
}

/* Export section */
.export-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.export-btn {
  appearance: none;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
.export-btn:hover {
  background: rgba(255,255,255,.03);
  border-color: var(--line-strong);
}
.export-btn--full {
  grid-column: 1 / -1;
}
.export-btn:disabled {
  opacity: .4;
  cursor: default;
}

/* ── Statusbar ───────────────────────────────────────────────────── */

.studio-statusbar {
  grid-area: statusbar;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  background: rgba(3,3,3,.9);
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--text-dim);
  min-height: 28px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.status-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.status-sep {
  width: 1px;
  height: 16px;
  background: var(--line);
  flex-shrink: 0;
}

/* ── Picker (inside sidebar) ─────────────────────────────────────── */

.picker-shell {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.picker-shell .panel-head {
  display: none;
}
.picker-search {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 6px;
}
.picker-search input {
  width: 100%;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
}
.picker-search input:focus-visible {
  outline: none;
  border-color: var(--line-strong);
}
.picker-search .chip-btn {
  display: none;
}
.picker-status {
  font-size: 10px;
  color: var(--text-dim);
  margin: 0;
}
.picker-results {
  display: grid;
  gap: 4px;
  max-height: 180px;
  overflow: auto;
}
.picker-result {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 6px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  padding: 4px;
  cursor: pointer;
  font: inherit;
}
.picker-result:hover { border-color: var(--line-strong); background: rgba(255,255,255,.02); }
.picker-result.is-selected {
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
}
.picker-thumb {
  display: block;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
  background-repeat: no-repeat;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.08);
}
.picker-copy { min-width: 0; display: grid; gap: 1px; }
.picker-copy strong {
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.picker-copy small {
  display: block;
  font-size: 9px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.picker-id {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: .06em;
}
.picker-empty {
  display: grid;
  gap: 4px;
  border: 1px dashed rgba(255,255,255,.08);
  border-radius: 6px;
  padding: 8px;
  color: var(--text-dim);
  font-size: 11px;
}
.picker-empty strong { color: var(--text-soft); font-size: 11px; }
.micro-label { display: none; }
.panel-title { display: none; }
.panel-subtle { display: none; }

/* ── Scrollbar ────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }

/* ── Server status indicator ─────────────────────────────────────── */

.server-status {
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.server-status[data-mode="ready"] { color: #d8d8d8; }
.server-status[data-mode="error"] { color: #f0bdbd; }
.server-status[data-mode="warn"] { color: #e5d6b5; }

/* ── Busy state ──────────────────────────────────────────────────── */

.studio.is-busy .server-generate-btn {
  opacity: .5;
  pointer-events: none;
}

/* ── Export busy state ─────────────────────────────────────────── */

.studio.is-exporting .studio-sidebar {
  pointer-events: none;
}

.studio.is-exporting .studio-sidebar > *:not(:last-child) {
  opacity: .45;
}

.studio.is-exporting .studio-canvas::before {
  opacity: .3;
  animation: exportPulse 1.2s ease-in-out infinite;
}

@keyframes exportPulse {
  0%, 100% { opacity: .2; }
  50% { opacity: .38; }
}

@keyframes studioSweep {
  0% {
    opacity: 0;
    transform: translateX(-120%);
  }
  18% {
    opacity: .85;
  }
  100% {
    opacity: 0;
    transform: translateX(120%);
  }
}

/* ── Responsive: sidebar drawer below 900px ──────────────────────── */

@media (max-width: 900px) {
  .studio {
    --topbar-height: 108px;
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-height) 1fr;
    grid-template-areas:
      "topbar"
      "canvas";
  }

  .studio-toolbar {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    z-index: 12;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    border-right: none;
    border-top: 1px solid rgba(255,255,255,.08);
    background:
      linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.008)),
      rgba(5,5,5,.94);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.02),
      0 -18px 40px rgba(0,0,0,.34);
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .studio-toolbar::-webkit-scrollbar {
    display: none;
  }

  .tool-btn {
    width: auto;
    min-width: 62px;
    height: auto;
    min-height: 56px;
    padding: 8px 10px 7px;
    border-radius: 12px;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 5px;
  }

  .tool-btn::after {
    position: static;
    transform: none;
    opacity: 1;
    border: none;
    background: none;
    box-shadow: none;
    padding: 0;
    font-size: 8px;
    line-height: 1.05;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-dim);
    white-space: nowrap;
  }

  .tool-btn:hover::after,
  .tool-btn:focus-visible::after {
    transform: none;
  }

  .toolbar-sep {
    width: 1px;
    min-width: 1px;
    height: auto;
    margin: 8px 2px;
    align-self: stretch;
  }

  .toolbar-readout {
    margin-top: 0;
    min-width: 92px;
    padding: 8px 10px;
    flex: 0 0 auto;
    align-content: center;
  }

  .studio-statusbar {
    display: none;
  }

  .studio-topbar {
    min-height: var(--topbar-height);
    padding: 10px 12px 8px;
    gap: 8px;
    row-gap: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .topbar-brandlock {
    min-width: auto;
    padding-right: 0;
    grid-column: 1;
  }

  .topbar-brand {
    font-size: 18px;
  }

  .topbar-sep,
  .topbar-spacer,
  .topbar-group--history,
  .topbar-status-shell,
  .sidebar-toggle {
    display: none;
  }

  .canvas-stage-shell {
    width: 100%;
    height: 100%;
    gap: 10px;
    transform: none !important;
    justify-content: flex-start;
  }

  .canvas-stage-head,
  .canvas-stage-foot,
  .canvas-stage-surface {
    width: 100%;
  }

  .canvas-stage-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 0;
  }

  .canvas-quickbar {
    justify-items: stretch;
  }

  .canvas-quick-color,
  .canvas-quick-paint,
  .canvas-start-rail {
    justify-self: stretch;
  }

  .canvas-quick-color {
    flex-wrap: wrap;
  }

  .canvas-stage-surface {
    width: min(100%, calc(100vw - 24px));
    max-width: min(100%, calc(100dvh - 240px));
    border-radius: 18px;
  }

  .topbar-kicker,
  .topbar-brand-note,
  .topbar-status-label {
    display: none;
  }

  .studio-dock-scrim {
    inset: var(--topbar-height) 0 0 0;
  }

  .studio-sidebar {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: min(68dvh, 640px);
    border-radius: 24px 24px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
    transform: translateY(calc(100% + 12px));
    opacity: 1;
    -webkit-overflow-scrolling: touch;
    backdrop-filter: blur(20px) saturate(1.15);
    -webkit-backdrop-filter: blur(20px) saturate(1.15);
    box-shadow: 0 -20px 60px rgba(0,0,0,.5);
    transition: transform 280ms var(--ease);
  }

  .studio-sidebar.is-open {
    transform: translateY(0);
  }

  .sidebar-pill {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,.16);
    margin: 0 auto 8px;
    flex-shrink: 0;
  }

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

  .studio.is-dock-open .canvas-stage-shell {
    transform: none;
  }

  .mobile-dock-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    bottom: calc(96px + env(safe-area-inset-bottom));
    z-index: 13;
  }

  .studio.is-dock-open .mobile-dock-toggle {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(10px);
  }

  .studio-canvas {
    align-items: flex-start;
    overflow: auto;
    padding: 12px 12px calc(172px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  .canvas-stage-head {
    padding: 0 4px;
  }

  .canvas-stage-foot {
    padding: 0 2px;
    gap: 8px;
  }

  .canvas-stage-chip {
    min-height: 22px;
    padding: 0 8px;
    font-size: 10px;
  }

  .dock-dismiss {
    min-width: 44px;
    height: 32px;
    padding: 0 10px;
  }

  .gallery-list {
    max-height: none;
  }

  .no-gallery-page {
    padding: 14px;
  }

  .no-gallery-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .no-gallery-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .no-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

  /* mini-notes visible on mobile (no hover) */
  .mini-note {
    max-height: none;
    overflow: visible;
    opacity: 1;
    margin-bottom: 10px;
  }
}

/* ── Utility ──────────────────────────────────────────────────────── */

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

/* ── Shortcut Overlay ──────────────────────────────────────────── */

.shortcut-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,.72);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: shortcutFadeIn 120ms var(--ease);
}

.shortcut-overlay-inner {
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.008)),
    var(--bg-1);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  padding: 28px 32px;
  max-width: 520px;
  width: 90vw;
  box-shadow: 0 28px 90px rgba(0,0,0,.5);
}

.shortcut-overlay-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.shortcut-grid {
  display: grid;
  gap: 20px;
}

.shortcut-group-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.shortcut-row kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 5px;
  background: rgba(255,255,255,.04);
  font: inherit;
  font-size: 11px;
  color: var(--text);
  letter-spacing: .02em;
}

@keyframes shortcutFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes galleryCardEnter {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── No-Gallery Page ───────────────────────────────────────────── */

.no-gallery-page {
  height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 20% 15%, rgba(255,255,255,.03), transparent),
    radial-gradient(ellipse 60% 40% at 85% 70%, rgba(255,255,255,.015), transparent),
    linear-gradient(180deg, rgba(255,255,255,.012), transparent 30%),
    var(--bg);
  color: var(--text);
  padding: 32px 28px;
  display: grid;
  align-content: start;
  gap: 20px;
  overflow: auto;
}

.no-gallery-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 20px 24px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.025), transparent 60%),
    rgba(255,255,255,.008);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.no-gallery-brand {
  display: grid;
  gap: 4px;
}

.no-gallery-kicker {
  font-size: 9px;
  letter-spacing: .32em;
  color: var(--text-dim);
  text-transform: uppercase;
  position: relative;
  padding-left: 14px;
}

.no-gallery-kicker::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 1px;
  background: rgba(255,255,255,.24);
}

.no-gallery-title {
  font-size: 32px;
  letter-spacing: .04em;
  color: var(--text);
  text-shadow: 0 0 48px rgba(255,255,255,.06);
}

.no-gallery-note {
  font-size: 11px;
  color: var(--text-soft);
}

.no-gallery-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.no-gallery-btn {
  appearance: none;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.015);
  color: var(--text-soft);
  font: inherit;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 160ms var(--ease), border-color 160ms var(--ease),
              color 160ms var(--ease), transform 160ms var(--ease),
              box-shadow 200ms var(--ease);
}

.no-gallery-btn:hover {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.14);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.no-gallery-btn:active {
  transform: translateY(0) scale(.98);
}

.no-gallery-grid-shell {
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 18px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.015), transparent 30%),
    rgba(255,255,255,.008);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.no-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.no-gallery-section {
  display: grid;
  gap: 14px;
}

.no-gallery-section + .no-gallery-section {
  margin-top: 22px;
}

.no-gallery-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.no-gallery-section-kicker {
  margin: 0 0 4px;
  font-size: 9px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-dim);
  position: relative;
  padding-left: 14px;
}

.no-gallery-section-kicker::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 1px;
  background: rgba(255,255,255,.24);
}

.no-gallery-section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--text);
}

.no-gallery-card-shell {
  display: grid;
  gap: 8px;
  animation: galleryCardEnter var(--card-enter-duration) var(--card-enter-ease) both;
}

.no-gallery-card-shell:nth-child(1) { animation-delay: 0ms; }
.no-gallery-card-shell:nth-child(2) { animation-delay: 40ms; }
.no-gallery-card-shell:nth-child(3) { animation-delay: 80ms; }
.no-gallery-card-shell:nth-child(4) { animation-delay: 120ms; }
.no-gallery-card-shell:nth-child(5) { animation-delay: 160ms; }
.no-gallery-card-shell:nth-child(6) { animation-delay: 200ms; }
.no-gallery-card-shell:nth-child(n+7) { animation-delay: 240ms; }

.no-gallery-card {
  appearance: none;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), transparent 40%),
    rgba(255,255,255,.01);
  overflow: hidden;
  text-align: left;
  color: inherit;
  cursor: pointer;
  display: block;
  text-decoration: none;
  transition: transform 200ms var(--ease), border-color 200ms var(--ease),
              background 200ms var(--ease), box-shadow 300ms var(--ease);
}

.no-gallery-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.03);
  box-shadow: 0 16px 48px rgba(0,0,0,.4), 0 0 1px rgba(255,255,255,.08);
}

.no-gallery-card-media {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  image-rendering: pixelated;
  background: #000;
  transition: transform 300ms var(--ease);
}

.no-gallery-card:hover .no-gallery-card-media {
  transform: scale(1.03);
}

.no-gallery-card-meta {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.no-gallery-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .02em;
}

.no-gallery-card-sub {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: .04em;
}

.no-gallery-card-sign {
  font-size: 11px;
  color: var(--text-soft);
}

.no-gallery-card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.no-gallery-reactions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.no-gallery-react-btn {
  appearance: none;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(255,255,255,.02);
  color: var(--text-dim);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background 160ms var(--ease),
              color 160ms var(--ease), transform 160ms var(--ease),
              box-shadow 200ms var(--ease);
}

.no-gallery-react-btn:hover:not(:disabled) {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.16);
  color: var(--text);
  transform: translateY(-1px);
}

.no-gallery-react-btn:active:not(:disabled) {
  transform: scale(.96);
}

.no-gallery-react-btn[data-reaction="no"].is-active {
  border-color: rgba(255,255,255,.32);
  background: rgba(255,255,255,.12);
  color: var(--text);
  box-shadow: 0 0 16px rgba(255,255,255,.04);
}

.no-gallery-react-btn[data-reaction="yes"].is-active {
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: var(--text-soft);
}

.no-gallery-react-btn:disabled {
  cursor: not-allowed;
  opacity: .4;
}

.no-gallery-sort-rail {
  margin-right: 6px;
}

.no-gallery-palette-strip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.no-gallery-palette-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,.14);
  flex-shrink: 0;
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease);
}

.no-gallery-palette-swatch:hover {
  transform: scale(1.3);
  box-shadow: 0 0 8px currentColor;
}

.no-gallery-palette-more {
  font-size: 10px;
  color: var(--text-dim);
}

.no-gallery-empty {
  grid-column: 1 / -1;
  padding: 32px;
  border: 1px dashed rgba(255,255,255,.06);
  border-radius: 14px;
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
  background: rgba(255,255,255,.005);
}

.no-gallery-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.no-gallery-week-card {
  appearance: none;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), transparent 50%),
    rgba(255,255,255,.01);
  padding: 12px;
  display: grid;
  gap: 12px;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: transform 200ms var(--ease), border-color 200ms var(--ease),
              box-shadow 300ms var(--ease), background 200ms var(--ease);
  animation: galleryCardEnter var(--card-enter-duration) var(--card-enter-ease) both;
}

.no-gallery-week-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.025);
  box-shadow: 0 16px 48px rgba(0,0,0,.35);
}

.no-gallery-week-cover {
  display: block;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,.02);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

.no-gallery-week-cover-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 1px;
  background: rgba(0,0,0,.6);
}

.no-gallery-week-cover-tile {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  background: #000;
}

.no-gallery-week-cover-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 11px;
}

.no-gallery-week-meta {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: var(--text-dim);
}

.no-gallery-week-meta strong {
  color: var(--text);
  font-size: 12px;
}

.no-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.no-gallery-modal[hidden] {
  display: none !important;
}

.no-gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.74);
}

.no-gallery-modal-panel {
  position: relative;
  width: min(1120px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(5,5,5,.98);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.no-gallery-modal-head,
.no-gallery-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.no-gallery-modal-head {
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.no-gallery-modal-foot {
  border-top: 1px solid rgba(255,255,255,.06);
}

.no-gallery-modal-meta {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.no-gallery-modal-title {
  font-size: 12px;
  color: var(--text-soft);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.no-gallery-modal-media-wrap {
  display: grid;
  place-items: center;
  padding: 12px;
  overflow: hidden;
}

.no-gallery-modal-media {
  width: auto;
  height: auto;
  max-width: min(1024px, calc(100vw - 72px));
  max-height: calc(100vh - 160px);
  image-rendering: pixelated;
  border: 1px solid rgba(255,255,255,.08);
  background: #000;
}

.no-gallery-modal-sign {
  font-size: 12px;
  color: var(--text-soft);
}

.no-gallery-modal-sign.is-empty {
  visibility: hidden;
}

.no-gallery-modal-palette.is-empty {
  display: none;
}

@media (max-width: 900px) {
  .no-gallery-page {
    padding: 16px 14px;
    gap: 14px;
  }

  .no-gallery-topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 12px;
  }

  .no-gallery-title {
    font-size: 24px;
  }

  .no-gallery-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }

  .no-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .no-gallery-grid-shell {
    padding: 14px;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
