:root {
  --ui-bg: #0f0f0f;
  --ui-panel: #141414;
  --ui-line: #232323;
  --ui-line-strong: #2e2e2e;
  --ui-text: #ece8e0;
  --ui-muted: #8b877f;
  --ui-gold: #e5d0a3;
  --ui-font: 'Afacad', system-ui, sans-serif;
  --ui-display: arpona, Georgia, serif;
  --ui-mono: ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html,
body,
#root {
  height: 100%;
  margin: 0;
}
body {
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: var(--ui-font);
  -webkit-font-smoothing: antialiased;
}
button,
input,
select {
  font: inherit;
}
[hidden] {
  display: none !important;
}
.icon {
  display: inline-grid;
  place-items: center;
}

/* ---- shell */

.app {
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr);
  height: 100%;
}
.outlet {
  display: grid;
  min-height: 0;
}
.topbar {
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--ui-line);
  background: #0b0b0b;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ui-text);
  text-decoration: none;
}
.brand img {
  width: 26px;
  height: auto;
}
.brand-name {
  font-family: var(--ui-display);
  font-size: 19px;
}
.brand-name span {
  color: var(--ui-gold);
}

/* ---- home */

.home {
  overflow-y: auto;
  padding: 40px 32px 64px;
}
.home-inner {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  max-width: 1240px;
  margin: 0 auto;
}
.home-main {
  min-width: 0;
}

/* collections, on the left */

.collections {
  display: grid;
  gap: 2px;
}
.collection {
  display: flex;
  align-items: center;
  border-radius: 10px;
  transition: background 0.15s;
}
.collection:hover {
  background: #161616;
}
.collection.is-on {
  background: #1d1d1d;
}
.collection-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding-left: 14px;
  color: var(--ui-muted);
  font-size: 16px;
  text-decoration: none;
}
.collection-link:hover,
.collection.is-on .collection-link {
  color: var(--ui-text);
}
.collection-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The count and the open collection's ⋯ share one slot at the right. */
.collection-link:last-child {
  padding-right: 8px;
}
.collection-count {
  min-width: 28px;
  color: var(--ui-muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.collection .menu-btn {
  flex-shrink: 0;
  margin-right: 8px;
}
.is-dragging-instance .collection {
  outline: 1px dashed var(--ui-line-strong);
  outline-offset: -1px;
}
.is-dragging-instance .collection.is-drop {
  outline-color: rgba(229, 208, 163, 0.7);
  background: rgba(229, 208, 163, 0.1);
}
.collection-new {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  margin-top: 10px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ui-muted);
  font-size: 16px;
  text-align: left;
  cursor: pointer;
}
.collection-new:hover {
  color: var(--ui-gold);
}
.home-empty p {
  margin: 0 0 14px;
}
.home-empty {
  padding: 40px 20px;
  border: 1px dashed var(--ui-line-strong);
  border-radius: 14px;
  color: var(--ui-muted);
  font-size: 16px;
  text-align: center;
}
.home-empty--page {
  margin: 40px auto;
  max-width: 520px;
  align-self: start;
}
.instance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
/* Wide previews (the carousel) take two columns where there are two. */
.instance-grid {
  container-type: inline-size;
}
@container (min-width: 580px) {
  .instance--wide {
    grid-column: span 2;
  }
}
.instance {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ui-line-strong);
  border-radius: 14px;
  background: #161616;
  transition: border-color 0.15s;
}
.instance:hover {
  border-color: #3d3a34;
}
.instance.is-dragging {
  opacity: 0.4;
}
.instance-preview {
  display: grid;
  place-items: center;
  height: 320px;
  padding: 30px 24px;
  overflow: hidden;
  cursor: pointer;
}
.instance-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 14px 18px;
  border-top: 1px solid var(--ui-line);
}
.instance-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.instance-meta {
  overflow: hidden;
  color: var(--ui-muted);
  font-size: 13px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The card's ⋯, in its top right corner over the preview: a light tint on dark backgrounds, a dark tint on light ones. */
.instance > .menu-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.instance > .menu-btn:hover,
.instance > .menu-btn[aria-expanded='true'] {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.instance--light > .menu-btn {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.7);
}
.instance--light > .menu-btn:hover,
.instance--light > .menu-btn[aria-expanded='true'] {
  background: rgba(0, 0, 0, 0.12);
  color: #000;
}
.instance-name {
  min-width: 0;
  color: var(--ui-text);
  font-family: commuters-sans, system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.2px;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.instance-name:hover {
  color: var(--ui-gold);
}
.instance-action {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--ui-text);
  text-decoration: none;
}
.instance-action--code {
  background: var(--ui-gold);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #28282b;
}
.instance-action--code:hover {
  background: #ecdab4;
}
.instance-action--edit {
  border: 1px solid var(--ui-line-strong);
  color: var(--ui-muted);
}
.instance-action--edit:hover {
  color: var(--ui-text);
  border-color: #444;
}

/* ---- workspace */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  min-height: 0;
}
.workspace--code {
  grid-template-columns: minmax(0, 1fr) 480px;
}
.stage-wrap {
  position: relative;
  display: grid;
  min-width: 0;
}
.stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--ui-bg);
  transition: background-color 0.25s ease;
}
.camera,
.camera-layer {
  position: absolute;
  inset: 0;
}
.camera {
  overflow: hidden;
}
.camera-layer {
  transform-origin: 0 0;
}
.camera.is-alt {
  cursor: grab;
}
.camera.is-dragging {
  cursor: grabbing;
}
.camera.is-alt .camera-layer,
.camera.is-dragging .camera-layer {
  pointer-events: none;
}
.camera-chip {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  padding: 6px 10px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.85);
  backdrop-filter: blur(6px);
  color: var(--ui-text);
  font-size: 13px;
  cursor: pointer;
}
.camera-chip--hint {
  color: var(--ui-muted);
  cursor: default;
  pointer-events: none;
  opacity: 0.8;
}
.stage-scroll {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 56px;
}
.stage-controls {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  pointer-events: none;
}
.stage-controls > * {
  pointer-events: auto;
  background: rgba(12, 12, 12, 0.85);
  backdrop-filter: blur(6px);
}
.stage-btn {
  height: 36px;
}

/* ---- panel */

.panel {
  position: relative;
  height: 100%;
  overflow-y: auto;
  background: var(--ui-panel);
  border-left: 1px solid var(--ui-line);
  padding: 0 20px;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.panel-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 0 16px;
  background: var(--ui-panel);
  border-bottom: 1px solid var(--ui-line);
}
.editor-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ui-muted);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}
.back-link:hover {
  color: var(--ui-text);
}
.name-input {
  width: 100%;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  color: var(--ui-text);
  font-family: var(--ui-display);
  font-size: 24px;
  outline: none;
}
.name-input:hover,
.name-input:focus {
  border-bottom-color: var(--ui-line-strong);
}
.settings-clipboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.panel-foot {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  gap: 8px;
  margin: 0 -20px;
  padding: 14px 20px;
  background: var(--ui-panel);
  border-top: 1px solid var(--ui-line);
}
.panel-foot .btn--gold {
  flex: 1;
}
.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--ui-line-strong);
  background: transparent;
  color: var(--ui-text);
  cursor: pointer;
}
.icon-btn:hover {
  border-color: var(--ui-gold);
  color: var(--ui-gold);
}
.section {
  padding: 18px 0;
  border-bottom: 1px solid var(--ui-line);
}
.controls .section:last-child {
  border-bottom: 1px solid var(--ui-line);
}
.section-title {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ui-muted);
}
.section-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.section > .btn {
  width: 100%;
}
.section > .btn + .btn {
  margin-top: 6px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-label {
  font-size: 14px;
  color: var(--ui-text);
}
.note {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--ui-muted);
}
.note--tight {
  margin-top: -8px;
  font-size: 13px;
}

/* ---- inputs */

.slider {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.slider-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.slider-value {
  width: 72px;
  margin-right: -6px;
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ui-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  cursor: text;
}
.slider-value:hover {
  border-color: var(--ui-line-strong);
  color: var(--ui-text);
}
.slider-value:focus {
  border-color: rgba(229, 208, 163, 0.6);
  background: #0c0c0c;
  color: var(--ui-text);
  outline: none;
}
.slider input[type='range'] {
  appearance: none;
  width: 100%;
  height: 16px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.slider input[type='range']::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ui-gold) var(--fill), #333 var(--fill));
}
.slider input[type='range']::-moz-range-track {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ui-gold) var(--fill), #333 var(--fill));
}
.slider input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--ui-text);
  box-shadow: 0 0 0 3px var(--ui-panel);
}
.slider input[type='range']::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--ui-text);
  box-shadow: 0 0 0 3px var(--ui-panel);
}
.slider input[type='range']:focus-visible::-webkit-slider-thumb {
  background: var(--ui-gold);
}
.seg {
  display: flex;
  padding: 3px;
  gap: 2px;
  border-radius: 9px;
  background: #0c0c0c;
  border: 1px solid var(--ui-line);
}
.seg-item {
  flex: 1;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ui-muted);
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}
.seg-item:hover {
  color: var(--ui-text);
}
.seg-item.is-on {
  background: #262626;
  color: var(--ui-text);
  box-shadow: inset 0 0 0 1px rgba(229, 208, 163, 0.18);
}
.text-input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  background: #0c0c0c;
  color: var(--ui-text);
  font-size: 15px;
}
.text-input:focus {
  border-color: rgba(229, 208, 163, 0.6);
  outline: none;
}
.text-input::placeholder {
  color: #5e5b55;
}
.text-input--small {
  height: 32px;
  font-size: 14px;
}
.text-input--mono {
  font: 12px var(--ui-mono);
}
.select {
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  background: #0c0c0c;
  color: var(--ui-text);
  font-size: 14px;
}
.swatches {
  display: flex;
  align-items: center;
  gap: 8px;
}
.swatch {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  cursor: pointer;
}
.swatch.is-on {
  box-shadow: 0 0 0 2px var(--ui-panel), 0 0 0 3px var(--ui-gold);
}
.color {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 4px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  background: #0c0c0c;
}
.color-chip {
  position: relative;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  overflow: hidden;
}
.color-chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.color-hex {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ui-text);
  font: 14px/1 var(--ui-mono);
  outline: none;
}
.image-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.image-thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  background: #0c0c0c repeating-conic-gradient(#151515 0 25%, #0c0c0c 0 50%) 0 0 / 12px 12px;
  overflow: hidden;
}
.image-thumb img {
  max-width: 86%;
  max-height: 86%;
  object-fit: contain;
}
.image-none {
  font-size: 12px;
  color: var(--ui-muted);
}
.image-actions {
  display: flex;
  gap: 6px;
}
.image-presets {
  display: flex;
  gap: 6px;
}
.image-preset {
  width: 40px;
  height: 40px;
  padding: 5px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  background: #0c0c0c;
  cursor: pointer;
}
.image-preset img {
  max-width: 100%;
  max-height: 100%;
}
.image-preset.is-on {
  border-color: var(--ui-gold);
}
.row-remove {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ui-muted);
  cursor: pointer;
}
.row-remove:hover {
  background: #222;
  color: var(--ui-text);
}

/* ---- buttons */

.btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--ui-line-strong);
  background: #1b1b1b;
  color: var(--ui-text);
  font-size: 15px;
  cursor: pointer;
}
.btn:hover {
  border-color: #444;
}
.btn--gold {
  background: var(--ui-gold);
  border-color: rgba(255, 255, 255, 0.3);
  color: #28282b;
  font-weight: 500;
}
.btn--gold:hover {
  background: #ecdab4;
  border-color: rgba(255, 255, 255, 0.3);
}
.btn--dashed {
  background: transparent;
  border-style: dashed;
  color: var(--ui-muted);
}
.btn--dashed:hover:not(:disabled) {
  color: var(--ui-gold);
  border-color: rgba(229, 208, 163, 0.5);
}
.btn:disabled {
  cursor: default;
  opacity: 0.5;
}
.btn--ghost {
  background: transparent;
  color: var(--ui-muted);
}
.btn--small {
  height: 30px;
  padding: 0 10px;
  font-size: 14px;
}
.btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}
a.btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}
.btn--danger {
  background: transparent;
  border-color: transparent;
  color: #c98a7f;
}
.btn--danger:hover {
  border-color: rgba(201, 138, 127, 0.4);
}
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ui-gold);
  font-size: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* ---- code view */

.panel--code {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 20px;
}
.code-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.code-title {
  margin: 0;
  font-family: var(--ui-display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.code-ui {
  margin-top: 2px;
  font-size: 14px;
  color: var(--ui-muted);
}
.code-tabs {
  margin-top: 6px;
}
.code-hint {
  min-height: 36px;
}
.code-block {
  position: relative;
  flex: 1;
  min-height: 240px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: #0b0b0b;
  overflow: hidden;
}
.code-block pre {
  position: absolute;
  top: 48px;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 14px;
  overflow: auto;
  font: 12px/1.55 var(--ui-mono);
  color: #cfcac0;
  white-space: pre;
}
.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 9px 0 14px;
  border-bottom: 1px solid var(--ui-line);
}
.code-file {
  font: 13px var(--ui-mono);
  color: var(--ui-muted);
}
.code-images {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.code-image {
  display: grid;
  grid-template-columns: 32px auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  color: var(--ui-text);
  font-size: 14px;
  text-decoration: none;
}
.code-image:hover {
  border-color: var(--ui-line-strong);
}
.code-image img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.code-image-file {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ui-muted);
  font: 12px var(--ui-mono);
  text-align: right;
}
.actions-row {
  display: flex;
  gap: 8px;
}
.actions-row .btn {
  flex: 1;
}
.actions-row a.btn {
  flex: 0 0 auto;
}

/* ---- menus and dialogs */

.menu-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ui-muted);
  cursor: pointer;
}
.menu-btn:hover,
.menu-btn[aria-expanded='true'] {
  background: #262626;
  color: var(--ui-text);
}
.menu {
  position: fixed;
  z-index: 20;
  display: grid;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 12px;
  background: #1a1a1a;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ui-text);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.menu-item:hover,
.menu-item:focus-visible {
  background: #262626;
  outline: none;
}
.menu-item .icon {
  color: var(--ui-muted);
}
.menu-item--danger,
.menu-item--danger .icon {
  color: #c98a7f;
}
.modal {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: 0;
  border: 1px solid var(--ui-line-strong);
  border-radius: 16px;
  background: #161616;
  color: var(--ui-text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
}
.modal-body {
  display: grid;
  gap: 18px;
  padding: 20px 24px 24px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-title {
  margin: 0;
  font-family: var(--ui-display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.modal-text {
  margin: 0;
  color: var(--ui-muted);
  font-size: 16px;
  line-height: 1.45;
}
.named {
  color: var(--ui-text);
  font-weight: 500;
}
.modal-input {
  height: 42px;
  font-size: 16px;
}
.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.modal-actions .btn {
  height: 42px;
}
.btn--danger-fill {
  background: #c98a7f;
  border-color: transparent;
  color: #28282b;
  font-weight: 500;
}
.btn--danger-fill:hover {
  background: #d49b91;
  border-color: transparent;
}
.choice-list {
  display: grid;
  gap: 2px;
  max-height: 50vh;
  margin: 0 -12px;
  overflow-y: auto;
}
.choice-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ui-text);
  font-size: 16px;
  text-align: left;
  cursor: pointer;
}
.choice-row:hover {
  background: #1f1f1f;
}
.choice-row input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ui-gold);
}
.choice-row--new {
  color: var(--ui-muted);
}
.choice-row--new:hover {
  color: var(--ui-gold);
}
.choice-thumb {
  flex-shrink: 0;
  display: flex;
  width: 44px;
  height: 44px;
  padding: 3px;
  border-radius: 8px;
  background: #0b0b0b;
}
.choice-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.choice-text {
  min-width: 0;
  display: grid;
}
.choice-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.choice-meta {
  color: var(--ui-muted);
  font-size: 13px;
}

/* ---- toast, focus */

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  padding: 10px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  background: #222;
  color: var(--ui-gold);
  font-size: 14px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.is-on {
  opacity: 1;
  transform: none;
}
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--ui-gold);
  outline-offset: 2px;
}

/* ---- narrow screens */

@media (max-width: 900px) {
  .app {
    height: auto;
    min-height: 100%;
  }
  .workspace,
  .workspace--code {
    grid-template-columns: 1fr;
    grid-template-rows: 62vh auto;
  }
  .home {
    padding: 24px 16px 48px;
  }
  .panel {
    height: auto;
    border-left: 0;
    border-top: 1px solid var(--ui-line);
    padding: 0 16px;
  }
  .panel-foot {
    margin: 0 -16px;
    padding: 12px 16px;
  }
  .stage-scroll {
    padding: 64px 24px 48px;
  }
}

/* Phones: the collections become a row of chips above the instances. */
@media (max-width: 700px) {
  .home-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .collections {
    display: flex;
    gap: 4px;
    margin: 0 -16px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .collections::-webkit-scrollbar {
    display: none;
  }
  .collection {
    flex-shrink: 0;
  }
  .collection-link {
    height: 40px;
  }
  .collection-link:last-child {
    padding-right: 14px;
  }
  .collection-count {
    min-width: 0;
  }
  .collection .menu-btn {
    margin: 0 6px 0 2px;
  }
  .collection-new {
    flex-shrink: 0;
    height: 40px;
    margin: 0;
    white-space: nowrap;
  }
}

/* ---- list control: cards, slides… each a collapsible group of fields */

.list {
  gap: 8px;
}
.list-item {
  border: 1px solid var(--ui-line-strong);
  border-radius: 10px;
  background: #101010;
}
.list-item[open] {
  border-color: #3a3a3a;
}
.list-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 10px;
  cursor: pointer;
  list-style: none;
}
.list-head::-webkit-details-marker {
  display: none;
}
.list-num {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #1d1d1d;
  color: var(--ui-gold);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.list-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.list-btn {
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ui-muted);
  font-size: 15px;
  cursor: pointer;
}
.list-btn:hover:not(:disabled) {
  background: #1f1f1f;
  color: var(--ui-text);
}
.list-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.list-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 12px 14px;
  border-top: 1px solid var(--ui-line);
}
.text-input--area {
  font-family: inherit;
  height: auto;
  min-height: 56px;
  padding: 8px 10px;
  line-height: 1.3;
  resize: vertical;
}

/* While copying the preview as a PNG, the stage's buttons and hints stay out of the picture. */
.stage-wrap.is-capturing .stage-controls,
.stage-wrap.is-capturing .camera-chip {
  visibility: hidden;
}
