/* Story Petal storefront.
   The brand is built from the book pages outward: warm paper, one signature coral (the petal), a rounded
   display face like the lettering on the covers, and one highlighted letter per caption. */
:root {
  --paper: #FFFBF4; --soft: #FFF1E8; --ink: #2A2330; --charcoal: #3A3340; --muted: #6F6474; --line: #EADFD6;
  --petal: #E8604C; --petal-dark: #C94A38; --petal-tint: #F3A897; --marigold: #F2B441; --leaf: #5C9C6E; --leaf-dark: #467D56; --sky: #4A86CF; --plum: #7B5EA7;
  /* legacy names used throughout the stylesheet */
  --rose: var(--petal); --rose-dark: var(--petal-dark); --sage: var(--leaf); --sage-dark: var(--leaf-dark); --honey: var(--marigold); --cream: var(--paper);
  --white: #fff; --danger: #b43b3b; --ok: #2f7d5a;
  --display: 'Fredoka', 'Nunito', system-ui, sans-serif; --sans: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif; --serif: var(--display);
  --radius: 18px; --shadow: 0 1px 2px rgba(42,35,48,.05), 0 12px 30px -14px rgba(42,35,48,.22);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--charcoal); font-family: var(--sans); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--display); color: var(--ink); line-height: 1.1; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); } h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); } h3 { font-size: 1.3rem; }
.h4 { font-size: 1.15rem; margin-bottom: .75rem; } .h5 { font-size: 1rem; margin: 1rem 0 .5rem; }
p { margin: 0 0 1em; } a { color: var(--rose-dark); } a:hover { color: var(--rose); }
img { max-width: 100%; height: auto; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.container { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(820px, 100%); margin-inline: auto; }
.center { text-align: center; } .muted { color: var(--muted); } .small { font-size: .875rem; } .lead { font-size: 1.2rem; color: #4d4554; }
.inline { display: inline; } .gap-lg { gap: 2rem; }

/* header / footer */
.site-header { background: rgba(255,251,244,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 0; }
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); }
.brand img { width: 40px; height: 40px; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 1.35rem; letter-spacing: -.01em; }
.site-nav { display: flex; align-items: center; gap: 1.1rem; }
.site-nav a { color: var(--charcoal); text-decoration: none; font-weight: 700; font-size: .95rem; }
.site-nav a:hover { color: var(--petal-dark); }
.nav-toggle { display: none; border: 2px solid var(--line); background: #fff; border-radius: 999px; width: 44px; height: 44px; font-size: 1.2rem; cursor: pointer; color: var(--ink); }
@media (max-width: 760px) {
  .nav-toggle { display: inline-grid; place-items: center; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); padding: 1rem 1.25rem 1.25rem; flex-direction: column; align-items: stretch; gap: .9rem; box-shadow: var(--shadow); }
  .site-nav.open { display: flex; }
  .site-header { position: sticky; }
  .header-inner { position: relative; }
}
.site-main { min-height: 60vh; }
.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 2rem 0; background: #fbf1e6; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: start; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; } .footer-links a { text-decoration: none; }
@media (max-width: 720px) { .footer-inner { grid-template-columns: 1fr; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .75rem 1.35rem; border-radius: 999px; border: 2px solid transparent; font: 800 .95rem var(--sans); text-decoration: none; cursor: pointer; transition: transform .12s, box-shadow .12s, background .12s; line-height: 1.2; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(232,96,76,.55); }
.btn-primary { background: var(--rose); color: #fff; } .btn-primary:hover { background: var(--rose-dark); color: #fff; }
.btn-secondary { background: var(--sage); color: #fff; } .btn-secondary:hover { background: var(--sage-dark); color: #fff; }
.btn-outline { border-color: var(--rose); color: var(--rose-dark); background: transparent; } .btn-outline:hover { background: var(--rose); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-lg { padding: 1rem 1.9rem; font-size: 1.1rem; } .btn-sm { padding: .45rem .95rem; font-size: .85rem; } .btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }
.link-btn { background: none; border: 0; color: var(--rose-dark); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; } .link-btn.danger { color: var(--danger); }
.back-link { display: inline-block; margin-bottom: 1rem; text-decoration: none; font-weight: 500; }
.edit-link { font-family: var(--sans); font-size: .8rem; font-weight: 500; margin-left: .5rem; }

/* sections */
.section { padding: 3.5rem 0; } .section-alt { background: var(--soft); }
.section-title { text-align: center; margin-bottom: 2rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.section-head .section-title { margin-bottom: 0; text-align: left; }
.hero { padding: 3.5rem 0 3rem; background: radial-gradient(ellipse at top left, #fff 0%, var(--paper) 55%); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; }
@media (max-width: 860px) { .hero-inner { grid-template-columns: 1fr; text-align: center; } .hero-actions { justify-content: center; } .hero-facts { justify-content: center; } }
.hero h1 { font-size: clamp(2.5rem, 5.5vw, 4rem); margin-bottom: .6rem; }
.hero h1 .accent { color: var(--petal); }
.hero .lead { max-width: 34rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.5rem 0 1rem; }
.hero-facts { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: .9rem; font-weight: 600; }
.hero-facts li::before { content: '✿'; color: var(--petal-tint); margin-right: .35rem; }
.hero-art { position: relative; }
.page-frame { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 16px; box-shadow: 0 24px 50px -22px rgba(42,35,48,.45), 0 2px 6px rgba(42,35,48,.08); background: var(--soft); }
.hero-art .page-frame { transform: rotate(-1.5deg); }
.hero-badge { position: absolute; right: -.4rem; bottom: -1rem; background: #fff; border-radius: 999px; padding: .55rem 1rem; font-weight: 800; font-size: .9rem; box-shadow: var(--shadow); color: var(--ink); }
.hero-badge b { color: var(--petal); }
.cta-band { background: linear-gradient(135deg, rgba(232,96,76,.12), rgba(242,180,65,.16)); border-radius: var(--radius); margin: 1rem auto; width: min(1120px, 100% - 2.5rem); }

/* cards + grids */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.25rem; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.product-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; } .product-card .btn { margin: auto 1.5rem 1.5rem; align-self: flex-start; }
.product-card > h3, .product-card > p, .product-card > .price-line { margin-left: 1.5rem; margin-right: 1.5rem; }
.product-card > h3 { margin-top: 1.1rem; }
.product-art { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--soft); }
.product-art.tall { object-position: top; }
.product-icon { font-size: 2.2rem; line-height: 1; margin-bottom: .6rem; }
.price-line { margin: .5rem 0 1rem; font-size: .95rem; }
.pack-card { text-decoration: none; color: inherit; display: block; transition: transform .12s; } .pack-card:hover { transform: translateY(-2px); color: inherit; }
.pack-kicker { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--petal-dark); font-weight: 800; margin-bottom: .25rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0 1rem; }
.chip { display: inline-block; padding: .15rem .65rem; border-radius: 999px; background: var(--soft); color: #6b4a44; font-size: .82rem; font-weight: 700; text-decoration: none; }
.chip-more { background: transparent; color: var(--muted); } .chip-active { background: var(--rose); color: #fff; } .chips-lg .chip { font-size: .95rem; padding: .3rem .8rem; }
.steps-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
@media (max-width: 860px) { .steps-grid { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 520px) { .steps-grid { grid-template-columns: 1fr; } }
.step-num { display: inline-flex; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--marigold); color: var(--ink); align-items: center; justify-content: center; font: 600 1.1rem var(--display); margin-bottom: .6rem; }
.steps-grid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; margin-bottom: .75rem; box-shadow: var(--shadow); background: var(--soft); }
.order-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 1rem 0 2rem; } @media (max-width: 600px) { .order-options { grid-template-columns: 1fr; } }
.option-card { display: flex; gap: 1rem; align-items: center; text-decoration: none; color: inherit; margin: 0; } .option-card .product-icon { margin: 0; }
.story-list .story-card { display: flex; justify-content: space-between; gap: 1.5rem; align-items: center; } @media (max-width: 600px) { .story-list .story-card { flex-direction: column; align-items: flex-start; } }
.story-card h3 { font-size: 1.15rem; } .story-card p { margin-bottom: .4rem; }
.how-list { padding-left: 1.2rem; } .how-list li { margin-bottom: 1.25rem; } .how-list h3 { margin-bottom: .25rem; }
.faq dt { font-weight: 700; margin-top: 1.25rem; } .faq dd { margin: .25rem 0 0; }

/* flash */
.flash { padding: .8rem 1rem; border-radius: 10px; margin: 1rem 0 0; font-weight: 500; }
.flash-success { background: #e6f4ec; color: #1f5f43; } .flash-error { background: #fbe4e4; color: #8f2a2a; } .flash-info { background: #eef2fb; color: #33466f; }
.notice { border-left: 5px solid var(--honey); }

/* forms */
.form-card { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend, .field-label { font-weight: 600; font-size: .92rem; }
.field-inline { flex-direction: row; align-items: center; gap: .75rem; } .field-inline input { width: 5rem; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: .65rem .8rem; border: 1px solid #dccfc4; border-radius: 10px; font: inherit; color: var(--ink); background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(199,107,138,.2); }
textarea { resize: vertical; }
.error { display: block; color: var(--danger); font-style: normal; font-size: .875rem; }
.radio-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; padding: .7rem .9rem; border: 1px solid #dccfc4; border-radius: 10px; margin-bottom: .5rem; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--rose); background: #fdf3f6; }
.radio-price { font-weight: 700; }
.radio-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.radio-pill { position: relative; } .radio-pill input { position: absolute; opacity: 0; }
.radio-pill span { display: inline-block; padding: .45rem .9rem; border: 1px solid #dccfc4; border-radius: 999px; cursor: pointer; font-weight: 500; }
.radio-pill input:checked + span { background: var(--rose); border-color: var(--rose); color: #fff; }
.radio-pill input:focus-visible + span { box-shadow: 0 0 0 3px rgba(199,107,138,.3); }
.checkbox { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; } .checkbox input { margin-top: .3rem; }
.form-actions { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: .5rem; }
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; } .inline-form input { width: auto; min-width: 16rem; }
.tips { margin-top: .5rem; font-size: .9rem; } .tips summary { cursor: pointer; font-weight: 600; color: var(--rose-dark); } .tips ul { margin: .5rem 0 0; padding-left: 1.2rem; }

/* stepper */
.stepper { list-style: none; padding: 0; margin: 0 0 1.75rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; counter-reset: s; }
.stepper li { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); padding-bottom: .5rem; border-bottom: 3px solid var(--line); }
.stepper li.current { color: var(--ink); border-color: var(--rose); font-weight: 600; } .stepper li.done { color: var(--sage-dark); border-color: var(--sage); }
.stepper-num { display: inline-flex; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--line); align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; }
.stepper li.current .stepper-num { background: var(--rose); color: #fff; } .stepper li.done .stepper-num { background: var(--sage); color: #fff; }
@media (max-width: 600px) { .stepper-label { display: none; } .stepper li.current .stepper-label { display: inline; } }

/* order lines */
.order-lines { list-style: none; padding: 0; margin: 0 0 .75rem; } .order-lines li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.line-right { display: flex; gap: .6rem; align-items: center; white-space: nowrap; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; margin: 0 0 1rem; } .totals dt { color: var(--muted); } .totals dd { margin: 0; text-align: right; }
.totals .total { font-weight: 700; color: var(--ink); font-size: 1.1rem; }

/* uploader */
.dropzone { border: 2px dashed var(--sage); border-radius: var(--radius); padding: 1.5rem; text-align: center; background: rgba(123,168,153,.08); cursor: pointer; transition: background .12s, border-color .12s; }
.dropzone:hover, .dropzone.drag { background: rgba(199,107,138,.08); border-color: var(--rose); }
.dropzone-icon { font-size: 2rem; }
.thumbs { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .6rem; }
.thumbs li { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #eee; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs li.uploading::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.55); }
.thumbs .bar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--rose); width: 0; z-index: 2; }
.thumb-remove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: .7rem; cursor: pointer; }
.thumbs-static li { aspect-ratio: 1; }
.upload-status { margin-top: .5rem; }

/* tracking */
.track-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.track-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: var(--shadow); }
.timeline { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .1rem; }
.timeline li { display: grid; grid-template-columns: 1.6rem 1fr; align-items: baseline; gap: .4rem .75rem; padding: .55rem 0; position: relative; color: var(--muted); }
.timeline li::before { content: ''; position: absolute; left: .75rem; top: 0; bottom: 0; width: 2px; background: var(--line); transform: translateX(-1px); }
.timeline li:first-child::before { top: 50%; } .timeline li:last-child::before { bottom: 50%; }
.timeline-dot { width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #fff; border: 3px solid var(--line); z-index: 1; justify-self: center; align-self: center; }
.timeline li.done { color: var(--sage-dark); } .timeline li.done .timeline-dot { background: var(--sage); border-color: var(--sage); }
.timeline li.current { color: var(--ink); font-weight: 600; } .timeline li.current .timeline-dot { background: var(--rose); border-color: var(--rose); box-shadow: 0 0 0 5px rgba(199,107,138,.25); }
.timeline-detail { grid-column: 2; font-weight: 400; font-size: .9rem; color: var(--muted); }
.download-list { list-style: none; padding: 0; margin: 0 0 .75rem; } .download-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); }

/* admin */
.admin-body { background: #f6f2ec; } .admin-header { background: #2f2a2b; color: #fff; } .admin-header .brand, .admin-header .site-nav a { color: #fff; } .admin-header .link-btn { color: #f3d3de; }
.admin-main { padding: 2rem 0; }
.badge { background: var(--rose); color: #fff; border-radius: 999px; padding: 0 .45rem; font-size: .75rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.stat { text-decoration: none; color: inherit; margin: 0; text-align: center; padding: 1rem; } .stat-num { font: 700 2rem var(--serif); color: var(--rose-dark); }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 1.5rem; font-size: .92rem; }
.table th, .table td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; } .table th { background: #faf5ef; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.status { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eee; color: #444; vertical-align: middle; }
.status-paid { background: #fff3d6; color: #7a5a00; } .status-in_production { background: #e3ecfb; color: #2c4f8f; } .status-ready_for_review { background: #fbe4ee; color: #8a3358; }
.status-delivered, .status-shipped { background: #e6f4ec; color: #1f5f43; } .status-needs_attention { background: #fbe4e4; color: #8f2a2a; } .status-awaiting_payment { background: #f1ebff; color: #5a3e9c; }
.status-cancelled, .status-refunded { background: #eee; color: #777; }
.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: .5rem 0 1rem; } .progress div { height: 100%; background: var(--rose); }
.action-list { display: flex; flex-direction: column; gap: .5rem; } .action-list form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; } .action-list input[type=text] { width: auto; flex: 1; min-width: 10rem; }
.note-form { display: flex; gap: .5rem; margin-top: 1rem; }
.events { list-style: none; padding: 0; margin: 0; max-height: 420px; overflow: auto; } .events li { padding: .45rem 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.deliv-thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; margin-right: .5rem; vertical-align: middle; }
.token { background: #2f2a2b; color: #f8e9ef; padding: .8rem 1rem; border-radius: 10px; overflow: auto; user-select: all; }

/* ------------------------------------------------------------------ create your character (step 2) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.center-head { text-align: center; margin-bottom: 1.5rem; } .center-head .accent { color: var(--rose); }
.character-form { display: block; }
.source-picker { border: 0; padding: 0; margin: 0 0 1.5rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 760px) { .source-picker { grid-template-columns: 1fr; } }
.source-card { position: relative; display: flex; flex-direction: column; gap: .35rem; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: .9rem; cursor: pointer; transition: transform .12s, border-color .12s, box-shadow .12s; }
.source-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.source-card input { position: absolute; opacity: 0; pointer-events: none; }
.source-card:has(input:checked) { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(199,107,138,.15), var(--shadow); }
.source-card:has(input:focus-visible) { outline: 3px solid rgba(199,107,138,.5); outline-offset: 2px; }
.source-card::after { content: '✓'; position: absolute; top: .65rem; right: .65rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--rose); color: #fff; font-size: .85rem; font-weight: 700; display: grid; place-items: center; opacity: 0; transform: scale(.6); transition: .15s; z-index: 1; }
.source-card:has(input:checked)::after { opacity: 1; transform: scale(1); }
.source-title { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); }
.source-blurb { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.source-badge { align-self: flex-start; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--rose-dark); background: #fdf0f4; padding: .2rem .55rem; border-radius: 999px; margin-top: .2rem; }
.source-art { display: block; height: 118px; border-radius: 10px; background: linear-gradient(135deg, #fdf3f6, #f3efe6); position: relative; overflow: hidden; }
.art-polaroid { position: absolute; width: 50px; height: 60px; background: #fff; border-radius: 4px; box-shadow: 0 4px 10px -4px rgba(0,0,0,.35); padding: 4px 4px 12px; }
.art-polaroid::before { content: ''; display: block; width: 100%; height: 100%; border-radius: 2px; background: linear-gradient(160deg, #f6c8b0, #c76b8a); }
.art-polaroid.p1 { left: 20%; top: 26px; transform: rotate(-12deg); } .art-polaroid.p1::before { background: linear-gradient(160deg, #ffd9a8, #e8a37a); }
.art-polaroid.p2 { left: 40%; top: 16px; transform: rotate(3deg); z-index: 1; }
.art-polaroid.p3 { left: 60%; top: 28px; transform: rotate(12deg); } .art-polaroid.p3::before { background: linear-gradient(160deg, #cfe7dc, #7ba899); }
.art-bubble { position: absolute; left: 10%; right: 10%; top: 24px; background: #fff; border-radius: 14px; padding: .55rem .75rem; font-family: var(--serif); font-style: italic; font-size: .86rem; line-height: 1.35; color: var(--ink); box-shadow: 0 4px 10px -4px rgba(0,0,0,.25); }
.art-bubble::after { content: ''; position: absolute; left: 26px; bottom: -9px; border: 10px solid transparent; border-top-color: #fff; border-bottom: 0; }
.art-bubble i { display: inline-block; width: 2px; height: .9em; background: var(--rose); vertical-align: -2px; margin-left: 1px; animation: sp-blink 1s steps(2) infinite; }
@keyframes sp-blink { 50% { opacity: 0; } }
.art-steps { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem; }
.art-chipsrow { display: flex; gap: .3rem; } .art-chipsrow b { font-weight: 600; font-size: .7rem; padding: .18rem .5rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); }
.art-chipsrow b.on { background: var(--rose); border-color: var(--rose); color: #fff; }
.art-swatches { display: flex; gap: .3rem; } .art-swatches i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.art-track { display: flex; gap: .4rem; } .art-track i { width: 8px; height: 8px; border-radius: 50%; background: #e6d6dc; } .art-track i.on { background: var(--rose); }
@media (prefers-reduced-motion: reduce) { .art-bubble i { animation: none; } .source-card, .chip-face, .btn { transition: none; } }

.character-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.character-main, .character-side { min-width: 0; }
.character-side { position: sticky; top: 84px; }
.character-card { text-align: center; } .character-card-body { min-width: 0; }
.avatar { display: block; width: 100%; aspect-ratio: 1; } .avatar svg { width: 100%; height: 100%; display: block; }
.avatar-lg { max-width: 220px; margin: 0 auto .5rem; } .avatar-sm { width: 96px; height: 96px; flex: none; }
.track-avatar.avatar { width: 96px; height: 96px; flex: none; background: #fdf1e4; }
.character-card-name { font-family: var(--serif); font-size: 1.35rem; color: var(--ink); margin-bottom: .5rem; }
.trait-chips { list-style: none; padding: 0; margin: 0 0 .75rem; display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; }
.trait-chips.left { justify-content: flex-start; margin-top: .5rem; }
.trait-chips li { font-size: .78rem; background: #f4e9e0; color: #6b5250; padding: .15rem .55rem; border-radius: 999px; } .trait-chips li b { color: var(--ink); font-weight: 600; }
.kind-emoji { margin-right: .3rem; }

/* family members in the stories */
.family-member { border: 1px dashed var(--line); border-radius: 14px; padding: 1rem; }
.family-member legend { font-weight: 800; padding: 0 .4rem; }
.uploader-small .dropzone { padding: .8rem; }

/* identity details: shown for children in photo and describe modes (the builder asks its own way) */
.character-form [data-panel="identity"] { display: none; }
.character-form:has(input[name="character_kind"][value="child"]:checked):not(:has(input[name="character_source"][value="build"]:checked)) [data-panel="identity"] { display: flex; }

/* which panels show depends on the chosen source / kind — pure CSS so it also works without JS */
.character-form [data-panel="build"], .character-form [data-panel="preview"], .character-form [data-desc-copy], .character-form [data-photos-copy], .character-form .builder-note, .character-form .builder-kind { display: none; }
.character-form:has(input[name="character_source"][value="build"]:checked) [data-panel="build"] { display: flex; }
.character-form:has(input[name="character_source"][value="build"]:checked) [data-panel="preview"] { display: block; }
.character-form:has(input[name="character_source"][value="build"]:checked) .character-layout { grid-template-columns: minmax(0, 1fr) 300px; }
@media (max-width: 900px) {
  .character-form:has(input[name="character_source"][value="build"]:checked) .character-layout { grid-template-columns: minmax(0, 1fr); }
  .character-side { order: -1; position: static; }
  .character-card { display: flex; align-items: center; gap: 1rem; text-align: left; }
  .character-card .avatar-lg { width: 110px; flex: none; margin: 0; }
  .character-card .trait-chips { justify-content: flex-start; margin-bottom: 0; }
  .character-card .character-card-name { font-size: 1.15rem; margin-bottom: .3rem; }
  .character-card p { display: none; }
}
.character-form:has(input[name="character_source"][value="photos"]:checked) [data-desc-copy="photos"],
.character-form:has(input[name="character_source"][value="describe"]:checked) [data-desc-copy="describe"],
.character-form:has(input[name="character_source"][value="build"]:checked):has(input[name="character_kind"][value="other"]:checked) [data-desc-copy="describe"],
.character-form:has(input[name="character_source"][value="build"]:checked):not(:has(input[name="character_kind"][value="other"]:checked)) [data-desc-copy="build"] { display: block; }
.character-form:has(input[name="character_source"][value="build"]:checked):has(input[name="character_kind"][value="other"]:checked) [data-desc-copy="describe"].desc-examples { display: flex; }
.character-form:has(input[name="character_source"][value="describe"]:checked) .desc-examples { display: flex; }
.character-form:has(input[name="character_source"][value="photos"]:checked) [data-photos-copy="photos"],
.character-form:not(:has(input[name="character_source"][value="photos"]:checked)) [data-photos-copy="optional"] { display: block; }
.character-form:not(:has(input[name="character_kind"]:checked)) [data-builder-nokind],
.character-form:has(input[name="character_kind"][value="other"]:checked) [data-builder-other] { display: block; }
.character-form:has(input[name="character_kind"][value="child"]:checked) [data-kind-steps="child"],
.character-form:has(input[name="character_kind"][value="pet"]:checked) [data-kind-steps="pet"],
.character-form:has(input[name="character_kind"][value="toy"]:checked) [data-kind-steps="toy"] { display: block; }
.builder-note { padding: 1rem; border: 1px dashed var(--line); border-radius: 10px; text-align: center; color: var(--muted); margin: 0; }

/* the guided builder */
.builder-head p { margin-bottom: 0; }
.builder-kind { border: 0; padding: 0; margin: 0; min-width: 0; }
.builder-tabs { list-style: none; padding: 0 0 .35rem; margin: 0 0 .75rem; display: flex; flex-wrap: wrap; gap: .35rem; }
@media (max-width: 640px) { .builder-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; } }
.builder-tabs:empty { display: none; }
.builder-tabs button { white-space: nowrap; border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 999px; padding: .35rem .75rem; font: 500 .82rem var(--sans); cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
.builder-tabs button::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #e6d6dc; }
.builder-tabs li.done button::before { background: var(--sage); }
.builder-tabs li.current button { border-color: var(--rose); color: var(--ink); background: #fdf3f6; } .builder-tabs li.current button::before { background: var(--rose); }
.builder-step { padding-top: .25rem; }
.builder-step-title { font-family: var(--sans); font-size: 1rem; font-weight: 700; margin: 0 0 .15rem; }
.builder-hint { margin-bottom: .25rem; }
.chips-grid { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.chip-opt { position: relative; } .chip-opt input { position: absolute; opacity: 0; pointer-events: none; }
.chip-face { display: inline-flex; align-items: center; gap: .45rem; padding: .42rem .85rem; border: 1px solid #dccfc4; border-radius: 999px; background: #fff; cursor: pointer; font-weight: 500; font-size: .92rem; transition: border-color .12s, background .12s, transform .12s; }
.chip-opt.has-swatch .chip-face { padding-left: .45rem; }
.chip-face:hover { border-color: var(--rose); transform: translateY(-1px); }
.chip-opt input:checked + .chip-face { background: var(--rose); border-color: var(--rose); color: #fff; }
.chip-opt input:focus-visible + .chip-face { box-shadow: 0 0 0 3px rgba(199,107,138,.35); }
.chip-opt input:disabled + .chip-face { opacity: .45; cursor: not-allowed; transform: none; }
.swatch { width: 22px; height: 22px; border-radius: 50%; background: var(--sw); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.14); flex: none; }
.swatch-rainbow { background: conic-gradient(#e0453b, #f2c531, #5aa856, #3f7fd6, #8a5bc7, #e0453b); }
.chip-emoji { font-size: 1.1rem; line-height: 1; }
.builder-other { max-width: 22rem; margin-top: .25rem; } .builder-other[hidden] { display: none; }
.builder-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed var(--line); }
.builder-nav[hidden] { display: none; }
.desc-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: -.25rem; } .desc-tools[hidden] { display: none; }
.link-btn.small { font-size: .85rem; }
.desc-examples { flex-wrap: wrap; gap: .4rem; align-items: center; }
.chip-btn { border: 1px solid #dccfc4; background: #fff; cursor: pointer; font: 500 .82rem var(--sans); }
.chip-btn:hover { border-color: var(--rose); color: var(--rose-dark); }
.review-character { display: flex; gap: 1rem; align-items: flex-start; } .review-character > div { min-width: 0; }
.source-chip { background: #eef2fb; color: #33466f; }

/* painted previews (optional fal.ai / mock renderer) */
.preview-box { border-top: 1px dashed var(--line); padding-top: .9rem; display: flex; flex-direction: column; gap: .6rem; }
.preview-head { display: flex; flex-direction: column; gap: .2rem; }
.preview-figure { margin: 0; }
.preview-figure img { display: block; width: 100%; max-width: 320px; aspect-ratio: 1; object-fit: cover; border-radius: 14px; box-shadow: var(--shadow); background: #f3efe6; transition: opacity .2s; }
.preview-figure figcaption { margin-top: .35rem; }
.preview-box.is-busy .preview-figure img { opacity: .45; }
.preview-box.is-busy [data-preview-generate], .preview-box.is-busy [data-preview-again] { position: relative; }
.preview-box.is-busy [data-preview-generate]::after, .preview-box.is-busy [data-preview-again]::after { content: ''; width: 1em; height: 1em; margin-left: .4rem; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: sp-spin .8s linear infinite; }
@keyframes sp-spin { to { transform: rotate(360deg); } }
.preview-actions { display: flex; flex-wrap: wrap; gap: .5rem; } .preview-actions [hidden] { display: none; }
.preview-status { margin: 0; min-height: 1.2em; }
.btn.is-chosen { background: var(--sage); border-color: var(--sage); color: #fff; }
.preview-thumb { object-fit: cover; border-radius: 50%; box-shadow: var(--shadow); }
.character-form:has(input[name="character_source"][value="photos"]:checked) [data-preview-box] { display: none; }

/* meet your character (approval step on the tracking page) */
.meet-card { border-left: 5px solid var(--rose); }
.candidates { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin: 1rem 0; }
.candidate { display: flex; flex-direction: column; gap: .6rem; margin: 0; }
.candidate img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); background: #f3efe6; }
.retry-box { margin-top: .5rem; } .retry-box form { margin-top: .75rem; }
.candidates-admin li.chosen { outline: 3px solid var(--sage); }
.candidates-admin li { aspect-ratio: auto; display: flex; flex-direction: column; gap: .3rem; background: none; align-items: center; }
.candidates-admin img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }

/* caption pill: the product's smallest signature, reused on the site */
.cap { display: inline-block; font-family: var(--display); font-weight: 600; font-size: 1.05rem; line-height: 1; padding: .55rem 1rem; border: 2px solid var(--line); border-radius: 999px; background: #fff; box-shadow: var(--shadow); white-space: nowrap; color: var(--ink); }
.cap .t { color: var(--petal); }

/* sample flipbook */
.flipbook { display: grid; gap: 1rem; }
.flipbook-stage { position: relative; }
.flipbook-stage img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 16px; box-shadow: var(--shadow); background: var(--soft); }
.flipbook-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.flipbook-thumbs { display: grid; grid-template-columns: repeat(10, 1fr); gap: .4rem; list-style: none; padding: 0; margin: 0; }
@media (max-width: 600px) { .flipbook-thumbs { grid-template-columns: repeat(5, 1fr); } }
.flipbook-thumbs button { border: 3px solid transparent; padding: 0; background: none; border-radius: 8px; cursor: pointer; overflow: hidden; }
.flipbook-thumbs button.current { border-color: var(--petal); }
.flipbook-thumbs img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.sample-note { display: flex; gap: 1rem; align-items: center; }
.sample-note img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow); flex: none; }

/* trust strip */
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 700px) { .trust { grid-template-columns: 1fr; } }
.trust .card { margin: 0; }
.trust h3 { font-size: 1.1rem; margin-bottom: .3rem; }

/* step 1: visual picker */
.picker-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .picker-layout { grid-template-columns: 1fr; } }
.order-summary { position: sticky; top: 84px; }
.picker-group { border: 0; padding: 0; margin: 0 0 1.75rem; }
.picker-group > legend { font-family: var(--display); font-weight: 600; font-size: 1.15rem; color: var(--ink); margin-bottom: .6rem; }
.picker-group[hidden] { display: none; }
.product-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; }
.product-choice { position: relative; } .product-choice input { position: absolute; opacity: 0; pointer-events: none; }
.product-choice-face { display: flex; flex-direction: column; gap: .3rem; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: .6rem .6rem .8rem; cursor: pointer; height: 100%; transition: border-color .12s, box-shadow .12s, transform .12s; }
.product-choice-face img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; background: var(--soft); }
.product-choice-face strong { font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--ink); }
.product-choice-face small { line-height: 1.35; } .product-choice-face .price { font-style: normal; font-weight: 800; color: var(--petal-dark); font-size: .9rem; }
.product-choice input:checked + .product-choice-face { border-color: var(--petal); box-shadow: 0 0 0 4px rgba(232,96,76,.15), var(--shadow); }
.product-choice input:focus-visible + .product-choice-face { outline: 3px solid rgba(232,96,76,.5); outline-offset: 2px; }
.pack-choices { display: flex; flex-wrap: wrap; gap: .45rem; }
.pack-choice { position: relative; } .pack-choice input { position: absolute; opacity: 0; pointer-events: none; }
.pack-choice .chip-face b { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--soft); color: var(--petal-dark); font-size: .75rem; }
.pack-choice input:checked + .chip-face { background: var(--petal); border-color: var(--petal); color: #fff; } .pack-choice input:checked + .chip-face b { background: rgba(255,255,255,.25); color: #fff; }
.pack-choice input:focus-visible + .chip-face { box-shadow: 0 0 0 3px rgba(232,96,76,.35); }
.story-choices { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (max-width: 640px) { .story-choices { grid-template-columns: 1fr; } }
.story-choice { position: relative; } .story-choice input { position: absolute; opacity: 0; pointer-events: none; }
.story-choice-face { display: flex; flex-direction: column; gap: .25rem; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: .75rem .85rem; cursor: pointer; height: 100%; }
.story-choice-face strong { font-family: var(--display); font-weight: 600; color: var(--ink); } .story-choice-face small { color: var(--charcoal); line-height: 1.4; } .story-choice-face em { font-style: normal; font-size: .8rem; }
.story-choice input:checked + .story-choice-face { border-color: var(--petal); box-shadow: 0 0 0 4px rgba(232,96,76,.15); }
.story-choice input:focus-visible + .story-choice-face { outline: 3px solid rgba(232,96,76,.5); outline-offset: 2px; }
.format-choices .radio-card { background: #fff; }

/* --- email sign-up, discount codes, admin stats --- */
.signup { display: grid; grid-template-columns: 160px 1fr; gap: 1.5rem; align-items: center; }
.signup img { width: 160px; border-radius: 10px; box-shadow: var(--shadow); }
.signup-form { display: flex; gap: .6rem; flex-wrap: wrap; margin: .6rem 0; }
.signup-form input[type=email] { flex: 1 1 240px; min-width: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.coupon-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .6rem; }
.coupon-form input { flex: 1 1 140px; min-width: 0; text-transform: uppercase; }
.totals .discount { color: #2f7d4b; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1rem 0 1.5rem; }
.stat { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; text-align: center; }
.stat b { display: block; font-size: 1.8rem; }
.stat span { font-size: .9rem; opacity: .75; }
@media (max-width: 640px) { .signup { grid-template-columns: 1fr; } .signup img { width: 120px; } .stats { grid-template-columns: 1fr 1fr; } }
