:root{
  --bg:#F5F0E8;--bg2:#EDE7DA;--bg3:#E4DCCC;
  --card:#FDFAF5;--text:#2C2318;--text2:#7A6A58;--text3:#A89880;
  --accent:#6B5240;--accent2:#8B6B52;
  --green:#4A7C5F;--gbg:#E8F0EB;
  --warn:#8B6020;--wbg:#F5EDD8;
  --border:#D8CEBE;--serif:'Georgia',serif;
  --red:#8B3A30;--rbg:#F5EAE8;
}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
body{font-family:'Helvetica Neue',Arial,sans-serif;background:var(--bg3);display:flex;justify-content:center;padding:16px;min-height:100vh}
.phone{width:390px;background:var(--bg);border-radius:20px;border:0.5px solid var(--border);overflow:hidden;display:flex;flex-direction:column;height:780px;position:relative;box-shadow:0 4px 32px rgba(44,35,24,.12)}

/* ── Mobile ── */
@media (max-width:480px){
  body{
    display:block;
    margin:0;padding:0;
    background:var(--bg);
  }
  .phone{
    width:100%;
    border-radius:0;border:none;box-shadow:none;
    /* высота задаётся через JS (--app-h) чтобы обойти iOS Safari баг */
    height:var(--app-h,100vh);
  }
  .scroll{
    flex:1;
    min-height:0;
    overflow-y:scroll;
    -webkit-overflow-scrolling:touch;
  }
  .bnav{
    flex-shrink:0;
    padding-bottom:env(safe-area-inset-bottom);
  }
  .sbar{display:none}
  .scr.center{min-height:0}
}
.sbar{display:none}
.hdr{padding:10px 16px 11px;display:flex;align-items:center;justify-content:space-between;border-bottom:0.5px solid var(--border);background:var(--card);flex-shrink:0}
.logo{font-family:var(--serif);font-size:17px;color:var(--text)}
.logo em{font-style:italic;color:var(--accent2)}
.lrow{display:flex;gap:3px}
.lb{font-size:10px;padding:2px 7px;border:0.5px solid var(--border);border-radius:20px;cursor:pointer;color:var(--text2);background:transparent;transition:all .15s}
.lb.on{background:var(--accent);color:var(--bg);border-color:var(--accent)}
.av{width:28px;height:28px;border-radius:50%;background:var(--bg3);color:var(--accent);display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:500;border:0.5px solid var(--border);cursor:pointer}
.scroll{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;min-height:0}

/* screens */
.scr{display:none;flex-direction:column;gap:10px;padding:14px 16px}
.scr.on{display:flex}
.scr.center{justify-content:center;align-items:center;min-height:500px}
#scr-schedule,#scr-profile{gap:8px;padding:12px 14px}

/* bottom nav */
.bnav{border-top:0.5px solid var(--border);padding:6px 0 10px;display:flex;background:var(--card);flex-shrink:0}
.bni{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;cursor:pointer;padding:4px 0}
.bni svg{width:20px;height:20px;stroke:var(--text3);fill:none;stroke-width:1.5}
.bni.on svg{stroke:var(--accent)}
.bni span{font-size:10px;color:var(--text3)}
.bni.on span{color:var(--accent);font-weight:500}

/* typography */
.ptitle{font-family:var(--serif);font-size:20px;color:var(--text);line-height:1.3}
.psub{font-size:11px;color:var(--text3);margin-top:3px}
.slbl{font-family:var(--serif);font-size:13px;font-style:italic;color:var(--text2)}

/* buttons */
.btn{font-size:13px;padding:12px;border:0.5px solid var(--border);border-radius:12px;cursor:pointer;background:transparent;color:var(--text2);width:100%;font-family:inherit;transition:all .12s;display:flex;align-items:center;justify-content:center;gap:6px}
.btn:active{opacity:.85}
.btn.pr{background:var(--accent);color:var(--bg);border-color:var(--accent)}
.btn.dk{background:#191C1F;color:#fff;border-color:#191C1F}
.btn.ol{color:var(--accent);border-color:var(--accent);background:transparent}
.btn.sm{font-size:12px;padding:8px 12px;border-radius:10px}
.btn.gh{border-color:transparent;color:var(--text3);font-size:12px;padding:8px;width:auto}

/* form */
.ff{display:flex;flex-direction:column;gap:4px}
.ff label{font-size:11px;color:var(--text3)}
.ff input,.ff select{font-size:14px;padding:11px 13px;border:0.5px solid var(--border);border-radius:11px;background:var(--card);color:var(--text);outline:none;width:100%;font-family:inherit;transition:border-color .15s}
.ff input:focus,.ff select:focus{border-color:var(--accent)}
.ff input.err{border-color:var(--red)}
.ferr{font-size:11px;color:var(--red);margin-top:2px;display:none}

/* checkboxes */
.cbrow{display:flex;align-items:flex-start;gap:10px;cursor:pointer}
.cbrow input{width:18px;height:18px;accent-color:var(--accent);flex-shrink:0;margin-top:1px;cursor:pointer}
.cbrow span{font-size:12px;color:var(--text2);line-height:1.5}
.cbrow span a{color:var(--accent);text-decoration:underline;cursor:pointer}

/* legal box */
.legal{background:var(--bg2);border-radius:11px;padding:11px 13px;font-size:11px;color:var(--text2);line-height:1.6}
.legal a{color:var(--accent);text-decoration:underline;cursor:pointer}

/* OTP */
.orow{display:flex;gap:8px;justify-content:center}
.oi{width:44px;height:52px;border:0.5px solid var(--border);border-radius:11px;background:var(--card);font-size:22px;font-weight:500;color:var(--text);text-align:center;outline:none;font-family:inherit;transition:border-color .15s}
.oi:focus{border-color:var(--accent)}

/* sub card */
.subcard{background:var(--accent);border-radius:14px;padding:16px;color:var(--bg);position:relative;overflow:hidden}
.subcard::before{content:'';position:absolute;right:-20px;top:-20px;width:90px;height:90px;border-radius:50%;background:rgba(255,255,255,.07)}
.slabel{font-size:10px;opacity:.7;margin-bottom:4px;text-transform:uppercase;letter-spacing:.06em}
.stype{font-family:var(--serif);font-size:14px;margin-bottom:11px;opacity:.9}
.sdots{display:flex;gap:6px;margin-bottom:9px}
.sd{width:22px;height:22px;border-radius:50%;border:1.5px solid rgba(255,255,255,.3)}
.sd.u{background:rgba(255,255,255,.2);border-color:rgba(255,255,255,.4)}
.sd.l{background:rgba(255,255,255,.85);border-color:#fff}
.smeta{display:flex;justify-content:space-between;font-size:11px;opacity:.7}

/* warn */
.warn{background:var(--wbg);border:0.5px solid #D4B870;border-radius:12px;padding:9px 12px;display:flex;align-items:center;gap:8px}
.wi{width:18px;height:18px;border-radius:50%;background:#D4B870;display:flex;align-items:center;justify-content:center;font-size:10px;color:var(--warn);font-weight:500;flex-shrink:0}

/* card */
.card{background:var(--card);border:0.5px solid var(--border);border-radius:14px;padding:13px 15px}
.card2{background:var(--bg2);border-radius:12px;padding:10px 12px}

/* hist */
.hrow{display:flex;align-items:center;gap:10px;padding:9px 12px;background:var(--card);border-radius:12px;border:0.5px solid var(--border)}

/* slots */
.dayb{background:var(--card);border:0.5px solid var(--border);border-radius:12px;overflow:hidden}
.daylbl{font-size:11px;font-weight:500;color:var(--text2);padding:5px 10px 4px;background:var(--bg2);border-bottom:0.5px solid var(--border)}
.slots{display:flex;flex-wrap:wrap;gap:5px;padding:7px 9px}
.slot{padding:5px 7px;border-radius:7px;font-size:11px;cursor:pointer;border:0.5px solid transparent;display:flex;flex-direction:column;align-items:center;min-width:60px;transition:all .12s}
.slot.mo{background:var(--card);border-color:var(--border);color:var(--text2)}
.slot.ev{background:var(--card);border-color:var(--border);color:var(--text2)}
.slot.fu{background:var(--bg2);border-color:var(--border);color:var(--text3);cursor:pointer;opacity:.85}
.slot.mi{background:var(--accent);border-color:var(--accent);color:var(--bg)}
.slot.wl{background:var(--wbg);border-color:#D4B870;color:var(--warn);cursor:pointer}
.slot:active:not(.fu):not(.mi){opacity:.8}

/* pay opts */
.popt{background:var(--card);border:0.5px solid var(--border);border-radius:12px;padding:13px 14px;cursor:pointer;display:flex;justify-content:space-between;align-items:center;transition:all .12s}
.popt:active{background:var(--bg2)}
.popt.sel{border-color:var(--accent);background:#F0EAE0}
.optprice{font-family:var(--serif);font-size:20px;color:var(--accent)}

/* profile rows */
.prow{display:flex;justify-content:space-between;align-items:center;padding:8px 11px;background:var(--card);border-radius:10px;border:0.5px solid var(--border)}

/* sheet */
.ov{display:none;position:absolute;inset:0;background:rgba(44,35,24,.45);z-index:50;align-items:flex-end}
.ov.on{display:flex}
.sheet{background:var(--card);border-radius:20px 20px 0 0;padding:18px;width:100%;max-height:88%;overflow-y:auto}
.shand{width:36px;height:3px;background:var(--border);border-radius:2px;margin:0 auto 16px}
.stitle{font-family:var(--serif);font-size:17px;color:var(--text);margin-bottom:4px}
.ssub{font-size:12px;color:var(--text2);margin-bottom:14px;line-height:1.5}
.tcon{font-size:12px;color:var(--text2);line-height:1.8}
.tcon h3{font-size:13px;font-weight:500;color:var(--text);margin:12px 0 4px}

/* progress */
.prog{height:5px;border-radius:3px;background:var(--border);overflow:hidden;margin-top:3px}
.progf{height:100%;border-radius:3px;background:var(--green);transition:width .3s}

/* week nav */
.wnav{display:flex;align-items:center;gap:8px}
.wlbl{flex:1;text-align:center;font-size:12px;font-weight:500;color:var(--text)}
.wbtn{width:28px;height:28px;border:0.5px solid var(--border);border-radius:8px;cursor:pointer;background:transparent;display:flex;align-items:center;justify-content:center;color:var(--text2);font-size:14px}

/* onboard steps */
.ob{display:none;flex-direction:column;gap:14px}
.ob.on{display:flex}
.sdots2{display:flex;gap:5px;justify-content:center}
.sdot2{width:7px;height:7px;border-radius:50%;background:var(--border);transition:all .2s}
.sdot2.on{background:var(--accent);width:20px;border-radius:4px}

/* toast */
.toast{position:absolute;bottom:85px;left:16px;right:16px;background:var(--accent);color:var(--bg);padding:10px 14px;border-radius:12px;font-size:12px;opacity:0;transition:opacity .25s;pointer-events:none;text-align:center;z-index:200}
.toast.on{opacity:1}
