/* BookBag v2 layout */
body{min-height:100vh;-webkit-tap-highlight-color:transparent}
.screen{min-height:100vh}
.wide{width:100%;justify-content:center}
.link{background:none;border:0;color:var(--muted);font-weight:600;cursor:pointer;padding:8px}
.auth-wrap{max-width:420px;margin:0 auto;padding:12vh 18px 40px;text-align:center}
.auth-wrap .card{text-align:left}
.big-logo{width:64px;height:64px;border-radius:20px;margin:0 auto}
.auth-title{font:800 38px/1 'Bricolage Grotesque',sans-serif;margin:16px 0 0;letter-spacing:-.02em}
.code-input{font:700 26px/1 ui-monospace,Menlo,monospace;letter-spacing:.3em;text-align:center}

/* header */
.apphead{position:sticky;top:0;z-index:10;background:rgba(251,246,238,.92);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);padding:calc(env(safe-area-inset-top) + 12px) 16px 8px;border-bottom:1px solid transparent}
.apphead .kids{margin:10px 0 2px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.apphead .kids::-webkit-scrollbar{display:none}
.apphead .chip{white-space:nowrap}
.sm-logo{width:32px;height:32px;border-radius:10px}
.apptitle{font:800 26px/1 'Bricolage Grotesque',sans-serif;margin:0}
.appmain{max-width:760px;margin:0 auto;padding:6px 14px calc(110px + env(safe-area-inset-bottom))}

/* bottom nav */
.bottomnav{position:fixed;left:0;right:0;bottom:0;z-index:20;display:flex;justify-content:space-around;align-items:flex-end;background:rgba(255,255,255,.96);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-top:1px solid var(--line);padding:6px 6px calc(6px + env(safe-area-inset-bottom))}
.bottomnav button{flex:1;border:0;background:none;display:flex;flex-direction:column;align-items:center;gap:2px;color:var(--muted);font-size:11px;font-weight:600;padding:4px 0;cursor:pointer}
.bottomnav svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.bottomnav button.on{color:var(--ink)}
.bottomnav .plus{flex:none;width:62px;height:62px;border-radius:50%;background:var(--accent);color:#fff;margin:-26px 6px 2px;box-shadow:0 10px 24px -8px rgba(255,107,74,.75);justify-content:center}
.bottomnav .plus svg{width:30px;height:30px;stroke-width:2.6}

/* cards */
.newcard{border:2px solid var(--accent)}
.justcard{border:2px solid var(--ok)}
.nitem{display:flex;gap:10px;align-items:center;padding:10px 0;border-top:1px solid var(--line)}
.nitem:first-child{border-top:0}
.nitem .body{flex:1;min-width:0;cursor:pointer}
.nitem .t{font-weight:600}
.nitem .meta{font-size:13px;color:var(--muted)}
.rb{width:40px;height:40px;border-radius:12px;border:1px solid var(--line);background:#fff;display:grid;place-items:center;cursor:pointer;font-size:18px;flex:none}
.rb.yes{background:var(--ok);border-color:var(--ok);color:#fff}
.rb svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.undo{border:0;background:none;color:var(--accent);font-weight:700;cursor:pointer;padding:6px}

/* sheets */
.sheet-back{position:fixed;inset:0;background:rgba(30,35,64,.4);opacity:0;pointer-events:none;transition:.2s;z-index:30}
.sheet-back.on{opacity:1;pointer-events:auto}
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:31;background:var(--bg);border-radius:22px 22px 0 0;padding:10px 18px calc(22px + env(safe-area-inset-bottom));transform:translateY(105%);transition:transform .25s ease;max-height:88vh;overflow:auto;max-width:640px;margin:0 auto}
.sheet.on{transform:none}
.grab{width:40px;height:5px;border-radius:3px;background:#DCD3C3;margin:0 auto 8px}
.sheet-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.sheet-btn{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;background:#fff;border:1px solid var(--line);border-radius:16px;padding:14px;cursor:pointer;font:inherit;color:inherit}
.sheet-btn .ico{font-size:24px;margin-bottom:4px}
.sheet-btn small{color:var(--muted)}
.sheet-btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}
.sheet-btn.primary small{color:#FFE6DF}
.tip{margin:14px 0 0}

/* busy */
.busy{position:fixed;inset:0;z-index:60;display:grid;place-items:center;background:rgba(251,246,238,.7);backdrop-filter:blur(3px)}
.busy-card{background:#fff;border-radius:16px;padding:16px 20px;box-shadow:var(--shadow);display:flex;gap:12px;align-items:center;font-weight:600}
.spin.dark{border-color:rgba(30,35,64,.2);border-top-color:var(--ink)}

/* setup */
#setupView{max-width:520px;margin:0 auto;padding:calc(env(safe-area-inset-top) + 14px) 20px 40px}
.setup-top{display:flex;justify-content:space-between;align-items:center}
.dots{display:flex;gap:6px}
.dots span{width:8px;height:8px;border-radius:4px;background:#E3D9C8;transition:.2s}
.dots span.on{width:22px;background:var(--accent)}
.setup-body{padding-top:8vh}
.setup-body h1{font:800 32px/1.1 'Bricolage Grotesque',sans-serif;margin:0 0 10px;letter-spacing:-.02em}
.setup-body .lead{color:var(--muted);margin:0 0 22px;font-size:16px}
.setup-actions{display:flex;flex-direction:column;gap:10px;margin-top:24px}
.setup-actions .btn{justify-content:center;padding:14px}

/* misc */
.toggle{display:flex;gap:12px;align-items:flex-start;padding:10px 0;border-top:1px solid var(--line)}
.toggle:first-of-type{border-top:0}
.toggle input{width:22px;height:22px;flex:none;margin-top:1px}
.kidrow{display:flex;align-items:center;gap:10px;padding:10px 0;border-top:1px solid var(--line);cursor:pointer}
.kidrow:first-child{border-top:0}
.kidrow .body{flex:1}
.toast{bottom:calc(96px + env(safe-area-inset-bottom))}
@media(min-width:900px){.bottomnav{max-width:520px;margin:0 auto 14px;border:1px solid var(--line);border-radius:22px;left:0;right:0}}
.apphead{display:block;margin:0}

/* install + email explainer */
.installcard{background:#fff;border:2px dashed var(--accent)}
.installcard .x{float:right;border:0;background:none;font-size:20px;color:var(--muted);cursor:pointer;margin:-6px -6px 0 0}
.isteps{margin:10px 0 0;padding:0;list-style:none;counter-reset:s}
.isteps li{counter-increment:s;display:flex;gap:10px;align-items:flex-start;padding:7px 0}
.isteps li::before{content:counter(s);flex:none;width:24px;height:24px;border-radius:50%;background:var(--ink);color:#fff;font:700 13px/24px Inter;text-align:center}
.shareico{display:inline-block;vertical-align:-4px;width:18px;height:18px}
.flow{display:flex;align-items:center;gap:6px;margin:12px 0 14px;flex-wrap:wrap}
.flow span{background:#F1E9DC;border-radius:10px;padding:7px 10px;font-size:13px;font-weight:600}
.flow i{color:var(--muted);font-style:normal}
.opt{border:1px solid var(--line);border-radius:14px;padding:14px;margin-top:12px;background:#FFFDF9}
.opt h3{margin:0 0 2px}
.opt .tag{display:inline-block;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;background:var(--ok-soft);color:var(--ok);border-radius:6px;padding:2px 7px;margin-left:6px;vertical-align:2px}

.wstep{display:flex;gap:12px;padding:14px 0 4px;border-top:1px solid var(--line);margin-top:12px}
.wnum{flex:none;width:28px;height:28px;border-radius:50%;background:var(--accent);color:#fff;font:700 14px/28px Inter;text-align:center}
.wbody{flex:1;min-width:0}
.confirmbox{background:var(--ok-soft);border-radius:12px;padding:12px;margin-top:8px}
.btn.ok{background:var(--ok)}
.okbadge{background:var(--ok-soft);color:var(--ok);font-weight:700;border-radius:10px;padding:8px 12px;margin:8px 0 4px;font-size:14px}
a.btn{text-decoration:none}
