/* Free Bedline tools: use the same Nunito, cream, amber, paper and navy as the iPhone app. */
.tool-page { --night:#141d34; --muted:#465b76; --mint:#e9f5f0; --peach:#fef1e0; color:var(--night); }
.tool-page :is(h1,h2,h3,p) { margin-top:0; }
.tool-page a { text-decoration-thickness:1px; }
.tools-container { width:min(calc(100% - 2.5rem), 1050px); margin:auto; }
.tool-nav { display:flex; align-items:center; gap:1.25rem; justify-content:space-between; padding:1.5rem 0; flex-wrap:wrap; }
.tool-brand { display:inline-flex; align-items:center; gap:.7rem; font-size:1.4rem; font-weight:800; text-decoration:none; }
.tool-brand img { width:44px; height:44px; border-radius:12px; }
.tool-links { display:flex; gap:1.25rem; flex-wrap:wrap; font-weight:800; color:var(--muted); }
.tool-links a:hover,.tool-page a:hover { color:var(--deep-amber); }
.tool-hero { padding:3rem 0 1.5rem; max-width:870px; }
.tool-eyebrow { display:inline-flex; font-size:.8rem; font-weight:800; letter-spacing:.15em; text-transform:uppercase; color:var(--deep-amber); margin-bottom:1rem; }
.tool-hero h1 { font-size:clamp(2.4rem,6vw,4.6rem); line-height:1.09; letter-spacing:-.045em; margin-bottom:1.25rem; }
.tool-hero p { font-size:clamp(1.05rem,2vw,1.35rem); color:var(--muted); max-width:720px; }
.tool-hero em { color:var(--deep-amber); font-style:normal; }
.tool-card { border-radius:28px; padding:clamp(1.4rem,3vw,2.8rem); background:var(--paper); border:1px solid var(--separator); box-shadow:0 8px 35px #1c100708; margin:1.5rem 0 2rem; }
.tool-grid { display:grid; grid-template-columns:1fr 1fr; gap:1.5rem; }
.tool-page label { display:block; font-weight:800; margin-bottom:.5rem; }
.tool-page input[type=range] { accent-color:var(--amber); width:100%; cursor:pointer; min-height:40px; }
.tool-page input[type=time],.tool-page select { width:100%; min-height:54px; padding:.8rem 1rem; border:1px solid #cbbfb0; border-radius:14px; background:white; color:var(--night); font:inherit; font-weight:800; }
.tool-control { display:flex; justify-content:space-between; gap:1rem; align-items:center; }
.tool-control strong { white-space:nowrap; color:var(--deep-amber); }
.tool-result { margin-top:1.5rem; padding:clamp(1.5rem,4vw,3rem); border-radius:24px; background:var(--night); color:white; }
.tool-result p { color:#d3dcef; }
.tool-result .metric { display:block; font-size:clamp(3rem,9vw,5.6rem); line-height:1.1; font-weight:800; color:#ffd57b; letter-spacing:-.04em; }
.tool-result .secondary-metric { display:block; font-weight:800; font-size:clamp(1.5rem,4vw,2rem); }
.tool-note { font-size:.9rem; color:var(--muted); line-height:1.5; }
.tool-result .tool-note { color:#d3dcef; }
.tool-actions { display:flex; flex-wrap:wrap; gap:.8rem; margin-top:1.4rem; }
.tool-button { min-height:50px; border-radius:999px; border:0; padding:.8rem 1.4rem; background:var(--amber); color:white; cursor:pointer; font:inherit; font-weight:800; display:inline-flex; justify-content:center; align-items:center; text-align:center; text-decoration:none; }
.tool-button:hover { background:var(--deep-amber); color:white !important; }
.tool-button.secondary { background:#ffffff; border:1px solid #ddd0c1; color:var(--night); }
.tool-button.secondary:hover { background:var(--peach); color:var(--night)!important; }
.tool-result .tool-button.secondary { background:transparent; border:1px solid #77839c; color:white; }
.tool-result .tool-button.secondary:hover { background:#34415e; color:white!important; }
.tool-cta { margin:2.5rem 0; display:grid; grid-template-columns:1fr auto; gap:1.25rem; align-items:center; background:var(--mint); border-radius:24px; padding:clamp(1.5rem,4vw,2.5rem); }
.tool-cta h2 { font-size:1.5rem; margin-bottom:.5rem; }
.tool-cta p { margin:0; }
.tool-explainer { max-width:800px; margin:3rem 0; }
.tool-explainer h2 { font-size:1.65rem; margin:2.2rem 0 .75rem; }
.tool-explainer h3 { font-size:1.15rem; margin:1.5rem 0 .5rem; }
.tool-explainer p { color:#384960; }
.tool-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1rem; margin:2rem 0; }
.tool-tile { display:block; border-radius:22px; padding:1.5rem; border:1px solid var(--separator); background:var(--paper); text-decoration:none; }
.tool-tile .tool-tile-icon { display:grid; place-items:center; width:54px; height:54px; border-radius:16px; background:var(--peach); margin-bottom:1rem; overflow:hidden; }
.tool-tile .tool-tile-icon img { width:100%; height:100%; object-fit:contain; transform:translateY(4px) scale(1.15); }
.tool-tile strong { display:block; font-size:1.15rem; line-height:1.3; }
.tool-tile p { margin:.6rem 0 0; color:var(--muted); font-size:.96rem; }
.tool-plan { display:grid; gap:.5rem; padding:1.2rem 0; border-bottom:1px solid #34415e; }
.tool-plan:last-of-type { border:0; }
.tool-plan strong { font-size:2rem; color:#ffd57b; line-height:1.2; }
.choice { display:block; text-align:left; width:100%; min-height:60px; margin:.65rem 0; padding:1rem 1.25rem; border:1px solid #d6cbbc; border-radius:16px; background:white; color:var(--night); font:inherit; font-weight:800; cursor:pointer; }
.choice:hover,.choice:focus-visible { background:var(--peach); border-color:var(--amber); }
.tool-page :is(input,select,button,a):focus-visible { outline:3px solid var(--amber); outline-offset:3px; }
.quiz-progress { color:var(--deep-amber); font-weight:800; font-size:.9rem; }
.tool-footer { border-top:1px solid var(--separator); padding:2rem 0 3rem; display:flex; justify-content:space-between; flex-wrap:wrap; gap:1rem; }
.tool-footer nav { display:flex; gap:1.2rem; flex-wrap:wrap; }
.tool-footer p { margin:0; color:var(--muted); }
/* A companion's room: the art crossfades to the companion asleep, and the phone glow brightens with data-glow (minutes ÷ 15). */
.tool-scene { position:relative; aspect-ratio:1290/780; border-radius:20px; overflow:hidden; background:var(--night); margin-bottom:1.6rem; transition:opacity .6s; }
.tool-scene.is-loading { opacity:0; }
.tool-scene img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transition:opacity .7s; }
.tool-scene .scene-asleep,.tool-scene.is-asleep .scene-awake { opacity:0; }
.tool-scene.is-asleep .scene-asleep { opacity:1; }
.scene-glow { position:absolute; inset:0; pointer-events:none; background:radial-gradient(circle at 44% 60%,#bfe3ff 0,#7fb7ff55 8%,#0000 26%); mix-blend-mode:screen; opacity:0; transition:opacity .3s; }
.tool-scene[data-glow="1"] .scene-glow { opacity:0.34; }
.tool-scene[data-glow="2"] .scene-glow { opacity:0.44; }
.tool-scene[data-glow="3"] .scene-glow { opacity:0.53; }
.tool-scene[data-glow="4"] .scene-glow { opacity:0.62; }
.tool-scene[data-glow="5"] .scene-glow { opacity:0.72; }
.tool-scene[data-glow="6"] .scene-glow { opacity:0.81; }
.tool-scene[data-glow="7"] .scene-glow { opacity:0.91; }
.tool-scene[data-glow="8"] .scene-glow { opacity:1.00; }
.tool-scene.is-asleep .scene-glow { opacity:0; }
.scene-z { position:absolute; left:54%; top:36%; font-weight:800; font-size:clamp(1.3rem,3vw,2.1rem); color:#ffd57b; opacity:0; }
.tool-scene.is-asleep .scene-z { animation:scene-z 2.6s ease-out infinite; }
@keyframes scene-z { 0% { opacity:0; transform:translate(0,0) scale(.8); } 30% { opacity:1; } 100% { opacity:0; transform:translate(1.4em,-2em) scale(1.2); } }
/* The scene beside its controls on wide screens, above them on phones. */
.tool-stage { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(0,1fr); gap:1.75rem; align-items:center; }
.tool-stage .tool-scene { margin:0; }
.tool-stage .tool-grid { grid-template-columns:1fr; }
.tool-columns { display:grid; grid-template-columns:1fr 1fr; gap:1.5rem; align-items:start; margin-top:1.5rem; }
.tool-columns .tool-result { margin-top:0; }
.tool-columns .tool-result .metric { font-size:clamp(2.8rem,5.4vw,4.4rem); }
.tool-reclaim { margin-top:1.4rem; font-size:1.05rem; }
.tool-reclaim strong { color:var(--deep-amber); }
/* The bedtime receipt, fed from a dark printer slot. */
.receipt-printer { position:relative; padding-top:12px; }
.receipt-printer::before { content:""; position:absolute; top:0; left:-8px; right:-8px; height:12px; border-radius:8px; background:var(--night); z-index:1; }
.receipt { background:#fff; color:var(--night); font-family:ui-monospace,Menlo,"Courier New",monospace; font-size:.92rem; line-height:1.6; padding:1.2rem 1.3rem 1.9rem; box-shadow:0 10px 24px #1c100722; transform-origin:top center;
  -webkit-mask:radial-gradient(circle 6px at 50% 100%,#0000 98%,#000) 0 0/14px 100% repeat-x; mask:radial-gradient(circle 6px at 50% 100%,#0000 98%,#000) 0 0/14px 100% repeat-x; }
.receipt p { margin:0; }
.receipt-title { font-family:Nunito,sans-serif; font-weight:800; font-size:1.15rem; text-align:center; letter-spacing:.02em; }
.receipt-brand,.receipt-footer { text-align:center; color:var(--muted); }
.receipt-brand { margin-bottom:.6rem!important; }
.receipt-row { display:flex; justify-content:space-between; gap:1rem; }
.receipt-row span:last-child { flex:none; white-space:nowrap; }
.receipt-total { border-top:2px dashed var(--night); margin-top:.5rem!important; padding-top:.5rem; font-weight:800; font-size:1.1rem; }
.receipt-footer { margin-top:.7rem!important; font-size:.82rem; }
.receipt.is-printing { animation:receipt-wobble .5s .35s; }
.receipt.is-printing > * { animation:receipt-line .28s both; }
.receipt.is-printing > :nth-child(2) { animation-delay:70ms; } .receipt.is-printing > :nth-child(3) { animation-delay:140ms; } .receipt.is-printing > :nth-child(4) { animation-delay:210ms; } .receipt.is-printing > :nth-child(5) { animation-delay:280ms; } .receipt.is-printing > :nth-child(6) { animation-delay:350ms; } .receipt.is-printing > :nth-child(7) { animation-delay:420ms; } .receipt.is-printing > :nth-child(8) { animation-delay:490ms; } .receipt.is-printing > :nth-child(9) { animation-delay:560ms; } .receipt.is-printing > :nth-child(10) { animation-delay:630ms; }
@keyframes receipt-line { from { opacity:0; transform:translateY(-10px); } }
@keyframes receipt-wobble { 30% { transform:rotate(-1.2deg); } 70% { transform:rotate(.8deg); } }
.tool-plan strong.is-ticking { animation:plan-tick .5s both; }
#plan-result.is-playing .tool-plan:nth-of-type(1) strong { animation-delay:300ms; } #plan-result.is-playing .tool-plan:nth-of-type(2) strong { animation-delay:550ms; } #plan-result.is-playing .tool-plan:nth-of-type(3) strong { animation-delay:800ms; }
@keyframes plan-tick { from { opacity:0; transform:translateY(-14px); } 60% { opacity:1; transform:translateY(3px); } to { transform:none; } }
/* The quiz's four companions: the one in the lead lifts after each answer. */
.quiz-crew { display:flex; justify-content:center; gap:clamp(.5rem,3vw,2rem); margin:0 0 1.2rem; }
.quiz-crew img { width:clamp(64px,13vw,112px); height:auto; transition:transform .35s cubic-bezier(.2,.8,.2,1),opacity .35s; }
.quiz-crew.has-leader img { opacity:.55; }
.quiz-crew.has-leader img.is-leading { opacity:1; transform:translateY(-8px) scale(1.08); }
.quiz-compare { display:flex; align-items:center; gap:.8rem; background:var(--peach); border-radius:16px; padding:.6rem 1rem; font-weight:800; margin:0 0 1.4rem; }
.quiz-compare img { width:48px; height:48px; flex:none; }
.quiz-reveal { text-align:center; font-weight:800; font-size:clamp(1.4rem,3.4vw,2.1rem); color:var(--deep-amber); padding:1.5rem 0 2rem; animation:quiz-reveal .7s ease-out both; }
@keyframes quiz-reveal { from { opacity:0; transform:scale(.96); } }
.quiz-scene { display:block; width:100%; height:auto; aspect-ratio:1290/780; max-height:min(360px,45vh); object-fit:cover; border-radius:18px; margin-bottom:1.3rem; }
.tool-result.is-flipping { animation:quiz-flip .55s cubic-bezier(.2,.8,.2,1) both; }
@keyframes quiz-flip { from { opacity:.3; transform:perspective(1200px) rotateY(80deg); } to { opacity:1; transform:none; } }
.visually-hidden { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
@media(prefers-reduced-motion:reduce){ .tool-scene,.tool-scene *,.receipt,.receipt > *,.tool-plan strong,.quiz-crew img,.quiz-reveal,.tool-result { animation:none!important; transition:none!important; } .tool-scene.is-asleep .scene-z { opacity:1; } }
[hidden] { display:none!important; }
@media(max-width:720px){ .tool-grid,.tool-cards,.tool-cta,.tool-columns,.tool-stage {grid-template-columns:1fr} .tool-hero {padding-top:1rem} .tool-actions .tool-button{flex:1 1 100%} .tool-cta .tool-button{justify-self:start} }
@media(prefers-reduced-motion:no-preference){.tool-tile,.tool-button,.choice{transition:background-color .15s,border-color .15s,transform .15s}.tool-tile:hover{transform:translateY(-3px)}}
