@font-face {
  font-family: "Apfel Grotezk";
  src: url("../assets/fonts/ApfelGrotezk-Regular.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
}

@font-face {
  font-family: "Apfel Grotezk";
  src: url("../assets/fonts/ApfelGrotezk-Satt.woff2") format("woff2");
  font-display: swap;
  font-weight: 700 900;
}

@font-face {
  font-family: "Newsreader";
  src: url("../assets/fonts/Newsreader-Italic.woff2") format("woff2");
  font-display: swap;
  font-style: italic;
}

:root {
  color-scheme: light;
  --purple: #883893;
  --purple-deep: #65276e;
  --purple-soft: #f4ebf5;
  --green: #86c356;
  --green-deep: #355f20;
  --green-soft: #edf6e7;
  --paper: #fffefb;
  --table: #f1eee8;
  --ink: #211d1b;
  --muted: #6b655f;
  --faint: #918a83;
  --line: #d9d3ca;
  --line-dark: #bdb5aa;
  --danger: #a33232;
  --sans: "Apfel Grotezk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--table);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--table);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
label:focus-within,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(136, 56, 147, 0.28);
  outline-offset: 3px;
}

.shell {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 14px max(32px, env(safe-area-inset-bottom));
}

.masthead {
  display: flex;
  align-items: center;
  min-height: 72px;
  gap: 11px;
  border-bottom: 1px solid var(--line-dark);
  padding: 0 2px 14px;
}

.brand-bags {
  width: auto;
  height: 52px;
  flex: none;
  object-fit: contain;
}

.wordmark {
  display: grid;
  min-width: 0;
  line-height: 1;
}

.wordmark-line {
  display: flex;
  align-items: baseline;
  font-size: clamp(1.2rem, 5.8vw, 1.58rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.wordmark-amp {
  margin: 0 0.05em;
  color: var(--purple);
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.35em;
  font-style: italic;
  font-weight: 400;
}

.wordmark-since {
  width: max-content;
  margin-top: 4px;
  background: var(--green);
  padding: 3px 8px 4px;
  color: #17220f;
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.internal-label {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
}

.intro {
  padding: 36px 4px 28px;
}

.intro h1 {
  max-width: 13ch;
  margin: 7px 0 10px;
  font-size: clamp(2.35rem, 10vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.intro > p:last-child {
  max-width: 35rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 3.7vw, 1.1rem);
  line-height: 1.5;
}

.eyebrow,
.store-name,
.step-label,
.section-number,
.privacy-note,
footer,
.receipt { margin: 0; }

.step-label,
.section-number {
  color: var(--purple);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

form { display: grid; gap: 12px; }

.paper-card,
.send-panel,
.success-panel {
  border: 1px solid var(--line);
  background: var(--paper);
}

.paper-card {
  padding: 21px 19px 20px;
  border-radius: 10px 15px 9px 12px;
  box-shadow: 0 8px 22px rgba(55, 45, 33, 0.055);
}

.photo-card {
  border-top: 5px solid var(--purple);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

.section-heading h2 {
  margin: 2px 0 0;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.required-pill,
.optional-pill {
  flex: none;
  border: 1px solid var(--line);
  padding: 4px 8px;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.035em;
}

.required-pill {
  border-color: rgba(53, 95, 32, 0.3);
  background: var(--green-soft);
  color: var(--green-deep);
}

.optional-pill {
  background: #f5f3ef;
  color: var(--muted);
}

.capture-button,
.record-button {
  display: flex;
  width: 100%;
  min-height: 76px;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
}

.capture-button {
  border: 0;
  border-radius: 8px 12px 8px 10px;
  background: var(--purple);
  color: #fff;
  padding: 15px 16px;
  box-shadow: 0 8px 18px rgba(101, 39, 110, 0.18);
}

.capture-button:active,
.send-button:active { transform: translateY(1px); }

.action-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
}

.action-icon svg {
  width: 24px;
  height: 24px;
}

.capture-button strong,
.record-copy strong {
  display: block;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.2;
}

.capture-button small,
.record-copy small {
  display: block;
  margin-top: 3px;
  font-size: 0.78rem;
  line-height: 1.3;
}

.capture-button small { color: rgba(255, 255, 255, 0.72); }

.action-arrow {
  margin-left: auto;
  font-size: 1.5rem;
  line-height: 1;
}

.library-button,
.fallback-audio {
  display: flex;
  width: max-content;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  margin: 8px auto 0;
  padding: 10px 8px;
  color: var(--purple-deep);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
}

.library-button svg {
  width: 18px;
  height: 18px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.photo-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ece7df;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-index {
  position: absolute;
  bottom: 6px;
  left: 6px;
  min-width: 24px;
  padding: 3px 6px;
  background: rgba(33, 29, 27, 0.78);
  color: #fff;
  font-size: 0.67rem;
  font-weight: 700;
  text-align: center;
}

.remove-photo {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: var(--danger);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 900;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.15);
}

.field-help {
  margin: 11px 0 0;
  color: var(--faint);
  font-size: 0.76rem;
}

.record-button {
  border: 1px solid rgba(136, 56, 147, 0.32);
  border-radius: 8px 12px 8px 10px;
  background: var(--purple-soft);
  color: var(--purple-deep);
  padding: 14px 15px;
}

.record-button .action-icon {
  border-color: rgba(136, 56, 147, 0.25);
  background: #fff;
}

.record-button[aria-pressed="true"] {
  border-color: rgba(163, 50, 50, 0.42);
  background: #faeae8;
  color: var(--danger);
}

.record-copy { min-width: 0; flex: 1; }
.record-copy small { color: var(--muted); }

.record-time {
  min-width: 38px;
  flex: none;
  font-variant-numeric: tabular-nums;
  font-size: 0.76rem;
  font-weight: 900;
  text-align: right;
}

.audio-preview {
  margin-top: 13px;
  border: 1px solid rgba(53, 95, 32, 0.25);
  background: var(--green-soft);
  padding: 11px;
}

.audio-preview audio { width: 100%; height: 42px; }

.text-button {
  min-height: 40px;
  margin-top: 5px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 0.77rem;
  font-weight: 900;
}

.danger { color: var(--danger); }

.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.79rem;
  font-weight: 900;
}

textarea,
.price-field {
  width: 100%;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: #fff;
}

textarea {
  min-height: 112px;
  padding: 13px 14px;
  color: var(--ink);
  line-height: 1.5;
  resize: vertical;
}

textarea::placeholder,
input::placeholder { color: #aaa29a; }

.price-label { margin-top: 16px; }

.price-field {
  display: flex;
  max-width: 220px;
  align-items: center;
  padding-right: 14px;
}

.price-field input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 13px 14px;
  color: var(--ink);
  font-size: 1rem;
}

.price-field span { color: var(--muted); font-weight: 900; }

.form-message {
  display: none;
  margin: 0;
  border: 1px solid rgba(163, 50, 50, 0.3);
  background: #fcedeb;
  color: var(--danger);
  padding: 12px 14px;
  font-size: 0.84rem;
  font-weight: 900;
}

.form-message.is-visible { display: block; }

.send-panel {
  position: static;
  margin-top: 3px;
  border-color: #211d1b;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 15px;
  box-shadow: 0 8px 22px rgba(33, 29, 27, 0.14);
}

.send-summary {
  margin-bottom: 9px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.75rem;
}

.send-button {
  display: flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 5px;
  background: var(--green);
  color: #17220f;
  cursor: pointer;
  padding: 0 18px 0 20px;
  font-size: 0.98rem;
  font-weight: 900;
}

.send-button:disabled {
  background: #625e59;
  color: rgba(255, 255, 255, 0.52);
  cursor: not-allowed;
}

.send-arrow { font-size: 1.5rem; line-height: 1; }

.progress-track {
  overflow: hidden;
  height: 4px;
  margin: 12px 0 0;
  background: rgba(255, 255, 255, 0.16);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 0.2s ease;
}

.privacy-note {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.68rem;
  line-height: 1.4;
}

.success-panel {
  padding: 42px 22px 25px;
  border-radius: 10px 15px 9px 12px;
  text-align: center;
}

.success-mark {
  display: grid;
  width: 66px;
  height: 66px;
  margin: 0 auto 20px;
  place-items: center;
  background: var(--green);
  color: #17220f;
  font-size: 2rem;
  font-weight: 900;
}

.success-panel h2 {
  margin: 7px 0 9px;
  font-size: clamp(2.2rem, 10vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1;
}

.success-panel > p:not(.step-label):not(.receipt) {
  max-width: 28rem;
  margin: 0 auto;
  color: var(--muted);
}

.receipt { margin-top: 13px; color: var(--faint); font-size: 0.7rem; }
.next-button { max-width: 330px; margin: 27px auto 0; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 4px 0;
  color: var(--faint);
  font-size: 0.65rem;
}

.visually-hidden {
  position: absolute !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

[hidden] { display: none !important; }

@media (min-width: 680px) {
  .shell { padding-inline: 24px; }
  .paper-card { padding: 26px; }
  .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .intro { padding-block: 46px 34px; }
}

@media (max-width: 430px) {
  .internal-label { display: none; }
  .brand-bags { height: 47px; }
  .wordmark-line { font-size: 1.18rem; }
}

@media (max-width: 360px) {
  .paper-card { padding-inline: 16px; }
  .record-button { gap: 10px; }
  .record-time { display: none; }
  .capture-button small, .record-copy small { font-size: 0.73rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
