/* Study Spotter app: cream café menu board, phone-first column, bottom tabs. */
:root{
  --cream:#F5EEDF; --paper:#FBF7EE; --fill:#EFE6D3; --fill2:#E3D7BF; --line:#DDD0B6; --line2:#BFAF92;
  --ink:#2A2420; --ink2:#4A3F36; --muted:#6F6357;
  --accent:#B5552B; --accent-hover:#9C4622; --accent-ink:#FFF8EC; --accent-soft:#F2DCC7;
  --star:#D99A1E;
  --l0:#E3D7BF; --l1:#3F8A4E; --l2:#7E9C2E; --l3:#C9931A; --l4:#D2652A; --l5:#BF3A30;
  --t1:#2F6E3E; --t2:#5A741C; --t3:#7A5A00; --t4:#A2461A; --t5:#9E2E26;
  --shadow:0 12px 30px rgba(74,52,30,.16);
  --display:"Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --body:"Work Sans", "Helvetica Neue", Arial, sans-serif;
  --tabh:64px;
  color-scheme:light;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{margin:0;background:var(--cream);color:var(--ink);font-family:var(--body);font-size:16px;line-height:1.5;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
a{color:var(--accent)}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px;border-radius:8px}
img{max-width:100%}

.top{position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;gap:10px;background:rgba(245,238,223,.94);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-bottom:1px solid var(--line);padding:calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px))}
.brand{display:flex;align-items:center;gap:8px;text-decoration:none;color:var(--ink);font-family:var(--display);font-size:26px;letter-spacing:.04em;line-height:1}
.brand svg{width:24px;height:24px;color:var(--accent)}
.schoolbtn{display:inline-flex;align-items:center;gap:6px;max-width:60%;background:var(--paper);border:1px solid var(--line2);border-radius:999px;padding:8px 12px;font-size:13px;font-weight:700;min-height:40px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.schoolbtn svg{width:15px;height:15px;flex:none;color:var(--accent)}

main{max-width:560px;margin:0 auto;padding:18px max(16px, env(safe-area-inset-right, 0px)) calc(var(--tabh) + 40px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px))}
.view{display:flex;flex-direction:column;gap:18px}
.hi{margin:0;font-size:14px;font-weight:600;color:var(--muted)}
.ask{margin:-8px 0 0;font-family:var(--display);font-weight:400;font-size:clamp(46px,12vw,64px);line-height:.92;letter-spacing:.01em}
.h2{margin:0;font-family:var(--display);font-weight:400;font-size:40px;line-height:.95}
.label{margin:0;font-size:12px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--ink2)}
.sub{margin:0;font-size:14px;color:var(--muted)}
.row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}

.moods{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.mood{display:flex;flex-direction:column;align-items:flex-start;gap:4px;text-align:left;padding:16px;border-radius:18px;min-height:78px;background:var(--paper);border:2px solid var(--line2)}
.mood b{font-size:16px}.mood span{font-size:12px;color:var(--muted);font-weight:500}
.mood[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:var(--paper)}.mood[aria-pressed="true"] span{color:var(--fill2)}

.btn,.btn-out,.btn-soft{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;border-radius:18px;padding:15px;font-size:17px;font-weight:700;min-height:56px;text-decoration:none;border:0}
.btn{background:var(--accent);color:var(--accent-ink)}
.btn:hover{background:var(--accent-hover);color:var(--accent-ink)}
.btn-out{background:transparent;color:var(--ink);border:2px solid var(--ink)}
.btn-soft{background:var(--paper);color:var(--ink);border:1px solid var(--line2);font-size:15px;min-height:50px}
.btn svg,.btn-out svg,.btn-soft svg{width:18px;height:18px;flex:none}
.btn:disabled,.btn-out:disabled{opacity:.5;cursor:not-allowed}
.btn-row{display:flex;gap:10px}
.btn-row > *{flex:1}
.link{background:none;border:0;padding:0;color:var(--accent);font-weight:700;font-size:14px}
.icon-btn{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;background:var(--paper);border:0;color:var(--ink)}
.icon-btn svg{width:20px;height:20px}

.list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.item{display:flex;align-items:center;gap:12px;width:100%;background:var(--paper);border:0;border-radius:18px;padding:10px;text-align:left;color:var(--ink)}
.item .thumb{width:58px;height:58px;border-radius:14px}
.item > svg{width:18px;height:18px;color:var(--muted);flex:none}
.it{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.it b{font-size:15px;overflow-wrap:anywhere}
.it span{font-size:13px;font-weight:600}
.it small{font-size:12px;color:var(--muted)}
.thumb{display:block;flex:none;object-fit:cover;background:var(--fill);width:32px;height:32px;border-radius:9px}

.card{background:var(--paper);border-radius:22px;padding:16px}
.pick{background:var(--paper);border-radius:26px;overflow:hidden;box-shadow:var(--shadow)}
.photo-wrap{position:relative;height:230px;background:var(--fill)}
.photo-wrap img{width:100%;height:100%;object-fit:cover;display:block}
.pill{position:absolute;left:14px;top:14px;display:inline-flex;align-items:center;gap:6px;background:var(--paper);padding:7px 12px;border-radius:999px;font-size:13px;font-weight:700}
.pill i{width:9px;height:9px;border-radius:50%}
.ph-tag{position:absolute;right:12px;bottom:12px;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#FFFFFF;background:rgba(0,0,0,.55);border-radius:999px;padding:4px 10px;border:0}
.pick-body{padding:16px 18px 18px;display:flex;flex-direction:column;gap:12px}
.pick-body h3{margin:0;font-family:var(--display);font-weight:400;font-size:32px;line-height:1;overflow-wrap:anywhere}
.reasons{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.reasons li{display:flex;gap:10px;align-items:flex-start;font-size:15px}
.reasons svg{flex:none;width:18px;height:18px;color:var(--t1);margin-top:2px}
.stars{display:inline-flex;align-items:center;gap:4px;font-weight:700;white-space:nowrap}
.stars svg{width:16px;height:16px;color:var(--star)}

.hero{position:relative;margin:-18px calc(-1 * max(16px, env(safe-area-inset-left, 0px))) 0;height:260px;background:var(--fill)}
.hero img{width:100%;height:100%;object-fit:cover;display:block}
.hero .icon-btn{position:absolute;left:16px;top:16px}
.spot-head{display:flex;flex-direction:column;gap:4px;margin-top:-4px}
.spot-head h2{margin:0;font-family:var(--display);font-weight:400;font-size:40px;line-height:.95;overflow-wrap:anywhere}
.now{display:flex;align-items:center;gap:14px}
.now b{font-family:var(--display);font-weight:400;font-size:28px;line-height:1}
.meter{display:flex;align-items:flex-end;gap:4px;height:38px;flex:none}
.meter i{display:block;width:9px;border-radius:2px;background:var(--l0)}
.bars{display:grid;grid-template-columns:repeat(16,minmax(0,1fr));gap:3px;align-items:end;height:80px}
.bars i{display:block;border-radius:3px 3px 1px 1px;min-height:4px;background:var(--l0)}
.bars i.past{opacity:.35}
.bars i.none{background:repeating-linear-gradient(135deg,var(--fill2) 0 3px,transparent 3px 6px);height:16%!important}
.bars i.cur{outline:2px solid var(--ink);outline-offset:2px}
.axis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));font-size:11px;color:var(--muted)}
.axis span:nth-child(2),.axis span:nth-child(3){text-align:center}.axis span:last-child{text-align:right}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border-radius:999px;background:var(--paper);border:1px solid var(--line2);font-size:13px;font-weight:600;color:var(--ink);text-decoration:none}
.chip svg{width:15px;height:15px}
.chip[aria-pressed="true"]{background:var(--ink);color:var(--paper);border-color:var(--ink)}

.photos{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.photos button,.photos .add{aspect-ratio:1/1;max-width:100%;border-radius:12px;overflow:hidden;border:0;padding:0;background:var(--fill)}
.photos img{width:100%;height:100%;object-fit:cover;display:block}
.photos .add{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border:1.5px dashed var(--line2);background:var(--paper);font-size:12px;font-weight:700;color:var(--ink2)}
.photos .add svg{width:24px;height:24px}

.review{display:flex;flex-direction:column;gap:6px;padding:14px 0;border-bottom:1px dotted var(--line2)}
.review:last-child{border-bottom:0}
.who{display:flex;align-items:center;gap:10px}
.av{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent);font-weight:700;overflow:hidden;flex:none}
.av img{width:100%;height:100%;object-fit:cover}
.av.lg{width:72px;height:72px;font-size:28px}
.review p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.tags{display:flex;flex-wrap:wrap;gap:6px}
.tag{font-size:12px;font-weight:600;border-radius:999px;padding:3px 10px;background:var(--fill);color:var(--ink2)}

.lvls{display:flex;flex-direction:column;gap:10px}
.lvl{display:flex;align-items:center;gap:14px;background:var(--paper);border:2px solid var(--line2);border-radius:18px;padding:14px 16px;font-size:17px;font-weight:700;min-height:64px;text-align:left;color:var(--ink)}
.lvl:disabled{opacity:.45;cursor:not-allowed}
.lvl .meter{height:28px;gap:3px}.lvl .meter i{width:7px}
.done{display:flex;flex-direction:column;align-items:center;text-align:center;gap:14px;padding:8px 0}
.done .ok{display:grid;place-items:center;width:92px;height:92px;border-radius:50%;background:var(--accent);color:var(--accent-ink)}
.done .ok svg{width:46px;height:46px}
.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;width:100%}
.stats div{background:var(--paper);border-radius:18px;padding:14px 8px;display:flex;flex-direction:column;align-items:center;text-align:center}
.stats b{font-family:var(--display);font-weight:400;font-size:34px;line-height:1}
.stats span{font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.note{margin:0;font-size:14px;color:var(--muted)}
.note.err{color:var(--t5);font-weight:600}

#mapEl{height:52vh;min-height:300px;border-radius:22px;overflow:hidden;background:var(--fill);z-index:1}
.leaflet-popup-content{font-family:var(--body);margin:12px 14px}
.leaflet-popup-content b{display:block;font-size:15px}
.leaflet-popup-content button{margin-top:8px;background:var(--accent);color:var(--accent-ink);border:0;border-radius:999px;padding:8px 14px;font-weight:700}
.legend{display:flex;flex-wrap:wrap;gap:6px 12px;font-size:12px;color:var(--muted)}
.legend span{display:inline-flex;align-items:center;gap:5px}
.legend i{width:11px;height:11px;border-radius:50%;display:inline-block}

.field{display:flex;flex-direction:column;gap:6px;font-size:14px;font-weight:600}
.field input,.field textarea,.field select{background:var(--paper);border:1.5px solid var(--line2);border-radius:14px;padding:12px 14px;font-size:16px;font-weight:400;min-height:50px}
.field textarea{min-height:120px;resize:vertical}
.field input:focus,.field textarea:focus,.field select:focus{border-color:var(--ink);outline:none}
.starpick{display:flex;gap:6px}
.starpick button{width:48px;height:48px;border-radius:12px;border:0;background:var(--fill2);color:#FFFFFF;display:grid;place-items:center}
.starpick button.on{background:var(--star)}
.starpick svg{width:26px;height:26px}
.divider{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:13px}
.divider::before,.divider::after{content:"";flex:1;height:1px;background:var(--line2)}

.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:30;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));background:rgba(251,247,238,.95);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-top:1px solid var(--line);padding:6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px))}
.tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:52px;background:none;border:0;color:var(--muted);font-size:11px;font-weight:600}
.tab svg{width:24px;height:24px}
.tab[aria-current="page"]{color:var(--accent);font-weight:700}

.sheet{position:fixed;inset:0;z-index:50;background:rgba(42,36,32,.5);display:flex;align-items:flex-end;justify-content:center}
.sheet-card{width:min(560px,100%);max-height:90vh;overflow:auto;background:var(--cream);border-radius:26px 26px 0 0;padding:20px max(18px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));display:flex;flex-direction:column;gap:14px}
@media (min-width:700px){.sheet{align-items:center}.sheet-card{border-radius:26px}}
.sheet-card h2{margin:0;font-family:var(--display);font-weight:400;font-size:34px;line-height:1}

.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(var(--tabh) + 20px + env(safe-area-inset-bottom, 0px));z-index:60;background:var(--ink);color:var(--paper);padding:11px 20px;border-radius:999px;font-weight:600;font-size:14px;box-shadow:var(--shadow);max-width:calc(100% - 32px);text-align:center}
.banner{background:var(--accent-soft);border-radius:18px;padding:14px 16px;display:flex;flex-direction:column;gap:6px;font-size:14px}
.banner b{font-size:15px}
.empty{text-align:center;color:var(--muted);padding:12px 0}
.setup{max-width:520px;margin:12vh auto;padding:24px;display:flex;flex-direction:column;gap:12px}
@media (prefers-reduced-motion:no-preference){.toast{animation:pop .3s ease-out}@keyframes pop{from{opacity:0;transform:translate(-50%,10px)}to{opacity:1;transform:translate(-50%,0)}}}
