@font-face {
  font-family: "Billabong";
  src: url("/assets/fonts/Billabong_Cyr.ttf") format("truetype");
  font-display: block;
}

:root {
  color-scheme: light;
  font-family: "SF Pro Display", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --bg: #f4f2f0;
  --surface: #ffffff;
  --surface-muted: #ebe8e5;
  --text: #201f1e;
  --muted: #77736f;
  --line: rgba(32, 31, 30, 0.1);
  --accent: #147ff5;
  --accent-pressed: #0866cf;
  --danger: #d94343;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

html {
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(20, 127, 245, 0.3);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.app {
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 5%, rgba(255, 255, 255, 0.9), transparent 32%),
    var(--bg);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(40px, 48px) minmax(0, 1fr) minmax(40px, 48px);
  align-items: center;
  min-height: calc(72px + var(--safe-top));
  padding: var(--safe-top) 14px 0;
  background: rgba(244, 242, 240, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.app-header.scrolled {
  box-shadow: 0 4px 14px rgba(32, 31, 30, 0.07);
}

.brand {
  grid-column: 2;
  margin: 0;
  color: var(--text);
  font-family: "Billabong", sans-serif;
  font-size: 3.2rem;
  font-weight: normal;
  line-height: 1;
  text-align: center;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.12);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.icon-button:active {
  background: rgba(32, 31, 30, 0.08);
  transform: scale(0.94);
}

.header-more {
  grid-column: 3;
  grid-row: 1;
  font-size: 1.15rem;
  letter-spacing: 2px;
}

.app-main {
  min-height: calc(100dvh - 72px - var(--safe-top));
}

.view {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 20px clamp(14px, 4vw, 28px) calc(24px + var(--safe-bottom));
}

.ready-view {
  display: flex;
  min-height: calc(100dvh - 72px - var(--safe-top));
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding-bottom: calc(72px + var(--safe-bottom));
  text-align: center;
}

.ready-mark {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: #24a866;
  box-shadow: 0 12px 28px rgba(36, 168, 102, 0.24);
  color: #fff;
  font-size: 2.7rem;
  font-weight: 650;
}

.ready-copy {
  max-width: 360px;
}

.ready-copy h2 {
  margin: 0 0 9px;
  font-size: 1.6rem;
  line-height: 1.12;
}

.ready-map-link {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
}

.ready-map-link:active {
  opacity: 0.65;
}

.pickup-code {
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(32, 31, 30, 0.1);
  color: var(--text);
  cursor: pointer;
  font-size: clamp(2rem, 10vw, 3rem);
  font-weight: 750;
  letter-spacing: 0.18em;
}

.pickup-code:active {
  transform: scale(0.98);
}

.ready-hint {
  margin: -10px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.ready-actions {
  display: grid;
  grid-template-columns: minmax(0, 210px);
  justify-content: center;
  width: min(100%, 210px);
  row-gap: 10px;
}

.ready-action-button {
  width: min(100%, 210px);
  min-width: 0;
  height: 52px;
  min-height: 52px;
  padding-right: 24px;
  padding-left: 24px;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0;
}

.danger-text {
  color: var(--danger);
  text-align: center;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 650;
  letter-spacing: 0;
  transition: transform 130ms ease, background-color 130ms ease, opacity 130ms ease;
}

.primary-button {
  min-width: 210px;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(20, 127, 245, 0.24);
  color: #fff;
}

.primary-button:active {
  background: var(--accent-pressed);
  transform: scale(0.97);
}

.primary-button:disabled {
  box-shadow: none;
  cursor: default;
  opacity: 0.38;
}

.ready-action-button.danger-button {
  background: var(--danger);
  box-shadow: 0 8px 18px rgba(217, 67, 67, 0.24);
  color: #fff;
}

.ready-action-button.danger-button:active {
  background: #b83232;
}

.secondary-button {
  min-height: 44px;
  padding: 0 16px;
  gap: 7px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
}

.secondary-button:active {
  background: var(--surface-muted);
  transform: scale(0.97);
}

.secondary-button span {
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
}

.order-view {
  width: 100%;
  max-width: none;
  padding-top: 14px;
  padding-right: 0;
  padding-left: 0;
}

.order-heading,
.empty-order {
  margin-right: clamp(14px, 4vw, 28px);
  margin-left: clamp(14px, 4vw, 28px);
}

.order-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.order-heading h2 {
  margin: 2px 0 0;
  font-size: 1.65rem;
  line-height: 1.1;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  text-transform: uppercase;
}

.empty-order {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed rgba(32, 31, 30, 0.22);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-order strong {
  color: var(--text);
}

.empty-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 0;
  margin-bottom: 8px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--accent);
  cursor: pointer;
}

.empty-icon::before,
.empty-icon::after {
  position: absolute;
  content: "";
  border-radius: 2px;
  background: var(--accent);
}

.empty-icon::before {
  width: 20px;
  height: 2px;
}

.empty-icon::after {
  width: 2px;
  height: 20px;
}

.empty-icon:hover {
  box-shadow: inset 0 0 0 1px var(--line), 0 2px 8px rgba(32, 31, 30, 0.08);
}

.empty-icon:active {
  transform: scale(0.96);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  width: auto;
  margin-right: clamp(14px, 4vw, 28px);
  margin-left: clamp(14px, 4vw, 28px);
  gap: 6px;
}

.photo-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  aspect-ratio: 1;
  padding: 0;
  border-radius: 6px;
  background: #dedbd8;
  cursor: pointer;
  contain: layout paint;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.photo-card:active img {
  opacity: 0.78;
}

.photo-card:focus-visible {
  outline: 3px solid rgba(20, 127, 245, 0.42);
  outline-offset: 3px;
}

.photo-card-copies-control {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 20px;
  background: rgba(22, 22, 22, 0.66);
  backdrop-filter: blur(8px);
  color: #fff;
}

.photo-card-copies-control button {
  width: 27px;
  height: 27px;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.photo-card-copies-control button:active {
  background: rgba(255, 255, 255, 0.2);
}

.photo-card-copies {
  min-width: 22px;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.photo-card-copy-button {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 36px;
  height: 29px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 16px;
  background: rgba(22, 22, 22, 0.66);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  font-size: 0;
  display: grid;
  place-items: center;
}

.photo-card-copy-button::before,
.photo-card-copy-button::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 11px;
  border: 1.4px solid rgba(126, 126, 126, 0.9);
  background: #fff;
  border-radius: 3px;
}

.photo-card-copy-button::before {
  transform: translate(3px, 2px);
  z-index: 1;
}

.photo-card-copy-button::after {
  transform: translate(-2px, -2px);
  z-index: 2;
}

.photo-card-copy-button:active {
  background: rgba(255, 255, 255, 0.2);
}

.order-bottom-spacer {
  height: 84px;
}

.order-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: calc(76px + var(--safe-bottom));
  padding: 10px clamp(12px, 4vw, 24px) calc(10px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.order-footer > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
}

.order-footer span {
  color: var(--muted);
  font-size: 0.78rem;
}

.order-footer strong {
  overflow: hidden;
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkout-button {
  min-width: 0;
  flex: 0 1 auto;
  min-height: 50px;
  padding-right: 16px;
  padding-left: 16px;
}

.visually-hidden {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  opacity: 0;
}

.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: block;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
}

.busy-overlay p {
  margin: 0;
}

.busy-spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1000;
  width: 60px;
  height: 60px;
  border: 8px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: preorder-upload-spin 1s linear infinite;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: calc(94px + var(--safe-bottom));
  left: 18px;
  z-index: 120;
  max-width: 480px;
  margin: auto;
  padding: 13px 16px;
  border-radius: 12px;
  background: rgba(32, 31, 30, 0.9);
  color: #fff;
  font-size: 0.9rem;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  animation: toast-in 180ms ease-out;
}

.toast.error {
  background: rgba(173, 38, 38, 0.94);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(4px);
}

.bottom-sheet {
  position: absolute;
  right: 10px;
  bottom: calc(10px + var(--safe-bottom));
  left: 10px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
  animation: sheet-in 180ms ease-out;
}

.checkout-sheet {
  gap: 16px;
  padding: 12px 16px 16px;
}

.checkout-sheet-heading {
  padding: 4px 2px 0;
}

.checkout-sheet-heading h2 {
  margin: 4px 0 0;
  font-size: 1.45rem;
}

.checkout-email {
  display: grid;
  gap: 7px;
  text-align: left;
}

.checkout-email span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.checkout-email input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  outline: 0;
}

.checkout-email-note,
.payment-mode-note {
  margin: -10px 2px 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.payment-mode-note {
  color: var(--accent);
  font-weight: 700;
}

.checkout-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px;
}

.checkout-total span {
  color: var(--muted);
}

.checkout-total strong {
  font-size: 1.35rem;
}

.payment-button {
  width: 100%;
}

.sheet-action {
  min-height: 50px;
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--text);
  font-weight: 650;
}

.danger-action {
  color: var(--danger);
}

.editor {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  animation: editor-in 190ms ease-out;
}

.editor-header {
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: calc(62px + var(--safe-top));
  padding: var(--safe-top) 14px 0;
  background: rgba(244, 242, 240, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.editor-header strong {
  font-size: 0.95rem;
}

.text-button {
  min-height: 46px;
  padding: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.text-button:last-child {
  text-align: right;
}

.accent-text {
  color: var(--accent);
  font-weight: 700;
}

.editor-scroll {
  overflow: auto;
  min-height: 0;
  flex: 1;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.editor-stage-wrap {
  display: grid;
  min-height: min(64dvh, 640px);
  place-items: center;
  padding: 24px 18px;
  background: #2a2928;
}

.editor-stage {
  position: relative;
  overflow: hidden;
  --editor-stage-border: clamp(10px, 2.8vw, 18px);
  box-sizing: content-box;
  width: min(
    calc(100% - var(--editor-stage-border) - var(--editor-stage-border)),
    calc(520px - var(--editor-stage-border) - var(--editor-stage-border))
  );
  aspect-ratio: 1050 / 1418;
  border: var(--editor-stage-border) solid #fff;
  background: #fff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  touch-action: pan-y;
}

.editor-image-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  background: #fff;
  touch-action: none;
}

.editor-stage.layout-square .editor-image-frame {
  flex: 0 0 auto;
  aspect-ratio: 1;
}

.editor-stage.layout-square {
  aspect-ratio: auto;
}

.editor-stage.layout-rectangle .editor-image-frame {
  flex: 1 1 auto;
}

.editor-image-frame img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: auto;
  object-fit: fill;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center;
  will-change: transform;
}

.print-overlay {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  padding: 0;
  background: #fff;
  color: #1d1d1d;
  pointer-events: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

.editor-stage.layout-square .print-overlay {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 1050 / 368;
}

.editor-stage {
  display: flex;
  flex-direction: column;
}

.editor-stage.layout-rectangle .print-overlay {
  display: none;
}

.metadata-row {
  position: relative;
  width: 100%;
  /* Match the canonical Canvas row offset below the 1050px photo. */
  top: calc(40px * var(--print-scale, 1));
  display: flex;
  align-items: center;
  height: calc(70px * var(--print-scale, 1));
  font-family: "SF Pro Display", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: calc(50px * var(--print-scale, 1));
  font-weight: 700;
  line-height: 1;
  z-index: 2;
}

.metadata-row > #overlay-date {
  position: relative;
  flex: 0 0 auto;
  align-self: stretch;
  margin-left: calc(15px * var(--print-scale, 1));
  pointer-events: auto;
  cursor: text;
  min-width: 0;
  height: 100%;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: calc(70px * var(--print-scale, 1));
  white-space: nowrap;
  overflow: hidden;
  resize: none;
  transform: translateY(calc(-5px * var(--print-scale, 1)));
}

.overlay-geo-value {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  align-self: stretch;
  margin-left: calc(5px * var(--print-scale, 1));
  pointer-events: auto;
}

.print-overlay.has-date .overlay-geo-value {
  margin-left: calc(14px * var(--print-scale, 1));
}

.overlay-geo-icon {
  position: relative;
  flex: 0 0 auto;
  width: calc(28px * var(--print-scale, 1));
  height: calc(40px * var(--print-scale, 1));
  object-fit: contain;
  opacity: 1;
  pointer-events: auto;
  user-select: none;
  -webkit-user-drag: none;
  /* Keep the editor pin optically aligned with the lowered date/geo text. */
  transform: translateY(calc(-6px * var(--print-scale, 1)));
}

.metadata-row #overlay-geo {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  margin-left: calc(16px * var(--print-scale, 1));
  overflow: hidden;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: calc(70px * var(--print-scale, 1));
  white-space: nowrap;
  pointer-events: auto;
  cursor: text;
  resize: none;
  transform: translateY(calc(-5px * var(--print-scale, 1)));
}

.print-overlay input,
.print-overlay textarea {
  box-sizing: border-box;
  border: 0;
  border-radius: calc(6px * var(--print-scale, 1));
  outline: none;
  background: transparent;
  color: #1d1d1d;
  caret-color: currentColor;
  -webkit-text-fill-color: currentColor;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  transition: box-shadow 120ms ease;
}

.print-overlay input:focus,
.print-overlay textarea:focus {
  caret-color: #1d1d1d;
  box-shadow: inset 0 0 0 1px rgba(24, 127, 245, 0.36);
}

.print-overlay p:not(:empty),
.print-overlay #overlay-text {
  --overlay-text-top: calc(110px * var(--print-scale, 1));
  position: absolute;
  top: var(--overlay-text-top);
  right: calc(15px * var(--print-scale, 1));
  left: calc(15px * var(--print-scale, 1));
  display: block;
  height: calc(256px * var(--print-scale, 1));
  height: 4lh;
  /* Four fixed 64px lines from the 1050px print layout. */
  border: 0;
  overflow: hidden;
  margin: 0;
  color: #1d1d1d;
  -webkit-text-fill-color: currentColor;
  font-family: "SF Pro Display", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: calc(52px * var(--print-scale, 1));
  font-weight: 300;
  line-height: calc(64px * var(--print-scale, 1));
  resize: none;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  pointer-events: auto;
  cursor: text;
  z-index: 2;
}

.print-overlay.without-metadata-row #overlay-text {
  --overlay-text-top: calc(40px * var(--print-scale, 1));
  height: calc(320px * var(--print-scale, 1));
  height: 5lh;
}

.print-overlay #overlay-text:focus {
  box-shadow: inset 0 0 0 1px rgba(24, 127, 245, 0.36);
}

.editor,
.editor button,
.editor input,
.editor textarea,
.editor select {
  font-family: "SF Pro Display", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  letter-spacing: 0;
}

.editor-tools {
  display: grid;
  gap: 20px;
  width: min(100%, 620px);
  margin: 0 auto;
  padding: 22px 18px calc(34px + var(--safe-bottom));
}

.tool-group {
  display: grid;
  gap: 9px;
}

.tool-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.editor-tools-handle {
  width: 34px;
  height: 4px;
  margin: -8px auto -4px;
  border-radius: 4px;
  background: rgba(32, 31, 30, 0.18);
}

.editor-primary-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  align-items: stretch;
  gap: 10px;
}

.editor-layout-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 18px;
  background: var(--surface-muted);
}

.editor-layout-segmented button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 48px;
  padding: 6px 8px;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: clamp(0.78rem, 3.5vw, 0.875rem);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.editor-layout-segmented button.active {
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(32, 31, 30, 0.12);
  color: var(--accent);
}

.editor-rotate-button {
  display: grid;
  width: 56px;
  min-height: 56px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.editor-rotate-button:active {
  background: var(--surface-muted);
  transform: scale(0.96);
}

.editor-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 360px);
  margin: 0 auto;
}

.tool-button {
  display: flex;
  min-width: 0;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  cursor: pointer;
  font-weight: 650;
}

.editor-secondary-actions .tool-button {
  min-height: 48px;
  padding: 6px 12px;
  font-size: clamp(0.78rem, 3.5vw, 0.875rem);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.tool-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.tool-button:active {
  background: var(--surface-muted);
  transform: scale(0.98);
}

.tool-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1;
}

.danger-tool {
  color: var(--danger);
}

.reset-tool {
  color: var(--text);
}

.fields-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.field-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 44px;
  min-height: 58px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.field-row:last-child {
  border-bottom: 0;
}

.field-row > label:first-child {
  font-size: 0.88rem;
  font-weight: 650;
}

.field-row input[type="text"],
.field-row textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  outline: 0;
  background: var(--surface-muted);
  color: var(--text);
  resize: none;
}

#geo-field {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

.field-row textarea {
  overflow-x: hidden;
  overflow-y: hidden;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

#geo-field {
  min-height: 40px;
  padding-top: 7px;
  padding-bottom: 7px;
  font-family: "SF Pro Display", "Apple Color Emoji", "Segoe UI Emoji",
    "Noto Color Emoji", sans-serif;
  line-height: 1.5;
}

.field-row input[type="text"]:disabled,
.field-row textarea:disabled {
  opacity: 0.42;
}

.field-row-text {
  align-items: start;
  padding-top: 12px;
  padding-bottom: 12px;
}

.field-row-text > label:first-child,
.field-row-text .switch {
  margin-top: 9px;
}

.copies-control {
  display: inline-flex;
  width: min(100%, 150px);
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.copies-control button {
  width: 40px;
  align-self: stretch;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 1.25rem;
}

.copies-control button:active {
  background: rgba(32, 31, 30, 0.1);
}

.copies-control input {
  width: 48px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  text-align: center;
}

.copies-control input::-webkit-inner-spin-button,
.copies-control input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.switch {
  position: relative;
  display: block;
  width: 42px;
  height: 26px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  background: #c9c5c2;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.switch span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  content: "";
  transition: transform 140ms ease;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(16px);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes preorder-upload-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes editor-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 680px) {
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
  }

}

@media (max-width: 380px) {
  .brand {
    font-size: 2.8rem;
  }

  .order-footer {
    align-items: stretch;
  }

  .order-footer strong {
    max-width: 120px;
  }

  .checkout-button {
    padding-right: 12px;
    padding-left: 12px;
    font-size: 0.9rem;
  }

  .field-row {
    grid-template-columns: 56px minmax(0, 1fr) 40px;
    padding-right: 8px;
    padding-left: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
