:root{
  --bg:#f4f6f7; --fg:#16191c; --muted:#5b646c; --line:#d8dde1; --card:#ffffff; --field:#f4f6f7;
  --ok:#0f7a56; --warn:#9a5b00; --bad:#bb2437;
  --brand:#d7263d; --on-brand:#ffffff;
  --display:'Barlow Condensed','Arial Narrow',sans-serif;
  --body:'Barlow',system-ui,-apple-system,'Segoe UI',sans-serif;
  --mono:'DM Mono',ui-monospace,Consolas,monospace;
}
@media (prefers-color-scheme: dark){
  :root{ --bg:#101316; --fg:#eef0f2; --muted:#98a2ab; --line:#2a2f34; --card:#1a1e22; --field:#101316;
    --ok:#4cc79a; --warn:#e5a54b; --bad:#ff7d8b; color-scheme:dark; }
}
*{box-sizing:border-box}
[hidden]{display:none !important}
html,body{margin:0}
body{background:var(--bg); color:var(--fg); font-family:var(--body); font-size:16px; line-height:1.45; -webkit-text-size-adjust:100%}
button{font:inherit; color:inherit; cursor:pointer}
button:disabled{cursor:not-allowed; opacity:.5}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--brand); outline-offset:2px}

.app{max-width:520px; margin:0 auto; min-height:100svh; display:flex; flex-direction:column; padding-top:env(safe-area-inset-top,0px)}
.boot{padding:40px 16px; color:var(--muted); text-align:center}
.head{display:flex; align-items:center; gap:10px; padding:12px 16px 8px}
.logo{width:40px; height:40px; border-radius:12px; background:var(--brand); color:var(--on-brand); display:grid; place-items:center; font-family:var(--display); font-weight:700; font-size:19px; flex:none}
.head b{display:block; font-family:var(--display); font-size:21px; line-height:1.1; font-weight:700; overflow-wrap:anywhere}
.head small{color:var(--muted); font-size:13px}
.head > div:nth-child(2){flex:1; min-width:0}
.main{flex:1; padding:6px 16px calc(96px + env(safe-area-inset-bottom,0px))}

h2{font-family:var(--display); font-size:28px; line-height:1.05; margin:8px 0 4px; font-weight:700; text-transform:uppercase; letter-spacing:.01em}
.sub{color:var(--muted); font-size:14px; margin:0 0 14px}
.sec{font-family:var(--mono); font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); margin:20px 0 6px}
.lbl{display:block; font-family:var(--mono); font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); margin:14px 0 6px}
.lbl:first-child{margin-top:0}
.mono{font-family:var(--mono); font-size:12.5px; color:var(--muted)}
.card{background:var(--card); border:1px solid var(--line); border-radius:14px; padding:14px; margin-bottom:12px}
.txt{width:100%; padding:11px 12px; border:1px solid var(--line); border-radius:10px; background:var(--field); color:var(--fg); font:inherit}
textarea.txt{min-height:110px; resize:vertical; line-height:1.4}

.btn{display:block; width:100%; border:0; background:var(--brand); color:var(--on-brand); border-radius:12px; padding:13px 16px; font-weight:600; font-size:16px; text-align:center}
.btn.ghost{background:none; color:var(--fg); border:1.5px solid var(--line)}
.btn.danger{background:none; color:var(--bad); border:1.5px solid var(--bad)}
.btn.sm{display:inline-block; width:auto; padding:7px 12px; font-size:14px; border-radius:9px; white-space:nowrap}
.stack > * + *{margin-top:8px}
.linkbtn{border:0; background:none; color:var(--muted); text-decoration:underline; font-size:13px; padding:6px}
.back{border:0; background:none; color:var(--muted); padding:4px 0 6px; font-size:14px}

.pill{display:inline-block; font-family:var(--mono); font-size:11px; padding:3px 8px; border-radius:99px; border:1px solid currentColor; white-space:nowrap}
.pill.ok{color:var(--ok)} .pill.warn{color:var(--warn)} .pill.bad{color:var(--bad)}
.stats{display:grid; grid-template-columns:repeat(3,1fr); border:1px solid var(--line); border-radius:14px; background:var(--card); margin-bottom:12px}
.stats div{padding:12px; border-right:1px solid var(--line); min-width:0}
.stats div:last-child{border-right:0}
.stats b{display:block; font-family:var(--display); font-size:26px; line-height:1.05; font-weight:700}
.stats small{color:var(--muted); font-size:12px; display:block}
.row{display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px 0; border-bottom:1px solid var(--line)}
.row:last-child{border-bottom:0}
.row .l{min-width:0}
.row b{font-weight:600; display:block; overflow-wrap:anywhere}
.row small{color:var(--muted); font-size:13px; display:block}
.rowbtn{width:100%; background:none; border:0; border-bottom:1px solid var(--line); text-align:left}
.rowbtn:last-child{border-bottom:0}
.empty{color:var(--muted); text-align:center; padding:28px 8px; font-size:14px}
.warnline{font-size:13px; color:var(--warn); margin:8px 0 0}
.errline{font-size:14px; color:var(--bad); margin:10px 0 0}
.chips{display:flex; gap:6px; flex-wrap:wrap}
.chips button{border:1px solid var(--line); background:var(--field); border-radius:10px; padding:8px 12px; font-size:14px}
.chips button[aria-pressed="true"]{background:var(--fg); color:var(--bg); border-color:var(--fg)}
.two{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.price{font-family:var(--display); font-size:40px; font-weight:700; line-height:1}
.price .mono{font-size:13px}
.note{border-left:3px solid var(--brand); padding:2px 0 2px 12px; font-size:14px; white-space:pre-line}
.note span{display:block; font-family:var(--mono); font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted)}
.linkbox{display:flex; gap:8px; margin:8px 0}
.linkbox .txt{font-family:var(--mono); font-size:12.5px}

.sw{display:flex; gap:10px; flex-wrap:wrap}
.sw button{width:36px; height:36px; border-radius:50%; border:3px solid var(--card); box-shadow:0 0 0 1px var(--line); padding:0}
.sw button[aria-checked="true"]{box-shadow:0 0 0 3px var(--fg)}

.days{display:grid; grid-template-columns:repeat(6,1fr); gap:6px; margin-bottom:10px}
.days button{padding:8px 0; border:1px solid var(--line); border-radius:10px; background:none; font-weight:600; font-size:14px}
.days button.today{border-color:var(--brand)}
.days button[aria-pressed="true"]{background:var(--fg); color:var(--bg); border-color:var(--fg)}
.days button:disabled{opacity:.4; text-decoration:line-through}
.slot{display:flex; align-items:center; gap:12px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:var(--card); margin-bottom:8px; min-height:56px}
.slot .t{width:46px; flex:none}
.slot > div{flex:1; min-width:0}
.slot b{display:block; font-weight:600}
.slot small{color:var(--muted); font-size:13px}
.slot.free{background:none; border-style:dashed}
.addbtn{flex:1; border:0; background:none; text-align:left; color:var(--muted); padding:8px 0}
.slot.picking{align-items:flex-start; border-color:var(--brand)}
.pick{flex:1; display:grid; gap:6px; min-width:0}
.pick button{display:flex; justify-content:space-between; gap:8px; padding:9px 12px; border:1px solid var(--line); border-radius:9px; background:var(--field); text-align:left}
.pick .cancel{border:0; background:none; color:var(--muted); justify-content:flex-start; padding:4px 0}
.sets{display:flex; gap:8px; flex-wrap:wrap}
.set{width:44px; height:44px; border-radius:50%; border:1.5px solid var(--line); background:var(--field); font-family:var(--mono); font-size:14px; padding:0}
.set[aria-pressed="true"]{background:var(--brand); border-color:var(--brand); color:var(--on-brand)}
.ex + .ex{border-top:1px solid var(--line); margin-top:12px; padding-top:4px}
.grid{display:grid; grid-template-columns:repeat(3,1fr); gap:6px}
.ph{aspect-ratio:3/4; border:1px solid var(--line); border-radius:10px; overflow:hidden; padding:0; background:var(--field); position:relative}
.ph img{width:100%; height:100%; object-fit:cover; display:block}
.ph span{position:absolute; left:0; right:0; bottom:0; font-family:var(--mono); font-size:10.5px; color:#fff; background:linear-gradient(transparent, rgba(0,0,0,.7)); padding:12px 6px 4px; text-align:left}
.dayh{font-family:var(--mono); font-size:12px; color:var(--muted); margin:14px 0 6px}

.tabbar{position:fixed; left:0; right:0; bottom:0; background:var(--card); border-top:1px solid var(--line); padding-bottom:env(safe-area-inset-bottom,0px)}
.tabbar nav{max-width:520px; margin:0 auto; display:grid; grid-auto-flow:column; grid-auto-columns:1fr; padding:4px 2px 6px}
.tabbar button{position:relative; border:0; background:none; display:grid; justify-items:center; gap:2px; padding:10px 2px 4px; font-size:11.5px; color:var(--muted); min-width:0}
.tabbar svg{width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round}
.tabbar button[aria-current="page"]{color:var(--fg); font-weight:600}
.tabbar button[aria-current="page"]::before{content:""; position:absolute; top:0; left:25%; right:25%; height:3px; border-radius:0 0 3px 3px; background:var(--brand)}

.auth{padding:32px 20px; display:flex; flex-direction:column; gap:8px; margin:auto 0}
.auth .logo{width:56px; height:56px; font-size:26px; border-radius:16px}
.auth h1{font-family:var(--display); font-size:40px; line-height:1; margin:10px 0 2px; text-transform:uppercase}
.seg{display:inline-flex; border:1px solid var(--line); border-radius:10px; padding:3px; background:var(--card); margin:14px 0 6px; align-self:flex-start}
.seg button{border:0; background:none; padding:8px 16px; border-radius:7px; font-weight:600}
.seg button[aria-pressed="true"]{background:var(--fg); color:var(--bg)}

.modal{position:fixed; inset:0; background:rgba(0,0,0,.86); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; padding:16px; z-index:10}
.modal img{max-width:100%; max-height:72svh; border-radius:10px}
.modal p{color:#fff; margin:0; font-family:var(--mono); font-size:13px}
.modal .acts{display:flex; gap:10px}
.modal .btn{width:auto; padding:9px 18px}
.modal .btn.ghost{color:#fff; border-color:#ffffff88}

.toast{position:fixed; left:16px; right:16px; bottom:calc(84px + env(safe-area-inset-bottom,0px)); max-width:488px; margin:0 auto; background:var(--fg); color:var(--bg); padding:10px 14px; border-radius:10px; font-size:14px; opacity:0; pointer-events:none; z-index:20}
.toast.show{opacity:1}
@media (prefers-reduced-motion: no-preference){ .toast{transition:opacity .2s ease} }
