@font-face {
  font-family: "Aeonik";
  src: url("/fonts/Aeonik-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Aeonik";
  src: url("/fonts/Aeonik-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Aeonik";
  src: url("/fonts/Aeonik-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f7f1e6;
  --paper-warm: #faf6ee;
  --card: #faf6ee;
  --ink: #1a1a1a;
  --ink-soft: rgba(0, 0, 0, 0.62);
  --postal-red: #9D3F36;
  --postal-red-deep: #7E322B;
  --brand-button-bg: #f3ebe0;
  --border: rgba(120, 95, 70, 0.22);
  --accent: #9D3F36;
  --accent-soft: #f3ebe0;
  --destructive: #d87878;
  --font-display: "Aeonik", sans-serif;
  --font-mono: "Aeonik", sans-serif;
  --font-script: "Aeonik", sans-serif;
  --kraft: #e2c9a5;
  --kraft-deep: #d2b48c;
  --app-background: var(--kraft);
  --shadow-soft: 4px 4px 0 rgba(70, 50, 30, 0.12);
  --heart-cursor: url("/assets/cursor-heart-32.png") 16 16, url("/assets/cursor-heart.png") 32 32, auto;
  --heart-cursor-pointer: url("/assets/cursor-heart-32.png") 16 16, url("/assets/cursor-heart.png") 32 32, pointer;
  --t-meta: 11px;
  --t-caption: 12px;
  --t-body: 14px;
  --t-label: 16px;
  --t-stamp: 18px;
  --t-title: 22px;
  --track-caps: 0.12em;
  --radius: 2px;
}

* { box-sizing: border-box; }

*, *::before, *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
}

html {
  min-height: 100%;
  background-color: var(--kraft);
  cursor: var(--heart-cursor);
}

html.is-recipient {
  background-color: #EDE1CD;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--t-body);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
  background: transparent;
  cursor: var(--heart-cursor);
}

a,
button,
.label-like,
.type-btn,
.floaty,
.floaty button,
[role="button"],
summary {
  cursor: var(--heart-cursor-pointer);
}

.wrap,
#recipientView {
  position: relative;
  z-index: 1;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 24px;
}

.builder-layout {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.builder-receipts {
  display: flex;
  flex-direction: column;
  gap: 0;
}

@media (min-width: 900px) {
  .builder-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.95fr) minmax(340px, 1.05fr);
    gap: 28px 40px;
    align-items: start;
  }

  .builder-receipts { gap: 24px; }

  section.panel.panel--parcel {
    position: sticky;
    top: 28px;
    margin-bottom: 0;
  }

  section.panel.panel--receipt { margin-bottom: 0; }
}

section.panel {
  position: relative;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-soft);
}

section.panel.panel--receipt {
  --receipt-paper: #f5f1e8;
  --receipt-ink: #1a1a1a;
  max-width: none;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  font-family: var(--font-mono);
  color: var(--receipt-ink);
  background-color: var(--receipt-paper);
  background-image:
    linear-gradient(180deg, rgba(245, 241, 232, 0.55), rgba(240, 234, 222, 0.4)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.03), transparent 12%, transparent 88%, rgba(0, 0, 0, 0.03));
  background-size: auto, auto;
  border: none;
  border-radius: 0;
  padding: 24px 24px 28px;
  margin-bottom: 24px;
  box-shadow: 4px 4px 0 rgba(40, 30, 20, 0.12);
}

section.panel.panel--share {
  padding: 20px 24px 22px;
}

.receipt-head { text-align: center; margin-bottom: 4px; }

.receipt-store {
  margin: 0;
  font-size: var(--t-meta);
  font-weight: 700;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--receipt-ink);
}

.receipt-addr {
  margin: 4px 0 12px;
  font-size: var(--t-caption);
  color: rgba(26, 26, 26, 0.62);
  letter-spacing: 0;
}

.receipt-rule {
  height: 0;
  border: none;
  border-top: 1px dashed rgba(26, 26, 26, 0.45);
  margin: 10px 0;
}

.receipt-rule--double {
  border-top: none;
  height: 5px;
  background:
    linear-gradient(to right, rgba(26, 26, 26, 0.55) 0, rgba(26, 26, 26, 0.55) 100%) top / 100% 1px no-repeat,
    linear-gradient(to right, rgba(26, 26, 26, 0.55) 0, rgba(26, 26, 26, 0.55) 100%) bottom / 100% 1px no-repeat;
}

.receipt-cols {
  display: flex;
  justify-content: space-between;
  font-size: var(--t-meta);
  font-weight: 700;
  letter-spacing: var(--track-caps);
  color: rgba(26, 26, 26, 0.7);
  margin: 2px 0 0;
}

.receipt-foot { text-align: center; margin-top: 4px; }

.receipt-barcode {
  height: 28px;
  margin: 8px auto 10px;
  max-width: 180px;
  background: repeating-linear-gradient(
    90deg,
    #111 0 2px, transparent 2px 4px,
    #111 4px 5px, transparent 5px 8px,
    #111 8px 11px, transparent 11px 13px,
    #111 13px 14px, transparent 14px 17px,
    #111 17px 20px, transparent 20px 22px
  );
  opacity: 0.7;
}

.receipt-thanks {
  margin: 0;
  font-size: var(--t-meta);
  font-weight: 700;
  letter-spacing: var(--track-caps);
}

.receipt-bye {
  margin: 4px 0 0;
  font-size: var(--t-caption);
  color: rgba(26, 26, 26, 0.62);
}

section.panel.panel--receipt .stamp {
  margin: 0 auto 2px;
}

section.panel.panel--receipt .type-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 8px;
  margin: 6px 0 2px;
}

section.panel.panel--receipt .type-btn,
section.panel.panel--receipt button.type-btn {
  color: var(--receipt-ink);
  font-size: var(--t-caption);
  font-weight: 500;
}

section.panel.panel--receipt .item-list { gap: 0; margin-top: 0; min-height: 8px; }

section.panel.panel--receipt .item-row {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 8px 0;
  gap: 10px;
  align-items: center;
}

section.panel.panel--receipt .item-row + .item-row {
  border-top: 1px dotted rgba(26, 26, 26, 0.28);
}

section.panel.panel--receipt .item-row img {
  width: 36px;
  height: 36px;
  border-radius: 0;
}

section.panel.panel--receipt .item-row .meta .t {
  color: var(--receipt-ink);
  font-family: var(--font-mono);
  font-size: var(--t-caption);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
}

section.panel.panel--receipt .item-row .meta .s {
  font-family: var(--font-mono);
  font-size: var(--t-caption);
  color: rgba(26, 26, 26, 0.62);
}

section.panel.panel--receipt .item-row .actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

section.panel.panel--receipt .item-qty {
  font-size: var(--t-caption);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 1.2em;
  text-align: right;
}

section.panel.panel--receipt .share-actions {
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 8px;
}

section.panel.panel--receipt .share-actions button { width: 100%; }

.pay-want {
  margin: 2px 0 10px;
}

.pay-want__label {
  display: block;
  font-size: var(--t-meta);
  font-weight: 700;
  letter-spacing: var(--track-caps);
  color: rgba(26, 26, 26, 0.7);
  margin-bottom: 4px;
}

.pay-want__hint {
  margin: 0 0 8px;
  font-size: var(--t-caption);
  color: rgba(26, 26, 26, 0.62);
  line-height: 1.45;
  letter-spacing: 0;
  font-weight: 400;
}

.pay-want__row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  border-bottom: 1px dotted rgba(26, 26, 26, 0.4);
  padding: 2px 0 8px;
}

.pay-want__currency {
  font-size: var(--t-label);
  font-weight: 700;
  color: var(--receipt-ink);
}

.pay-want input,
section.panel.panel--receipt .pay-want input {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  font-family: var(--font-mono);
  font-size: var(--t-label);
  font-weight: 500;
  color: var(--receipt-ink);
  box-shadow: none;
}

.pay-want input::placeholder { color: rgba(0, 0, 0, 0.28); }
.pay-want input:focus {
  outline: none;
  border: none;
  box-shadow: none;
  background: transparent;
}

.protect-row {
  margin: 4px 0 12px;
}

.protect-toggle {
  display: flex;
  gap: 8px;
  margin: 4px 0 8px;
}

.protect-toggle__opt,
section.panel.panel--receipt .protect-toggle__opt {
  flex: 1;
  width: auto;
  padding: 8px 10px;
  font-size: var(--t-caption);
  font-weight: 700;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
}

.protect-toggle__opt:not(.is-on),
section.panel.panel--receipt .protect-toggle__opt:not(.is-on) {
  background: transparent;
  color: var(--receipt-ink);
  border-color: rgba(26, 26, 26, 0.4);
}

.protect-toggle__opt:not(.is-on):hover,
section.panel.panel--receipt .protect-toggle__opt:not(.is-on):hover {
  background: rgba(26, 26, 26, 0.04);
  color: var(--receipt-ink);
  border-color: rgba(26, 26, 26, 0.55);
}

.protect-pass { margin-top: 4px; }

.protect-pass input,
section.panel.panel--receipt .protect-pass input {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  font-family: var(--font-mono);
  font-size: var(--t-label);
  font-weight: 500;
  color: var(--receipt-ink);
  box-shadow: none;
}

.protect-pass input::placeholder { color: rgba(0, 0, 0, 0.28); }
.protect-pass input:focus {
  outline: none;
  border: none;
  box-shadow: none;
  background: transparent;
}

section.panel.panel--receipt .link-box {
  border: none;
  border-top: 1px dashed rgba(26, 26, 26, 0.35);
  border-bottom: 1px dashed rgba(26, 26, 26, 0.35);
  background: transparent;
  padding: 10px 0;
  border-radius: 0;
  margin-top: 4px;
}

section.panel.panel--receipt .link-box input {
  font-family: var(--font-mono);
  font-size: var(--t-caption);
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 4px 0;
  box-shadow: none;
}

/* —— CSS shipping label —— */
section.panel.panel--parcel {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin-bottom: 28px;
  box-shadow: none !important;
}

.parcel-label {
  background: #fff;
  border: 2px solid #111;
  box-shadow: 4px 4px 0 rgba(70, 50, 30, 0.12);
  overflow: hidden;
}

.parcel-label__header {
  background: #111;
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--t-body);
  letter-spacing: var(--track-caps);
  text-align: center;
  padding: 10px 12px;
}

.parcel-label__body {
  position: relative;
  padding: 16px 16px 14px;
}

.parcel-label__row--to {
  padding-right: 134px;
}

.parcel-label__field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.parcel-label__key {
  display: block;
  font-weight: 700;
  font-size: var(--t-meta);
  letter-spacing: var(--track-caps);
}

.parcel-label .stamp {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 118px;
  font-size: var(--t-caption);
  padding: 8px 8px;
}

.parcel-label__row--from {
  margin-top: 16px;
}

.parcel-label__customs {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(26, 26, 26, 0.4);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.parcel-label textarea {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 2px 0 0;
  font-size: var(--t-label);
  font-family: var(--font-mono);
  font-weight: 500;
  color: #111;
  width: 100%;
  line-height: 1.3;
  box-shadow: none;
  resize: none;
  min-height: 64px;
}

.parcel-label textarea::placeholder { color: rgba(0, 0, 0, 0.28); }
.parcel-label textarea:focus {
  outline: none;
  background: transparent;
  border: none;
  box-shadow: none;
}

.parcel-label__barcode {
  height: 36px;
  margin: 16px auto 6px;
  max-width: 72%;
  background: repeating-linear-gradient(
    90deg,
    #111 0 2px, transparent 2px 4px,
    #111 4px 5px, transparent 5px 8px,
    #111 8px 12px, transparent 12px 14px,
    #111 14px 15px, transparent 15px 18px
  );
}

.parcel-label__track {
  margin: 0;
  text-align: center;
  font-size: var(--t-meta);
  letter-spacing: var(--track-caps);
  color: #111;
}

.parcel-label input[type="text"] {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 2px 0 0;
  font-size: var(--t-label);
  font-family: var(--font-mono);
  font-weight: 500;
  color: #111;
  width: 100%;
  line-height: 1.3;
  box-shadow: none;
}

.parcel-label input[type="text"]::placeholder { color: rgba(0, 0, 0, 0.28); }
.parcel-label input[type="text"]:focus {
  outline: none;
  background: transparent;
  border: none;
  box-shadow: none;
}

.stamp {
  display: inline-block;
  margin: 0;
  padding: 8px 12px;
  color: var(--postal-red);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--t-stamp);
  line-height: 1.25;
  letter-spacing: 0;
  text-align: center;
  background: none;
  border: 1px dashed var(--postal-red);
  outline: 1px solid var(--postal-red);
  outline-offset: -4px;
  box-shadow: none;
}

label.field-label {
  display: block;
  font-size: var(--t-caption);
  color: var(--ink-soft);
  margin: 14px 0 6px;
  letter-spacing: 0;
  font-weight: 500;
}

input[type="text"],
input[type="url"],
textarea {
  width: 100%;
  font-size: var(--t-body);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 252, 245, 0.7);
  color: var(--ink);
  font-family: inherit;
}

textarea { resize: vertical; min-height: 76px; }

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--postal-red);
  box-shadow: none;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 10px;
  margin-bottom: 4px;
}

.type-btn,
button.type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 6px 4px;
  font-size: var(--t-caption);
  font-weight: 500;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  letter-spacing: 0;
}

.type-icon {
  position: relative;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
}

.type-btn img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.marker-circle {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 132%;
  height: 132%;
  pointer-events: none;
  background: url("/assets/marker-circle.svg") center / contain no-repeat;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.type-btn:hover .marker-circle,
.type-btn:focus-visible .marker-circle {
  opacity: 1;
}

.type-btn:nth-child(3n+2) .marker-circle,
.type-btn:nth-child(3n) .marker-circle {
  transform: translate(-50%, -50%);
}

button.type-btn:hover,
button.type-btn:focus-visible,
button.type-btn:active {
  transform: none;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--receipt-ink);
}

.item-form { color: #3a2a1a; }

.item-form-title {
  font-family: var(--font-display);
  font-size: var(--t-title);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--postal-red);
  margin: 0 28px 16px 0;
  line-height: 1.2;
}

.item-form .field-label { color: rgba(58, 42, 26, 0.78); }

.item-form input[type="text"],
.item-form input[type="url"],
.item-form textarea {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(90, 90, 90, 0.28);
  color: #2a2a2a;
}

.item-form .row-buttons {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.item-form .upload-status {
  font-size: var(--t-caption);
  color: rgba(58, 42, 26, 0.72);
  margin-top: 8px;
}

.item-form .upload-status:empty { display: none; }

.item-form .upload-status.is-error { color: var(--destructive); }

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 168px;
  padding: 20px 16px;
  border: 1px dashed rgba(26, 26, 26, 0.4);
  border-radius: var(--radius);
  background: rgba(255, 252, 245, 0.55);
  text-align: center;
  cursor: var(--heart-cursor-pointer);
}

.dropzone.is-dragover {
  border-color: var(--postal-red);
  background: rgba(157, 63, 54, 0.08);
}

.dropzone__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dropzone__prompt {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropzone__title {
  font-size: var(--t-body);
  font-weight: 500;
  color: var(--ink);
}

.dropzone__sub {
  font-size: var(--t-caption);
  color: var(--ink-soft);
}

.dropzone.has-file .dropzone__prompt { display: none; }

.item-form .photo-preview,
.dropzone__preview {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  margin: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
}

.item-form .photo-preview[hidden] { display: none; }

.link-preview {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  margin: 10px 0 0;
  border: 1px solid rgba(90, 90, 90, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
}

.link-preview[hidden] { display: none; }

.voice-recorder {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.voice-recorder.has-memo .voice-recorder__viz { display: none; }

.voice-recorder__viz {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
  background: rgba(255, 252, 245, 0.7);
  border: 1px solid rgba(90, 90, 90, 0.28);
  border-radius: var(--radius);
}

.voice-recorder.is-recording .voice-recorder__viz {
  border-color: var(--postal-red);
}

.voice-recorder__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--t-caption);
}

.voice-recorder__label {
  font-weight: 500;
  color: var(--ink-soft);
}

.voice-recorder.is-recording .voice-recorder__label {
  color: var(--postal-red);
}

.voice-recorder__time {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.voice-recorder__meter {
  height: 10px;
  border: 1px solid rgba(26, 26, 26, 0.4);
  background: rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.voice-recorder__level {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--postal-red);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

.voice-recorder__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.voice-player {
  position: relative;
  display: flex;
  width: 100%;
  margin-top: 4px;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius);
  background: rgba(255, 252, 245, 0.7);
  border: 1px solid rgba(90, 90, 90, 0.28);
  padding: 8px 10px;
}

.voice-recorder .voice-player { display: none; margin-top: 2px; }
.voice-recorder .voice-player.is-visible { display: flex; }

.voice-player__play {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  height: auto;
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: var(--t-caption);
  font-weight: 700;
  line-height: 1;
}

.voice-player__seek {
  flex: 1;
  min-width: 0;
  height: 10px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  accent-color: var(--postal-red);
}

.voice-player__seek::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(26, 26, 26, 0.4);
}

.voice-player__seek::-moz-range-track {
  height: 10px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(26, 26, 26, 0.4);
}

.voice-player__seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 8px;
  height: 14px;
  margin-top: -3px;
  border-radius: 0;
  background: var(--postal-red);
  border: 1px solid var(--postal-red-deep);
}

.voice-player__seek::-moz-range-thumb {
  width: 8px;
  height: 14px;
  border-radius: 0;
  background: var(--postal-red);
  border: 1px solid var(--postal-red-deep);
}

.voice-player__time {
  flex: 0 0 auto;
  font-size: var(--t-caption);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  min-width: 5.5em;
  text-align: right;
}

.voice-player audio {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  opacity: 0;
  pointer-events: none;
}

.draw-pad { margin-top: 4px; }

.draw-pad--sign { margin-top: 0; }

.draw-canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  cursor: crosshair;
  background: #fff8f4;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
}

.modal-card .coupon-ticket {
  border: none;
  box-shadow: none;
  background: transparent;
}

.modal-card .coupon-ticket + button {
  display: block;
  width: 100%;
  margin-top: 14px;
}

.draw-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.draw-colors { display: flex; gap: 6px; flex-wrap: wrap; }

.draw-swatch {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50% !important;
  border: 2px solid rgba(92, 74, 90, 0.25);
  min-width: 26px;
  transform: none !important;
}

.draw-swatch.light { border-color: rgba(92, 74, 90, 0.4); }
.draw-swatch.active { outline: 2px solid var(--postal-red); outline-offset: 2px; }
.draw-sizes { display: flex; gap: 6px; }
.draw-size.active {
  border-color: rgba(157, 63, 54, 0.45);
  background: var(--brand-button-bg);
  color: var(--postal-red);
}

button {
  font-family: var(--font-mono);
  font-size: var(--t-body);
  font-weight: 700;
  letter-spacing: 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  cursor: var(--heart-cursor-pointer);
  border: 1px solid var(--postal-red);
  background: var(--postal-red);
  color: var(--paper);
  box-shadow: none;
  transform: none;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s, color 0.15s;
}

button:hover {
  background: var(--postal-red-deep);
  border-color: var(--postal-red-deep);
  color: var(--paper);
}

button:active { transform: none; }

button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: rgba(26, 26, 26, 0.4);
  box-shadow: none;
}

button.secondary:hover {
  background: rgba(26, 26, 26, 0.04);
  border-color: rgba(26, 26, 26, 0.55);
  color: var(--ink);
}

button.small {
  padding: 5px 10px;
  font-size: var(--t-caption);
  border-radius: var(--radius);
}

button.danger {
  background: #252525;
  color: #fff;
  border-color: #252525;
  box-shadow: none;
}

button.danger:hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
}

button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

button.bare {
  all: unset;
  cursor: var(--heart-cursor-pointer);
  display: block;
  width: 100%;
}

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

.item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  background: rgba(255, 252, 245, 0.55);
}

.item-row img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.item-row img.item-row__shot {
  object-fit: cover;
  background: #ebe4d8;
}

.item-row .meta { flex: 1; min-width: 0; }
.item-row .meta .s {
  font-size: var(--t-caption);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-soft);
}
.item-row .actions { display: flex; gap: 6px; }

.link-box { display: flex; gap: 8px; margin-top: 12px; }
.link-box input { flex: 1; }
#linkResult { display: none; }
.copied-msg {
  font-size: var(--t-caption);
  color: var(--postal-red);
  margin-left: 6px;
  display: none;
}
.error-msg {
  font-size: var(--t-caption);
  color: var(--destructive);
  margin-top: 8px;
  display: none;
}

#shareSuccessBackdrop { display: none; }
#shareSuccessBackdrop.visible { display: flex; }

.modal-card--share-success {
  max-width: 460px;
  text-align: center;
  padding: 40px 32px 32px;
}

.share-success-eyebrow {
  margin: 0 0 8px;
  font-size: var(--t-meta);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--postal-red);
}

.share-success-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: var(--t-title);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
}

.share-success-copy {
  margin: 0 0 22px;
  font-size: var(--t-body);
  line-height: 1.45;
  color: var(--ink-soft);
}

.share-success-label {
  display: block;
  margin: 0 0 8px;
  font-size: var(--t-meta);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: left;
}

.share-success-link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.share-success-link-row input {
  flex: 1;
  min-width: 0;
  font-size: var(--t-caption);
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
}

.share-success-link-row button { flex-shrink: 0; white-space: nowrap; }

.share-success-copied {
  margin: 0 0 14px;
  font-size: var(--t-body);
  color: var(--postal-red);
}

.share-success-copied[hidden] { display: none !important; }
#shareSuccessDone { width: 100%; margin-top: 8px; }

@media (max-width: 520px) {
  .share-success-link-row { flex-direction: column; }
}

html.is-recipient,
html.is-recipient body {
  height: 100%;
  overflow: hidden;
}

html.is-recipient.is-package-open,
html.is-recipient.is-package-open body {
  overflow: auto;
  height: auto;
}

html.is-recipient.is-package-open {
  background-color: #EDE4D3;
}

html.is-recipient .modal-backdrop {
  background: #EDE1CD;
}

html.is-recipient.is-package-open .modal-backdrop {
  background: #EDE4D3;
}

#recipientView {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  padding: 0;
  box-sizing: border-box;
}

html.is-recipient.is-package-open #recipientView {
  height: auto;
  min-height: 100dvh;
}

#recipientView > .stage { flex: 1 1 auto; min-height: 0; }

#recipientView > footer.hint {
  flex-shrink: 0;
  width: 100%;
  max-width: none;
  margin: auto 0 0;
  padding: 10px 16px 18px;
  font-size: var(--t-caption);
  text-align: center;
}

html.is-recipient.is-package-open .stage {
  overflow: visible;
  flex: 1 0 auto;
  height: auto;
  min-height: 0;
  max-width: min(1180px, 94vw);
  width: 100%;
}

@media (max-width: 767px) {
  html.is-recipient.is-package-open .stage { max-width: 100%; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  html.is-recipient.is-package-open .stage { max-width: min(880px, 94vw); }
}
@media (min-width: 1024px) {
  html.is-recipient.is-package-open .stage { max-width: min(1180px, 92vw); }
}

.stage {
  flex: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  height: auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.box-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.8vh, 18px);
  padding: clamp(8px, 2vh, 20px);
  box-sizing: border-box;
  transition: opacity 0.5s ease;
}

.box-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.pkg-title {
  font-family: var(--font-display);
  font-size: var(--t-title);
  font-weight: 500;
  text-align: center;
  padding: 0 28px;
  color: var(--postal-red);
  line-height: 1.2;
  letter-spacing: 0;
}

.pkg-from {
  font-size: var(--t-caption);
  color: var(--ink-soft);
  text-align: center;
}

.box-photo-btn {
  position: relative;
  display: block;
}

.box-scene {
  position: relative;
  display: inline-block;
}

.box-scene.is-shaking { animation: box-shake 0.75s ease-in-out; }

.care-box {
  width: min(420px, 54vh);
  height: min(420px, 54vh);
  position: relative;
}

.care-box__front {
  position: absolute;
  left: 14%;
  right: 14%;
  top: 28%;
  bottom: 16%;
  background:
    linear-gradient(180deg, rgba(255, 248, 236, 0.18), transparent 30%),
    linear-gradient(90deg, #c9a06c, #d8b07a 18%, #c4a06c 52%, #d2b48c 82%, #b98d58);
  border: 1px solid rgba(90, 60, 30, 0.22);
  box-shadow: 0 8px 0 rgba(70, 50, 30, 0.18), inset 0 0 0 8px rgba(180, 130, 70, 0.12);
}

.care-box__lid {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 18%;
  height: 16%;
  background:
    linear-gradient(180deg, #e2c49a, #c9a06c 70%, #b89058);
  border: 1px solid rgba(90, 60, 30, 0.2);
  clip-path: polygon(6% 100%, 0 18%, 100% 18%, 94% 100%);
}

.care-box__tape {
  position: absolute;
  background: rgba(255, 255, 255, 0.38);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.care-box__tape--v {
  left: 48%;
  width: 4.5%;
  top: 18%;
  bottom: 16%;
}

.care-box__tape--h {
  top: 32%;
  height: 3.5%;
  left: 14%;
  right: 14%;
}

@keyframes box-shake {
  0%, 100% { transform: translateX(0); }
  12% { transform: translateX(-10px); }
  24% { transform: translateX(12px); }
  36% { transform: translateX(-11px); }
  48% { transform: translateX(10px); }
  60% { transform: translateX(-8px); }
  72% { transform: translateX(7px); }
  84% { transform: translateX(-4px); }
}

@media (prefers-reduced-motion: reduce) {
  .box-scene,
  .box-scene.is-shaking { animation: none; }
}

.box-label {
  position: absolute;
  left: 50%;
  top: calc(63% + 2px);
  width: 44%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.box-label__face {
  background: #fff;
  border: 1.5px solid #111;
  overflow: hidden;
  box-shadow: 1px 2px 0 rgba(60, 40, 30, 0.22);
}

.box-label__header {
  background: #111;
  color: #fff;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 3px 4px;
}

.box-label__stamp {
  position: absolute;
  top: 22%;
  right: 6%;
  width: 38%;
  color: var(--postal-red);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 6px;
  line-height: 1.15;
  letter-spacing: 0;
  text-align: center;
  padding: 3px 3px;
  border: 1px dashed var(--postal-red);
  outline: 1px solid var(--postal-red);
  outline-offset: -2px;
}

.box-label__keys {
  padding: 8px 8px 22px;
  font-size: clamp(0.28rem, 0.85vh, 0.4rem);
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.box-label__barcode {
  height: 10px;
  margin: 0 10% 6px;
  background: repeating-linear-gradient(90deg, #111 0 1px, transparent 1px 2px);
}

.box-label__fields { position: absolute; inset: 0; }

.box-label__to,
.box-label__from {
  position: absolute;
  left: 13%;
  right: 6%;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #111;
  line-height: 1.15;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.box-label__to { top: 23%; font-size: clamp(0.42rem, 1.35vh, 0.7rem); }
.box-label__from { top: 53%; left: 24%; font-size: clamp(0.38rem, 1.2vh, 0.62rem); }

.tap-pill {
  margin-top: 6px;
  font-size: var(--t-body);
  letter-spacing: 0;
  text-transform: lowercase;
  color: #1a1a1a;
  font-weight: 400;
}

.edit-pkg-btn {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 40;
  margin: 0;
}

html.is-preview.is-package-open .edit-pkg-btn { display: inline-block; }
html.is-preview.is-package-open .open-header { padding-top: 76px; }
html.is-preview.is-package-open .open-header .pkg-title--stamp {
  max-width: min(360px, calc(100vw - 7.5rem));
}

.open-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  overflow: hidden;
}

.open-screen.visible {
  position: relative;
  inset: auto;
  opacity: 1;
  pointer-events: auto;
  overflow: visible;
  min-height: 0;
}

.open-header {
  text-align: center;
  padding: 56px 20px 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.open-header .pkg-title--stamp {
  font-size: var(--t-stamp);
  padding: 8px 12px;
  max-width: min(400px, 78vw);
  margin-left: auto;
  margin-right: auto;
}

.open-header .pkg-msg {
  font-size: var(--t-caption);
  color: var(--ink-soft);
  max-width: 320px;
  margin: 8px auto 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.open-header .pkg-msg:empty { display: none; }

#floatyHost {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  flex: 0 0 auto;
  min-height: 0;
  margin-top: 4px;
  overflow: visible;
  padding: 0 clamp(8px, 2.5vw, 16px) 32px;
  box-sizing: border-box;
}

.floaty {
  position: absolute;
  width: 130px;
  height: auto;
  top: 0;
  left: 0;
  z-index: 1;
  animation: none !important;
}

.floaty button {
  all: unset;
  cursor: var(--heart-cursor-pointer);
  display: block;
  width: 100%;
}

.floaty-tile {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  box-sizing: border-box;
  background: #fffef8;
  border: 1px solid rgba(120, 95, 70, 0.18);
}

.floaty-tile img {
  width: 82%;
  height: 82%;
  object-fit: contain;
}

.floaty--polaroid .polaroid {
  background: #fffef8;
  padding: 7px 7px 22px;
  border: 1px solid rgba(120, 95, 70, 0.14);
  box-shadow: 0 10px 0 rgba(60, 40, 30, 0.12);
}

.floaty--polaroid img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: #ebe4d8;
}

.floaty .fl-label {
  text-align: center;
  font-size: var(--t-caption);
  color: var(--postal-red);
  background: var(--paper-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 10px;
  margin: 8px auto 0;
  width: fit-content;
}

.notfound-msg {
  text-align: center;
  padding: 80px 20px;
  color: var(--ink-soft);
  font-size: var(--t-body);
}

.lock-screen {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.lock-screen[hidden] { display: none; }

.lock-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 2px solid #111;
  box-shadow: 4px 4px 0 rgba(70, 50, 30, 0.12);
}

.lock-card__header {
  background: #111;
  color: #fff;
  font-weight: 700;
  font-size: var(--t-body);
  letter-spacing: var(--track-caps);
  text-align: center;
  padding: 10px 12px;
}

.lock-card__body {
  padding: 20px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lock-card__stamp {
  margin: 0 auto 10px;
  font-size: var(--t-body);
}

.lock-card__key {
  display: block;
  font-weight: 700;
  font-size: var(--t-meta);
  letter-spacing: var(--track-caps);
}

.lock-card input[type="password"] {
  border: none;
  border-bottom: 1px dotted rgba(26, 26, 26, 0.4);
  border-radius: 0;
  background: transparent;
  padding: 4px 0 8px;
  font-size: var(--t-label);
  font-family: var(--font-mono);
  font-weight: 500;
  color: #111;
  box-shadow: none;
}

.lock-card input[type="password"]:focus {
  outline: none;
  border-color: var(--postal-red);
  box-shadow: none;
  background: transparent;
}

.lock-card .error-msg { margin: 0; }

.lock-card button { margin-top: 8px; width: 100%; }

@keyframes fl0 {
  0%, 100% { transform: translateY(0) rotate(var(--float-rot, -3deg)); }
  50% { transform: translateY(-3px) rotate(calc(var(--float-rot, -3deg) + 1.5deg)); }
}
@keyframes fl1 {
  0%, 100% { transform: translateY(0) rotate(var(--float-rot, 2.5deg)); }
  50% { transform: translateY(-2px) rotate(calc(var(--float-rot, 2.5deg) + 1.2deg)); }
}
@keyframes fl2 {
  0%, 100% { transform: translateY(0) rotate(var(--float-rot, -2deg)); }
  50% { transform: translateY(-3px) rotate(calc(var(--float-rot, -2deg) - 1.2deg)); }
}
@keyframes fl3 {
  0%, 100% { transform: translateY(0) rotate(var(--float-rot, 1.8deg)); }
  50% { transform: translateY(-2px) rotate(calc(var(--float-rot, 1.8deg) - 1deg)); }
}
@keyframes fl4 {
  0%, 100% { transform: translateY(0) rotate(var(--float-rot, -3.5deg)); }
  50% { transform: translateY(-3px) rotate(calc(var(--float-rot, -3.5deg) + 1.4deg)); }
}
@keyframes fl5 {
  0%, 100% { transform: translateY(0) rotate(var(--float-rot, 2deg)); }
  50% { transform: translateY(-2px) rotate(calc(var(--float-rot, 2deg) + 1.1deg)); }
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--kraft);
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal-backdrop.visible { display: flex; }

.modal-card {
  isolation: isolate;
  background-color: var(--paper);
  border: none;
  border-radius: var(--radius);
  max-width: 420px;
  width: 100%;
  padding: 34px 30px 28px;
  position: relative;
  max-height: 82vh;
  overflow: auto;
  color: #3a2a1a;
  box-shadow: 4px 4px 0 rgba(40, 30, 20, 0.12);
}

.modal-card--form {
  max-width: 520px;
  max-height: 90vh;
  padding: 40px 34px 44px;
}

.modal-card--form:has(.draw-pad) {
  max-height: 94vh;
  padding-bottom: 56px;
}

body.modal-open { overflow: hidden; }

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  font-size: 18px;
  padding: 4px;
  box-shadow: none;
  border-radius: 0;
}

.modal-close:hover,
button.modal-close:hover {
  background: transparent;
  border: none;
  box-shadow: none;
  transform: none;
  opacity: 0.7;
  color: var(--ink);
}

.modal-card img.full {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 12px;
  border: 5px solid #fff;
  box-shadow: 2px 3px 0 rgba(60, 40, 30, 0.12);
}

.modal-card .note-text {
  font-family: var(--font-mono);
  font-size: var(--t-body);
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--ink);
  text-align: center;
}

.modal-card iframe {
  width: 100%;
  border: none;
  border-radius: var(--radius);
}

.link-out {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 6px;
  text-decoration: none;
}

footer.hint {
  text-align: center;
  font-size: var(--t-caption);
  color: var(--ink-soft);
  margin-top: 28px;
  line-height: 1.65;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

footer.hint p {
  margin: 0;
}

footer.hint p + p {
  margin-top: 12px;
}

footer.hint a {
  color: var(--postal-red);
  text-decoration: none;
  border-bottom: 1px solid rgba(169, 72, 63, 0.35);
}

@media (max-width: 520px) {
  .type-grid { grid-template-columns: repeat(2, 1fr); }
  .type-icon { width: 64px; height: 64px; }
  .type-btn img { width: 56px; height: 56px; }
  .parcel-label__row--to { padding-right: 116px; }
  .parcel-label .stamp { width: 100px; }
  .care-box { width: min(340px, 48vh); height: min(340px, 48vh); }
  .floaty { width: 120px; }
  .floaty--polaroid img { width: 100%; height: auto; }
  #floatyHost { padding: 0 6px 40px; }
  .open-header { padding: 44px 16px 6px; }
  html.is-preview.is-package-open .open-header { padding-top: 72px; }
  html.is-preview.is-package-open .edit-pkg-btn {
    top: 12px;
    right: 12px;
    padding: 8px 12px;
    font-size: var(--t-caption);
  }
}
