/* The order page's styles (create.html), shared with the gift purchase page
   (gifts.py /gift) since 2026-11-14 so they look the same. theme.css loads after. */
:root{
  /* My Generations Book palette -- the accent/rule colors are pulled
     directly from the Chapter 3 chart palettes (the 2nd-darkest shade of
     each chart's ramp), same colors as the 5 dots in the logo:
     longevity green #0f6346, child-loss gold #F1B921, family-size
     crimson #B6143A, marriage-patterns plum #74297A, migration navy
     #455679. Crimson is the primary accent here; --oxblood/--oxblood-dark
     variable names are unchanged from the old palette to minimize the
     diff, but now hold the crimson values, not the old brownish-red. */
  --paper:#e5e5e5;
  --card:#f5f5f5;
  --ink:#000000;
  --ink-soft:#454545;
  --ink-faint:#8a8a8a;
  --oxblood:#B6143A;
  --oxblood-dark:#890F2C;
  --gold:#F1B921;
  --rule:#000000;
  --rule-strong:#000000;
  --error:#8C3B2E;
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  background:var(--paper);
  color:var(--ink);
  font-family:'Montserrat', sans-serif;
  min-height:100vh;
}

/* --- App shell: same look as the edit and preview screens -------------
   Slim header with the order steps; the current step on the left, the
   order summary in view on the right (it drops below on narrow screens).
   The book-being-written step uses the full width. */
:root{ --appbar-h:80px; --success:#0f6346; --line:#c9c9c9; }
.appbar{
  position:sticky; top:0; z-index:30;
  display:flex; align-items:center; gap:18px;
  min-height:var(--appbar-h); padding:8px 20px;
  background:var(--card); border-bottom:1px solid var(--rule);
}
/* mgb-logo-header.png: the logo trimmed to its edges and made at 2x
   this size, so it stays sharp and the wordmark is readable. */
.appbar-logo{width:180px; height:auto; display:block; flex:none;}
.appbar-help{font-size:12px; color:var(--ink-soft); white-space:nowrap; margin-left:auto;}
.appbar-help a{color:var(--oxblood); font-weight:600;}
.steps{display:flex; gap:6px; list-style:none; margin:0; padding:0; flex:1; justify-content:center; min-width:0;}
.steps li{display:flex; align-items:center; gap:7px; font-size:11.5px; font-weight:600; letter-spacing:.3px; color:var(--ink-faint); padding:6px 10px; border:1.5px solid var(--line); border-radius:2px; background:#fff; white-space:nowrap;}
.steps .num{flex:none; width:20px; height:20px; border-radius:50%; border:1.5px solid currentColor; display:flex; align-items:center; justify-content:center; font-size:11px;}
.steps li.done{color:var(--ink);}
.steps li.done .num{background:var(--ink); border-color:var(--ink); color:#fff;}
.steps li.active{color:var(--oxblood); border-color:var(--oxblood); box-shadow:0 0 0 2px rgba(182,20,58,0.08);}
.steps li.active .num{background:var(--oxblood); border-color:var(--oxblood); color:#fff;}

.main{padding:26px 28px 60px;}
.shell{max-width:1180px; margin:0 auto; display:grid; grid-template-columns:minmax(0,1.6fr) minmax(300px,1fr); gap:26px; align-items:start;}
.shell > *{min-width:0;}
.shell.full{grid-template-columns:minmax(0,1fr);}
.shell.full .col-side{display:none;}
.col-side{position:sticky; top:calc(var(--appbar-h) + 20px);}
.crumb{font-size:10.5px; font-weight:700; letter-spacing:1.2px; text-transform:uppercase; color:var(--oxblood);}
.lede{font-size:14px; line-height:1.6; color:var(--ink-soft); margin:0 0 20px; max-width:62ch;}
.panel{background:var(--card); border:1px solid var(--rule); border-radius:2px; padding:22px 24px;}
.panel + .panel{margin-top:18px;}
.panel h2{font-family:'Libre Baskerville', serif; font-weight:700; font-size:18px; margin:0 0 12px;}
.panel-head{display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:14px;}
.panel-head h2{margin:0;}
.grid2{display:grid; grid-template-columns:1fr 1fr; gap:16px;}
.grid2 .field{margin-bottom:0;}
.actions{display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:20px; flex-wrap:wrap;}
.actions .link-toggle{margin:0; width:auto;}
.action-buttons{display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end;}
/* Keep / Switch / Use a different tree side by side, not full-width secondaries. */
.action-buttons button.secondary{width:auto; margin-top:0;}
.privacy-note{margin:18px 4px 22px; font-size:13px; line-height:1.55; color:var(--ink-soft, #4a443d);}
.privacy-note a{white-space:nowrap;}
.manual-intro{margin:0; text-align:center;}
.manual-intro .manual-toggle{display:inline; width:auto; margin:0 0 0 4px;}
#manual-form{margin-top:16px;}
#manual-form .opt{font-weight:400; color:var(--ink-faint); text-transform:none; letter-spacing:0;}
.action-buttons #choose-different-file{order:3;}
button.primary.next-btn{width:auto; margin-top:0; padding:14px 22px;}
button.secondary{font-family:'Montserrat', sans-serif; font-weight:600; font-size:12.5px; letter-spacing:1px; text-transform:uppercase; background:#fff; color:var(--ink); border:1.5px solid var(--rule); border-radius:2px; padding:13px 18px; cursor:pointer;}
button.secondary:hover{border-color:var(--oxblood); color:var(--oxblood);}

/* order summary */
.sum-book{display:flex; gap:14px; align-items:flex-start;}
.sum-covers{display:flex; align-items:flex-end; flex:none; width:104px;}
.sum-book img{width:70px; max-width:100%; aspect-ratio:8.5/11; object-fit:cover; border:1px solid var(--line); background:#ddd; box-shadow:0 2px 5px rgba(0,0,0,.16);}
.sum-book img + img{margin-left:-36px; margin-bottom:-3px; position:relative;}
.sum-book .nm{font-family:'Libre Baskerville', serif; font-weight:700; font-size:16px;}
.sum-book .sub2{font-size:12.5px; color:var(--ink-soft); line-height:1.5; margin-top:4px;}
.sum-change{background:none; border:0; padding:0; margin-top:6px; font-family:'Montserrat', sans-serif; font-size:12px; font-weight:600; color:var(--oxblood); text-decoration:underline; cursor:pointer;}
.sum-lines{border-top:1px solid var(--rule); margin-top:16px; padding-top:12px; display:grid; gap:7px; font-size:13px; font-variant-numeric:tabular-nums;}
.sum-lines div{display:flex; justify-content:space-between; gap:10px;}
.sum-lines .total{font-weight:700; font-size:16px; border-top:1px dashed var(--ink-faint); padding-top:9px; margin-top:3px;}
.sum-lines .free{color:var(--success); font-weight:600;}
.sum-label{font-size:10.5px; font-weight:700; letter-spacing:1.2px; text-transform:uppercase; color:var(--ink-soft); margin:18px 0 8px;}
.sum-label:first-child{margin-top:0;}
.sum-includes{list-style:none; padding:0; margin:14px 0 0; display:grid; gap:7px; font-size:12.5px; color:var(--ink-soft);}
.sum-includes li{display:flex; gap:8px;}
.sum-includes li::before{content:'✓'; color:var(--success); font-weight:700;}
.sum-next{list-style:none; padding:0; margin:0; counter-reset:n; display:grid; gap:10px;}
.sum-next li{counter-increment:n; display:flex; gap:10px; font-size:12.5px; line-height:1.5; color:var(--ink-soft);}
.sum-next li::before{content:counter(n); flex:none; width:20px; height:20px; border-radius:50%; border:1.5px solid var(--ink-faint); display:flex; align-items:center; justify-content:center; font-size:10.5px; font-weight:700;}
.sum-next b{color:var(--ink);}
.sum-ship{font-size:12px; color:var(--ink-faint); line-height:1.55; margin:14px 0 0;}
.sum-ship a{color:var(--oxblood);}

/* review */
.review-details dl{margin:0; display:grid; grid-template-columns:minmax(120px,auto) 1fr; gap:10px 18px; font-size:14px;}
.review-details dt{font-size:10.5px; font-weight:700; letter-spacing:1.2px; text-transform:uppercase; color:var(--ink-soft); padding-top:2px;}
.review-details dd{margin:0;}
.review-details .change{background:none; border:0; padding:0; margin-left:8px; font-family:'Montserrat', sans-serif; font-size:12px; font-weight:600; color:var(--oxblood); text-decoration:underline; cursor:pointer;}

/* GEDCOM how-to tabs on step 2 */
.howto h2{margin-bottom:8px;}
.howto p, .howto li{font-size:13.5px; line-height:1.6; color:var(--ink-soft);}
.howto p{margin:0 0 10px;}
.howto strong{color:var(--ink);}
.howto a{color:var(--oxblood);}
.howto-include{background:#fff; border-left:3px solid var(--oxblood); padding:10px 12px;}
.howto-tabs{display:flex; gap:0; border-bottom:1.5px solid var(--rule); margin:16px 0 14px; flex-wrap:wrap;}
.howto-tab{font-family:'Montserrat', sans-serif; font-size:12.5px; font-weight:600; color:var(--ink-soft); background:none; border:0; border-bottom:3px solid transparent; margin-bottom:-1.5px; padding:9px 14px; cursor:pointer;}
.howto-tab:hover{color:var(--oxblood);}
.howto-tab.active{color:var(--oxblood); border-bottom-color:var(--oxblood);}
.howto-tab:focus-visible{outline:2px solid var(--gold); outline-offset:2px;}
.howto-panel ol{margin:0 0 10px; padding-left:22px;}
.howto-panel ol li{margin-bottom:6px;}
.howto-more{font-size:12.5px !important; color:var(--ink-faint) !important;}
.howto .help-video-btn{display:inline-flex; align-items:center; gap:8px;}
.howto .help-video-frame{margin-top:14px;}

.warn-box{display:flex; gap:10px; align-items:flex-start; background:rgba(241,185,33,.15); border:1px solid rgba(241,185,33,.55); border-radius:2px; padding:12px 14px; font-size:12.5px; line-height:1.55; margin-top:16px;}

/* status */
.status-card{max-width:640px; margin:10px auto 0; padding:32px 30px;}
.gen-steps{list-style:none; padding:0; margin:0 auto 22px; max-width:420px; display:grid; gap:9px; font-size:13px;}
.gen-steps li{display:flex; gap:10px; align-items:center; color:var(--ink-faint);}
.gen-steps .d{width:18px; height:18px; border-radius:50%; border:1.5px solid var(--line); flex:none; display:flex; align-items:center; justify-content:center; font-size:10px; background:#fff;}
.gen-steps li.ok{color:var(--ink);}
.gen-steps li.ok .d{background:var(--success); border-color:var(--success); color:#fff;}
.gen-steps li.ok .d::after{content:'✓';}
.gen-steps li.now{color:var(--ink); font-weight:600;}
.gen-steps li.now .d{border-color:var(--oxblood); box-shadow:0 0 0 3px rgba(182,20,58,0.12);}

@media (max-width:1100px){ .steps li .t{display:none;} }
@media (max-width:980px){
  .shell{grid-template-columns:minmax(0,1fr);}
  .col-side{position:static;}
}
@media (max-width:760px){
  .appbar{flex-wrap:wrap; gap:10px; padding:8px 16px;}
  .appbar .steps{order:3; flex-basis:100%; justify-content:space-between;}
  .steps li{flex:1; justify-content:center; padding:6px 4px;}
  .appbar-help{display:none;}
  .appbar-logo{width:140px;}
  .main{padding:18px 16px 50px;}
  .panel{padding:18px 16px;}
  .grid2{grid-template-columns:minmax(0,1fr);}
  .review-details dl{grid-template-columns:minmax(0,1fr);}
  .review-details dt{padding-top:6px;}
}

.masthead{
  text-align:center;
  margin-bottom:40px;
  user-select:none;
}
.masthead img{
  width:100%;
  max-width:320px;
  height:auto;
}
@media (max-width:520px){
  .masthead img{max-width:240px;}
}

.card{
  background:var(--card);
  width:100%;
  max-width:560px;
  border:1px solid var(--rule);
  border-radius:2px;
  padding:44px 44px 40px;
  box-shadow:0 1px 0 rgba(0,0,0,0.03), 0 18px 40px -24px rgba(0,0,0,0.25);
  position:relative;
}
@media (max-width:520px){
  .card{padding:32px 22px 30px;}
}

/* record status trail — encodes the actual pipeline stages, not generic step dots */
.trail{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin-bottom:34px;
  flex-wrap:wrap;
}
.trail .stage{
  font-size:10.5px;
  letter-spacing:2px;
  text-transform:uppercase;
  font-weight:600;
  color:var(--ink-faint);
  display:flex;
  align-items:center;
  gap:8px;
  transition:color .3s ease;
}
.trail .stage.active{color:var(--oxblood);}
.trail .stage.done{color:var(--ink-soft);}
.trail .stage .dot{
  width:5px;height:5px;border-radius:50%;
  background:var(--ink-faint);
  transition:background .3s ease;
}
.trail .stage.active .dot{background:var(--oxblood);}
.trail .stage.done .dot{background:var(--ink-soft);}
.trail .sep{color:var(--rule-strong); font-size:11px;}

h1{
  font-family:'Libre Baskerville', serif;
  font-weight:700;
  font-size:28px;
  line-height:1.25;
  margin:6px 0 8px;
  color:var(--ink);
  text-wrap:balance;
}
@media (max-width:760px){ h1{font-size:23px;} }
.sub{
  font-size:14px;
  line-height:1.6;
  color:var(--ink-soft);
  margin:0 0 30px;
}

label{
  display:block;
  font-size:11px;
  letter-spacing:1.5px;
  text-transform:uppercase;
  font-weight:600;
  color:var(--ink);
  margin-bottom:7px;
}
.field{margin-bottom:20px;}
input[type=text], input[type=email]{
  width:100%;
  font-family:'Montserrat', sans-serif;
  font-size:15px;
  padding:12px 14px;
  border:1px solid var(--rule-strong);
  border-radius:2px;
  background:#fff;
  color:var(--ink);
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
}
input[type=text]:focus, input[type=email]:focus{
  border-color:var(--oxblood);
  box-shadow:0 0 0 3px rgba(182,20,58,0.12);
}
.hint{font-size:12px; color:var(--ink-faint); margin-top:6px;}
/* Shipping terms -- shown before payment (step 1 and the last step
   before ThriveCart), so deliberately darker than .hint. */
.ship-note{
  font-size:12.5px;
  line-height:1.55;
  color:var(--ink-soft);
  border-left:2px solid var(--oxblood);
  padding:2px 0 2px 10px;
  margin:0 0 12px;
}
.ship-note a{color:var(--oxblood);}

/* drop zone */
.dropzone{
  border:1.5px dashed var(--rule-strong);
  border-radius:3px;
  padding:30px 20px;
  text-align:center;
  cursor:pointer;
  transition:border-color .15s ease, background .15s ease;
  background:rgba(241,185,33,0.03);
}
.dropzone:hover, .dropzone.drag{
  border-color:var(--gold);
  background:rgba(241,185,33,0.08);
}
.dropzone.has-file{
  border-style:solid;
  border-color:var(--oxblood);
  background:rgba(182,20,58,0.04);
}
.dropzone svg{width:26px;height:26px;stroke:var(--ink-soft); margin-bottom:10px;}
.dropzone .dz-text{font-size:14px; color:var(--ink-soft);}
.dropzone .dz-text strong{color:var(--oxblood); font-weight:600;}
.dropzone .dz-file{font-size:14px; color:var(--ink); font-weight:600;}
.dropzone input[type=file]{display:none;}

button.primary{
  width:100%;
  font-family:'Montserrat', sans-serif;
  font-weight:600;
  font-size:13px;
  letter-spacing:1.5px;
  text-transform:uppercase;
  background:var(--oxblood);
  color:#ffffff;
  border:none;
  border-radius:2px;
  padding:15px 20px;
  cursor:pointer;
  margin-top:8px;
  transition:background .15s ease, transform .1s ease;
}
button.primary:hover:not(:disabled){background:var(--oxblood-dark);}
button.primary:active:not(:disabled){transform:translateY(1px);}
button.primary:disabled{background:var(--ink-faint); cursor:not-allowed;}
button.primary:focus-visible{outline:3px solid var(--gold); outline-offset:2px;}

/* FamilySearch's official Mosaic Tree icon -- per their Solutions
   Program Brand Guide, this marks programmatic FamilySearch API calls
   (including authentication) and must stand alone, never merged onto a
   button with other words -- so it sits beside the button, not inside
   it. Not the "FamilySearch Compatible" badge, which requires actual
   certification first. */
.fs-auth-row{display:flex; align-items:center; gap:10px; margin-top:8px;}
.fs-auth-row button.primary{flex:1; width:auto; margin-top:0;}
.fs-tree-icon{width:32px; height:32px; flex:none; border-radius:4px;}

.error-box{
  background:rgba(140,59,46,0.08);
  border:1px solid rgba(140,59,46,0.35);
  color:var(--error);
  font-size:13px;
  padding:12px 14px;
  border-radius:2px;
  margin-bottom:18px;
  line-height:1.5;
}

.how-it-works{
  background:var(--card);
  border:1px solid var(--rule);
  border-radius:3px;
  padding:18px 20px;
  margin-bottom:22px;
}
.how-it-works .hiw-title{
  font-family:'Montserrat', sans-serif;
  font-weight:600;
  font-size:11px;
  letter-spacing:1.2px;
  text-transform:uppercase;
  color:var(--ink-faint);
  margin-bottom:10px;
}
.how-it-works ol{
  margin:0;
  padding-left:20px;
}
.how-it-works li{
  font-size:13px;
  line-height:1.6;
  color:var(--ink-soft);
  margin-bottom:8px;
}
.how-it-works li:last-child{margin-bottom:0;}

.notice-box{
  background:rgba(241,185,33,0.1);
  border:1px solid rgba(241,185,33,0.45);
  color:var(--ink);
  font-size:13px;
  padding:14px 16px;
  border-radius:2px;
  margin-bottom:18px;
  line-height:1.6;
}
.notice-box strong{color:var(--oxblood);}

/* "This book is for" -- me, or our children (a family book) */
.book-for{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:18px;}
.book-for label.book-for-pick{
  display:flex; align-items:flex-start; gap:10px; cursor:pointer; margin:0;
  text-transform:none; letter-spacing:0; font-weight:400; font-size:14px; line-height:1.45;
  color:var(--ink); border:1.5px solid var(--rule-strong); border-radius:2px; padding:11px 14px; background:#fff;
}
.book-for label.book-for-pick:has(input:checked){border-color:var(--oxblood); background:rgba(182,20,58,0.04);}
.book-for input[type=radio]{margin:3px 0 0; accent-color:var(--oxblood); flex-shrink:0;}
.book-for .pick-sub{display:block; font-size:12.5px; color:var(--ink-soft); margin-top:2px;}

.agree-row{
  display:flex;
  align-items:flex-start;
  gap:10px;
  font-size:13px;
  color:var(--ink-soft);
  line-height:1.5;
  margin:-6px 0 16px;
  cursor:pointer;
}
.agree-row input[type=checkbox]{
  margin:2px 0 0;
  width:16px;
  height:16px;
  accent-color:var(--oxblood);
  flex-shrink:0;
  cursor:pointer;
}

.link-toggle{
  display:block;
  width:100%;
  text-align:center;
  margin-top:14px;
  font-family:'Montserrat', sans-serif;
  font-size:12.5px;
  color:var(--ink-faint);
  text-decoration:underline;
  background:none;
  border:none;
  cursor:pointer;
  padding:0;
}
.link-toggle:hover{color:var(--ink-soft);}

.help-videos{margin:16px 0 14px; text-align:left;}
@media (max-width:760px){ .book-for{grid-template-columns:minmax(0,1fr);} }
.help-videos-title{font-size:12.5px; color:var(--ink-soft); margin-bottom:8px;}
.help-videos-links{display:flex; gap:8px; justify-content:center; flex-wrap:wrap;}
.help-video-btn{
  font-family:'Montserrat', sans-serif;
  font-size:12.5px;
  font-weight:600;
  color:var(--oxblood);
  background:none;
  border:1px solid currentColor;
  border-radius:999px;
  padding:6px 14px;
  cursor:pointer;
}
.help-video-btn.active{background:var(--oxblood); color:#fff; border-color:var(--oxblood);}
.help-video-frame{margin-top:12px; position:relative; aspect-ratio:16/9; width:100%; border-radius:8px; overflow:hidden; background:#000;}
.help-video-frame iframe{position:absolute; inset:0; width:100%; height:100%; border:0;}

button.secondary{
  width:100%;
  font-family:'Montserrat', sans-serif;
  font-weight:600;
  font-size:13px;
  letter-spacing:1.5px;
  text-transform:uppercase;
  background:transparent;
  color:var(--oxblood);
  border:1.5px solid var(--rule-strong);
  border-radius:2px;
  padding:13.5px 20px;
  cursor:pointer;
  margin-top:10px;
  transition:border-color .15s ease, background .15s ease;
}
button.secondary:hover{border-color:var(--oxblood); background:rgba(182,20,58,0.04);}
button.secondary:focus-visible{outline:3px solid var(--gold); outline-offset:2px;}

/* root person search */
.search-wrap{position:relative; margin-bottom:14px;}
.search-wrap svg{
  position:absolute; left:13px; top:50%; transform:translateY(-50%);
  width:15px; height:15px; stroke:var(--ink-faint);
}
.search-wrap input{padding-left:38px;}

.candidate-list{
  max-height:260px;
  overflow-y:auto;
  border:1px solid var(--rule);
  border-radius:2px;
  background:#fff;
}
.candidate-row{
  padding:11px 14px;
  font-size:14px;
  color:var(--ink);
  cursor:pointer;
  border-bottom:1px solid var(--rule);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}
.candidate-row:last-child{border-bottom:none;}
.candidate-row:hover{background:rgba(241,185,33,0.08);}
.candidate-row.selected{
  background:rgba(182,20,58,0.06);
  border-left:3px solid var(--oxblood);
  padding-left:11px;
}
.candidate-row .yr{font-size:12px; color:var(--ink-faint); white-space:nowrap;}
.candidate-row.default-guess .yr::after{content:" · likely you"; color:var(--gold);}
.family-mode .candidate-row.default-guess .yr::after{content:"";}
.no-results{padding:20px 14px; font-size:13px; color:var(--ink-faint); text-align:center;}

.selected-banner{
  display:none;
  align-items:center;
  justify-content:space-between;
  background:rgba(182,20,58,0.05);
  border:1px solid rgba(182,20,58,0.2);
  border-radius:2px;
  padding:12px 14px;
  margin-bottom:16px;
  font-size:13px;
}
.selected-banner.show{display:flex;}
.selected-banner .who{color:var(--ink);}
.selected-banner .who strong{font-weight:600;}
.selected-banner button{
  background:none; border:none; color:var(--oxblood);
  font-size:12px; text-decoration:underline; cursor:pointer; padding:0;
  font-family:'Montserrat', sans-serif;
}

/* Status step: the customer's own book cover with a soft light passing
   across it while it's written, a slim progress bar, and a plain status
   label (replaced the old rotated rubber-stamp circle, 2026-10-09). The
   label keeps the #stamp / .stamp hooks the status code sets. */
.gen-visual{display:flex; flex-direction:column; align-items:center; gap:16px; margin:8px 0 26px;}
.gen-cover-wrap{position:relative; width:150px; max-width:60%; aspect-ratio:8.5/11; overflow:hidden; border:1px solid var(--line); box-shadow:0 14px 30px -12px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.15); background:#222;}
.gen-cover-wrap img{width:100%; height:100%; object-fit:cover; display:block;}
.gen-cover-wrap::after{content:""; position:absolute; inset:0; background:linear-gradient(115deg, transparent 30%, rgba(255,255,255,.28) 48%, transparent 66%); transform:translateX(-120%); opacity:0;}
.gen-visual.working .gen-cover-wrap::after{opacity:1; animation:gen-shine 2.6s ease-in-out infinite;}
.gen-visual.done .gen-cover-wrap{box-shadow:0 0 0 4px rgba(15,99,70,.18), 0 14px 30px -12px rgba(0,0,0,.45);}
@keyframes gen-shine{0%{transform:translateX(-120%);} 60%,100%{transform:translateX(120%);}}
.gen-progress{width:min(320px, 80%); height:6px; border-radius:3px; background:#d8d8d8; overflow:hidden; position:relative;}
.gen-progress span{position:absolute; top:0; bottom:0; left:0; width:35%; border-radius:3px; background:var(--oxblood);}
.gen-visual.working .gen-progress span{animation:gen-bar 1.8s ease-in-out infinite;}
.gen-visual.done .gen-progress span{width:100%; background:var(--success);}
.gen-visual.failed .gen-progress span{width:100%; background:var(--error);}
@keyframes gen-bar{0%{left:-35%;} 100%{left:100%;}}
.stamp{display:inline-flex; align-items:center; gap:8px; font-size:13px; font-weight:600; color:var(--ink); background:#fff; border:1.5px solid var(--line); border-radius:999px; padding:6px 14px;}
.stamp::before{content:""; width:8px; height:8px; border-radius:50%; background:var(--oxblood); flex:none;}
.stamp.processing::before{animation:gen-dot 1.2s ease-in-out infinite;}
.stamp.done{border-color:var(--success); color:var(--success);}
.stamp.done::before{background:var(--success);}
.stamp.failed{border-color:var(--error); color:var(--error);}
.stamp.failed::before{background:var(--error);}
@keyframes gen-dot{0%,100%{opacity:1;} 50%{opacity:.3;}}
@media (prefers-reduced-motion: reduce){
  .gen-visual .gen-cover-wrap::after, .gen-visual .gen-progress span, .stamp::before{animation:none !important;}
  .gen-visual.working .gen-progress span{left:0; width:60%;}
}

/* FamilySearch books: one more sign-in after payment (first_sketches.py) */
.first-sketches{border:1.5px solid var(--oxblood); border-radius:12px; padding:20px 22px; margin:18px 0 6px; background:#fff; text-align:left;}
.first-sketches h2{font-family:'Libre Baskerville', Georgia, serif; font-size:19px; margin:0 0 8px;}
.first-sketches p{font-size:14px; line-height:1.6; color:var(--ink-soft); margin:0 0 12px;}
.first-sketches .fs-actions{display:flex; flex-direction:column; align-items:flex-start; gap:12px; margin-top:6px;}
.fs-signin-btn{display:inline-flex; align-items:center; gap:12px; background:var(--oxblood); color:#fff; text-decoration:none;
  font-family:'Montserrat', sans-serif; font-weight:600; font-size:15px; letter-spacing:0; padding:9px 24px 9px 9px;
  border-radius:999px; box-shadow:0 6px 16px -6px rgba(182,20,58,.55); transition:background .15s ease, transform .15s ease;}
.fs-signin-btn:hover{background:var(--oxblood-dark); color:#fff; transform:translateY(-1px);}
.fs-signin-btn:focus-visible{outline:3px solid var(--gold, #c9a14a); outline-offset:3px;}
.fs-signin-btn img{width:32px; height:32px; flex:none; border-radius:50%; background:#fff; padding:4px; box-sizing:border-box;}
@media (max-width:520px){ .fs-signin-btn{align-self:stretch; justify-content:center;} }
/* While waiting for that sign-in, the card is the only thing on the screen. */
.status-card.fs-only > *:not(#first-sketches){display:none !important;}
.status-card.fs-only .first-sketches{margin:0; border:0; padding:4px 0;}
.status-card.fs-only .first-sketches h2{font-size:24px;}
.first-sketches .fs-skip{background:none; border:0; padding:0; font:inherit; font-size:13px; color:var(--ink-faint); text-decoration:underline; cursor:pointer;}
.status-msg{
  text-align:center;
  font-size:14px;
  color:var(--ink-soft);
  line-height:1.7;
  margin-bottom:22px;
}
.status-msg .email{color:var(--ink); font-weight:600;}

.status-reassure{
  text-align:center;
  font-size:12px;
  color:var(--ink-faint);
  line-height:1.6;
  margin:-8px 0 22px;
}

a.download-link{
  display:block;
  text-align:center;
  text-decoration:none;
  width:100%;
  font-family:'Montserrat', sans-serif;
  font-weight:600;
  font-size:13px;
  letter-spacing:1.5px;
  text-transform:uppercase;
  background:var(--oxblood);
  color:#ffffff;
  border-radius:2px;
  padding:15px 20px;
  box-sizing:border-box;
  transition:background .15s ease;
}
a.download-link:hover{background:var(--oxblood-dark);}

.restart{
  display:block;
  text-align:center;
  margin-top:22px;
  font-size:12px;
  color:var(--ink-faint);
  text-decoration:underline;
  cursor:pointer;
  background:none;
  border:none;
  width:100%;
  font-family:'Montserrat', sans-serif;
}
.restart:hover{color:var(--ink-soft);}

footer{
  margin:36px auto 0;
  font-size:11.5px;
  color:var(--ink-faint);
  text-align:center;
  max-width:480px;
  line-height:1.6;
}
footer a{color:var(--oxblood); text-decoration:underline;}
footer a:hover{color:var(--oxblood-dark);}

.hidden{display:none !important;}

/* generation-tier picker */
.tier-picker{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:14px;
}
@media (max-width:760px){
  .tier-picker{grid-template-columns:minmax(0,1fr);}
  .tier-option{flex-direction:row !important; align-items:center;}
  .tier-option .tier-covers{width:104px !important; flex:none;}
  /* The sale prices (2026-11-09) need room: they drop below the
     ancestors line instead of running past the card on narrow phones. */
  .tier-option .tier-text{min-width:0;}
  .tier-option .tier-foot{flex-wrap:wrap; row-gap:2px;}
  .tier-option .tier-prices{margin-left:auto;}
}
@media (max-width:400px){
  .tier-option .tier-covers{width:84px !important; padding:16px 10px 14px !important;}
  .tier-option .tier-text{padding:12px 12px 14px !important;}
  .tier-option .tier-prices{flex-wrap:wrap; column-gap:6px; row-gap:0;}
}

.tier-header{
  margin-bottom:7px;
}
/* softcover / hardcover segmented control */
.binding-toggle{
  display:flex;
  width:auto;
  border:1.5px solid var(--rule);
  border-radius:3px;
  overflow:hidden;
  margin:2px 0 12px;
}
.binding-btn{
  flex:1;
  font-family:'Montserrat', sans-serif;
  font-weight:600;
  font-size:12px;
  letter-spacing:1px;
  text-transform:uppercase;
  background:#fff;
  color:var(--ink-soft);
  border:none;
  padding:11px 10px;
  cursor:pointer;
  transition:background .15s ease, color .15s ease;
}
.binding-btn .binding-plus{
  display:block;
  font-size:10px;
  letter-spacing:.5px;
  font-weight:500;
  opacity:.75;
  margin-top:2px;
}
.binding-btn + .binding-btn{border-left:1.5px solid var(--rule);}
.binding-btn.selected{background:var(--oxblood); color:#fff;}
.binding-btn.selected .binding-plus{opacity:.9;}

.tier-option{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:10px;
  text-align:left;
  background:#fff;
  border:1.5px solid var(--rule-strong);
  border-radius:3px;
  padding:14px 16px;
  cursor:pointer;
  font-family:'Montserrat', sans-serif;
  transition:border-color .15s ease, background .15s ease;
}
.tier-option:hover{border-color:var(--gold);}
.tier-option.selected{
  border-color:var(--oxblood);
  background:rgba(182,20,58,0.04);
}
.tier-option .tier-name{
  display:block;
  font-family:'Libre Baskerville', serif;
  font-weight:700;
  font-size:16px;
  color:var(--ink);
  margin-bottom:4px;
}
.tier-option .tier-desc{
  display:block;
  font-size:12.5px;
  line-height:1.5;
  color:var(--ink-soft);
}
.tier-option .tier-price{
  display:block;
  font-weight:700;
  font-size:18px;
  color:var(--ink);
  margin-top:8px;
  font-variant-numeric:tabular-nums;
}
/* Launch sale (2026-11-09): regular price struck through, sale price in red. */
.tier-option .tier-prices{display:flex; align-items:baseline; gap:8px; justify-content:flex-end;}
.tier-option .tier-was{font-size:14px; font-weight:500; color:var(--ink-faint); font-variant-numeric:tabular-nums;}
.tier-picker.on-sale .tier-price{color:var(--oxblood);}
.sale-ends{margin:12px 0 0; text-align:center; color:var(--oxblood); font-weight:600; font-size:0.95rem;}
/* Black and white covers together, the white one slightly in front --
   shows there's a choice without asking for it yet (it's made at
   finalize, after they've seen the book). */
.tier-option .tier-covers{display:flex; align-items:flex-end; width:100%; max-width:100%;}
.tier-option .tier-cover{width:62%; max-width:100%; aspect-ratio:8.5/11; object-fit:cover; border:1px solid var(--line); background:#ddd; display:block; box-shadow:0 2px 6px rgba(0,0,0,.18);}
.tier-option .tier-cover + .tier-cover{margin-left:-24%; margin-bottom:-4px; position:relative;}
.cover-note{margin:14px 0 0; color:var(--ink-soft);}
/* Founding prices banner (founding batch, Oct 2026 -- see FOUNDING_PRICES below). */
/* "Buying it for someone else? Give it as a gift" (2026-11-10) */
.gift-link-note{margin:-6px 0 18px; font-size:14px; line-height:1.55; color:var(--ink-soft);}
/* Purchase-first (2026-11-23): what happens after paying, in place of the details panel. */
.buy-note{margin:18px 0 0; padding:16px 20px; border-radius:12px; background:#fff; border:1px solid var(--rule, #e3dfd8); font-size:14.5px; line-height:1.6; color:var(--ink-soft);}
.buy-note strong{color:var(--ink);}
.gift-link-note strong{color:var(--ink);}
.gift-link-note a{color:var(--oxblood); font-weight:600;}
.gift-link-note[hidden]{display:none;}
.founding-banner{margin:0 0 16px; padding:12px 14px; border:1px solid var(--oxblood); border-radius:10px;
  background:rgba(182,20,58,0.05); font-size:0.88rem; line-height:1.5; color:var(--ink);}
.founding-banner strong{color:var(--oxblood);}
/* Gift mode (/create?gift=CODE, gifts.py): the book was bought for this
   person, so the tier/binding panel is replaced by this one. */
.gift-panel{display:flex; gap:22px; align-items:center;}
.gift-panel img{width:118px; flex:none; aspect-ratio:8.5/11; object-fit:cover; border:1px solid var(--line); box-shadow:0 8px 18px -8px rgba(0,0,0,.45);}
.gift-panel .gift-from{font-size:11px; font-weight:700; letter-spacing:1.6px; text-transform:uppercase; color:var(--oxblood); margin-bottom:6px;}
.gift-panel h2{margin:0 0 6px;}
.gift-panel p{margin:0 0 8px; font-size:0.92rem; line-height:1.55;}
.gift-panel .gift-msg{font-family:'Libre Baskerville', Georgia, serif; font-style:italic; color:var(--ink);}
@media (max-width:560px){ .gift-panel{flex-direction:column; align-items:flex-start;} }
.tier-option .tier-text{display:block; min-width:0;}
.tier-option .tier-people{display:block; font-size:11.5px; color:var(--ink-faint); margin-top:6px;}
.tier-option .tier-badge{position:absolute; top:10px; left:10px; z-index:1; font-size:10px; font-weight:700; letter-spacing:.8px; text-transform:uppercase; background:var(--gold); color:#000; padding:3px 7px; border-radius:2px;}
.tier-option .tier-tick{position:absolute; top:10px; right:10px; z-index:1; width:22px; height:22px; border-radius:50%; background:var(--oxblood); color:#fff; display:none; align-items:center; justify-content:center; font-size:12px;}
.tier-option.selected .tier-tick{display:flex;}
.tier-option:focus-visible{outline:3px solid var(--gold); outline-offset:2px;}

.book-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  background:#fff;
  border:1.5px solid var(--rule-strong);
  border-radius:3px;
  padding:11px 14px;
  font-size:13px;
  margin-bottom:16px;
}
.book-summary .bs-label{color:var(--ink); font-weight:600;}
.book-summary .bs-label .bs-price{color:var(--oxblood); font-weight:600;}
.book-summary button{
  font-family:'Montserrat', sans-serif;
  font-weight:600;
  font-size:10.5px;
  letter-spacing:1px;
  text-transform:uppercase;
  background:transparent;
  color:var(--oxblood);
  border:1.5px solid var(--oxblood);
  border-radius:2px;
  padding:6px 12px;
  cursor:pointer;
}
.book-summary button:hover{background:rgba(182,20,58,0.06);}

.spinner-inline{
  display:inline-block; width:12px; height:12px;
  border:2px solid rgba(255,255,255,0.4);
  border-top-color:#ffffff;
  border-radius:50%;
  animation:spin .7s linear infinite;
  margin-right:8px;
  vertical-align:-2px;
}
@keyframes spin{to{transform:rotate(360deg);}}
@media (prefers-reduced-motion: reduce){
  .spinner-inline{animation:none;}
}
