:root {
  --paper: #f1efe5;
  --paper-deep: #e3e1d4;
  --card: #fffdf4;
  --card-soft: #f8f5e9;
  --accent: #d9f24b;
  --accent-dark: #526600;
  --accent-soft: #eff9bd;
  --green: #176b55;
  --lime: #d9f24b;
  --lime-soft: #f0f8c8;
  --olive: #526600;
  --olive-deep: #303b0a;
  --stage: #171a12;
  --stage-soft: #24291d;
}

::selection { color: var(--ink); background: var(--lime); }
:focus-visible { outline-color: var(--accent-dark); }
.site-footer :focus-visible,
.referral-card :focus-visible,
.share-prompt :focus-visible,
.stage-wrap :focus-visible { outline-color: var(--lime); }
body {
  background-image:
    linear-gradient(rgba(25, 21, 16, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 21, 16, .028) 1px, transparent 1px),
    radial-gradient(circle at 85% 8%, rgba(217, 242, 75, .17), transparent 27rem);
  background-size: 28px 28px, 28px 28px, auto;
}
.crop-mark {
  padding: 8px;
  gap: 5px;
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--accent);
}
.crop-mark i,
.crop-mark i:nth-child(1),
.crop-mark i:nth-child(4) {
  background: transparent;
  border: 2px solid var(--accent);
  border-radius: 0;
}
.crop-mark i:nth-child(1) { border-right: 0; border-bottom: 0; }
.crop-mark i:nth-child(2) { border-left: 0; border-bottom: 0; }
.crop-mark i:nth-child(3) { border-right: 0; border-top: 0; }
.crop-mark i:nth-child(4) { border-left: 0; border-top: 0; }
.crop-mark.small { padding: 6px; gap: 4px; box-shadow: none; }
.crop-mark.small i,
.crop-mark.small i:nth-child(1),
.crop-mark.small i:nth-child(4) { border-width: 1.5px; }

.hero {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: clamp(36px, 7vw, 92px);
  padding-block: clamp(52px, 7vw, 88px) 68px;
}
.hero h1 { font-size: clamp(52px, 7.6vw, 92px); }
.hero h1 em { color: var(--olive); }
.hero h1 em::after { height: .3em; opacity: .32; }
.hero .eyebrow span { color: var(--ink); background: var(--lime); }
.hero-lead { max-width: 660px; }
.hero-facts span { background: rgba(255, 253, 244, .76); }
.hero-frame {
  width: min(100%, 390px);
  justify-self: end;
  padding: 10px;
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 24px;
  box-shadow: 11px 11px 0 var(--accent);
  transform: rotate(1.4deg);
}
.hero-photo {
  position: relative;
  aspect-ratio: 4 / 4.7;
  overflow: hidden;
  background: linear-gradient(156deg, #b6d5cf 0 30%, #e7e0b9 53%, #666f3c 54% 100%);
  border-radius: 15px;
}
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, transparent, rgba(10, 12, 7, .25));
  pointer-events: none;
}
.hero-sun {
  position: absolute;
  width: 82px;
  height: 82px;
  left: 53%;
  top: 17%;
  background: var(--lime);
  border: 2px solid rgba(25, 21, 16, .55);
  border-radius: 50%;
  box-shadow: 0 0 0 14px rgba(217, 242, 75, .11);
}
.hero-ridge {
  position: absolute;
  left: -14%;
  width: 128%;
  display: block;
  transform-origin: center bottom;
}
.ridge-back {
  bottom: 21%;
  height: 38%;
  background: #788a5a;
  clip-path: polygon(0 78%, 16% 58%, 27% 67%, 43% 31%, 58% 65%, 73% 42%, 100% 81%, 100% 100%, 0 100%);
}
.ridge-front {
  bottom: -9%;
  height: 52%;
  background: #26301c;
  clip-path: polygon(0 51%, 14% 31%, 29% 53%, 49% 17%, 70% 54%, 83% 40%, 100% 57%, 100% 100%, 0 100%);
}
.hero-crop-frame {
  position: absolute;
  z-index: 2;
  inset: 18% 14% 16% 17%;
  border: 2px solid rgba(255, 255, 255, .92);
  box-shadow: 0 0 0 1px rgba(20, 24, 12, .55), 0 0 0 999px rgba(13, 16, 9, .3);
}
.hero-crop-frame i {
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--lime);
  border: 1.5px solid var(--ink);
}
.hero-crop-frame i:nth-child(1) { left: -2px; top: -2px; }
.hero-crop-frame i:nth-child(2) { right: -2px; top: -2px; }
.hero-crop-frame i:nth-child(3) { left: -2px; bottom: -2px; }
.hero-crop-frame i:nth-child(4) { right: -2px; bottom: -2px; }
.hero-photo-code {
  position: absolute;
  z-index: 3;
  left: 23%;
  bottom: 7%;
  color: #f8f6df;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .19em;
}
.hero-frame-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 7px 2px;
  color: #d9dcc9;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .1em;
}
.hero-frame-foot strong { color: var(--lime); font-size: 9px; }

.crop-studio {
  grid-template-columns: minmax(0, 1.13fr) minmax(340px, .87fr);
  gap: 28px;
  scroll-margin-top: 24px;
}
.editor-card,
.output-card { padding: clamp(20px, 3vw, 30px); border-radius: 20px; }
.editor-card { background: rgba(255, 253, 244, .96); }
.output-card {
  position: sticky;
  top: 22px;
  background: rgba(255, 253, 244, .98);
  box-shadow: 6px 6px 0 var(--lime);
}
.editor-card .card-heading h2,
.output-card .card-heading h2 { letter-spacing: -.035em; }
.editor-card .status-pill { background: var(--lime-soft); border-color: #b3c542; }
.editor-card .status-pill.is-ok { color: var(--ink); background: var(--lime); border-color: var(--ink); }
.premium-state { background: var(--paper); }
body.is-premium .premium-state { color: var(--card); background: var(--green); border-color: var(--green); }

.upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 9px;
  margin-top: 22px;
}
.upload-button {
  display: flex;
  flex: 1 1 260px;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 58px;
  padding: 9px 15px;
  background: var(--lime-soft);
  border: 1.5px dashed #96a836;
  border-radius: 11px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.upload-button:hover { background: #f5f9d8; border-color: var(--olive); transform: translateY(-1px); }
.upload-plus {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: var(--ink);
  background: var(--lime);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 20px;
  line-height: 1;
}
.upload-button > span:last-child { display: grid; min-width: 0; line-height: 1.35; }
.upload-button strong { font-size: 13px; }
.upload-button small { margin-top: 3px; color: #6e744d; font-size: 10.5px; }
.upload-row > .button { flex: 0 1 auto; background: var(--card); }
.clear-button { color: var(--muted); }
.clear-button:disabled { color: #a39788; cursor: not-allowed; }

.stage-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 18px;
  padding: 13px;
  background:
    linear-gradient(45deg, rgba(217, 242, 75, .055) 25%, transparent 25%, transparent 75%, rgba(217, 242, 75, .055) 75%),
    var(--stage-soft);
  background-position: 0 0, 11px 11px;
  background-size: 22px 22px;
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .18);
  touch-action: pan-y;
}
.stage-wrap.is-dragover { outline: 3px dashed var(--lime); outline-offset: -8px; }
.stage-wrap.is-dragover .crop-stage { border-color: var(--lime); }
.crop-stage {
  position: relative;
  width: 100%;
  min-height: 350px;
  margin: 0 auto;
  overflow: hidden;
  background:
    linear-gradient(rgba(217, 242, 75, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 242, 75, .06) 1px, transparent 1px),
    var(--stage);
  background-size: 24px 24px;
  border: 2px solid #0b0d08;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
  touch-action: none;
  user-select: none;
}
.crop-stage.has-image { min-height: 0; background: #0e100b; }
.crop-stage:not(.has-image) { touch-action: pan-y; }
#cropCanvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

.stage-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 30px 20px;
  color: #dce3c9;
  text-align: center;
}
.stage-empty > strong { font-family: var(--font-display); font-size: 24px; letter-spacing: -.02em; }
.stage-empty > span:not(.empty-frame) { color: #9fa88b; font-size: 11.5px; }
.stage-empty .button { margin-top: 11px; color: var(--ink); background: var(--lime); }
.empty-frame {
  position: relative;
  width: 84px;
  height: 66px;
  margin-bottom: 9px;
  border: 1.5px dashed rgba(217, 242, 75, .65);
  border-radius: 5px;
  transform: rotate(-3deg);
}
.empty-frame::before,
.empty-frame::after {
  content: "";
  position: absolute;
  width: 38px;
  height: 29px;
  border: 1.5px solid var(--lime);
  border-radius: 5px;
}
.empty-frame::before { left: -11px; top: -10px; }
.empty-frame::after { right: -11px; bottom: -10px; }
.empty-frame i {
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--lime);
  border-radius: 50%;
}
.empty-frame i:first-child { left: 13px; top: 17px; }
.empty-frame i:last-child { right: 19px; bottom: 16px; }

.crop-box {
  position: absolute;
  z-index: 3;
  left: 8%;
  top: 8%;
  width: 84%;
  height: 84%;
  border: 2px solid var(--lime);
  outline: 1px solid rgba(12, 15, 8, .72);
  box-shadow: 0 0 0 9999px rgba(7, 10, 5, .63);
  cursor: move;
  touch-action: none;
}
.crop-box:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.crop-box.is-dragging { border-color: #fff; }
.crop-box.is-circular::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(217, 242, 75, .9);
  border-radius: 50%;
  pointer-events: none;
}
.crop-third {
  position: absolute;
  display: block;
  background: rgba(255, 255, 255, .24);
  pointer-events: none;
}
.thirds-v1, .thirds-v2 { top: 0; bottom: 0; width: 1px; }
.thirds-v1 { left: 33.333%; }
.thirds-v2 { left: 66.666%; }
.thirds-h1, .thirds-h2 { left: 0; right: 0; height: 1px; }
.thirds-h1 { top: 33.333%; }
.thirds-h2 { top: 66.666%; }
.crop-handle {
  position: absolute;
  z-index: 2;
  width: 18px;
  height: 18px;
  background: var(--lime);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .45);
}
.crop-handle::after { content: ""; position: absolute; inset: -11px; }
.handle-nw { left: -9px; top: -9px; cursor: nwse-resize; }
.handle-n { left: calc(50% - 9px); top: -9px; cursor: ns-resize; }
.handle-ne { right: -9px; top: -9px; cursor: nesw-resize; }
.handle-e { right: -9px; top: calc(50% - 9px); cursor: ew-resize; }
.handle-se { right: -9px; bottom: -9px; cursor: nwse-resize; }
.handle-s { left: calc(50% - 9px); bottom: -9px; cursor: ns-resize; }
.handle-sw { left: -9px; bottom: -9px; cursor: nesw-resize; }
.handle-w { left: -9px; top: calc(50% - 9px); cursor: ew-resize; }
.crop-size {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  max-width: 100%;
  padding: 3px 6px;
  color: var(--ink);
  background: var(--lime);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
}
.crop-stage.is-compact .crop-size { display: none; }

.stage-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  min-height: 22px;
  margin-top: 9px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.55;
}
.stage-meta span:last-child { color: var(--olive); }
.form-error {
  padding: 9px 11px;
  background: #ffe7dc;
  border-left: 3px solid var(--warning);
  border-radius: 0 7px 7px 0;
}

.ratio-block {
  margin-top: 22px;
  padding-top: 19px;
  border-top: 1px dashed var(--soft-line);
}
.ratio-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 11px;
}
.ratio-heading > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; }
.ratio-heading strong { font-size: 13px; }
.ratio-heading span { color: var(--muted); font-size: 10.5px; }
.ratio-heading .text-button { margin: -7px 0 -7px auto; white-space: nowrap; }
.ratio-heading .text-button:disabled { color: #a39788; cursor: not-allowed; }
.ratio-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.ratio-chip {
  min-height: 44px;
  padding: 8px 13px;
  color: var(--ink);
  background: var(--card-soft);
  border: 1.5px solid #9d917f;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: transform .14s, box-shadow .14s, background .14s;
}
.ratio-chip small { color: var(--muted); font-family: var(--font-mono); font-size: 8px; }
.ratio-chip:hover { transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--ink); }
.ratio-chip.is-active {
  color: var(--ink);
  background: var(--lime);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.ratio-chip.is-active small { color: #4c570c; }

.transform-block {
  margin-top: 19px;
  padding: 15px;
  background: rgba(239, 249, 189, .44);
  border: 1px dashed #a7b64e;
  border-radius: 11px;
}
.transform-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}
.transform-heading > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.transform-heading .section-index { flex: 0 0 100%; margin: 0; }
.transform-heading strong { font-size: 12.5px; }
.transform-heading .premium-chip { min-height: 20px; padding: 1px 6px; font-size: 8px; }
.transform-heading .mini-note { margin: 1px 0 0; text-align: right; }
.transform-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.transform-actions .tool-button { background: var(--card); font-family: var(--font-sans); }
.transform-actions .tool-button.is-on { color: var(--ink); background: var(--lime); }

.number-field {
  position: relative;
  display: block;
}
.number-field input { padding-right: 39px; font-family: var(--font-mono); font-size: 13px; }
.number-field em {
  position: absolute;
  right: 12px;
  top: 50%;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: normal;
  transform: translateY(-50%);
  pointer-events: none;
}
.output-size-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 21px;
}
.output-size-grid .field > span:first-child { min-height: 20px; }
.output-size-grid .lock-dot { font-size: 8px; }

.circle-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  background: var(--card-soft);
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  cursor: pointer;
}
.circle-row > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  margin-top: 1px;
  background: #d3c8b7;
  border: 1.5px solid var(--ink);
  border-radius: 100px;
  transition: background .18s;
}
.switch-track i {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 15px;
  height: 15px;
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: 50%;
  transition: transform .18s;
}
.circle-row > input:checked + .switch-track { background: var(--lime); }
.circle-row > input:checked + .switch-track i { transform: translateX(17px); }
.circle-row > input:focus-visible + .switch-track { outline: 3px solid var(--accent-dark); outline-offset: 2px; }
.circle-row > input:disabled + .switch-track { opacity: .58; }
.circle-row > input:disabled ~ .circle-copy { opacity: .66; }
.circle-copy { display: grid; min-width: 0; line-height: 1.4; }
.circle-copy strong { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.circle-copy small { margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.lock-note { margin: 14px 0 0; padding: 9px 11px; font-size: 10.5px; }

.preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 248px;
  margin-top: 17px;
  padding: 15px;
  overflow: hidden;
  background-color: #e8e5d8;
  background-image:
    linear-gradient(45deg, #d6d2c4 25%, transparent 25%),
    linear-gradient(-45deg, #d6d2c4 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d6d2c4 75%),
    linear-gradient(-45deg, transparent 75%, #d6d2c4 75%);
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  background-size: 18px 18px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .35);
}
#previewCanvas {
  display: block;
  max-width: 100%;
  max-height: 330px;
  border-radius: 2px;
  box-shadow: 0 3px 14px rgba(23, 26, 18, .2);
}
.preview-stage.is-circle #previewCanvas { border-radius: 50%; }
.preview-empty {
  display: grid;
  justify-items: center;
  gap: 2px;
  color: #766f60;
  text-align: center;
}
.preview-empty span {
  margin-bottom: 5px;
  padding: 2px 7px;
  color: var(--ink);
  background: var(--lime);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: .12em;
}
.preview-empty strong { color: var(--ink); font-family: var(--font-display); font-size: 19px; }
.preview-empty small { font-size: 10px; }
.preview-badge {
  position: absolute;
  left: 9px;
  top: 9px;
  padding: 2px 6px;
  color: var(--ink);
  background: var(--lime);
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: .08em;
}
.preview-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 5px 14px;
  min-height: 20px;
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.55;
}
.preview-meta span:last-child { color: var(--olive); font-weight: 700; }

.export-actions {
  display: flex;
  gap: 9px;
  margin-top: 17px;
}
.export-actions .button { flex: 1 1 0; padding-inline: 12px; }
.export-actions .button-primary { color: var(--ink); background: var(--lime); }
.export-actions .button-primary span { font-size: 16px; }
.export-actions .button-quiet { background: var(--card-soft); }
#result {
  min-height: 48px;
  margin-top: 14px;
  padding: 11px 13px;
  background: #f4f1e4;
  border-style: solid;
  border-color: #c7c2b2;
  font-family: var(--font-mono);
  font-size: 13px;
}
#result:not(:empty) {
  color: var(--ink);
  background: var(--lime-soft);
  border-color: #a5b641;
  box-shadow: inset 3px 0 0 var(--lime);
}
#result.is-stale { opacity: .72; box-shadow: none; }
.result-meta { min-height: 18px; font-size: 10px; }
.privacy-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 15px 0 0;
  padding-top: 12px;
  color: var(--muted);
  border-top: 1px dashed var(--soft-line);
  font-size: 10px;
}
.privacy-line span { color: var(--green); font-size: 7px; }

.quick-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}
.quick-facts > div {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 1px 6px;
  padding: 11px 10px;
  background: var(--card);
  border: 1px solid var(--soft-line);
  border-radius: 9px;
}
.quick-facts span {
  grid-row: 1 / 3;
  align-self: center;
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 8px;
}
.quick-facts strong { font-size: 10.5px; line-height: 1.25; }
.quick-facts small { color: var(--muted); font-size: 8.5px; line-height: 1.3; }

.guide-shell, .faq-shell { margin-top: 60px; }
.how-to-grid li > span { color: var(--ink); background: var(--lime); }
.faq-list summary::after { color: var(--accent-dark); }
.premium-map { box-shadow: 6px 6px 0 var(--lime); }
.premium-map .section-index { color: var(--accent-dark); }
.premium-map li span { color: var(--accent-dark); }
.unlock-section { margin-block: 54px; }
.referral-card { box-shadow: 7px 7px 0 var(--lime); }
.footer-brand strong { font-family: var(--font-display); font-size: 18px; letter-spacing: .04em; }

@media (max-width: 980px) {
  .crop-studio { grid-template-columns: 1fr; }
  .output-card { position: static; }
  .tool-side { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(250px, .85fr); gap: 20px; align-items: start; }
  .output-card { grid-row: 1 / 3; }
  .quick-facts { grid-template-columns: 1fr; margin-top: 0; }
}

@media (max-width: 900px) {
  .hero-frame { width: min(100%, 330px); }
}

@media (max-width: 760px) {
  .hero { gap: 34px; }
  .hero-frame { justify-self: start; width: min(100%, 310px); transform: rotate(.8deg); }
  .hero-photo { aspect-ratio: 4 / 4.15; }
  .tool-side { display: block; }
  .quick-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
  .quick-facts > div { padding: 9px 8px; }
}

@media (max-width: 700px) {
  .hero { padding-bottom: 48px; }
  .hero h1 { font-size: clamp(46px, 15vw, 68px); }
  .editor-card, .output-card { padding: 18px; }
  .stage-wrap { padding: 9px; }
  .crop-stage { min-height: 290px; }
  .upload-row { align-items: stretch; }
  .upload-button { flex-basis: 100%; }
  .upload-row > .button,
  .upload-row > .text-button { flex: 1 1 0; justify-content: center; }
  .clear-button { min-height: 44px; }
  .transform-heading { flex-direction: column; gap: 5px; }
  .transform-heading .mini-note { text-align: left; }
  .transform-actions .tool-button { flex: 1 1 calc(50% - 7px); }
  .ratio-heading { flex-direction: column; gap: 6px; }
  .ratio-heading .text-button { margin: -8px 0 0; }
  .preview-stage { min-height: 230px; }
  .quick-facts { grid-template-columns: 1fr; }
  .quick-facts > div { grid-template-columns: 28px 1fr auto; grid-template-rows: auto; align-items: center; }
  .quick-facts span { grid-row: auto; }
  .quick-facts small { text-align: right; }
}

@media (max-width: 430px) {
  .hero-photo { aspect-ratio: 4 / 3; }
  .hero-frame { width: min(100%, 100%); box-shadow: 7px 7px 0 var(--accent); }
  .stage-meta { font-size: 8.5px; }
  .ratio-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ratio-chip { padding-inline: 7px; white-space: nowrap; }
  .ratio-chip[data-ratio="photo"] { grid-column: span 2; }
  .output-size-grid { gap: 9px; }
  .export-actions { flex-direction: column; }
  .export-actions .button { width: 100%; }
  .preview-stage { min-height: 215px; }
}

@media (max-width: 700px), (pointer: coarse) {
  .crop-handle { width: 24px; height: 24px; border-width: 2px; border-radius: 5px; }
  .handle-nw { left: -12px; top: -12px; }
  .handle-n { left: calc(50% - 12px); top: -12px; }
  .handle-ne { right: -12px; top: -12px; }
  .handle-e { right: -12px; top: calc(50% - 12px); }
  .handle-se { right: -12px; bottom: -12px; }
  .handle-s { left: calc(50% - 12px); bottom: -12px; }
  .handle-sw { left: -12px; bottom: -12px; }
  .handle-w { left: -12px; top: calc(50% - 12px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-frame { transform: none; }
}
