@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700;800&family=Bebas+Neue&family=Montserrat:wght@400;600;800&family=Oswald:wght@400;600;700&family=Playfair+Display:wght@600;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Poppins:wght@400;600;800&family=Roboto+Condensed:wght@400;700&display=swap");

:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #000000;
  --text-strong: #111111;
  --muted: #666666;
  --subtle: #8a8a8a;
  --soft: #f5f5f5;
  --line: #d9d9d9;
  --line-dark: #a8a8a8;
  --panel: #ffffff;
  --shadow: 0 16px 34px rgba(0, 0, 0, 0.1);
  font-family:
    "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea,
select,
.button-link {
  font: inherit;
}

.app-shell {
  width: min(1220px, calc(100% - 32px));
  height: 100svh;
  margin: 0 auto;
  padding: 10px 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  filter: grayscale(1) contrast(1.05);
  object-fit: contain;
}

.topbar h1,
.upload-heading h2,
.form-heading h2,
.action-row p,
.order-form p {
  margin: 0;
}

.topbar h1 {
  font-family: "Barlow Condensed", "Plus Jakarta Sans", sans-serif;
  color: var(--text-strong);
  font-size: 34px;
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: 0;
}

.workspace {
  display: grid;
  min-height: 0;
}

.viewer-band {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #ececec;
  border-radius: 8px;
  background:
    radial-gradient(ellipse at center, #f1f1f1 0%, #f4f4f4 46%, #ffffff 100%);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.08);
}

.viewer-band::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0) 16%, rgba(255, 255, 255, 0) 84%, #ffffff 100%),
    linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0) 14%, rgba(255, 255, 255, 0) 86%, #ffffff 100%);
}

#modelCanvas {
  display: block;
  width: 100%;
  height: 100%;
  transition: filter 180ms ease, opacity 180ms ease;
}

.viewer-status {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
}

.viewer-loading {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 43px;
  display: none;
  height: 4px;
}

.viewer-band.is-submitting-order #modelCanvas {
  filter: blur(5px);
  opacity: 0.62;
}

.viewer-band.is-submitting-order .viewer-loading {
  top: 12px;
  bottom: auto;
  z-index: 4;
  height: 6px;
}

.viewer-band.is-submitting-order .viewer-loading-track {
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.viewer-band.is-submitting-order .viewer-status {
  z-index: 4;
}

.viewer-loading.is-active {
  display: block;
}

.viewer-loading-track {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: #ededed;
}

.viewer-loading-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #000000;
  transition: width 180ms ease;
}

.preorder-panel {
  display: grid;
  grid-template-rows: auto;
  gap: 8px;
  min-height: 0;
}

.mode-switch {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.mode-tab {
  flex: 1 1 0;
  min-height: 36px;
  border-color: var(--line-dark);
  background: #ffffff;
  color: var(--ink);
  white-space: nowrap;
}

.mode-tab.is-active {
  border-color: #000000;
  background: #000000;
  color: #ffffff;
}

.mode-panel {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.mode-panel[hidden] {
  display: none !important;
}

.spec-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.spec-strip div {
  display: grid;
  gap: 2px;
  min-height: 56px;
  padding: 10px 12px;
  background: var(--panel);
}

.spec-strip strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.spec-strip span {
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.15;
}

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

.upload-card,
.order-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.upload-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.upload-heading,
.form-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.upload-heading h2,
.form-heading h2 {
  color: var(--text-strong);
  font-size: 18px;
  line-height: 1.1;
  font-weight: 800;
}

.upload-heading span,
.form-heading span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
}

.drop-zone {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 62px;
  padding: 10px;
  border: 1px dashed var(--line-dark);
  border-radius: 8px;
  background: var(--soft);
  cursor: pointer;
  text-align: center;
}

.drop-zone:hover {
  border-color: var(--ink);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.drop-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.drop-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-meta.is-good,
.drop-meta.is-bad {
  color: var(--muted);
  font-weight: 400;
}

.drop-meta.is-warn {
  color: var(--muted);
  font-weight: 400;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 42px;
}

.create-row {
  justify-content: center;
  min-height: 58px;
}

button {
  min-height: 38px;
  border: 1px solid #000000;
  border-radius: 8px;
  background: #000000;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

button:hover:not(:disabled),
.button-link.is-primary:hover {
  background: #333333;
}

button:disabled {
  cursor: not-allowed;
  border-color: #c8c8c8;
  background: #e5e5e5;
  color: #8a8a8a;
}

#createButton,
#orderButton {
  min-width: 154px;
}

#createButton {
  min-height: 44px;
  padding: 0 26px;
  font-size: 16px;
}

.action-row p {
  color: var(--subtle);
  font-size: 13px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anamorphic-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
}

.projection-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 12px;
  min-width: 0;
}

.projection-canvas-panel,
.projection-controls {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.projection-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.projection-heading h2,
.projection-status,
.projection-range span {
  margin: 0;
}

.projection-heading h2 {
  color: var(--text-strong);
  font-size: 18px;
  line-height: 1.1;
  font-weight: 850;
}

.projection-heading span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.projection-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  min-height: 220px;
  max-height: min(52svh, 460px);
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #ffffff;
}

.projection-canvas-wrap[hidden] {
  display: none !important;
}

.projection-model-preview {
  width: 100%;
  aspect-ratio: 2 / 1;
  min-height: 220px;
  max-height: min(52svh, 460px);
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #ffffff;
}

.projection-model-preview[hidden] {
  display: none !important;
}

.projection-model-preview .viewer-band {
  width: 100%;
  height: 100%;
  min-height: inherit;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
}

#projectionDesignCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#projectionDesignCanvas:active {
  cursor: grabbing;
}

.projection-text-delete {
  position: absolute;
  z-index: 4;
  display: grid;
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 1px solid #000000;
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  cursor: pointer;
  place-items: center;
  transform: translate(8px, -100%);
}

.projection-text-delete[hidden] {
  display: none !important;
}

.projection-text-delete svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.projection-controls textarea,
.projection-controls select,
.projection-controls input[type="color"] {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  padding: 7px 10px;
  background: #ffffff;
  color: var(--ink);
}

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

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

.projection-controls input[type="color"] {
  min-width: 44px;
  padding: 4px;
}

.projection-range {
  display: grid;
  gap: 5px;
}

.projection-range span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.projection-range b {
  color: var(--ink);
  font-weight: 800;
  text-transform: none;
}

.projection-range input[type="range"] {
  width: 100%;
  min-height: 28px;
  accent-color: #000000;
}

.projection-buttons {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 8px;
}

.projection-buttons button {
  padding: 0 12px;
}

.projection-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.order-panel {
  display: none;
  width: 100%;
  min-height: 0;
  padding: 16px;
  overflow-x: hidden;
  overflow-y: auto;
}

.order-form {
  display: grid;
  min-width: 0;
  gap: 9px;
  margin-top: 12px;
}

.order-details-step {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.order-form label,
.form-field {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.order-form label span,
.form-field span {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.order-form input,
.order-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  padding: 7px 10px;
  background: #ffffff;
  color: var(--ink);
  resize: none;
}

.schedule-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.schedule-grid input {
  min-width: 0;
}

.address-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 8px;
}

#mapSelectButton {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  white-space: nowrap;
}

.payment-step {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.payment-step[hidden] {
  display: none !important;
}

.payment-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.payment-heading h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 18px;
  line-height: 1.1;
  font-weight: 850;
}

.secondary-button {
  min-height: 34px;
  border-color: var(--line-dark);
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
}

.secondary-button:hover:not(:disabled) {
  border-color: #000000;
  background: #f4f4f4;
}

.payment-summary {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.order-type-fieldset {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 0;
  background: #ffffff;
}

.order-type-fieldset legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.order-type-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.order-type-option {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  background: #ffffff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.order-type-option:hover {
  border-color: var(--line-dark);
}

.order-type-option:has(input:checked) {
  border-color: #000000;
  background: #f6f6f6;
}

.order-type-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.order-type-label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

.order-type-price {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.order-type-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.price-row:last-child {
  border-bottom: 0;
}

.price-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.price-row strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 850;
  text-align: right;
}

.price-row.is-total {
  background: #f6f6f6;
}

.price-row.is-total strong {
  font-size: 18px;
}

.shipping-note,
.payment-note {
  min-height: 0 !important;
}

.payment-note {
  color: var(--text-strong) !important;
  font-weight: 750;
}

.pac-container {
  z-index: 10000;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-family:
    "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.pac-item {
  padding: 8px 10px;
  color: var(--muted);
}

.pac-item-query {
  color: var(--ink);
}

.editor-mode {
  display: none;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.editor-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  background: var(--panel);
  flex: 0 0 auto;
}

.editor-action-bar .editor-status {
  margin: 0;
  flex: 0 1 auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

#editorBackButton {
  width: 34px;
  min-height: 34px;
  border-color: var(--line-dark);
  background: #ffffff;
  color: var(--ink);
  flex: 0 0 auto;
}

.editor-progress {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 999px;
  background: #ededed;
  overflow: hidden;
  display: none;
}

.editor-progress.is-active {
  display: block;
}

.editor-progress-track {
  width: 100%;
  height: 100%;
}

.editor-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #000000;
  transition: width 180ms ease;
}

.editor-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 10px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.editor-preview-column {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

.editor-form-column {
  min-width: 0;
  min-height: 0;
}

.editor-form-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.editor-form-column > .editor-view-tabs,
.editor-form-column > .editor-2d-surface,
.editor-form-column > .editor-finish-bar {
  flex: 0 0 auto;
  min-width: 0;
}

.editor-form-column > .crop-editor-pane,
.editor-form-column > .projection-editor-pane {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.editor-form-column input,
.editor-form-column select,
.editor-form-column textarea,
.editor-form-column button {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.editor-preview-area {
  position: relative;
  min-height: 0;
  min-width: 0;
  display: grid;
  place-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  padding: 10px;
  overflow: hidden;
}

#editor3dSlot {
  width: 100%;
  height: 100%;
}

#editor3dSlot .viewer-band {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  box-shadow: none;
  border-radius: 6px;
}

.editor-2d-surface {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  padding: 6px;
  overflow: hidden;
}

.editor-2d-surface > .crop-stage,
.editor-2d-surface > .projection-canvas-wrap {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  min-height: 0;
}

.editor-2d-surface > .crop-stage[hidden],
.editor-2d-surface > .projection-canvas-wrap[hidden] {
  display: none !important;
}

.editor-finish-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

#finishButton {
  min-width: 140px;
  min-height: 40px;
  flex: 0 0 auto;
}

.editor-view-tabs {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.editor-view-tab {
  flex: 1 1 0;
  min-height: 36px;
  border-color: var(--line-dark);
  background: #ffffff;
  color: var(--ink);
}

.editor-view-tab.is-active {
  border-color: #000000;
  background: #000000;
  color: #ffffff;
}

.crop-editor-pane,
.projection-editor-pane {
  display: grid;
  gap: 12px;
  min-width: 0;
  min-height: 0;
}

.editor-control-column {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.editor-upload-zone {
  min-height: 54px;
  padding: 11px 12px;
  border-style: solid;
  background: #f4f4f4;
}

.editor-text-field {
  grid-column: 1 / -1;
}

.crop-editor-pane[hidden],
.projection-editor-pane[hidden] {
  display: none !important;
}

.crop-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line-dark);
  background: #eeeeee;
  cursor: grab;
  touch-action: none;
}

.crop-stage.is-empty {
  display: grid;
  place-items: center;
  cursor: pointer;
  background: #eeeeee;
}

.crop-stage.is-drop-target {
  border-color: #000000;
  background: #e5e5e5;
}

.crop-empty-state {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  gap: 5px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
  text-align: center;
}

.crop-empty-state strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.1;
}

.crop-empty-state span {
  color: var(--muted);
  font-size: 12px;
}

.crop-empty-state[hidden] {
  display: none !important;
}

.crop-stage.is-dragging {
  cursor: grabbing;
}

.crop-stage img {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  max-width: none;
  user-select: none;
  pointer-events: none;
}

.artwork-text-layer-root {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.artwork-text-layer {
  position: absolute;
  width: max-content;
  max-width: none;
  padding: 3px 7px;
  color: #ffffff;
  cursor: grab;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  transform: translate(-50%, -50%);
  user-select: none;
  touch-action: none;
  white-space: pre-wrap;
  overflow-wrap: normal;
  word-break: normal;
  pointer-events: auto;
}

.artwork-text-layer.is-selected {
  outline: 1px solid rgba(255, 255, 255, 0.95);
  outline-offset: 6px;
}

.artwork-text-layer.is-dragging {
  cursor: grabbing;
}

@media (pointer: coarse) {
  .artwork-text-layer::before {
    content: "";
    position: absolute;
    inset: -12px -18px;
  }
}

.crop-frame {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  box-shadow: none;
  pointer-events: none;
}

.crop-grid {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: calc(100% / 12) 100%, 100% calc(100% / 6);
  background-position: 0 0, 0 0;
  mix-blend-mode: overlay;
  opacity: 0.55;
}

.crop-stage.is-empty .crop-grid {
  display: none;
}

.crop-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 12px;
}

.crop-controls label,
.artwork-text-tools {
  display: grid;
  gap: 6px;
}

.crop-controls label span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.crop-controls input[type="range"] {
  width: 100%;
  min-height: 34px;
  accent-color: #000000;
}

.artwork-text-tools {
  grid-template-columns: minmax(0, 1fr) minmax(118px, 0.85fr);
  align-items: end;
  gap: 8px;
}

.artwork-text-tools input,
.artwork-text-tools select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  padding: 7px 10px;
  background: #ffffff;
  color: var(--ink);
}

.artwork-text-tools input[type="color"] {
  min-width: 44px;
  padding: 4px;
}

.crop-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

#artworkTextRemoveButton {
  border-color: var(--line-dark);
  background: #ffffff;
  color: var(--ink);
}

#cropApplyButton {
  min-width: 116px;
}

.artwork-text-delete {
  position: absolute;
  right: -22px;
  top: -24px;
  z-index: 5;
  display: none;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px solid #000000;
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  place-items: center;
  cursor: pointer;
}

.artwork-text-layer.is-selected .artwork-text-delete {
  display: grid;
}

.artwork-text-delete svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.map-dialog {
  width: min(960px, calc(100% - 24px));
  max-height: calc(100svh - 24px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  color: var(--ink);
}

.map-dialog::backdrop {
  background: rgba(0, 0, 0, 0.56);
}

.map-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.map-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.map-heading h2,
.map-selection {
  margin: 0;
}

.map-heading h2 {
  color: var(--text-strong);
  font-size: 20px;
  line-height: 1.1;
  font-weight: 850;
}

.map-icon-button {
  width: 34px;
  min-height: 34px;
  border-color: var(--line-dark);
  background: #ffffff;
  color: var(--ink);
}

.map-search-input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--ink);
}

.map-canvas {
  width: 100%;
  min-height: 360px;
  height: min(56svh, 520px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.map-selection {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.map-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#mapCancelButton {
  border-color: var(--line-dark);
  background: #ffffff;
  color: var(--ink);
}

#mapConfirmButton {
  min-width: 122px;
}

.projection-dialog {
  width: min(1120px, calc(100% - 24px));
  max-height: calc(100svh - 24px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  color: var(--ink);
}

.projection-dialog::backdrop {
  background: rgba(0, 0, 0, 0.56);
}

.projection-preview-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.projection-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.projection-preview-heading h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 20px;
  line-height: 1.1;
  font-weight: 850;
}

.projection-icon-button {
  width: 34px;
  min-height: 34px;
  border-color: var(--line-dark);
  background: #ffffff;
  color: var(--ink);
}

.projection-preview-tabs {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.projection-tab {
  flex: 1 1 0;
  min-height: 36px;
  border-color: var(--line-dark);
  background: #ffffff;
  color: var(--ink);
}

.projection-tab.is-active {
  border-color: #000000;
  background: #000000;
  color: #ffffff;
}

.projection-preview-section {
  max-height: min(68svh, 680px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 10px;
}

.projection-preview-section > img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.projection-face-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.projection-face-grid figure {
  display: grid;
  gap: 5px;
  margin: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #ffffff;
}

.projection-face-grid img {
  display: block;
  width: min(100%, 96px);
  aspect-ratio: 2 / 1;
  justify-self: center;
  border: 1px solid var(--line-dark);
  object-fit: cover;
}

.projection-face-grid figcaption {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

#submitButton {
  margin-top: 2px;
}

.order-form p {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.submit-note {
  color: var(--text-strong);
  font-weight: 700;
}

.order-form a {
  color: var(--ink);
  font-weight: 800;
}

.confirmation-shell {
  width: min(760px, calc(100% - 32px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 10px 0 32px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
}

.confirmation-panel {
  align-self: center;
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.confirmation-panel h2,
.confirmation-panel p {
  margin: 0;
}

.confirmation-panel h2 {
  color: var(--text-strong);
  font-size: 28px;
  line-height: 1.1;
  font-weight: 850;
}

.confirmation-panel p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.confirmation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  padding: 9px 14px;
  text-decoration: none;
  font-weight: 800;
}

.button-link.is-primary {
  border: 1px solid #000000;
  background: #000000;
  color: #ffffff;
}

.button-link.is-secondary {
  border: 1px solid var(--line-dark);
  background: #ffffff;
  color: var(--ink);
}

.button-link.is-secondary:hover {
  border-color: #000000;
}

.app-shell.is-editing {
  grid-template-rows: auto minmax(0, 1fr);
}

.app-shell.is-editing .workspace,
.app-shell.is-editing .preorder-panel {
  display: none !important;
}

.app-shell.is-editing .editor-mode {
  display: grid;
  grid-row: 2 / 3;
}

.app-shell.is-checkout {
  grid-template-rows: auto minmax(0, 1fr);
}

.app-shell.is-checkout .workspace {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 10px;
}

.app-shell.is-checkout .order-panel {
  display: block;
}

.app-shell.is-checkout .preorder-panel,
.app-shell.is-checkout .editor-mode {
  display: none !important;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 8px 0;
    gap: 6px;
  }

  .topbar {
    min-height: 42px;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .topbar h1 {
    font-size: 26px;
  }

  .spec-strip div {
    min-height: 42px;
    padding: 6px;
  }

  .spec-strip span {
    font-size: 12px;
  }

  .drop-title {
    font-size: 13px;
  }

  .drop-meta,
  .action-row p,
  .upload-heading span,
  .form-heading span,
  .projection-heading span {
    font-size: 11px;
  }

  .mode-switch {
    gap: 5px;
  }

  .mode-tab {
    min-height: 34px;
    font-size: 12px;
  }

  .anamorphic-panel {
    padding: 10px;
  }

  .projection-workspace {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .projection-heading {
    display: grid;
    gap: 3px;
  }

  .projection-canvas-wrap,
  .projection-model-preview {
    min-height: 170px;
  }

  .projection-control-grid,
  .projection-buttons {
    grid-template-columns: 1fr;
  }

  .projection-controls textarea {
    min-height: 58px;
  }

  .app-shell.is-checkout .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 42svh) minmax(0, 1fr);
  }

  .order-panel {
    padding: 10px;
  }

  .order-form {
    gap: 7px;
    margin-top: 10px;
  }

  .order-details-step {
    gap: 7px;
  }

  .order-form input,
  .order-form textarea {
    min-height: 34px;
    padding: 6px 8px;
  }

  .editor-split {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 38svh) minmax(0, 1fr);
  }

  .editor-form-column {
    padding: 10px;
  }

  .editor-control-column {
    padding: 0;
  }

  .editor-action-bar {
    padding: 6px 10px;
  }

  .projection-workspace {
    grid-template-columns: 1fr;
  }

  .crop-stage {
    aspect-ratio: 2 / 1;
    min-height: 170px;
  }

  .crop-frame {
    width: 100%;
    height: 100%;
  }

  .crop-controls {
    grid-template-columns: 1fr;
  }

  .artwork-text-tools {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px 8px;
  }

  .artwork-text-tools .editor-text-field,
  .artwork-text-tools > label:first-child {
    grid-column: 1 / -1;
  }

  .crop-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .map-panel {
    padding: 10px;
  }

  .map-canvas {
    min-height: 300px;
    height: 52svh;
  }

  .map-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .projection-preview-panel {
    padding: 10px;
  }

  .projection-preview-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .projection-preview-section {
    max-height: 62svh;
    padding: 8px;
  }

  .confirmation-shell {
    width: min(100% - 20px, 760px);
    padding: 8px 0 20px;
  }

  .confirmation-panel {
    padding: 18px;
  }

  .confirmation-panel h2 {
    font-size: 22px;
  }

  .confirmation-actions {
    display: grid;
  }
}
