:root {
  --pink: #ff2b9b;
  --pink-hot: #ff007f;
  --pink-pale: #ffd4ec;
  --purple: #a327d9;
  --yellow: #fff33b;
  --black: #171016;
  --ink: #2b1725;
  --muted: #775a70;
  --white: #fffdfd;
  --line: #2b1725;
  --panel: #fff8fc;
  --danger: #ea205f;
  --shadow: 0 10px 0 rgba(43, 23, 37, 0.95), 0 24px 55px rgba(91, 16, 67, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background-color: #ff9bca;
  background-image:
    radial-gradient(circle, rgba(59, 34, 50, 0.4) 0 3px, transparent 3.5px),
    linear-gradient(135deg, #ff91c5, #ffb6dc 48%, #f272b0);
  background-position: 0 0, 0 0;
  background-size: 34px 34px, 100% 100%;
  font-family: "Arial Rounded MT Bold", "Hiragino Maru Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 49%, rgba(255, 255, 255, 0.17) 50%, transparent 51%) 0 0 / 34px 34px,
    linear-gradient(transparent 49%, rgba(255, 255, 255, 0.14) 50%, transparent 51%) 0 0 / 34px 34px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-sparkles {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.page-sparkles span {
  position: absolute;
  color: #fff;
  font-size: clamp(22px, 3vw, 46px);
  line-height: 1;
  filter: drop-shadow(2px 3px 0 var(--pink-hot));
  animation: twinkle 2.8s ease-in-out infinite alternate;
}

.page-sparkles span:nth-child(1) { top: 18%; left: 2%; }
.page-sparkles span:nth-child(2) { top: 42%; right: 2%; animation-delay: -0.8s; }
.page-sparkles span:nth-child(3) { top: 72%; left: 3%; animation-delay: -1.5s; }
.page-sparkles span:nth-child(4) { top: 9%; right: 5%; animation-delay: -2s; }
.page-sparkles span:nth-child(5) { bottom: 3%; right: 7%; animation-delay: -0.3s; }

@keyframes twinkle {
  from { opacity: 0.45; transform: scale(0.8) rotate(-8deg); }
  to { opacity: 1; transform: scale(1.15) rotate(8deg); }
}

.app-header {
  position: relative;
  z-index: 1;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 22px;
  min-height: 205px;
  padding: 12px 26px 14px;
  border: 3px solid #fff;
  border-radius: 24px 8px 24px 8px;
  background:
    linear-gradient(120deg, transparent 0 46%, rgba(255,255,255,.12) 47% 49%, transparent 50% 100%),
    linear-gradient(135deg, #2c1727, #090609 55%, #42122f);
  box-shadow: 0 7px 0 var(--pink-hot), 0 11px 0 var(--black), 0 20px 45px rgba(67, 8, 48, 0.38);
}

.app-header::after {
  position: absolute;
  right: 20%;
  bottom: -15px;
  content: "♥ ♥ ♥";
  color: var(--yellow);
  font-size: 18px;
  letter-spacing: 5px;
  text-shadow: 2px 2px 0 var(--pink-hot), -1px -1px 0 #111;
  transform: rotate(-4deg);
}

.brand {
  position: relative;
  z-index: 2;
  flex: 1 1 54%;
  min-width: 0;
}

.title-deco-zone {
  position: relative;
  z-index: 1;
  flex: 0 1 460px;
  align-self: stretch;
  min-width: 300px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.title-deco-zone::before {
  position: absolute;
  inset: 12% 2% 8%;
  z-index: -1;
  content: "";
  border: 2px dashed rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 0, 127, 0.34), transparent 70%);
  transform: rotate(-4deg);
}

.title-stamp-showcase {
  position: relative;
  width: min(100%, 430px);
  height: 190px;
}

.hero-stamp {
  position: absolute;
  display: block;
  width: 190px;
  height: 190px;
  object-fit: contain;
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, .62)) drop-shadow(0 0 7px rgba(255, 255, 255, .8));
}

.hero-stamp-wanted {
  top: -4px;
  left: 18px;
  z-index: 1;
  transform: rotate(-4deg);
}

.hero-stamp-offer {
  right: 16px;
  bottom: -3px;
  z-index: 2;
  transform: rotate(4deg);
}

.title-kira {
  position: absolute;
  z-index: 2;
  color: var(--yellow);
  font-size: 29px;
  line-height: 1;
  text-shadow: 2px 2px 0 var(--pink-hot), -1px -1px 0 #fff;
  animation: twinkle 1.8s ease-in-out infinite alternate;
}

.kira-one {
  top: 10px;
  left: 4px;
}

.kira-two {
  right: 2px;
  bottom: 12px;
  animation-delay: -0.8s;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--yellow);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 var(--pink-hot);
}

.eyebrow span {
  color: var(--pink);
}

h1,
h2 {
  margin: 0;
}

h1 {
  width: clamp(300px, 43vw, 540px);
  line-height: 0;
  filter: drop-shadow(4px 5px 0 rgba(0, 0, 0, 0.92));
  transform: rotate(-2deg);
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
}

.brand-tagline {
  width: fit-content;
  margin: 4px 0 0 12px;
  padding: 3px 8px;
  color: #fff;
  background: var(--pink-hot);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: 3px 3px 0 #000;
  transform: none;
}

h2 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.ghost-link,
button,
.file-button {
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid var(--line);
  border-radius: 12px 5px 12px 5px;
  color: var(--ink);
  background: #fff;
  box-shadow: 3px 3px 0 var(--line);
  font-weight: 900;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.ghost-link:hover,
button:hover:not(:disabled),
.file-button:hover {
  transform: translate(-1px, -2px);
  box-shadow: 5px 6px 0 var(--line);
  filter: saturate(1.12);
}

.ghost-link:active,
button:active:not(:disabled),
.file-button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line);
}

.compact {
  min-height: 40px;
  padding: 0 13px;
  font-size: 13px;
}

.primary {
  border-color: #170d15;
  color: #fff;
  background: linear-gradient(180deg, #ff6fba 0%, var(--pink-hot) 58%, #c60065 100%);
  text-shadow: 1px 1px 0 #73103f;
}

.save-button {
  position: relative;
  flex: 0 0 auto;
  min-height: 40px;
  min-width: 96px;
  padding: 0 18px;
  border: 2px solid var(--black);
  border-radius: 12px 5px 12px 5px;
  box-shadow: 0 0 0 2px rgba(255, 243, 59, 0.75), 4px 4px 0 var(--black);
  font-size: 13px;
}

.save-button:hover:not(:disabled) {
  box-shadow: 5px 6px 0 var(--black);
}

.save-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
}

.save-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.save-label {
  line-height: 1;
}

.secondary {
  background: linear-gradient(180deg, #fff, #ffd8ed);
}

.danger {
  border-color: var(--line);
  color: #fff;
  background: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.25);
  opacity: 0.5;
}

.app-shell {
  position: relative;
  z-index: 40;
  display: block;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 52px;
}

.workspace {
  position: relative;
  min-width: 0;
}

.canvas-wrap {
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  max-height: none;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: 18px 6px 18px 6px;
  background:
    linear-gradient(45deg, #ffe8f4 25%, transparent 25%),
    linear-gradient(-45deg, #ffe8f4 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ffe8f4 75%),
    linear-gradient(-45deg, transparent 75%, #ffe8f4 75%),
    #fff;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
  box-shadow: 0 0 0 4px var(--black), var(--shadow);
}

.canvas-wrap:not(.is-empty) {
  width: min(100%, calc((100vh - 174px) * var(--canvas-ratio, 1)));
  margin-right: auto;
  margin-left: auto;
}

.canvas-wrap::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  border: 5px solid var(--pink-hot);
  border-radius: 13px 2px 13px 2px;
  pointer-events: none;
}

.canvas-wrap.is-empty {
  cursor: pointer;
}

#editorCanvas,
#cropCanvas {
  display: block;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.empty-state {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  padding: 30px;
  text-align: center;
  color: var(--muted);
  pointer-events: none;
}

.empty-state::before {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: min(420px, 76vw);
  aspect-ratio: 1.55 / 1;
  content: "";
  border: 3px solid var(--black);
  border-radius: 28px 8px 28px 8px;
  background:
    radial-gradient(circle at 90% 12%, rgba(255,255,255,.9) 0 2px, transparent 3px),
    radial-gradient(circle at 10% 85%, rgba(255,255,255,.9) 0 2px, transparent 3px),
    linear-gradient(145deg, rgba(255,255,255,.94), rgba(255,210,234,.92));
  background-size: 28px 28px, 32px 32px, 100% 100%;
  box-shadow: 7px 8px 0 var(--pink-hot), 11px 12px 0 var(--black);
  transform: translate(-50%, -50%) rotate(-1deg);
}

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

.upload-icon {
  display: grid;
  width: 60px;
  height: 56px;
  place-items: center;
  border: 3px solid var(--black);
  border-radius: 50%;
  color: #fff;
  background: var(--pink-hot);
  box-shadow: 4px 4px 0 var(--black);
  font-size: 29px;
  transform: rotate(-7deg);
}

.empty-state strong {
  color: var(--ink);
  font-size: clamp(19px, 3vw, 27px);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.empty-state span {
  color: var(--pink-hot);
  font-size: 14px;
  font-weight: 900;
}

.empty-state small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.canvas-actions {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 9px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.file-button {
  color: #fff;
  background: linear-gradient(180deg, #ff72bc, var(--pink-hot));
  text-shadow: 1px 1px 0 #77103f;
}

.file-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.stamp-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: block;
  pointer-events: none;
}

.stamp-picker-overlay[hidden] {
  display: none;
}

.stamp-picker-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  pointer-events: none;
  opacity: 0;
  background: rgba(23, 16, 22, 0.68);
  box-shadow: none;
  backdrop-filter: blur(4px);
  transition: opacity 0.25s ease;
}

.stamp-picker-backdrop:hover,
.stamp-picker-backdrop:active {
  transform: none;
  box-shadow: none;
}

.stamp-dock {
  position: absolute;
  right: 50%;
  bottom: 0;
  z-index: 1;
  display: grid;
  width: min(390px, calc(100% - 24px));
  max-height: min(76dvh, 720px);
  padding: 0;
  border: 3px solid var(--black);
  border-radius: 22px 22px 0 0;
  background: #fff4fa;
  box-shadow: 5px 6px 0 var(--pink-hot), 8px 9px 0 var(--black);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  transform: translate(50%, calc(100% - 58px));
  transition: transform 0.28s cubic-bezier(.2,.8,.2,1);
}

.stamp-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 55px;
  padding: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

.stamp-drawer-handle {
  position: relative;
  display: grid;
  grid-template-rows: 6px minmax(0, 1fr);
  justify-items: center;
  align-items: center;
  gap: 3px;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 55px;
  padding: 6px 44px 5px;
  border: 0;
  border-radius: 19px 19px 0 0;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255,255,255,.35), transparent 42%),
    linear-gradient(90deg, #ff2b9b, #ff007f 58%, #a327d9);
  box-shadow: none;
  text-shadow: 1px 1px 0 rgba(71, 7, 50, .7);
  touch-action: none;
}

.stamp-drawer-handle:hover,
.stamp-drawer-handle:active {
  transform: none;
  box-shadow: none;
}

.stamp-drawer-grip {
  width: 46px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .28);
}

.stamp-drawer-label {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.stamp-drawer-label small {
  color: var(--yellow);
  font: 900 8px/1 Arial, sans-serif;
  letter-spacing: .12em;
}

.stamp-drawer-label strong {
  font-size: 13px;
  letter-spacing: .04em;
}

.stamp-drawer-cue {
  position: absolute;
  right: 18px;
  bottom: 10px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  transition: transform 0.25s ease;
}

.stamp-drawer-cue svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(1px 1px 0 rgba(71, 7, 50, .45));
}

.stamp-picker-content {
  display: grid;
  gap: 8px;
  min-height: 0;
  margin: 8px 8px 10px;
  padding: 4px;
  border-radius: 14px;
  background:
    linear-gradient(45deg, rgba(255,216,236,.55) 25%, transparent 25%) 0 0 / 20px 20px,
    linear-gradient(-45deg, rgba(255,216,236,.55) 25%, transparent 25%) 0 10px / 20px 20px,
    #fff;
}

.stamp-picker-overlay.is-open {
  pointer-events: auto;
}

.stamp-picker-overlay.is-open .stamp-picker-backdrop {
  pointer-events: auto;
  opacity: 1;
}

.stamp-picker-overlay.is-open .stamp-dock {
  transform: translate(50%, 0);
}

.stamp-picker-overlay.is-open .stamp-drawer-cue {
  transform: rotate(180deg);
}

.stamp-picker-overlay.is-open .stamp-dock {
  width: min(760px, calc(100% - 24px));
}

body.stamp-picker-open {
  overflow: hidden;
}

.stamp-color-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: visible;
  padding: 5px 6px 7px;
  scrollbar-width: none;
}

.stamp-color-bar::-webkit-scrollbar {
  display: none;
}

.stamp-color-label {
  flex: 0 0 auto;
  margin-right: 2px;
  color: var(--pink-hot);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.stamp-color-option {
  position: relative;
  flex: 0 0 auto;
  width: auto;
  min-height: 36px;
  padding: 0 14px 0 32px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 0 0 2px var(--black), 2px 2px 0 var(--black);
  font: 900 10px/1 Arial, sans-serif;
  letter-spacing: 0.06em;
}

.stamp-color-option::before {
  position: absolute;
  top: 50%;
  left: 8px;
  width: 18px;
  height: 18px;
  content: "";
  border: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  background: var(--chip-color);
  transform: translateY(-50%);
}

.stamp-color-option:hover:not(:disabled) {
  box-shadow: 0 0 0 2px var(--black), 3px 4px 0 var(--black);
}

.stamp-color-option.active {
  box-shadow: 0 0 0 3px var(--yellow), 0 0 0 5px var(--pink-hot), 3px 4px 0 var(--black);
  transform: translateY(-1px);
}

.pink-color {
  --chip-color: #ff5eae;
}

.blue-color {
  --chip-color: #55c8ff;
}

.stamp-list {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  max-height: min(52dvh, 520px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--pink-hot) transparent;
  padding: 4px 5px 8px;
}

.stamp-browser {
  display: block;
}

.stamp-nav {
  display: none;
}

.stamp-nav:disabled {
  opacity: 0.28;
}

.stamp-list::-webkit-scrollbar {
  display: none;
}

.stamp-option {
  width: 100%;
  height: 96px;
  padding: 7px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  scroll-snap-align: start;
}

.stamp-option:nth-child(even) {
  transform: none;
}

.stamp-option img {
  width: 100%;
  height: 80px;
  object-fit: contain;
}

.stamp-option span {
  display: none;
}

.stamp-option.active {
  border-color: var(--pink-hot);
  background: #fff4fa;
  box-shadow:
    inset 0 0 0 3px #fff,
    inset 0 0 0 6px var(--yellow),
    3px 3px 0 var(--black);
}

.stamp-option.just-added img {
  animation: stamp-pop 0.32s ease-out;
}

@keyframes stamp-pop {
  0% { transform: scale(0.82); }
  60% { transform: scale(1.09); }
  100% { transform: scale(1); }
}

.range-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px;
  border: 2px solid rgba(43, 23, 37, 0.18);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 900;
}

.range-row input,
.range-row select {
  width: 100%;
}

input[type="range"] {
  accent-color: var(--pink-hot);
}

select {
  height: 40px;
  border: 2px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
}

.crop-dialog {
  width: min(940px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  border-radius: 18px 6px 18px 6px;
  background: transparent;
}

.crop-dialog::backdrop {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 43, 155, .35), transparent 35%),
    rgba(22, 8, 18, 0.78);
  backdrop-filter: blur(5px);
}

.crop-card {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 18px;
  border: 4px solid #fff;
  border-radius: 18px 6px 18px 6px;
  background:
    linear-gradient(120deg, transparent 0 46%, rgba(255,255,255,.75) 47% 49%, transparent 50% 100%),
    var(--panel);
  box-shadow: 0 0 0 4px var(--black), 8px 9px 0 var(--pink-hot), 12px 13px 0 var(--black);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.dialog-head .eyebrow {
  color: var(--pink-hot);
  text-shadow: none;
}

.icon-button {
  width: 42px;
  min-height: 42px;
  padding: 0;
  color: #fff;
  background: var(--black);
  font-size: 24px;
  line-height: 1;
}

.crop-stage {
  width: min(100%, calc(100dvh - 230px));
  min-width: 0;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 3px solid var(--black);
  border-radius: 12px 4px 12px 4px;
  background: #171017;
  box-shadow: inset 0 0 0 3px var(--pink-hot);
}

.crop-tools {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  border: 2px solid var(--line);
  border-radius: 12px 5px 12px 5px;
  background: var(--pink-pale);
}

.segmented button {
  min-height: 36px;
  border-color: transparent;
  box-shadow: none;
  background: transparent;
}

.segmented button.active {
  color: #fff;
  border-color: var(--line);
  background: var(--pink-hot);
  box-shadow: 2px 2px 0 var(--line);
}

@media (max-width: 880px) {
  .app-header {
    align-items: center;
  }

  .canvas-wrap {
    max-height: none;
  }
}

@media (max-width: 620px) {
  html,
  body {
    min-height: 100%;
  }

  body {
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    background-size: 30px 30px, 100% 100%;
  }

  .page-sparkles {
    display: none;
  }

  .app-header,
  .app-shell {
    width: calc(100% - 12px);
  }

  .app-header {
    display: block;
    height: 200px;
    min-height: 200px;
    margin: 6px auto 12px;
    padding: 11px 12px 12px;
    border-width: 2px;
    border-radius: 17px 6px 17px 6px;
    box-shadow: 0 4px 0 var(--pink-hot), 0 7px 0 var(--black);
  }

  .brand {
    width: 100%;
    overflow: visible;
  }

  .title-deco-zone {
    position: absolute;
    z-index: 3;
    right: -2px;
    bottom: -5px;
    width: 190px;
    height: 112px;
    min-width: 0;
    opacity: 0.96;
  }

  .title-deco-zone::before {
    inset: 12% 0 5%;
    border-width: 1px;
  }

  .title-stamp-showcase {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
  }

  .hero-stamp {
    width: 112px;
    height: 112px;
    filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .62)) drop-shadow(0 0 4px rgba(255, 255, 255, .8));
  }

  .hero-stamp-wanted {
    top: -2px;
    left: 0;
  }

  .hero-stamp-offer {
    right: 0;
    bottom: 0;
  }

  .title-kira {
    font-size: 15px;
  }

  .app-header::after {
    display: none;
  }

  .eyebrow {
    margin: 0 0 2px 2px;
    font-size: 9px;
    letter-spacing: 0.09em;
  }

  h1 {
    width: min(76vw, 320px);
    filter: drop-shadow(3px 4px 0 #000);
    transform: rotate(-1deg);
  }

  .brand-tagline {
    margin: 3px 0 0 5px;
    padding: 3px 7px;
    font-size: 10px;
    letter-spacing: 0.05em;
  }

  .save-button {
    flex: 0 0 auto;
    min-width: 88px;
    min-height: 40px;
    padding: 0 14px;
    border-width: 2px;
    box-shadow: 0 0 0 2px rgba(255, 243, 59, 0.75), 4px 4px 0 #000;
    font-size: 11px;
  }

  .save-icon,
  .save-icon svg {
    width: 16px;
    height: 16px;
  }

  .app-shell {
    display: block;
    height: auto;
    margin-bottom: 20px;
    overflow: visible;
  }

  .workspace {
    height: auto;
    display: block;
  }

  .canvas-wrap {
    min-width: 0;
    width: 100%;
    max-height: none;
    max-width: 100%;
    margin: 0 auto;
    border-width: 3px;
    border-radius: 12px 4px 12px 4px;
    box-shadow: 0 0 0 3px var(--black), 0 6px 0 var(--pink-hot), 0 10px 0 var(--black), 0 18px 30px rgba(43, 23, 37, .28);
  }

  .canvas-wrap:not(.is-empty) {
    width: 100%;
  }

  .canvas-wrap::before {
    border-width: 3px;
    border-radius: 8px 1px 8px 1px;
  }

  .empty-state {
    gap: 7px;
  }

  .empty-state::before {
    width: min(350px, 82vw);
  }

  .upload-icon {
    width: 58px;
    height: 54px;
    font-size: 28px;
  }

  .empty-state strong {
    font-size: 20px;
  }

  .empty-state span {
    font-size: 13px;
  }

  .empty-state small {
    font-size: 10px;
  }

  .ghost-link,
  button,
  .file-button {
    min-height: 42px;
    padding: 0 11px;
    font-size: 12px;
  }

  .canvas-actions {
    width: 100%;
    margin-bottom: 10px;
    padding: 0;
    gap: 4px;
    flex-wrap: nowrap;
  }

  .canvas-actions button,
  .canvas-actions .file-button {
    padding-right: 8px;
    padding-left: 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  .canvas-actions .save-button {
    font-size: 11px;
  }

  .stamp-dock {
    width: min(360px, calc(100% - 24px));
    max-height: min(82dvh, 680px);
    padding: 0;
    border-width: 2px;
    border-radius: 22px 22px 0 0;
    box-shadow: 3px 4px 0 var(--pink-hot), 5px 6px 0 var(--black);
    backdrop-filter: none;
  }

  .stamp-picker-overlay {
    padding: 0;
  }

  .stamp-picker-head {
    font-size: 15px;
  }

  .stamp-picker-content {
    margin-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .stamp-picker-overlay.is-open .stamp-dock {
    width: calc(100% - 12px);
  }

  .stamp-color-bar {
    gap: 6px;
    padding: 5px 5px 8px;
  }

  .stamp-color-label {
    font-size: 9px;
  }

  .stamp-color-option {
    min-height: 36px;
    padding: 0 13px 0 31px;
    font-size: 10px;
  }

  .stamp-color-option::before {
    left: 8px;
    width: 18px;
    height: 18px;
  }

  .stamp-browser {
    display: block;
  }

  .stamp-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    max-height: min(58dvh, 530px);
    padding: 5px 4px 10px;
  }

  .stamp-option {
    width: 100%;
    height: 100px;
    padding: 7px;
  }

  .stamp-option img {
    height: 84px;
  }

  .stamp-option span {
    font-size: 11px;
  }

  .range-row {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px;
    min-height: 62px;
    padding: 12px 10px;
    font-size: 12px;
  }

  select {
    height: 40px;
    font-size: 13px;
  }

  .crop-dialog {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .crop-card {
    min-height: 100dvh;
    padding: 10px;
    border: 0;
    border-radius: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
    box-shadow: none;
  }

  .dialog-head h2 {
    font-size: 19px;
  }

  .crop-stage {
    width: min(100%, calc(100dvh - 255px));
    align-self: center;
    max-height: calc(100dvh - 245px);
  }

  .crop-tools {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .segmented button {
    min-height: 38px;
  }
}

@media (max-width: 350px) {
  .canvas-actions {
    gap: 4px;
  }

  .canvas-actions button,
  .canvas-actions .file-button {
    min-height: 40px;
    padding: 0 7px;
    font-size: 10px;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Common footer and information pages */
.site-footer {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 34px auto 0;
  padding: 24px 20px max(24px, env(safe-area-inset-bottom));
  border: 2px solid rgba(43, 23, 37, 0.55);
  border-radius: 16px 6px 16px 6px;
  color: #4c2d42;
  background: #f7a4ca;
  text-align: center;
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  margin-bottom: 14px;
}

.footer-links a {
  color: var(--ink);
  font-weight: 800;
  text-underline-offset: 4px;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: #c70068;
}

.site-footer p {
  margin: 0;
}

.info-page {
  min-height: 100vh;
}

.info-header {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 32px));
  margin: 18px auto 0;
}

.info-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 7px 16px;
  border: 2px solid #fff;
  border-radius: 16px 6px 16px 6px;
  color: #fff;
  background: linear-gradient(135deg, #2c1727, #090609 62%, #42122f);
  box-shadow: 0 4px 0 var(--pink-hot), 0 7px 0 var(--black);
  text-decoration: none;
}

.info-brand img {
  display: block;
  width: 158px;
  height: auto;
}

.info-brand span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .05em;
}

.info-main {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 32px));
  margin: 28px auto 0;
}

.info-card {
  padding: clamp(24px, 5vw, 54px);
  border: 3px solid var(--line);
  border-radius: 26px 10px 26px 10px;
  background: rgba(255, 253, 253, .97);
  box-shadow: 0 7px 0 var(--pink-hot), 0 11px 0 var(--black), 0 22px 50px rgba(91, 16, 67, .25);
}

.info-kicker {
  margin: 0 0 8px;
  color: var(--pink-hot);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
}

.info-card h1 {
  width: auto;
  margin: 0 0 28px;
  font-size: clamp(27px, 5vw, 42px);
  line-height: 1.3;
  filter: none;
  transform: none;
}

.info-card h2 {
  margin: 34px 0 12px;
  padding-bottom: 7px;
  border-bottom: 3px solid var(--pink-pale);
  font-size: clamp(18px, 3vw, 23px);
  line-height: 1.5;
}

.info-card h3 {
  margin: 22px 0 8px;
  font-size: 17px;
}

.info-card p,
.info-card li,
.info-card dd,
.info-card dt {
  line-height: 1.9;
}

.info-card p {
  margin: 0 0 14px;
}

.info-card ul,
.info-card ol {
  margin: 8px 0 18px;
  padding-left: 1.5em;
}

.info-card a {
  color: #b60061;
  font-weight: 800;
  text-underline-offset: 3px;
}

.info-lead {
  padding: 18px 20px;
  border: 2px solid var(--pink-hot);
  border-radius: 16px;
  background: #fff0f8;
  font-weight: 700;
}

.info-note {
  padding: 14px 16px;
  border-left: 5px solid var(--pink-hot);
  background: #fff5fa;
}

.contact-box {
  margin: 22px 0;
  padding: 20px;
  border: 2px dashed var(--pink-hot);
  border-radius: 16px;
  background: #fff7fb;
}

.contact-box p:last-child {
  margin-bottom: 0;
}

.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 6px;
  padding: 0 20px;
  border: 2px solid var(--black);
  border-radius: 12px;
  color: #fff !important;
  background: linear-gradient(#ff43aa, #f00079);
  box-shadow: 3px 4px 0 var(--black);
  text-decoration: none;
}

.revision-date {
  margin-top: 34px !important;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

@media (max-width: 620px) {
  .site-footer {
    width: calc(100% - 24px);
    margin-top: 28px;
    padding-right: 8px;
    padding-bottom: max(82px, calc(68px + env(safe-area-inset-bottom)));
    padding-left: 8px;
  }

  .info-page .site-footer {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .footer-links {
    gap: 12px 18px;
  }

  .info-header,
  .info-main {
    width: calc(100% - 24px);
  }

  .info-header {
    margin-top: 12px;
  }

  .info-main {
    margin-top: 20px;
  }

  .info-brand {
    width: 100%;
    justify-content: center;
  }

  .info-brand img {
    width: 145px;
  }

  .info-card {
    padding: 24px 18px 30px;
    border-radius: 20px 8px 20px 8px;
  }

  .info-card h1 {
    margin-bottom: 22px;
  }
}
