:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #656565;
  --line: #d8d6d0;
  --paper: #f7f3e8;
  --green: #137a5b;
  --red: #b44436;
  --blue: #275e9f;
  --gold: #d8a735;
  --shadow: 0 18px 48px rgba(35, 34, 31, 0.16);
  --hex-clip: polygon(25% 6.699%, 75% 6.699%, 100% 50%, 75% 93.301%, 25% 93.301%, 0 50%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: #11110f;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  transition: filter 320ms ease;
}

body.is-loading .app-shell {
  filter: blur(12px) saturate(0.82);
  pointer-events: none;
  user-select: none;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 16, 14, 0.72);
  color: #fff;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.loading-screen.done {
  opacity: 0;
  visibility: hidden;
}

.loading-panel {
  display: grid;
  gap: 12px;
  width: min(360px, 100%);
}

.loading-panel .brand-mark {
  color: var(--ink);
}

.loading-panel h2 {
  font-size: 36px;
  line-height: 0.95;
}

.loading-panel .eyebrow,
.loading-panel p {
  color: rgba(255, 255, 255, 0.78);
}

.loading-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
}

.loading-bar {
  width: 0%;
  height: 100%;
  background: var(--gold);
  transition: width 220ms ease;
}

.topbar {
  position: relative;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(23, 23, 23, 0.16);
  background: rgba(255, 255, 255, 0.82);
}

.brand-lockup,
.stats,
.studio-head,
.panel-head,
.section-head,
.action-row,
.submit-row,
.tool-row,
.frame-strip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-lockup {
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: var(--gold);
  font-size: 28px;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 0.9;
}

.brand-lockup p {
  margin-top: 4px;
  color: var(--muted);
}

.stats {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stat-button,
.view-button,
.help-button {
  border: 1px solid rgba(23, 23, 23, 0.18);
  background: rgba(255, 255, 255, 0.86);
  padding: 8px 10px;
  font-size: 14px;
}

.stat-button {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  align-items: baseline;
  color: var(--ink);
}

.stat-button strong {
  font-weight: 900;
}

.stat-button span {
  color: var(--muted);
}

.view-button,
.help-button {
  color: var(--ink);
  font-weight: 850;
}

.stat-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.view-button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}

.help-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
}

.workspace {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(216, 167, 53, 0.14), transparent 34%),
    radial-gradient(circle at 50% 55%, rgba(255, 255, 255, 0.08), transparent 46%),
    #10100e;
}

.board-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background: transparent;
}

.board-wrap.dragging {
  cursor: grabbing;
}

.board {
  --spot-size: 150px;
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  grid-template-columns: repeat(13, var(--spot-size));
  grid-template-rows: repeat(8, var(--spot-size));
  gap: 0;
  width: calc(13 * var(--spot-size));
  height: calc(8 * var(--spot-size));
  transform-origin: 0 0;
  will-change: transform;
}

.globe-host {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  transform: none;
}

.globe-host canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.spot {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 0;
  isolation: isolate;
  transition: filter 150ms ease;
  touch-action: none;
}

.spot:hover,
.spot:focus-visible,
.spot.selected {
  filter: brightness(0.96) saturate(1.08);
  outline: none;
}

.spot.selected::after,
.spot:focus-visible::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  box-shadow: inset 0 0 0 4px rgba(23, 23, 23, 0.9);
  pointer-events: none;
}

.spot-price {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 4;
  min-width: 34px;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 7px;
  font-size: 13px;
  font-weight: 800;
}

.spot-state {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 4;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.spot.locked .spot-state {
  background: var(--red);
}

.spot.claimed .spot-state {
  background: var(--blue);
}

.spot-content,
.history-thumb {
  width: 100%;
  height: 100%;
  background: var(--paper);
}

.spot-content img,
.spot-content video,
.history-thumb img,
.history-thumb video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: var(--paper);
}

.content-card,
.canvas-preview {
  container-type: size;
  width: 100%;
  height: 100%;
  padding: 10%;
  text-align: center;
  background: var(--bg, var(--paper));
  color: var(--fg, #171717);
  font-family: var(--font, Inter, ui-sans-serif, system-ui, sans-serif);
  clip-path: var(--cell-clip, var(--hex-clip));
}

.content-card-inner {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  transform-origin: center;
}

.content-card strong {
  display: block;
  font-size: clamp(10px, var(--title-size, 19cqw), 48px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.content-card span {
  display: block;
  margin-top: 8px;
  font-size: clamp(8px, var(--body-size, 9cqw), 28px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.canvas-preview {
  position: relative;
  padding: 0;
  overflow: hidden;
}

.preview-object {
  position: absolute;
  z-index: 2;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--w) * 1%);
  height: calc(var(--h) * 1%);
  transform: translate(-50%, -50%) rotate(var(--rot)) skew(var(--skew-x), var(--skew-y)) scale(var(--scale));
  transform-origin: center;
  overflow-wrap: anywhere;
}

.preview-object.media img,
.preview-object.media video,
.preview-object.media .video-layer-shell,
.preview-object.drawing img {
  width: 100%;
  height: 100%;
  object-fit: var(--media-fit, fill);
  display: block;
}

.preview-object.text {
  display: grid;
  place-items: center;
  padding: 4px;
  text-align: center;
  line-height: 1.05;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.preview-paint {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.studio-overlay,
.help-overlay,
.publish-confirm-overlay,
.checkout-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 23, 23, 0.36);
}

.publish-confirm-overlay {
  z-index: 35;
  background: rgba(23, 23, 23, 0.52);
}

.checkout-overlay {
  z-index: 42;
  align-items: start;
  overflow: auto;
  background: rgba(23, 23, 23, 0.62);
}

.studio-dialog {
  width: min(1180px, 100%);
  max-height: min(860px, calc(100vh - 36px));
  overflow: auto;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(23, 23, 23, 0.18);
  box-shadow: var(--shadow);
  padding: 16px;
}

.publish-confirm-dialog {
  display: grid;
  gap: 12px;
  width: min(480px, 100%);
  border: 1px solid rgba(23, 23, 23, 0.22);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  padding: 18px;
}

.checkout-dialog {
  display: grid;
  gap: 14px;
  width: min(760px, 100%);
  min-height: min(760px, calc(100vh - 36px));
  border: 1px solid rgba(23, 23, 23, 0.22);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 16px;
}

.checkout-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.checkout-head h2 {
  margin-top: 4px;
  font-size: 28px;
  line-height: 1;
}

.checkout-head p:not(.eyebrow) {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.checkout-mount {
  min-height: 620px;
}

.publish-confirm-dialog h2 {
  font-size: 28px;
  line-height: 1;
}

.publish-confirm-dialog p:not(.eyebrow) {
  color: #2b2b2b;
  line-height: 1.45;
}

.publish-fields {
  display: grid;
  gap: 10px;
}

.publish-fields textarea {
  min-height: 86px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.confirm-actions > * {
  flex: 1;
}

.studio-head {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(320px, 560px) auto;
  grid-template-areas: "title status close";
  gap: 12px;
  align-items: center;
}

.studio-title {
  grid-area: title;
  min-width: 0;
}

.studio-head .icon-button {
  grid-area: close;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.studio-head h2,
.help-dialog h2 {
  margin-top: 2px;
  font-size: 30px;
  line-height: 1;
}

.studio-status {
  grid-area: status;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  margin: 0;
  min-width: 0;
}

.studio-status div {
  padding: 9px;
  border-right: 1px solid var(--line);
}

.studio-status div:last-child {
  border-right: 0;
}

.studio-status span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.studio-status strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
}

.studio-action-bar {
  display: grid;
  margin-top: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px;
}

.studio-action-bar .editor-tools {
  gap: 0;
}

.primary-tools {
  justify-content: stretch;
}

.primary-tools .upload-button {
  flex: 1;
}

.studio-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 340px;
  gap: 14px;
  margin-top: 14px;
  align-items: stretch;
}

.stage-wrap,
.studio-tools {
  min-width: 0;
}

.canvas-shell {
  display: grid;
  place-items: center;
  background: #222;
  padding: 52px;
  overflow: visible;
}

.studio-stage {
  position: relative;
  width: min(100%, 72vh, 760px);
  aspect-ratio: 1 / 1;
  overflow: visible;
  background: transparent;
  touch-action: none;
}

.stage-background,
.frame-surface,
#paintLayer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  clip-path: var(--cell-clip, var(--hex-clip));
}

.stage-background {
  z-index: 1;
  background: var(--paper);
  pointer-events: none;
}

.frame-surface {
  z-index: 3;
  pointer-events: none;
}

#paintLayer {
  z-index: 4;
  pointer-events: none;
}

.studio-stage.draw-active #paintLayer {
  pointer-events: auto;
  cursor: crosshair;
}

.studio-stage.draw-active .studio-object {
  pointer-events: none;
}

.studio-object,
.transform-box {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--w) * 1%);
  height: calc(var(--h) * 1%);
  transform: translate(-50%, -50%) rotate(var(--rot)) skew(var(--skew-x), var(--skew-y)) scale(var(--scale));
  transform-origin: center;
}

.studio-object {
  z-index: 2;
  user-select: none;
  pointer-events: auto;
  touch-action: none;
  overflow: visible;
}

.studio-object.selected {
  outline: 0;
}

.studio-object.text {
  display: grid;
  place-items: center;
  padding: 4px;
  text-align: center;
  line-height: 1.05;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.studio-object.media img,
.studio-object.media video,
.studio-object.media .video-layer-shell,
.studio-object.drawing img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: var(--media-fit, fill);
  pointer-events: none;
}

.video-layer-shell {
  position: relative;
  overflow: hidden;
  background: #202020;
}

.video-layer-shell video {
  position: absolute;
  inset: 0;
}

.video-unsupported {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 16px;
  color: #fff;
  text-align: center;
  background: #202020;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.video-layer-shell .video-unsupported {
  position: absolute;
  inset: 0;
}

.spot-content .video-unsupported,
.history-thumb .video-unsupported {
  width: 100%;
  height: 100%;
}

.video-unsupported.hidden,
.video-layer-shell video.hidden {
  display: none;
}

.video-play-mark {
  width: min(42%, 110px);
  aspect-ratio: 1.25;
  clip-path: polygon(18% 8%, 18% 92%, 88% 50%);
  background: rgba(255, 255, 255, 0.16);
}

.video-unsupported strong {
  font-size: clamp(15px, 8cqw, 46px);
}

.video-unsupported em {
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(11px, 3cqw, 18px);
  font-style: normal;
}

.transform-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: visible;
  pointer-events: none;
}

.transform-box {
  pointer-events: none;
}

.transform-outline {
  position: absolute;
  inset: 0;
  outline: 3px solid rgba(23, 23, 23, 0.88);
  outline-offset: 3px;
  pointer-events: none;
}

.transform-handles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.transform-handle {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  touch-action: none;
}

.transform-handle.resize-nw {
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  cursor: nwse-resize;
}

.transform-handle.resize-n {
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  cursor: ns-resize;
}

.transform-handle.resize-ne {
  top: 0;
  right: 0;
  transform: translate(50%, -50%);
  cursor: nesw-resize;
}

.transform-handle.resize-e {
  top: 50%;
  right: 0;
  transform: translate(50%, -50%);
  cursor: ew-resize;
}

.transform-handle.resize-se {
  right: 0;
  bottom: 0;
  transform: translate(50%, 50%);
  cursor: nwse-resize;
}

.transform-handle.resize-s {
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 50%);
  cursor: ns-resize;
}

.transform-handle.resize-sw {
  bottom: 0;
  left: 0;
  transform: translate(-50%, 50%);
  cursor: nesw-resize;
}

.transform-handle.resize-w {
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  cursor: ew-resize;
}

.transform-handle.rotate {
  top: -38px;
  left: 50%;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  cursor: grab;
}

.transform-handle.rotate::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 2px;
  height: 20px;
  background: var(--ink);
  transform: translateX(-50%);
  pointer-events: none;
}

.transform-handle.skew-x,
.transform-handle.skew-y {
  width: 18px;
  height: 18px;
  border-color: var(--ink);
  background: var(--gold);
}

.transform-handle.skew-x {
  top: 50%;
  right: -38px;
  transform: translate(50%, -50%) rotate(45deg);
  cursor: ew-resize;
}

.transform-handle.skew-y {
  bottom: -38px;
  left: 50%;
  transform: translate(-50%, 50%) rotate(45deg);
  cursor: ns-resize;
}

.frame-strip {
  justify-content: space-between;
  margin-top: 10px;
}

.frame-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.frame-button {
  border: 1px solid var(--line);
  background: #fff;
  min-width: 34px;
  min-height: 32px;
  font-weight: 800;
}

.frame-button.active {
  background: var(--gold);
  border-color: var(--ink);
}

.studio-tools {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  align-content: stretch;
  min-height: 100%;
}

.editor-tools {
  display: grid;
  gap: 12px;
}

#publishInfo {
  grid-row: 1;
}

#editorOptions {
  grid-row: 2;
}

.studio-tools > .history {
  grid-row: 3;
}

.tool-row,
.submit-row {
  justify-content: stretch;
}

.tool-row > *,
.submit-row > *,
.action-row > * {
  flex: 1;
}

.primary-button,
.secondary-button,
.mini-button,
.icon-button,
.upload-button {
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  padding: 9px 12px;
  font-weight: 850;
  text-align: center;
}

.primary-button {
  background: var(--ink);
  color: #fff;
}

.danger-primary-button {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.danger-button {
  border-color: var(--red);
  color: var(--red);
}

.secondary-button:disabled,
.mini-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.mini-button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 13px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
}

.upload-button {
  display: block;
  cursor: pointer;
}

.upload-button:has(input:disabled) {
  opacity: 0.55;
  cursor: wait;
}

.upload-button input {
  display: none;
}

.upload-progress {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 8px;
}

.upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.upload-progress-head strong {
  color: var(--ink);
  font-size: 13px;
}

.upload-progress-track {
  height: 9px;
  overflow: hidden;
  border: 1px solid rgba(23, 23, 23, 0.22);
  background: #fff;
}

.upload-progress-bar {
  width: 0%;
  height: 100%;
  background: var(--gold);
  transition: width 140ms ease;
}

.upload-progress.is-processing .upload-progress-bar {
  background: linear-gradient(90deg, var(--gold), #f2d778, var(--gold));
  background-size: 220% 100%;
  animation: upload-processing 950ms linear infinite;
}

.media-budget {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  padding: 8px;
}

.media-budget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.media-budget-head strong {
  color: var(--ink);
  font-size: 13px;
}

.media-budget-track {
  height: 9px;
  overflow: hidden;
  border: 1px solid rgba(23, 23, 23, 0.22);
  background: #fff;
}

.media-budget-bar {
  width: 0%;
  height: 100%;
  background: var(--green);
  transition: width 140ms ease, background-color 140ms ease;
}

.media-budget.low .media-budget-bar {
  background: var(--red);
}

@keyframes upload-processing {
  from {
    background-position: 0% 0;
  }

  to {
    background-position: 220% 0;
  }
}

.field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px;
}

.field input[type="color"] {
  height: 42px;
  padding: 4px;
}

.field input[type="range"] {
  padding: 0;
}

.field textarea {
  min-height: 72px;
  resize: vertical;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wide-field {
  grid-column: 1 / -1;
}

.format-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.format-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  line-height: 1;
}

.format-button.italic {
  font-style: italic;
}

.format-button.underline {
  text-decoration: underline;
}

.format-button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.check-field input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.check-field.align-end {
  align-self: end;
  min-height: 42px;
}

.layers-panel {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.layer-list {
  display: grid;
  gap: 6px;
}

.layer-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 30px 26px;
  gap: 8px;
  align-items: start;
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px;
  text-align: left;
  cursor: pointer;
}

.layer-item.active {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 2px rgba(23, 23, 23, 0.18);
}

.layer-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  align-self: center;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.layer-copy strong,
.layer-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-copy strong {
  font-size: 13px;
}

.layer-copy span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

.layer-empty {
  border: 1px dashed var(--line);
  color: var(--muted);
  padding: 10px;
  font-size: 13px;
}

.object-controls {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.object-controls h3,
.section-head h3 {
  font-size: 16px;
}

.layer-order-controls {
  display: grid;
  gap: 4px;
}

.layer-order-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 24px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.layer-order-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.layer-delete-button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 24px;
  border: 1px solid rgba(180, 68, 54, 0.42);
  background: #fff;
  color: var(--red);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.publish-info {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}

.publish-info h3 {
  font-size: 24px;
  line-height: 1.05;
}

.publish-info p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.publish-info #publishInfoDescription {
  color: #2b2b2b;
  white-space: pre-wrap;
}

.history {
  align-self: end;
  border-top: 1px solid var(--line);
  margin-top: auto;
  padding-top: 12px;
}

.section-head {
  justify-content: space-between;
}

.history-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px;
  text-align: left;
}

.history-thumb {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
}

.history-copy strong,
.history-copy span {
  display: block;
  overflow-wrap: anywhere;
}

.history-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.help-dialog {
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(23, 23, 23, 0.18);
  box-shadow: var(--shadow);
  padding: 18px;
}

.help-copy {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.help-copy h3 {
  margin-top: 4px;
  font-size: 16px;
}

.help-copy p {
  color: #2b2b2b;
  line-height: 1.45;
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .studio-head {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title close"
      "status status";
  }

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

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
  }

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

  h1 {
    font-size: 30px;
  }

  .stat-button,
  .view-button,
  .help-button {
    font-size: 12px;
    padding: 6px 8px;
  }

  .help-button {
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 16px;
  }

  .board {
    --spot-size: 140px;
  }

  .studio-overlay {
    padding: 8px;
  }

  .studio-dialog {
    padding: 12px;
  }
}
