/* One canvas from the first photo to the finished pet. Functional cards keep
   a light surface, so photos, prices and long-form text stay easy to read. */
:root{
  --site-canvas:#193BB5;--site-ink:#FFFFFF;--site-muted:#DCE4FF;
  --site-line:#6A83D3;--site-raised:#2448BB;--site-accent:#FFCE55;
  --site-action:#FFCE55;--site-action-ink:#17171F;--site-action-lip:#BE8D19;
  --site-header:rgba(25,59,181,.94);
  background:var(--site-canvas);
}
body:is(.home,.journey-night,.flow,.legal-page,[data-build-state]),body.flow.night{
  margin:0;min-width:0;background:var(--site-canvas);background-image:none;color:var(--site-ink);
  --pb-on-night:var(--site-ink);--pb-on-night-muted:var(--site-muted);
}
.home{
  --home-ink:var(--site-ink);--home-muted:var(--site-muted);--home-line:var(--site-line);
  --home-surface:var(--site-raised);--home-surface-2:var(--site-raised);
}
.home .home-top{background:var(--site-header)}
.home .hero-line{color:var(--site-accent)}
.home .stage-glow{background:radial-gradient(circle,rgba(144,177,255,.24),transparent 68%)}
.home .sample-pages{background:radial-gradient(circle,var(--site-raised),transparent 72%)}
.home .step-num{background:var(--site-ink);color:var(--site-canvas)}
.journey-night .explain-kicker{color:var(--site-accent)}
.journey-night .explain-progress i{background:var(--site-line)}
.journey-night .explain-progress i.on{background:var(--site-accent)}
.journey-night .explain-visual{background:var(--site-raised)}
body.flow .flow-lead,.legal-page .legal-version{color:var(--site-muted)}
body.flow .top-link{color:var(--site-ink)}
body.flow .empty-state{background:var(--site-raised);box-shadow:none}

body.flow .history .badge{color:var(--pb-ink)}
.legal-page .legal-index a:hover{background:var(--site-raised)}
.legal-page .legal-index>a[aria-current=page]{background:var(--site-ink);color:var(--site-canvas)}
.legal-page :is(.legal-copy,.legal-summary){color:var(--pb-ink)}
body:is(.home,.journey-night,.flow,.legal-page,[data-build-state]) .site-footer{color:var(--site-muted);border-top-color:var(--site-line)}
body:is(.home,.journey-night,.flow,.legal-page,[data-build-state]) :focus-visible{outline-color:var(--site-accent)}
body :is(.card,.journey-card,.legal-copy,.legal-summary,.library-card,dialog) :focus-visible{outline-color:var(--pb-blue)}
/* The studio shares the canvas; the model and parts retain neutral surfaces. */
body[data-build-state] .stage{background:#F1F3FA}
/* Responsive foundations: let grid/flex children shrink and long names wrap. */
:is(.journey-top,.flow-top,.home-top){flex-wrap:wrap;row-gap:12px}
:is(.journey-top,.flow-top,.home-top) nav{flex-wrap:wrap}
:is(.journey-main,.flow-main,.legal-main) h1{overflow-wrap:anywhere}
:is(.capture,.stage-card,.explain-grid)>*{min-width:0}
.flow-top .brand{min-width:0}
.flow-top nav a,.journey-top nav a:not(.pb-button):not(.pb-button){min-height:44px;display:inline-flex;align-items:center}
.pet-head h1{overflow-wrap:anywhere;min-width:0}

.pet-grid{grid-template-columns:repeat(auto-fill,minmax(min(250px,100%),1fr))}
.model-stage{min-height:420px}
@media(max-width:820px){.model-stage{min-height:390px}}
@media(max-width:520px){
  .journey-main h1{font-size:clamp(36px,11vw,45px)}
  .journey-card{padding:22px 20px}
  .home .home-hero h1{font-size:clamp(42px,12.8vw,62px)}
  .home .cost-card{gap:4px 8px;padding:14px 12px}
  .home .cost-card .cost-price{font-size:18px}
  .flow-top{gap:10px}.flow-top nav{margin-left:auto}
  .flow-top .brand{font-size:20px}
  .flow-top .top-link{padding:10px;font-size:14px}
  .legal-page .legal-index a{background:var(--site-raised)}
  .legal-page .journey-top nav{gap:18px}
  .model-stage{min-height:360px}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}
}

.purchase-dialog .order-loading{display:block;padding:0;background:transparent}
.purchase-dialog .order-loading-status{display:block}
body.flow .email-updates{color:var(--pb-ink)}

.home :is(.stage-status,.sample-fallback){color:var(--site-muted)}
.home .hero-stage input[type=range]{outline-offset:4px}
.purchase-dialog #order-loading-status{position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip-path:none;white-space:normal}
.purchase-dialog[data-order-state=loading]:has(.waiting:not([hidden])) .order-hero{display:none}
.making-visual{background:var(--site-raised)}
.animal-option{color:var(--pb-ink)}
body.flow .pet-tile{color:var(--pb-ink)}

@media print{
  :root{--site-canvas:#FFFFFF;--site-ink:#17171F;--site-muted:#5E6070;--site-line:#DCE1EE;--site-raised:#F1F3FA}
}
:is(.journey-top,.flow-top,.home-top) .brand,.quiet-link,.explain-back,.legal-index a{min-height:44px}
.legal-index a{display:flex;align-items:center}

/* White cards on the blue canvas need dark text (4 Nov 2026: My pets names were white on white). */
body .library-card{color:var(--pb-ink,#16192b)}
/* Studio surfaces are white; their text must be dark (4 Nov 2026: parts list was white on white). */
body[data-build-state] :is(.stage,.stock-card,.stock-switch,.parts-panel,.parts-footer,.spare-options,.face-pack-box,dialog){color:var(--pb-ink,#17171F)}
/* Keep the parts list usable when stock and face-pack cards share the sidebar (4 Nov 2026: list squeezed to 44px). */
/* Invoice rows sit on the blue canvas; give them the white card their dark text expects. */
body .invoice-row{background:var(--pb-white,#fff);color:var(--pb-ink,#17171F);border-radius:18px}
/* Account pages on a phone: the brand on its own row, the account links
   (My pets, Invoices, Account, Sign out) spread across the row under it. */
@media(max-width:560px){
  .flow-top:has(nav [href="/account"]){flex-wrap:wrap;row-gap:0}
  .flow-top:has(nav [href="/account"]) .brand{flex:1 0 100%}
  .flow-top nav:has([href="/account"]){flex:1 0 100%;justify-content:space-between;gap:0;margin:0 -6px}
  .flow-top nav:has([href="/account"]) .top-link{padding:10px 6px;font-size:15px}
}

/* The brand's logo spot (ui/brand-logo.mjs, config/footer.mjs; Owen, 20 Nov 2026: "always use the 3JS"): the live
   three.js logo's own 600 x 180 frame, its final size from the first paint, empty until the live logo has drawn (Owen,
   21 Nov 2026: "No fallback logos on either website"). The frame's margins (the paw starts 10% in, the ink sits in its upper part) are taken back so the logo
   lines up with the page as the old picture did. */
/* The frame's own margins, as a share of the logo's width (a percentage would be of the header's, which on a phone's
   pet page is the whole row and pushed the logo off the left edge). */
.brand-logo { position: relative; display: block; flex: none; width: var(--brand-logo-w, 210px); aspect-ratio: 10 / 3; margin: calc(var(--brand-logo-w, 210px) * -.12) 0 calc(var(--brand-logo-w, 210px) * -.14) calc(var(--brand-logo-w, 210px) * -.098); }
.brand-logo-flat { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.brand-logo-live { position: absolute; inset: 0; opacity: 0; transition: opacity .3s ease; }
.brand-logo.is-drawn .brand-logo-live { opacity: 1; }
.brand-logo.is-drawn .brand-logo-flat, .brand-logo:is([data-brand-logo="buildmypet"], [data-brand-logo="telepawt"]) .brand-logo-flat { display: none; }
:is(.journey-top, .flow-top, .home-top) .brand { --brand-logo-w: 214px; }
.site-footer-brand { --brand-logo-w: 250px; }
@media (max-width: 560px) { :is(.journey-top, .flow-top, .home-top) .brand { --brand-logo-w: 168px; } .site-footer-brand { --brand-logo-w: 220px; } }
/* Telepawt's header logo 30% bigger (Owen, 21 Nov 2026). */
:is(.journey-top, .flow-top, .home-top) .brand:has([data-brand-logo="telepawt"]) { --brand-logo-w: 278px; }
@media (max-width: 560px) { :is(.journey-top, .flow-top, .home-top) .brand:has([data-brand-logo="telepawt"]) { --brand-logo-w: 218px; } }
/* On the brand sites' sign-in twins: the brand's picture and name, laid out as before, under the live logo. */
.brand-logo--twin .brand-logo-flat { display: flex; align-items: center; gap: 10px; padding-left: 9.8%; font-weight: 800; white-space: nowrap; }
.brand-logo--twin .brand-logo-flat img { width: 40px; height: auto; }
