:root {
  color-scheme: light;
  font-family: Inter, Geist, system-ui, sans-serif;
  font-size: 14px;
  --paper: #f5f3eb;
  --paper-bright: #fbfaf5;
  --ink: #242620;
  --muted: #62645a;
  --line: #e1dfd4;
  --chrome: #22241f;
  --chrome-raised: #30322b;
  --chrome-line: #41443a;
  --lime: #d5f45c;
  --lime-dark: #4e6419;
  --stage: #30332b;
  --danger: #9b3323;
}

@font-face { font-family: "Scatter Sans"; src: url("/static/fonts/DejaVuSans.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Scatter Sans"; src: url("/static/fonts/DejaVuSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Scatter Serif"; src: url("/static/fonts/DejaVuSerif.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Scatter Serif"; src: url("/static/fonts/DejaVuSerif-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Scatter Mono"; src: url("/static/fonts/DejaVuSansMono.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Scatter Mono"; src: url("/static/fonts/DejaVuSansMono-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select, output, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled, input:disabled { cursor: default; }
button:disabled { opacity: .42; }
button, a, input, select, textarea, [tabindex="0"] { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--lime-dark); }
.topbar :focus-visible, .workspace :focus-visible { outline-color: var(--lime); }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: block; flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 17px; font-weight: 680; letter-spacing: -.025em; }
h3 { font-size: 12px; font-weight: 730; letter-spacing: .045em; text-transform: uppercase; }

.topbar {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(0, 1fr) minmax(max-content, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 70px;
  padding: 12px 24px;
  background: var(--chrome);
  color: var(--paper-bright);
  border-bottom: 1px solid #393c32;
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-symbol { position: relative; display: block; flex: 0 0 36px; height: 36px; }
.brand-symbol i { display: block; position: absolute; width: 19px; height: 24px; top: 5px; left: 8px; border: 1.5px solid var(--lime); border-radius: 2px; background: var(--chrome); }
.brand-symbol i:nth-child(1) { transform: translateX(-6px) rotate(-20deg); }
.brand-symbol i:nth-child(2) { transform: translateX(5px) rotate(18deg); }
.brand-symbol i:nth-child(3) { background: var(--lime); transform: rotate(-4deg); }
.brand-text { display: grid; gap: 1px; }
.brand h1 { font-size: 24px; font-weight: 780; line-height: 1; letter-spacing: -.075em; }
.brand-text span { font-size: 10px; font-weight: 550; color: #c5c8b9; }
.project-heading { display: flex; justify-content: center; align-items: center; gap: 10px; min-width: 0; font-size: 13px; font-weight: 600; }
#project-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-status { font-size: 10px; font-weight: 540; white-space: nowrap; color: #d1d4c6; }
.project-status::before { display: inline-block; width: 5px; height: 5px; margin-right: 5px; vertical-align: .1em; border-radius: 50%; background: #a7a99c; content: ""; }
.project-status.is-dirty::before { background: var(--lime); }
.header-actions, .toolbar-group { display: flex; align-items: center; gap: 7px; }
.header-actions { justify-content: end; }

.button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #d9d9cd;
  border-radius: 7px;
  background: var(--paper-bright);
  color: var(--ink);
  font-weight: 650;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}
.button:not(:disabled):hover, .icon-button:not(:disabled):hover { background: #eae8de; }
.button .icon, .icon-button .icon { width: 16px; height: 16px; }
.button.small { min-height: 30px; padding: 0 8px; font-size: 11px; gap: 5px; }
.button.small .icon { width: 14px; height: 14px; }
.button.chrome, .workspace .icon-button { background: var(--chrome-raised); color: #e9ebdf; border-color: var(--chrome-line); }
.button.chrome:not(:disabled):hover, .workspace .icon-button:not(:disabled):hover { background: #414439; }
.button.primary { background: var(--lime); color: #22271a; border-color: var(--lime); }
.button.primary:not(:disabled):hover { background: #e3fa95; border-color: #e3fa95; }
.button.dark { background: var(--chrome); color: var(--paper-bright); border-color: var(--chrome); }
.button.dark:not(:disabled):hover { background: #383b30; }
.button.subtle { font-size: 11px; min-height: 28px; padding: 0 5px; background: transparent; border-color: transparent; }
.icon-button { width: 34px; min-height: 34px; padding: 0; }

.studio {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 270px;
  grid-template-areas: "controls workspace photos";
  min-height: 0;
}
.sidebar { min-width: 0; background: var(--paper); }
.controls { grid-area: controls; }
.photo-sidebar { grid-area: photos; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 61px; padding: 12px 17px; border-bottom: 1px solid var(--line); }
.control-section, .inspector { padding: 15px 17px; border-bottom: 1px solid var(--line); }
.control-section:last-child, .inspector:last-child { border-bottom: 0; }
.section-heading { display: flex; justify-content: space-between; min-height: 22px; align-items: center; gap: 10px; margin-bottom: 11px; color: #42453a; }
details.control-section, details.inspector { padding-block: 0; }
.control-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  list-style: none;
  cursor: pointer;
  color: #42453a;
  font-size: 12px;
  font-weight: 730;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.control-summary::-webkit-details-marker { display: none; }
.control-summary::before { content: ""; width: 6px; height: 6px; margin: 0 3px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); }
details[open] > .control-summary::before { transform: rotate(45deg); }
.control-summary span { margin-left: auto; font-size: 11px; letter-spacing: 0; text-transform: none; font-weight: 550; color: var(--muted); }
#layout-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.control-body { padding-top: 12px; padding-bottom: 15px; }
.arrange-actions { justify-content: flex-end; }
.shape-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.shape-text-bold input { accent-color: var(--lime-dark); }
#shape-text-status.is-error { color: var(--danger); }
.section-heading select {
  width: 66px;
  min-height: 28px;
  padding: 0 3px 0 6px;
  border: 1px solid #d9d9cd;
  border-radius: 5px;
  background: var(--paper-bright);
  color: var(--ink);
  font-size: 11px;
}
.field-pair, .color-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.field-pair label, .color-pair label, .text-field, .select-field { display: grid; align-content: start; gap: 5px; }
.field-pair label, .color-pair label, .inline-field, .slider-field, .select-field { font-size: 12px; font-weight: 580; }
.settings-gap, .background-fields + .background-fields { margin-top: 12px; }
.select-field + .field-pair { margin-top: 10px; }
.field-pair select, .select-field select { width: 100%; min-width: 0; height: 32px; padding: 0 5px; border: 1px solid #d9d9cd; border-radius: 5px; background: var(--paper-bright); color: var(--ink); font-size: 11px; }
.background-fields input[type="color"] { height: 32px; }
#background-pattern-fields, .background-image-fields { margin-top: 12px; }
.background-image-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.background-image-fields p { flex-basis: 100%; }
.background-image-fields .icon-button { width: 30px; min-height: 30px; }
.layout-presets { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.layout-presets button[aria-pressed="true"] { background: #e9eddb; border-color: #a9b585; }
.inline-field { display: flex; justify-content: space-between; align-items: center; gap: 7px; margin-top: 12px; }
input[type="number"], .text-field input, .text-field textarea {
  color: var(--ink);
  border: 1px solid #d9d9cd;
  border-radius: 5px;
  background: var(--paper-bright);
  min-width: 0;
  padding: 6px 7px;
  height: 32px;
  font-variant-numeric: tabular-nums;
}
.field-pair input { width: 100%; }
.inline-field input[type="number"] { width: 105px; }
.unit-input { position: relative; display: inline-flex; align-items: center; width: 105px; }
.unit-input input[type="number"] { padding-right: 35px; width: 100%; }
.unit-input span { position: absolute; right: 8px; color: var(--muted); font-size: 10px; pointer-events: none; }
input[type="number"] { appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { appearance: none; }
input[type="color"] { width: 100%; height: 27px; padding: 3px; background: var(--paper-bright); border: 1px solid #d9d9cd; border-radius: 5px; cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 1px solid #0002; border-radius: 3px; }
input[type="color"]::-moz-color-swatch { border: 1px solid #0002; border-radius: 3px; }
.sliders { display: grid; gap: 10px; }
.slider-field { display: grid; gap: 3px; }
.slider-field span { display: flex; justify-content: space-between; gap: 7px; align-items: center; min-height: 15px; }
.slider-field output { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); }
input[type="range"] { appearance: none; width: 100%; height: 16px; margin: 0; cursor: pointer; background: transparent; accent-color: var(--lime-dark); }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 9px; background: #dedfd1; }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 9px; background: #dedfd1; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; margin-top: -4.5px; border: 1px solid #3e492c; border-radius: 50%; background: #687747; }
input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border: 1px solid #3e492c; border-radius: 50%; background: #687747; }
input[type="range"]:disabled { opacity: .45; }
.color-pair { margin-top: 12px; }
.checkbox-line input { appearance: none; position: relative; width: 34px; height: 19px; margin: 0; border-radius: 15px; border: 1px solid #b7bbab; background: #e1e2d8; cursor: pointer; }
.checkbox-line input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 13px; height: 13px; border-radius: 50%; background: #595d50; }
.checkbox-line input:checked { border-color: #536431; background: #c9df8b; }
.checkbox-line input:checked::after { left: 17px; background: #425022; }

.workspace {
  grid-area: workspace;
  min-width: 0;
  min-height: 0;
  background: var(--chrome);
  color: #eeeee5;
  display: grid;
  grid-template-rows: 53px minmax(0,1fr) 36px;
}
.workspace-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 0 13px; }
#zoom-value { display: block; min-width: 42px; text-align: center; font-size: 11px; font-variant-numeric: tabular-nums; }
.zoom-tools { justify-content: end; gap: 5px; }
.workspace .icon-button { width: 31px; min-height: 31px; }
.canvas-info { font-size: 11px; color: #d0d3c6; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.viewport {
  position: relative;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  touch-action: none;
  user-select: none;
  background: radial-gradient(circle, #52574a 1px, transparent 1.2px) center / 18px 18px, var(--stage);
  border-block: 1px solid #383d32;
}
.viewport:focus-visible { outline-offset: -3px; }
.artboard { overflow: hidden; position: absolute; top: 50%; left: 50%; width: 90%; height: 80%; transform: translate(-50%, -50%); background: var(--paper); box-shadow: 0 0 0 1px #c8cabc40, 0 18px 38px #11140b62; }
#preview { display: block; width: 100%; height: 100%; overflow: hidden; }
.artwork-text { white-space: pre; }
[data-item-id], [data-text-id] { cursor: grab; }
[data-item-id].is-locked { cursor: default; }
.viewport.can-pan, .viewport.can-pan [data-item-id], .viewport.can-pan [data-text-id] { cursor: grab; }
.viewport.is-dragging, .viewport.is-dragging [data-item-id], .viewport.is-dragging [data-text-id] { cursor: grabbing; }
#selection-outline { fill: none; stroke: #d9ff66; stroke-width: 2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 1px #1c2308); }
.photo-toolbar {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--chrome-line);
  border-radius: 7px;
  background: var(--chrome);
  box-shadow: 0 3px 12px #11140b60;
  touch-action: manipulation;
}
.workspace .photo-toolbar .icon-button { width: 28px; min-height: 28px; border-color: transparent; }
.workspace .photo-toolbar .icon-button:focus-visible { outline-offset: -2px; }
.photo-toolbar-lock { display: inline-flex; align-items: center; gap: 3px; padding-inline: 5px; color: #d9ddcd; font-size: 10px; }
.photo-toolbar-lock .icon { width: 12px; height: 12px; }
.is-drop-target .photo-toolbar { visibility: hidden; }
.viewport.is-shape-editing { touch-action: none; cursor: crosshair; }
.viewport.is-shape-editing.can-pan { cursor: grab; }
.viewport.is-shape-editing.is-dragging { cursor: grabbing; }
.viewport.is-shape-editing :is([data-item-id], [data-text-id]) { cursor: inherit; }
.viewport.is-shape-editing .upload-status { display: none; }
#shape-guide-path {
  fill: none;
  stroke: #5b701e;
  stroke-width: 2px;
  stroke-dasharray: 7 4;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 1px #fbfaf5);
  pointer-events: none;
}
.is-shape-editing #shape-guide-path { stroke-width: 2.5px; }
[data-shape-point] {
  fill: var(--paper-bright);
  stroke: #3d5116;
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
  cursor: move;
}
[data-shape-point][aria-pressed="true"], [data-shape-point]:focus-visible { fill: var(--lime); stroke: var(--ink); }
.shape-editor {
  position: absolute;
  z-index: 5;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: min(434px, calc(100% - 20px));
  display: grid;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid #d9d9cd;
  border-radius: 8px;
  background: var(--paper-bright);
  color: var(--ink);
  box-shadow: 0 3px 13px #1b1d1650;
  cursor: default;
}
.shape-editor-tools { display: flex; flex-wrap: wrap; gap: 5px; align-items: end; }
.shape-editor-tools .select-field { margin-right: auto; }
.shape-editor-tools .button { min-height: 32px; }
.shape-editor-hint { color: var(--muted); font-size: 11px; line-height: 1.4; }
.shape-editor-hint.is-error { color: var(--danger); }
.shape-editor :focus-visible { outline-color: var(--lime-dark); }
@media (pointer: coarse) {
  .workspace .photo-toolbar .icon-button { width: 38px; min-height: 38px; }
}
.empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 10px;
  transform: translate(-50%, -50%);
  width: min(80%, 326px);
  padding: 20px;
  color: var(--ink);
  background: var(--paper-bright);
  border: 1px solid #e1dfd4;
  border-radius: 12px;
  box-shadow: 0 7px 17px #282b1b0d;
  text-align: center;
}
.empty-state h2 { font-size: clamp(16px,2vw,24px); font-weight: 740; letter-spacing: -.045em; }
.empty-state p { color: var(--muted); font-size: 12px; line-height: 1.45; }
.empty-state .button { margin-top: 3px; }
.empty-mark { position: relative; width: 58px; height: 48px; margin-bottom: 1px; color: #343a26; }
.empty-mark i, .empty-mark .icon { position: absolute; top: 5px; left: 10px; width: 37px; height: 31px; transform: rotate(-14deg); border: 1px solid #90957c; border-radius: 4px; background: #eceee2; }
.empty-mark i:nth-child(2) { transform: translate(4px, 3px) rotate(12deg); background: #e2e7d1; }
.empty-mark .icon { top: 10px; border: 0; transform: rotate(-4deg); background: #d7ed9e; stroke-width: 1.15; padding: 2px; }
.drop-overlay {
  display: none;
  position: absolute;
  inset: 10px;
  place-items: center;
  background: #303527db;
  border: 2px dashed var(--lime);
  border-radius: 7px;
  pointer-events: none;
  color: var(--lime);
}
.drop-overlay div { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; }
.is-drop-target .drop-overlay { display: grid; }
.photo-sidebar.is-drop-target { box-shadow: inset 0 0 0 3px #8ba63e; }
.upload-status {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(370px, calc(100% - 24px));
  display: grid;
  gap: 5px;
  padding: 10px 13px 12px;
  border: 1px solid #d9d9cd;
  border-radius: 9px;
  background: var(--paper-bright);
  color: var(--ink);
  box-shadow: 0 4px 17px #1b1d1640;
}
.dialog-body .upload-status { position: static; transform: none; width: 100%; margin: 10px 0; box-shadow: none; }
.upload-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 27px; }
.upload-heading h2 { font-size: 14px; }
.upload-heading .button { min-height: 26px; }
.upload-meta { color: var(--muted); font-size: 11px; line-height: 1.4; font-variant-numeric: tabular-nums; }
#upload-detail { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
#upload-progress { display: block; height: 8px; margin: 1px 0 3px; border: 0; border-radius: 5px; overflow: hidden; background: #dfe2d7; accent-color: #90b12e; }
#upload-progress::-webkit-progress-bar { background: #dfe2d7; }
#upload-progress::-webkit-progress-value { background: #90b12e; }
#upload-progress::-moz-progress-bar { background: #90b12e; }
.upload-status :focus-visible { outline-color: var(--lime-dark); }
.workspace-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 0 11px; }
#status { font-size: 11px; color: #dadccf; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#status.is-error { color: #ffbdab; }
.workspace-footer .subtle { color: #d9ddcd; }
.workspace-footer .subtle:not(:disabled):hover { background: var(--chrome-raised); }
.workspace-footer .icon { width: 14px; height: 14px; }

.photo-heading h2 { display: flex; align-items: center; gap: 8px; }
.count { color: var(--muted); font-size: 10px; font-weight: 550; letter-spacing: 0; white-space: nowrap; }
.button.icon-add { width: 35px; min-height: 35px; padding: 0; background: #e9eddc; border-color: #d9e1c6; }
.button.icon-add:not(:disabled):hover { background: #dfe8c8; }
.photos-empty { display: grid; gap: 8px; place-items: center; padding: 25px 12px 27px; color: var(--muted); font-size: 12px; text-align: center; }
.photos-empty .icon { width: 22px; height: 22px; color: #737b61; }
.photo-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; min-height: 0; max-height: min(42vh, 400px); overflow-y: auto; list-style: none; margin: 0; padding: 14px 17px; }
.photo-grid li { min-width: 0; }
.thumbnail { display: block; position: relative; aspect-ratio: 1; width: 100%; overflow: hidden; padding: 0; border-radius: 5px; border: 1px solid #dddccd; background: #e9e7dc; }
.thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumbnail[aria-pressed="true"] { outline: 2px solid var(--lime-dark); outline-offset: 1px; }
.thumbnail[aria-pressed="true"]:focus-visible { outline-width: 3px; }
#photo-grid .icon { position: absolute; right: 3px; bottom: 3px; width: 16px; height: 16px; padding: 2px; border-radius: 3px; color: #fff; background: #22241fe6; }
.inspector { border-top: 1px solid var(--line); }
.inspector-empty { color: var(--muted); font-size: 12px; line-height: 1.5; }
.selected-filename { overflow-wrap: anywhere; color: var(--muted); font-size: 12px; }
.selected-angle { margin-top: 12px; }
.item-actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 5px; margin-top: 15px; }
.remove-button { color: var(--danger); }
.text-list { display: grid; gap: 5px; margin: 0 0 10px; padding: 0; max-height: 165px; overflow: auto; list-style: none; }
.text-list .button { width: 100%; justify-content: start; }
.text-list .button[aria-pressed="true"] { background: #e9eddb; border-color: #a9b585; }
.text-list .button span { overflow: hidden; text-overflow: ellipsis; }
.text-field textarea { min-height: 58px; height: auto; resize: vertical; }

dialog {
  width: min(480px, 100% - 24px);
  max-height: calc(100% - 24px);
  padding: 0;
  border: 1px solid #cfcfc0;
  border-radius: 12px;
  background: var(--paper-bright);
  color: var(--ink);
  box-shadow: 0 16px 80px #14161065;
}
dialog::backdrop { background: #1b1d1699; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 15px 19px; }
.dialog-heading h2 { font-size: 20px; }
.dialog-body { padding: 16px 19px 19px; margin: 0; }
.dialog-description, .dialog-message, .dialog-notice { font-size: 12px; line-height: 1.5; color: var(--muted); }
.dialog-message:not(:empty) { margin-block: 13px 7px; }
.dialog-message.is-error { color: var(--danger); }
.dialog-notice { margin-bottom: 12px; }
.dialog-actions, .project-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.dialog-actions { justify-content: end; margin-top: 16px; }
.text-field { font-weight: 600; font-size: 12px; }
.text-field input { height: 37px; font-weight: 500; }
.projects-list { display: grid; gap: 5px; list-style: none; padding: 0; margin: 12px 0 0; }
.project-option { display: grid; gap: 3px; text-align: start; width: 100%; background: #f3f2e9; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); overflow-wrap: anywhere; }
.project-option:hover { background: #e9edda; }
.project-option strong { font-size: 13px; }
.project-option span { font-size: 11px; color: var(--muted); }
.formats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; border: 0; padding: 0; margin: 12px 0 0; }
.formats label { display: flex; gap: 7px; align-items: start; padding: 9px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.formats label:has(:checked) { background: #edf1de; border-color: #a4af83; }
.formats label:has(:disabled) { opacity: .6; }
.formats input { margin: 1px 0 0; accent-color: var(--lime-dark); }
.formats span { display: grid; gap: 2px; }
.formats strong { font-size: 12px; }
.formats small { font-size: 11px; color: var(--muted); }
.export-progress { display: grid; gap: 5px; margin-top: 16px; font-size: 12px; font-weight: 620; }
progress { width: 100%; height: 9px; accent-color: var(--lime-dark); }
.shortcut-list { display: grid; gap: 0; }
.usage-help { padding-bottom: 0; }
.usage-help p + p { margin-top: 9px; }
.usage-help h3 { margin-top: 18px; color: var(--ink); }
.shortcut-list div { display: flex; justify-content: space-between; align-items: center; gap: 7px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.shortcut-list div:last-child { border-bottom: 0; }
.shortcut-list dd { margin: 0; text-align: right; }
kbd { display: inline-block; margin: 1px 0; padding: 1px 4px; border: 1px solid #d5d7c9; border-radius: 4px; background: #efefe6; color: var(--ink); }

@media (min-width: 901px) {
  body { min-height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0,1fr); }
  .sidebar { overflow-y: auto; overscroll-behavior: contain; }
}
@media (min-width: 1450px) {
  .studio { grid-template-columns: 270px minmax(0,1fr) 290px; }
  .panel-heading, .control-section, .inspector, .photo-grid { padding-inline: 21px; }
}
@media (min-width: 901px) and (max-width: 1120px) {
  .studio { grid-template-columns: 221px minmax(0,1fr) 230px; }
  .panel-heading, .control-section, .inspector, .photo-grid { padding-inline: 13px; }
  .workspace-toolbar { padding-inline: 8px; gap: 5px; }
  .toolbar-group { gap: 4px; }
}
@media (max-width: 900px) {
  .studio { grid-template-columns: minmax(0,1fr) minmax(0,1fr); grid-template-areas: "workspace workspace" "controls photos"; }
  .workspace { min-height: 400px; height: min(68svh, 620px); }
  .controls { border-right: 1px solid var(--line); }
  .photo-grid { max-height: 385px; grid-template-columns: repeat(4,minmax(0,1fr)); }
  .viewport { touch-action: pan-y; }
  .viewport [data-item-id], .viewport [data-text-id], .viewport.can-pan, .viewport.is-zoomed { touch-action: none; }
}
@media (max-width: 595px) {
  .topbar { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "brand actions" "project project"; gap: 10px; padding: 10px 12px; }
  .brand { grid-area: brand; gap: 8px; }
  .brand h1 { font-size: 22px; }
  .project-heading { grid-area: project; justify-content: start; padding-left: 3px; }
  .header-actions { grid-area: actions; gap: 5px; }
  .header-actions .button { min-height: 34px; padding-inline: 7px; gap: 4px; }
  .header-actions .chrome .icon { display: none; }
  .workspace { height: 54svh; min-height: 342px; }
  .studio { grid-template-columns: minmax(0,1fr); grid-template-areas: "workspace" "photos" "controls"; }
  .controls { border-top: 1px solid var(--line); border-right: 0; }
  .panel-heading { min-height: 49px; }
  .photo-grid { grid-template-columns: repeat(5,minmax(0,1fr)); max-height: 260px; }
  .workspace-toolbar { padding-inline: 7px; gap: 4px; }
  .workspace .icon-button { width: 29px; min-height: 29px; }
  .toolbar-group { gap: 3px; }
  #zoom-value { min-width: 32px; }
  .canvas-info { font-size: 10px; }
}
@media (max-width: 340px) {
  .header-actions .primary .icon, .fit-button .icon { display: none; }
  .fit-button::after { content: "Fit"; }
  .empty-state { gap: 7px; padding: 11px; }
}
