/* Family Recipe Book Builder — shared design system.
   Warm print-kitchen feel: cream paper, ink text, terracotta accent.
   Same self-hosted faces as the book itself, so site and book read as one brand. */
@import url("/shared/css/fonts.css");

:root {
  --paper: #faf6ef;
  --paper-deep: #f3ecdf;
  --ink: #2c2420;
  --ink-soft: #5f5348;
  --accent: #c2542b;      /* terracotta */
  --accent-dark: #a03f1c;
  --green: #3e5c46;
  --gold: #b98a2e;
  --card: #fffdf8;
  --line: #e2d8c6;
  --danger: #a03030;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(44, 36, 32, 0.10);
  --serif: Fraunces, Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --hand: Caveat, "Bradley Hand", "Segoe Script", cursive;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* The hidden attribute must always win, even over display classes like .row/.btn */
[hidden] { display: none !important; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}
/* The /keep audience gets bigger type everywhere */
body.big-type { font-size: 19px; }

h1, h2, h3, .serif { font-family: var(--serif); line-height: 1.15; font-weight: 600; }
.hero h1, .capture-hero h1, .final-cta h2, .auth-panel h1 { font-weight: 900; letter-spacing: -0.01em; }

img { max-width: 100%; }
a { color: var(--accent-dark); }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 246, 239, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; padding-bottom: 12px;
}
.logo {
  font-family: var(--serif); font-size: 1.35rem; font-weight: 600;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.header-actions { display: flex; gap: 10px; align-items: center; }
.header-link { color: var(--ink-soft); font-weight: 600; font-size: .95rem; text-decoration: none; white-space: nowrap; }
.header-link:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 480px) {
  .logo { font-size: 1.12rem; }
  .site-header .btn-small { padding: 8px 14px; font-size: .85rem; }
  .cta-long { display: none; }
}
@media (min-width: 481px) { .cta-short { display: none; } }
.logo .spoon { color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  font-family: var(--sans); font-weight: 700; font-size: 1rem;
  padding: 14px 28px; border-radius: 999px; transition: background .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn-secondary:hover { box-shadow: inset 0 0 0 2px var(--ink-soft); }
.btn-big { font-size: 1.15rem; padding: 18px 40px; }
.btn-small { font-size: .9rem; padding: 9px 18px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- landing sections ---------- */
.hero { padding: 72px 0 56px; text-align: center; }
.hero h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.4rem);
  max-width: 21ch; margin: 0 auto 18px;
}
.hero .sub {
  font-size: 1.2rem; color: var(--ink-soft);
  max-width: 54ch; margin: 0 auto 30px;
}
.hero .cta-note { margin-top: 12px; color: var(--ink-soft); font-size: .95rem; }

.section { padding: 64px 0; }
.section.alt { background: var(--paper-deep); }
.section h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  text-align: center; margin-bottom: 12px;
}
.section .lede {
  text-align: center; color: var(--ink-soft);
  max-width: 60ch; margin: 0 auto 40px;
}

.cols { display: grid; gap: 28px; }
@media (min-width: 760px) { .cols-3 { grid-template-columns: repeat(3, 1fr); } .cols-2 { grid-template-columns: repeat(2, 1fr); } }

.step-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); text-align: center;
}
.step-card .step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 1.2rem;
  margin-bottom: 14px;
}
.step-card h3 { margin-bottom: 8px; }
.step-card p { color: var(--ink-soft); }

/* handwritten card → typed card demo */
.transform-demo {
  display: grid; gap: 18px; align-items: stretch; margin: 44px auto 0; max-width: 880px;
}
@media (min-width: 700px) { .transform-demo { grid-template-columns: 1fr auto 1fr; } }
.demo-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; text-align: left;
}
.demo-card.handwritten {
  background: #fdf9ee;
  background-image: repeating-linear-gradient(transparent, transparent 27px, #e8ddc4 28px);
  font-family: var(--hand); font-size: 1.1rem; line-height: 28px; color: #4a3d33;
  transform: rotate(-1.2deg);
}
.demo-card.handwritten .card-title { font-size: 1.35rem; text-decoration: underline; }
.demo-arrow {
  align-self: center; justify-self: center; font-size: 2rem; color: var(--accent);
  font-family: var(--serif);
}
.demo-card.typed .card-title {
  font-family: var(--serif); font-size: 1.3rem; margin-bottom: 4px;
}
.demo-card.typed .attribution { color: var(--gold); font-style: italic; font-size: .95rem; margin-bottom: 12px; }
.demo-card.typed ul { margin: 0 0 12px 18px; color: var(--ink-soft); }
.demo-card.typed ol { margin: 0 0 0 18px; color: var(--ink-soft); }

/* pricing */
.price-cards { display: grid; gap: 22px; margin-top: 36px; }
@media (min-width: 820px) { .price-cards { grid-template-columns: repeat(3, 1fr); } }
.price-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px; text-align: center; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
}
.price-card.featured { border: 2px solid var(--accent); position: relative; }
.price-card .flag {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: .8rem; font-weight: 700;
  padding: 4px 14px; border-radius: 999px; white-space: nowrap;
}
.price-card h3 { font-size: 1.25rem; }
.price-card .price { font-family: var(--serif); font-size: 2.3rem; font-weight: 700; }
.price-card .price .was {
  font-size: 1.2rem; color: var(--ink-soft); text-decoration: line-through;
  font-weight: 400; margin-right: 8px;
}
.price-card ul { list-style: none; color: var(--ink-soft); flex: 1; }
.price-card li { padding: 4px 0; }
.price-card li::before { content: "✓ "; color: var(--green); font-weight: 700; }

/* testimonials */
.quote-card {
  background: var(--card); border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 22px 24px; box-shadow: var(--shadow);
}
.quote-card p { font-style: italic; margin-bottom: 10px; }
.quote-card .who { color: var(--ink-soft); font-size: .95rem; }

/* FAQ */
.faq details {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 12px;
}
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin-top: 10px; color: var(--ink-soft); }

.final-cta { text-align: center; padding: 80px 0; }
.final-cta h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 24px; }

.site-footer {
  border-top: 1px solid var(--line); padding: 28px 0; color: var(--ink-soft);
  font-size: .9rem; text-align: center;
}
.site-footer a { color: var(--ink-soft); }

/* ---------- app chrome (builder pages) ---------- */
.app-main { padding: 28px 0 80px; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 22px;
}
.panel h2 { font-size: 1.3rem; margin-bottom: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 4px; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
.field textarea { min-height: 110px; }
.muted { color: var(--ink-soft); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

.recipe-list { list-style: none; }
.recipe-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; margin-bottom: 8px;
}
.recipe-list .thumb {
  width: 52px; height: 52px; object-fit: cover; border-radius: 6px; background: var(--paper-deep);
}
.chip {
  display: inline-block; font-size: .8rem; font-weight: 700; padding: 2px 10px;
  border-radius: 999px; background: var(--paper-deep); color: var(--ink-soft);
}
.chip.ok { background: #e4eee6; color: var(--green); }
.chip.warn { background: #f6e3d3; color: var(--accent-dark); }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: max-content; max-width: calc(100vw - 32px); text-align: center;
  background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 14px;
  box-shadow: 0 6px 24px rgba(44, 36, 32, 0.28); z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity .25s; font-size: .95rem; line-height: 1.4;
}
.toast.show { opacity: 1; }

/* side-by-side digitize view */
.digitize-grid { display: grid; gap: 20px; }
@media (min-width: 860px) { .digitize-grid { grid-template-columns: 1fr 1fr; } }
.original-photo {
  width: 100%; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--paper-deep); min-height: 220px; object-fit: contain;
}

/* ---------- capture-first builder flow ---------- */
.capture-hero { text-align: center; padding: 34px 0 10px; }
.capture-hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin-bottom: 10px; }
.capture-hero p { color: var(--ink-soft); max-width: 46ch; margin: 0 auto 26px; }
.drop-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; min-height: 220px; cursor: pointer; text-align: center;
  background: var(--card); border: 2px dashed var(--accent); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 30px; font-weight: 700; font-size: 1.15rem;
  transition: background .15s;
}
.drop-zone:hover { background: #fff7ec; }
.drop-zone .big { font-size: 2.4rem; }
.drop-zone .hint { font-weight: 400; color: var(--ink-soft); font-size: .95rem; }
.link-quiet {
  background: none; border: 0; cursor: pointer; font: inherit;
  color: var(--ink-soft); text-decoration: underline; padding: 8px;
}
.progress-line { margin-top: 18px; color: var(--ink-soft); text-align: center; }

.title-inline {
  width: 100%; border: 0; background: transparent; font-family: var(--serif);
  font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 700; color: var(--ink);
  padding: 6px 2px; border-bottom: 2px dashed transparent; border-radius: 0;
}
.title-inline:hover, .title-inline:focus { border-bottom-color: var(--line); outline: none; }
.title-inline::placeholder { color: #c9bda9; font-weight: 400; }

.pages-grid { display: grid; gap: 20px 18px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin: 14px 0 26px; }
@media (max-width: 640px) { .pages-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; } }

.cta-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
.cta-bar .note { color: var(--ink-soft); font-size: .92rem; }

.save-banner {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: var(--paper-deep); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 22px; font-size: .95rem;
}
.save-banner input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }

.more-options { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin-bottom: 22px; }
.more-options > summary {
  cursor: pointer; padding: 14px 18px; font-weight: 700; color: var(--ink-soft); list-style: none;
}
.more-options > summary::before { content: "⚙︎ "; }
.more-options .inner { padding: 4px 18px 18px; border-top: 1px solid var(--line); }


/* ---------- sign-in ---------- */
.auth-wrap { max-width: 520px; }
.auth-panel { padding: 34px 30px; }
.auth-panel h1 { font-size: clamp(1.8rem, 6vw, 2.3rem); margin-bottom: 8px; }
.auth-panel > p { margin-bottom: 22px; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; }
.g-mark { font-weight: 800; color: #4285f4; font-size: 1.15rem; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); margin: 22px 0; font-size: .9rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.hint-line { color: var(--ink-soft); font-size: .9rem; margin-top: 10px; text-align: center; }
.form-error { color: var(--danger); margin-top: 12px; font-weight: 600; }
.form-error:empty { display: none; }
.big-icon { font-size: 2.6rem; margin-bottom: 6px; }
.auth-foot { text-align: center; color: var(--ink-soft); margin-top: 6px; }
.field input[type="email"], .field input[type="password"] { font-size: 1.05rem; padding: 13px 14px; }

/* ---------- builder: header account ---------- */
.account-email { font-size: .85rem; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.returning { text-align: center; color: var(--ink-soft); margin-top: 26px; font-size: .95rem; }

/* ---------- builder: the reveal (card → page) ---------- */
.reveal { scroll-margin-top: 84px;
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px 24px 24px; margin: 14px 0 28px;
  animation: reveal-in .45s ease-out;
}
@keyframes reveal-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.reveal h2 { font-size: clamp(1.4rem, 4vw, 1.8rem); margin-bottom: 4px; padding-right: 30px; }
.reveal > p { margin-bottom: 20px; font-size: .95rem; }
.reveal-close {
  position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: transparent; font-size: 1.6rem; line-height: 1; color: var(--ink-soft); cursor: pointer;
}
.reveal-close:hover { background: var(--paper-deep); }
.reveal-grid { display: grid; grid-template-columns: 1fr auto 1.25fr; gap: 16px; align-items: center; }
.reveal-card { margin: 0; background: #fffdf8; padding: 10px 10px 4px; border: 1px solid var(--line);
  box-shadow: 3px 4px 14px rgba(44,36,32,.18); transform: rotate(-1.5deg); }
.reveal-card img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.reveal-card figcaption { font-family: var(--hand); font-size: 1.25rem; text-align: center; color: var(--ink-soft); }
.reveal-arrow { font-size: 2rem; color: var(--accent); }
.reveal-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
@media (max-width: 640px) {
  .reveal { padding: 22px 16px 18px; }
  .reveal-grid { grid-template-columns: 1fr; }
  .reveal-card { width: 62%; justify-self: center; }
  .reveal-arrow { transform: rotate(90deg); justify-self: center; line-height: 1; }
  .reveal-actions .btn { flex: 1; text-align: center; }
}
mark.unclear-key { background: #fde3bd; outline: 1px solid #e8b878; border-radius: 3px; padding: 0 3px; color: inherit; }

/* ---------- builder: pages as real mini pages ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 0 4px; }
.section-head h2 { font-size: 1.25rem; }
.section-head .count { color: var(--ink-soft); font-weight: 400; font-family: var(--sans); font-size: 1rem; }
.page-tile { position: relative; display: block; min-width: 0; text-decoration: none; color: var(--ink); }
.page-tile .mini-page { transition: transform .15s, box-shadow .15s; }
.page-tile:hover .mini-page { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(44,36,32,.2); }
.page-tile .tile-card {
  position: absolute; right: -6px; bottom: 30px; width: 38%; background: #fff;
  border: 4px solid #fff; border-bottom-width: 12px; box-shadow: 0 3px 10px rgba(44,36,32,.3);
  transform: rotate(4deg);
}
.tile-label {
  display: block; margin-top: 8px; font-size: .88rem; font-weight: 600; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.page-tile.failed, .page-tile.generating, .page-tile.add-tile {
  aspect-ratio: 2 / 3; border-radius: 6px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 14px;
}
.page-tile.failed + .tile-label, .page-tile.failed .tile-label { display: none; }
.page-tile.failed { background: #fbf1e6; border: 2px dashed #d9a27f; color: var(--accent-dark); }
.failed-photo { width: 64%; max-height: 45%; object-fit: cover; border: 4px solid #fff;
  box-shadow: 0 2px 8px rgba(44,36,32,.2); opacity: .9; }
.failed-body { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.failed-body span { color: var(--ink-soft); font-size: .82rem; }
.page-tile.generating { background: var(--card); border: 1px solid var(--line); color: var(--ink-soft); font-size: .88rem; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-tile.add-tile { border: 2px dashed var(--accent); background: transparent; cursor: pointer;
  font-weight: 700; color: var(--accent-dark); }
.page-tile.add-tile:hover { background: #fff7ec; }
.page-tile.add-tile .big { font-size: 2.2rem; line-height: 1; }
.add-sub { font-weight: 400; font-size: .82rem; }
.pages-grid.reordering .page-tile { cursor: default; }
.move-ctl { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; }
.move-ctl button {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink); color: #fff;
  font-size: 1.2rem; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.move-ctl button[disabled] { opacity: .25; cursor: default; }

/* ---------- builder: style picker ---------- */
.theme-picker {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(118px, 1fr); gap: 14px;
  overflow-x: auto; padding: 6px 2px 14px; margin-bottom: 18px; scroll-snap-type: x mandatory;
}
.theme-option {
  border: 0; background: none; padding: 0; cursor: pointer; text-align: center; font: inherit;
  color: var(--ink); scroll-snap-align: start;
}
.theme-option .mini-page { outline: 3px solid transparent; outline-offset: 3px; transition: outline-color .15s; }
.theme-option:hover .mini-page { outline-color: var(--line); }
.theme-option.selected .mini-page { outline-color: var(--accent); }
.theme-option:focus-visible { outline: none; }
.theme-option:focus-visible .mini-page { outline-color: var(--ink); }
.theme-name { display: block; margin-top: 10px; font-weight: 600; font-size: .92rem; }
.theme-option.selected .theme-name { color: var(--accent-dark); }
.theme-option.selected .theme-name::before { content: "✓ "; }

/* ---------- builder: share + save ---------- */
.share-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
.share-url { font-size: .9rem; word-break: break-all; color: var(--ink-soft); }
.save-banner { flex-direction: column; align-items: stretch; gap: 10px; }
.save-text { line-height: 1.5; }
.save-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.email-link-form { display: flex; gap: 10px; flex-wrap: wrap; }
.email-link-form input { flex: 1; min-width: 200px; font-size: 1rem; padding: 9px 12px; }
.save-msg { font-size: .92rem; color: var(--ink-soft); }
.save-msg:empty { display: none; }
.autosave-note { font-size: .85rem; margin: -4px 0 18px; }
.sub-h { font-size: 1.05rem; margin-bottom: 6px; }
.inline-input { flex: 1; min-width: 160px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.icon-btn { min-width: 40px; padding-left: 12px; padding-right: 12px; }
.cta-bar .btn-big { padding: 17px 32px; }

/* ---------- recipe editor ---------- */
.editor-title { font-size: clamp(1.6rem, 4.5vw, 2.2rem); margin-bottom: 4px; }
.editor-sub { margin-bottom: 20px; }
.notice { border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; line-height: 1.5; }
.notice.warn { background: #fbf1e6; border: 1px solid #e9c4a6; color: #5c3a22; }
.editor-grid { display: grid; gap: 22px; align-items: start; }
@media (min-width: 900px) {
  .editor-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .editor-side { position: sticky; top: 84px; }
}
@media (max-width: 899px) {
  /* phone order: the card, then the words to check, then the page preview */
  .editor-side { display: contents; }
  .card-panel { order: 1; }
  .editor-form { order: 2; }
  .preview-panel { order: 3; }
  .original-photo { max-height: 260px; }
}
.editor-grid .panel { margin-bottom: 0; }
.editor-side .panel + .panel { margin-top: 22px; }
.opt { font-weight: 400; font-size: .85rem; color: var(--ink-soft); }
.photo-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 170px; border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer;
  color: var(--ink-soft); font-weight: 600; background: var(--paper);
}
.photo-empty:hover { border-color: var(--accent); }
.photo-empty .big { font-size: 2rem; }
.original-photo { min-height: 0; max-height: 460px; display: block; }
.status-line { font-size: .9rem; margin-top: 8px; }
.status-line:empty { display: none; }
#page-preview .mini-page { max-width: 340px; margin: 0 auto; }
.unclear-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: #fff8ec; border: 1px solid #f0d7b0; border-radius: 8px; padding: 10px 12px; margin-bottom: 16px;
  font-size: .92rem;
}
.field textarea { line-height: 1.5; }
.save-bar {
  position: sticky; bottom: 0; z-index: 5; display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  margin: 8px -24px -24px; padding: 14px 24px calc(14px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 253, 248, 0.96); border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius); backdrop-filter: blur(6px);
}
.danger-zone { margin: 10px 0 4px; text-align: center; }
.danger-link { color: var(--danger); font-size: .92rem; }
.danger-link.armed { font-weight: 700; }

/* ---------- export: flip-through preview + print order ---------- */
.flip { margin: 18px -20px 8px; }
.flip-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 210px); gap: 18px;
  overflow-x: auto; padding: 10px 20px 18px; scroll-snap-type: x mandatory;
  background: linear-gradient(var(--paper-deep), var(--paper));
}
.flip-page { scroll-snap-align: start; }
.flip-hint { padding: 0 20px; font-size: .88rem; }
.export-cards { margin-top: 22px; }
.status-banner { margin: 16px 0 0; color: var(--ink-soft); }
.status-banner:empty { display: none; }
.status-banner.error { color: var(--danger); font-weight: 600; }
.order-panel { margin-top: 26px; }
.order-grid { display: grid; gap: 28px; }
@media (min-width: 820px) { .order-grid { grid-template-columns: 1fr 1.2fr; } }
.choice-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: 10px; margin-bottom: 18px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span {
  display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 2px solid var(--line);
  border-radius: var(--radius); background: #fff;
}
.choice em { font-style: normal; color: var(--ink-soft); font-size: .9rem; }
.choice small { color: var(--ink-soft); font-size: .78rem; }
.choice input:checked + span { border-color: var(--accent); box-shadow: var(--shadow); }
.choice input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.stepper button { width: 48px; height: 48px; border: 0; background: none; font-size: 1.4rem; cursor: pointer; color: var(--ink); }
.stepper input { width: 56px; text-align: center; border: 0; font: inherit; font-size: 1.15rem; font-weight: 700; background: none; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.small { font-size: .88rem; }
.qty-field .small { margin-top: 6px; }
.summary { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; color: var(--ink-soft); }
.summary .total { color: var(--ink); font-weight: 800; font-size: 1.15rem; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .field-row { grid-template-columns: 1fr; } }
.field input.invalid { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(160,48,48,.15); }
.order-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.order-done { margin-top: 26px; border-color: #b9d3be; background: #f3faf4; }

/* ---------- landing: real product visuals ---------- */
.hero { overflow: hidden; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) {
  .hero { text-align: left; padding-top: 64px; }
  .hero-grid { grid-template-columns: 1.05fr 1fr; }
  .hero .hero-text h1, .hero .hero-text .sub { margin-left: 0; }
}
.hero-visual { position: relative; height: clamp(300px, 70vw, 440px); max-width: 460px; width: 100%; justify-self: center; }
.hero-visual .hv-cover { position: absolute; left: 0; top: 4%; width: 46%; transform: rotate(-5deg); }
.hero-visual .hv-page { position: absolute; left: 30%; top: 0; width: 52%; transform: rotate(2deg); z-index: 1; }
.hero-visual .hv-page .mini-page { box-shadow: 0 10px 34px rgba(44, 36, 32, 0.26); }
.hero-visual .hv-card { position: absolute; right: 0; bottom: 2%; width: 50%; z-index: 2; transform: rotate(-3deg); }
.hand-card {
  background: #fdf9ee; background-image: repeating-linear-gradient(transparent, transparent 21px, #e8ddc4 22px);
  font-family: var(--hand); color: #4a3d33; font-size: clamp(.82rem, 2.6vw, 1.02rem); line-height: 22px;
  padding: 10px 14px 12px; border: 1px solid #e6dcc8; box-shadow: 0 8px 24px rgba(44,36,32,.22);
  text-align: left;
}
.hand-card .hc-title { font-size: 1.2em; text-decoration: underline; margin-bottom: 2px; }
.demo-page { width: 100%; max-width: 380px; justify-self: center; }
.demo-page .mini-page { box-shadow: 0 6px 26px rgba(44,36,32,.18); }
.transform-demo { align-items: center; }
.styles-section .lede { margin-bottom: 30px; }
.style-gallery {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 20px;
  overflow-x: auto; padding: 6px 4px 18px; scroll-snap-type: x mandatory;
}
.gallery-item { margin: 0; scroll-snap-align: start; text-align: center; }
.gallery-item figcaption { margin-top: 10px; font-weight: 600; }
.price-note { color: var(--ink-soft); font-size: .9rem; margin-top: -6px; }
@media (max-width: 640px) {
  .style-gallery { grid-auto-columns: 58%; }
  .theme-picker { grid-auto-columns: 38%; }
}

/* ---- print ordering (export page) ---- */
.order-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.order-step { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 22px; }
.step-h { font-size: 1.08rem; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink); color: var(--paper); font-family: var(--sans); font-size: .8rem; font-weight: 800; }
.fine-print { font-size: .8rem; color: var(--ink-soft); line-height: 1.5; margin-top: 10px; }
.field-label { font-weight: 600; font-size: .92rem; margin-bottom: 8px; }

.edition-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 12px; }
.edition { position: relative; cursor: pointer; }
.edition input { position: absolute; opacity: 0; }
.edition-body { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px;
  padding: 18px 12px 14px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--card);
  transition: border-color .15s, box-shadow .15s, transform .15s; height: 100%; }
.edition-body em { font-style: normal; font-family: var(--serif); font-weight: 900; font-size: 1.25rem; }
.edition-body small { color: var(--ink-soft); font-size: .8rem; }
.edition input:checked + .edition-body { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.edition input:focus-visible + .edition-body { outline: 2px solid var(--ink); outline-offset: 2px; }

/* little book illustrations */
.book-art { position: relative; display: block; width: 46px; height: 64px; margin-bottom: 10px;
  background: linear-gradient(90deg, #8f3b1e 0 7%, var(--accent) 7% 100%); border-radius: 2px 4px 4px 2px;
  box-shadow: 3px 4px 0 -1px #efe5d3, 3px 4px 0 0 var(--line), 0 6px 14px rgba(44,36,32,.18); }
.book-art::after { content: "✦"; position: absolute; inset: 0; display: grid; place-items: center; color: #f6d9a8; font-size: 14px; }
.book-art.coil { background: var(--green); border-radius: 3px; }
.book-art.coil::before { content: ""; position: absolute; left: -4px; top: 4px; bottom: 4px; width: 8px;
  background: radial-gradient(circle, transparent 1.6px, #6b6258 1.8px 2.6px, transparent 2.8px) 0 0 / 8px 7px repeat-y; }
.book-art.hardcover { width: 50px; height: 68px; background: linear-gradient(90deg, #2a211b 0 9%, #3a2f25 9% 100%);
  border-radius: 2px 5px 5px 2px; box-shadow: 4px 5px 0 -1px #efe5d3, 4px 5px 0 0 var(--line), 0 8px 16px rgba(44,36,32,.25); }
.book-art.hardcover::after { color: var(--gold); }
.book-art.big { width: 92px; height: 128px; margin: 0 auto 14px; }
.book-art.big::after { font-size: 26px; }

.cover-grid { display: grid; gap: 24px; }
@media (min-width: 820px) { .cover-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: start; } }
.cover-picker { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; margin-bottom: 14px; scroll-snap-type: x mandatory; }
.cover-card { flex: 0 0 auto; width: 104px; cursor: pointer; scroll-snap-align: start; text-align: center; }
.cover-card input { position: absolute; opacity: 0; }
.cover-card img { display: block; width: 104px; height: 78px; object-fit: cover; border-radius: 6px;
  border: 2px solid var(--line); background: #fff; transition: border-color .15s, transform .15s; }
.cover-card span { display: block; font-size: .72rem; color: var(--ink-soft); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cover-card input:checked + img { border-color: var(--accent); transform: rotate(-2deg); box-shadow: var(--shadow); }
.cover-card input:focus-visible + img { outline: 2px solid var(--ink); outline-offset: 2px; }

.proof { background: var(--paper-deep); border-radius: var(--radius); padding: 18px; min-height: 240px;
  display: flex; flex-direction: column; justify-content: center; gap: 12px; transition: opacity .2s; }
.proof.loading { opacity: .55; }
.proof-empty { text-align: center; color: var(--ink-soft); font-size: .92rem; max-width: 22rem; margin: 0 auto; }
.proof-cover { margin: 0; }
.proof-cover img { display: block; width: 100%; height: auto; border-radius: 3px; box-shadow: 0 10px 28px rgba(44,36,32,.25); }
.proof-cover figcaption { display: flex; justify-content: space-around; font-family: var(--sans); font-size: .7rem;
  font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); margin-top: 8px; }
.proof-facts { list-style: none; font-size: .9rem; line-height: 1.6; }
.proof .btn { align-self: flex-start; }

.approve { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 6px; padding: 12px 14px;
  background: var(--paper-deep); border-radius: 8px; cursor: pointer; font-size: .92rem; }
.approve input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.secure-note { margin-top: 8px; }

.orders-panel { margin-top: 26px; }
.orders-list { display: grid; gap: 14px; }
.order-card { display: flex; gap: 16px; align-items: flex-start; padding: 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--card); }
.order-thumb { width: 120px; flex: 0 0 auto; border-radius: 3px; box-shadow: var(--shadow); }
.order-info { min-width: 0; flex: 1; }
.order-title { margin-bottom: 2px; }
.order-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: .9rem; }
.status-track { list-style: none; display: flex; gap: 6px; margin: 10px 0 4px; flex-wrap: wrap; }
.status-track li { font-size: .75rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--paper-deep); color: var(--ink-soft); }
.status-track li.done { background: var(--green); color: #fff; }
.status-pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--paper-deep); margin-top: 8px; }
.status-pill.problem { background: #f6dcd6; color: var(--danger); }
@media (max-width: 520px) { .order-card { flex-direction: column; } .order-thumb { width: 100%; } }
