:root {
  color-scheme: light;
  --ink: #071321;
  --blue: #073b72;
  --red: #c93633;
  --paper: #ffffff;
  --canvas: #e8edf2;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(320px, 1fr);
  gap: 38px;
  align-items: start;
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px;
}

.controls {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 22px;
  padding: 28px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(7, 19, 33, .12);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--red);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 { margin: 0; font-family: Georgia, serif; font-size: 2.25rem; line-height: 1; color: var(--blue); }
.instructions, .print-note { margin: 12px 0 0; line-height: 1.55; color: #526171; }
.print-note { margin: 0; font-size: .86rem; }

.date-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.date-summary div { padding: 12px 14px; border: 1px solid #dce3e9; border-radius: 12px; }
.date-summary dt { color: #667584; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.date-summary dd { margin: 5px 0 0; font-weight: 800; }

.coupon-picker { display: grid; gap: 7px; color: #526171; font-size: .82rem; font-weight: 750; }
.coupon-picker select { width: 100%; min-height: 44px; border: 1px solid #cbd5df; border-radius: 10px; padding: 0 12px; background: #fff; color: var(--ink); font: inherit; }
.primary-actions { display: grid; grid-template-columns: 1.35fr 1fr; gap: 10px; }

#generate-button, #print-button, .secondary-button {
  min-height: 58px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--blue);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(7, 59, 114, .25);
}

#generate-button:hover, #print-button:hover { background: #0a4b8f; }
#generate-button:focus-visible, #print-button:focus-visible { outline: 4px solid rgba(201, 54, 51, .35); outline-offset: 3px; }
.redeem-button { min-height: 44px; border: 1px solid #b9c4ce; border-radius: 10px; background: #fff; color: #344454; font: inherit; font-weight: 750; cursor: pointer; }
.redeem-button.redeemed { border-color: #7b8792; color: #687580; background: #eef1f4; }
.secondary-button { border: 2px solid var(--blue); color: var(--blue); background: #fff; box-shadow: none; }
.secondary-button:hover { background: #eef5fb; }
.send-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.text-button { min-height: 43px; border: 1px solid #cbd5df; border-radius: 10px; background: #fff; color: var(--blue); font: inherit; font-weight: 800; cursor: pointer; }
.text-button:hover { border-color: var(--blue); background: #f5f8fb; }

.preview-shell { display: grid; place-items: start center; width: 100%; }
.coupon-stage { width: min(4in, 100%); aspect-ratio: 2 / 3; }

.coupon {
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: .15in .18in .11in;
  border: 2.4px solid #000;
  border-radius: .13in;
  background: var(--paper);
  color: #000;
  text-align: center;
  box-shadow: 0 20px 55px rgba(7, 19, 33, .18);
}

.coupon p, .coupon h2, .coupon h3 { margin: 0; }
.coupon-header { display: grid; place-items: center; height: .78in; border-bottom: 1.4px solid #000; }
.coupon-header img { width: 1.28in; height: auto; display: block; }
.welcome { display: grid; place-content: center; height: .70in; padding: .08in 0; }
.welcome h2 { font-size: .18in; line-height: 1.05; text-transform: uppercase; }
.welcome p { margin-top: .07in; font-size: .105in; line-height: 1.34; }

.offer { display: grid; place-content: center; height: 1.35in; padding: .095in .08in; border-radius: .09in; color: #fff; background: #000; }
.offer-kicker { font-size: .105in; font-weight: 800; text-transform: uppercase; }
.choose { margin-top: .045in !important; font-size: .075in; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.discount { margin-top: .015in !important; font-size: .29in; line-height: 1; text-transform: uppercase; }
.qualifier { margin-top: .025in !important; font-size: .095in; font-weight: 650; }
.or { margin-top: .02in !important; font-size: .07in; font-weight: 800; text-transform: uppercase; }
.delivery { margin-top: .012in !important; font-size: .135in; font-weight: 850; line-height: 1; text-transform: uppercase; }

.products { display: grid; place-content: center; height: .43in; padding: .04in 0; font-size: .088in; line-height: 1.34; }
.products span { padding: 0 .03in; }
.products strong { font-size: .098in; }
.story { display: grid; place-content: center; height: .62in; padding: .05in 0; border-top: 1px solid #000; }
.story h3 { font-size: .095in; text-transform: uppercase; }
.story p { margin-top: .04in; font-size: .078in; line-height: 1.32; }

.visit { display: grid; grid-template-columns: .75in 1fr; gap: .12in; align-items: center; height: 1.05in; text-align: left; padding: .08in .10in; }
.visit img { width: .73in; height: .73in; }
.visit h3 { font-size: .105in; text-transform: uppercase; }
.visit p { margin-top: .035in; font-size: .073in; line-height: 1.42; }

.coupon-footer { display: grid; align-content: center; height: .57in; border-top: 1px solid #000; padding-top: .035in; }
.dates { font-size: .066in; }
.dates span { padding: 0 .035in; }
.code { margin-top: .035in !important; font-size: .069in; font-weight: 800; }
.terms { margin-top: .026in !important; font-size: .048in; }

@media (max-width: 820px) {
  .workspace { grid-template-columns: 1fr; padding: 18px; gap: 24px; }
  .controls { position: static; padding: 22px; }
  .preview-shell { overflow-x: auto; justify-content: start; padding-bottom: 20px; }
  .coupon-stage { width: min(4in, calc(100vw - 36px)); }
  .coupon { transform-origin: top left; }
}

@media print {
  @page { size: 4in 6in; margin: 0; }
  html, body { width: 4in; height: 6in; margin: 0; background: #fff; }
  .workspace { display: block; width: 4in; margin: 0; padding: 0; }
  .controls { display: none !important; }
  .preview-shell, .coupon-stage { display: block; width: 4in; height: 6in; margin: 0; padding: 0; }
  .coupon { width: 4in; height: 6in; box-shadow: none; break-inside: avoid; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
