:root {
  --paper: #faf6ee; --card: #fffdf8; --ink: #1d1a17; --soft: #6a6157; --line: #e6dccd;
  --pine: #234a3d; --pine-ink: #fff; --berry: #8c2f39; --chip: #f1e9db; --warn: #8a4b12;
  --serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang TC', 'Noto Sans TC', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); }
a { color: var(--pine); }
img { max-width: 100%; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.top { border-bottom: 1px solid var(--line); background: var(--card); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font: 600 20px/1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.top nav { display: flex; gap: 16px; font-size: 14px; }
.top nav a { color: var(--soft); text-decoration: none; }
.banner { background: #f6ecd2; color: #5a4310; font-size: 13px; text-align: center; padding: 7px 16px; border-bottom: 1px solid #ead9a8; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 15px/1 var(--sans); min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--pine); background: var(--pine); color: var(--pine-ink); text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--pine); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, .strip button:focus-visible { outline: 2px solid var(--berry); outline-offset: 2px; }
footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 0 40px; color: var(--soft); font-size: 13px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
footer nav { display: flex; gap: 16px; flex-wrap: wrap; }

/* catalogue */
.hero { padding: 44px 0 20px; max-width: 640px; }
.hero h1 { font: 600 clamp(32px, 6vw, 48px)/1.1 var(--serif); margin: 0 0 12px; }
.hero p { margin: 0; color: var(--soft); font-size: 17px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; padding: 20px 0; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.tile .pic { aspect-ratio: 3 / 4; background: var(--chip); }
.tile .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .body { padding: 16px; display: grid; gap: 6px; }
.tile h2 { margin: 0; font: 600 22px/1.2 var(--serif); }
.tile .meta { color: var(--soft); font-size: 13px; }
.tile .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.price { font-weight: 600; }
.soon { background: transparent; border-style: dashed; justify-content: center; align-items: center; text-align: center; padding: 28px; color: var(--soft); min-height: 200px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 12px 0; }
.how div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.how b { display: block; margin-bottom: 4px; }
h2.sec { font: 600 22px/1.2 var(--serif); margin: 36px 0 4px; }

/* editor */
.make { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 28px; padding: 24px 0; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: grid; gap: 14px; }
.panel h1 { font: 600 24px/1.2 var(--serif); margin: 0; }
.panel .sub { color: var(--soft); font-size: 14px; margin: 0; }
.field { display: grid; gap: 4px; }
.field label { font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; }
.field .count { font-weight: 400; color: var(--soft); font-size: 12.5px; }
.field input, .field textarea { font: inherit; font-size: 16px; /* 16px: stops iOS Safari zooming into the field */ padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); width: 100%; }
.field textarea { resize: vertical; min-height: 120px; }
.strip { display: flex; gap: 10px; flex-wrap: wrap; }
.strip button { display: grid; grid-template-columns: 44px auto; gap: 10px; align-items: center; text-align: left; font: inherit; font-size: 14px; padding: 6px 12px 6px 6px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; color: var(--ink); }
.strip button[aria-pressed="true"] { border-color: var(--pine); box-shadow: 0 0 0 1px var(--pine); }
.strip img { width: 44px; height: 58px; object-fit: cover; border-radius: 6px; }
.strip small { display: block; color: var(--soft); }
.note { font-size: 13px; color: var(--soft); margin: 0; }
.note.warn { color: var(--warn); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.buy { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.stage { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; position: sticky; top: 12px; }
.stage .bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--berry); color: #fff; }
.stage iframe { display: block; width: 100%; height: min(76vh, 760px); border: 0; background: #fff; }
.stage .cap { margin: 0; padding: 8px 12px; border-top: 1px solid var(--line); }
.only-phone { display: none; }
.close { position: absolute; top: 10px; left: 10px; z-index: 3; }

@media (max-width: 860px) {
  .make { grid-template-columns: 1fr; padding-top: 14px; }
  .how { grid-template-columns: 1fr; }
  .only-phone { display: inline-flex; }
  /* on phones the preview is a full-screen sheet so the card gets the whole screen, as a recipient's phone would */
  .stage { position: fixed; inset: 0; z-index: 20; border: 0; border-radius: 0; display: none; background: #fff; }
  .stage.on { display: block; }
  .stage .bar, .stage .cap { position: absolute; left: 0; right: 0; z-index: 3; border: 0; background: transparent; pointer-events: none; }
  .stage .bar { top: 0; padding-top: max(8px, env(safe-area-inset-top)); justify-content: center; }
  .stage .bar > * { pointer-events: auto; }
  .stage .bar .close { position: absolute; left: 10px; top: max(6px, env(safe-area-inset-top)); }
  .stage .cap { bottom: 78px; text-align: center; }
  .stage iframe { height: 100%; }
}
.legal { max-width: 760px; padding: 28px 16px 8px; }
.legal h1 { font: 600 32px/1.15 var(--serif); margin: 0 0 6px; }
.legal h2 { font: 600 19px/1.3 var(--serif); margin: 26px 0 4px; }
.legal p, .legal li { color: #3a342e; }
.draftbox { background: #fdeede; border: 1px solid #efc79a; border-radius: 12px; padding: 12px 14px; font-size: 14px; color: #6b3a0a; margin: 14px 0; }
.todo { background: #fff3a8; padding: 0 3px; border-radius: 3px; }
