:root {
  color-scheme: light;
  --ink: #161716;
  --muted: #666b63;
  --line: #d8dbd4;
  --paper: #f5f3ed;
  --surface: #fffdfa;
  --accent: #172338;
  --accent-2: #b68b55;
  --danger: #9a3426;
  --shadow: 0 18px 60px rgba(22, 23, 22, 0.12);
}

* {
  box-sizing: border-box;
}

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

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

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  min-height: calc(100vh - 48px);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 34px;
  min-width: 0;
}

.brand-lockup img {
  width: 128px;
  height: auto;
  flex: 0 0 auto;
}

.topbar h1,
.section-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.language-toggle {
  min-width: 58px;
}

.section-heading h2 {
  font-size: 18px;
}

.conversion-time {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.render-meta {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 150px;
  border: 1px solid var(--line);
  padding: 9px 12px;
  color: var(--muted);
  text-align: left;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #b8b8b0;
}

.status.ready .status-dot {
  background: #2f8f46;
}

.status.not-ready {
  border-color: rgba(154, 52, 38, 0.4);
  color: var(--danger);
}

.status.not-ready .status-dot {
  background: var(--danger);
}

.layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) 380px minmax(480px, 1.25fr);
  height: calc(100vh - 173px);
  min-height: 0;
}

.app-footer {
  display: grid;
  gap: 3px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 10px 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.drawing-pane,
.controls-pane,
.result-pane {
  min-width: 0;
  min-height: 0;
  padding: 24px;
}

.drawing-pane {
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
}

.preview-frame {
  grid-row: -2 / -1;
}

.result-pane {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.controls-pane {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  gap: 0;
  height: 100%;
  overflow: hidden;
  background: #fbfaf6;
  padding-bottom: 24px;
}

.material-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}

.material-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  text-align: center;
}

.material-tab.selected,
.material-tab:hover {
  border-color: var(--accent);
  background: #f7f5ee;
}

.material-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.material-panel > fieldset:last-child {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.controls-pane,
.result-pane {
  border-left: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.result-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.scene-lock-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 34px;
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.scene-lock-row label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.scene-lock-row input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.scene-lock-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 0 12px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}

.ghost-button:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.drop-zone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 132px;
  border: 1px dashed #aeb4aa;
  background: #faf9f4;
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.drop-zone.has-file {
  grid-template-columns: auto minmax(0, 1fr);
  place-items: center start;
  min-height: 74px;
  padding: 14px 18px;
  text-align: left;
}

.drop-zone.has-file .drop-icon {
  grid-row: span 2;
}

.drop-zone.has-file strong,
.drop-zone.has-file span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-zone.dragging,
.drop-zone:hover {
  border-color: var(--accent);
  background: #f1f0e9;
  transform: translateY(-1px);
}

.drop-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
}

.drop-zone strong {
  font-size: 18px;
}

.drop-zone span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.kitchen-name-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #fffdfa;
  padding: 10px 12px;
}

.kitchen-name-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kitchen-name-row input {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  outline: none;
}

.kitchen-name-row input:focus {
  box-shadow: inset 0 -1px 0 var(--accent);
}

.pdf-page-selector {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fffdfa;
}

.pdf-page-heading {
  display: grid;
  gap: 2px;
}

.pdf-page-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pdf-page-heading small,
.pdf-page-empty {
  color: var(--muted);
  font-size: 12px;
}

.pdf-page-options {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.pdf-page-option {
  display: grid;
  gap: 2px;
  min-width: 68px;
  max-width: 68px;
  border: 1px solid var(--line);
  background: #f8f7f2;
  padding: 4px;
  cursor: pointer;
  text-align: center;
}

.pdf-page-option.selected,
.pdf-page-option:hover {
  border-color: var(--accent);
  background: #fff;
}

.pdf-page-option img {
  width: 100%;
  height: 42px;
  object-fit: cover;
  background: #edece6;
}

.pdf-page-option span {
  font-size: 11px;
  font-weight: 700;
}

.layout-mark-tools {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.mark-mode-toggle,
.mark-action-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mark-mode-toggle {
  grid-template-columns: auto auto;
  align-items: center;
  min-height: 36px;
  color: var(--ink);
}

.mark-mode-toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.mark-action-field select {
  margin-top: 0;
  min-height: 36px;
}

#layoutMarkCount {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.layout-render-button {
  grid-column: 3 / 5;
  min-height: 38px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  padding: 0 12px;
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.layout-render-button:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.layout-render-button:disabled {
  cursor: progress;
  opacity: 0.72;
  transform: none;
}

.layout-action-help,
.finish-action-help {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.layout-action-help {
  grid-column: 1 / 3;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  border-top: 0;
  padding-top: 0;
}

.finish-action-help {
  margin: 0 0 8px;
}

.layout-action-help strong,
.finish-action-help strong {
  color: var(--ink);
  font-size: 12px;
}

.preview-frame {
  position: relative;
  height: auto;
  min-height: 0;
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #edece6;
  overflow: hidden;
}

.preview-scroll {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.preview-scroll.zoomed {
  overflow: auto;
}

.preview-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 8;
  display: flex;
  gap: 8px;
}

.preview-zoom-button {
  min-width: 34px;
  padding: 0;
}

.preview-zoom-reset {
  min-width: 58px;
}

.preview-actions .ghost-button {
  min-height: 32px;
  background: rgba(255, 253, 250, 0.94);
  backdrop-filter: blur(6px);
}

.preview-frame iframe,
.image-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #edece6;
}

.image-preview {
  display: block;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.empty-preview,
.render-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.mark-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.mark-overlay.active {
  cursor: crosshair;
  pointer-events: auto;
  touch-action: none;
}

.layout-mark {
  position: absolute;
  min-width: 28px;
  min-height: 24px;
  border: 2px solid #000;
  background: rgba(0, 0, 0, 0.04);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.layout-mark.draft {
  border-style: dashed;
}

.layout-mark span {
  position: absolute;
  top: -1px;
  left: -1px;
  max-width: min(220px, 100%);
  overflow: hidden;
  background: var(--accent);
  color: #fff;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mark-delete {
  position: absolute;
  top: -10px;
  right: -10px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.selected-panel {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: #faf9f4;
  padding: 8px;
}

.selected-panel strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-reference {
  width: 104px;
  height: 104px;
  object-fit: contain;
  background: #f0eee7;
  border: 1px solid var(--line);
}

fieldset {
  border: 0;
  margin: 0 0 12px;
  padding: 0;
}

legend,
.notes-label,
.inline-fields label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

legend {
  margin-bottom: 8px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.style-option,
.color-option {
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.style-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 34px;
  padding: 5px 6px;
}

.collection-option {
  display: grid;
  gap: 0;
  justify-content: stretch;
  text-align: center;
}

.style-option:hover,
.color-option:hover,
.panel-option:hover,
.style-option.selected,
.color-option.selected,
.panel-option.selected {
  border-color: var(--accent);
  background: #f7f5ee;
}

.style-option:hover,
.color-option:hover,
.panel-option:hover {
  transform: translateY(-1px);
}

.style-option strong,
.style-option small {
  display: block;
}

.style-option strong {
  font-size: 12px;
  line-height: 1.2;
}

.style-option small {
  margin-top: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.door {
  position: relative;
  width: 34px;
  height: 48px;
  flex: 0 0 auto;
  background: var(--accent);
}

.door::after {
  content: "";
  position: absolute;
  inset: 9px 7px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.door.slim::after {
  inset: 6px;
}

.door.slab::after {
  content: none;
}

.door.raised::after {
  inset: 10px 8px;
  border-width: 3px;
}

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

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding-right: 3px;
}

.color-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px;
}

.panel-option {
  display: grid;
  grid-template-rows: 96px auto;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  background: transparent;
  padding: 7px;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.panel-option img {
  width: 100%;
  height: 96px;
  object-fit: contain;
  background: transparent;
}

.panel-option span {
  min-height: 30px;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.25;
}

.quartz-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding-right: 3px;
  content-visibility: auto;
}

.quartz-option {
  display: grid;
  grid-template-rows: 92px auto;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  background: transparent;
  padding: 6px;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
  contain: layout paint;
}

.quartz-option:hover,
.quartz-option.selected {
  border-color: var(--accent);
  background: #f7f5ee;
}

.quartz-option:hover {
  transform: translateY(-1px);
}

.quartz-option img {
  width: 100%;
  height: 92px;
  object-fit: cover;
  background: #f0eee7;
}

.quartz-option span {
  min-height: 26px;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.2;
}

.quartz-empty {
  display: grid;
  grid-row: 1 / 3;
  place-items: center;
}

.swatch {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

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

select,
textarea {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 9px;
  outline: none;
}

textarea {
  resize: vertical;
}

select:focus,
textarea:focus {
  border-color: var(--accent);
}

.notes-label {
  display: block;
  margin-bottom: 12px;
}

.render-button {
  width: 100%;
  min-height: 50px;
  border: 0;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.render-button:hover {
  background: #243653;
  transform: translateY(-1px);
}

.render-button:disabled {
  cursor: progress;
  opacity: 0.72;
  transform: none;
}

.render-button.blocked-by-marks {
  background: #5e6470;
}

.finish-action-help.blocked-by-marks {
  color: var(--danger);
}

.button-arrow {
  font-size: 22px;
}

.result-stage {
  position: relative;
  height: auto;
  min-height: 0;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    #f0efe9;
  background-size: 36px 36px;
  overflow: hidden;
}

.history-strip {
  display: flex;
  gap: 8px;
  min-height: 122px;
  margin-bottom: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 6px;
}

.history-collection {
  display: grid;
  gap: 5px;
  flex: 0 0 auto;
}

.history-collection-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  max-width: 248px;
}

.history-collection-title strong,
.history-collection-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-collection-title strong {
  font-size: 11px;
}

.history-collection-title small {
  color: var(--muted);
  font-size: 10px;
}

.history-collection-row {
  display: flex;
  gap: 8px;
}

.history-thumb {
  display: grid;
  grid-template-rows: 54px auto auto auto;
  gap: 3px;
  min-width: 116px;
  max-width: 116px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 5px;
  cursor: pointer;
  text-align: left;
}

.history-thumb.selected,
.history-thumb:hover {
  border-color: var(--accent);
}

.history-thumb img {
  width: 100%;
  height: 54px;
  object-fit: cover;
  background: #f0efe9;
}

.history-thumb span,
.history-thumb small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-thumb span {
  font-size: 11px;
  font-weight: 700;
}

.history-thumb small,
.history-empty {
  color: var(--muted);
  font-size: 10px;
}

.history-empty {
  margin: auto 0;
}

.result-stage.loading {
  animation: breathe 1.4s ease-in-out infinite alternate;
}

.render-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
}

.render-placeholder p {
  max-width: 280px;
  margin: 0;
}

#renderImage {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 260ms ease, transform 260ms ease;
}

#renderImage.visible {
  opacity: 1;
  transform: scale(1);
}

.loading-bar {
  position: relative;
  width: min(260px, 70%);
  height: 6px;
  overflow: hidden;
  background: rgba(23, 35, 56, 0.12);
}

.loading-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  background: var(--accent);
  animation: loading-slide 1.15s ease-in-out infinite;
}

.error-mark {
  width: min(260px, 70%);
  height: 6px;
  background: var(--danger);
}

.hidden {
  display: none !important;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: rgba(15, 16, 15, 0.92);
  color: #fff;
}

.modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.modal-topbar strong {
  display: block;
  font-size: 15px;
}

.zoom-controls {
  display: flex;
  gap: 8px;
}

.image-modal .ghost-button {
  min-width: 42px;
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.image-modal .ghost-button:hover {
  border-color: #fff;
}

.modal-stage {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  cursor: zoom-in;
  touch-action: none;
}

.modal-stage.can-pan {
  cursor: grab;
}

.modal-stage.can-pan:active {
  cursor: grabbing;
}

#modalImage {
  max-width: 96vw;
  max-height: calc(100vh - 86px);
  object-fit: contain;
  transform-origin: center;
  transition: transform 120ms ease;
  user-select: none;
}

@keyframes loading-slide {
  0% {
    transform: translateX(-110%);
  }
  50% {
    transform: translateX(70%);
  }
  100% {
    transform: translateX(240%);
  }
}

@keyframes breathe {
  from {
    filter: saturate(0.9);
  }
  to {
    filter: saturate(1.08);
  }
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  }

  .result-pane {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .result-stage {
    height: 620px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 0;
  }

  .workspace {
    min-height: 100vh;
    border: 0;
  }

  .topbar,
  .layout {
    display: block;
  }

  .topbar {
    padding: 20px;
  }

  .status {
    margin-top: 14px;
    text-align: left;
  }

  .drawing-pane,
  .controls-pane,
  .result-pane {
    padding: 20px;
  }

  .controls-pane {
    display: block;
    max-height: none;
    overflow: visible;
  }

  .controls-pane,
  .result-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .option-grid,
  .swatch-grid,
  .panel-grid,
  .inline-fields {
    grid-template-columns: 1fr;
  }

  .result-actions,
  .zoom-controls {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .panel-grid {
    height: auto;
    max-height: 340px;
  }

  .preview-frame,
  .result-stage {
    min-height: 420px;
    height: 60vh;
  }
}
