/* City Events — mobile-first, responsive, light+dark */
:root{
  --bg:#f7f8fa; --card:#ffffff; --ink:#1a1d24; --muted:#6b7280; --line:#e5e7eb;
  --brand:#2563eb; --brand-ink:#ffffff; --accent:#0ea5e9;
  --ok:#16a34a; --warn:#d97706; --bad:#dc2626;
  --pill:#eef2ff; --chipbg:#eef1f5; --chip-on:#2563eb; --chip-on-ink:#fff;
  --shadow:0 1px 3px rgba(0,0,0,.08),0 4px 16px rgba(0,0,0,.05);
  --radius:14px;
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#10131a; --card:#181c25; --ink:#e7eaf0; --muted:#98a1b3; --line:#262b36;
    --brand:#3b82f6; --pill:#1e2637; --chipbg:#222835;
    --shadow:0 1px 3px rgba(0,0,0,.4);
  }
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--ink);
  font:15px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,sans-serif;
  padding-bottom:70px; /* room for bottom nav on mobile */
}
button{font:inherit; cursor:pointer}
.hidden{display:none !important}
.muted{color:var(--muted)} .small{font-size:12px}

/* header */
.top{
  position:sticky; top:0; z-index:30; background:var(--card);
  border-bottom:1px solid var(--line);
  display:flex; align-items:center; gap:10px; padding:10px 14px;
  flex-wrap:wrap;
}
.brand{display:flex; align-items:center; gap:8px; font-weight:700; font-size:17px}
.logo{color:var(--brand); font-size:20px}
.top-controls{display:flex; gap:8px; flex:1; min-width:0; align-items:center; justify-content:flex-end; flex-wrap:wrap}
.top-controls select,.top-controls input[type=search]{
  background:var(--bg); color:var(--ink); border:1px solid var(--line);
  border-radius:10px; padding:8px 10px; font:inherit; max-width:46vw;
}
.top-controls input[type=search]{flex:1; min-width:120px}
.btn{
  background:var(--chipbg); color:var(--ink); border:1px solid var(--line);
  border-radius:10px; padding:8px 14px;
}
.btn.primary{background:var(--brand); border-color:var(--brand); color:var(--brand-ink)}
.avatar-btn{border:none;background:none;padding:0}
.avatar-btn img{width:34px;height:34px;border-radius:50%;display:block}

/* filter bar */
.filters{
  padding:10px 14px 6px; display:flex; flex-direction:column; gap:8px;
  background:var(--bg); position:sticky; top:57px; z-index:20;
}
.chip-row{display:flex; gap:6px; overflow-x:auto; -webkit-overflow-scrolling:touch; padding-bottom:2px}
.chip-row::-webkit-scrollbar{display:none}
.chip{
  background:var(--chipbg); border:1px solid var(--line); color:var(--ink);
  border-radius:999px; padding:6px 12px; white-space:nowrap; font-size:13px;
}
.chip.on{background:var(--chip-on); color:var(--chip-on-ink); border-color:var(--chip-on)}
.chip .dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px}
.row2{display:flex; align-items:center; gap:14px; flex-wrap:wrap}
.near{display:flex; align-items:center; gap:8px}
.near-status{font-size:12px;color:var(--muted)}
input[type=range]{accent-color:var(--brand)}
.ver-toggle{font-size:13px; color:var(--muted); display:flex; gap:6px; align-items:center}

/* list */
.list{max-width:860px; margin:0 auto; padding:8px 14px 40px}
.day-head{
  font-weight:700; margin:22px 2px 8px; font-size:14px; color:var(--muted);
  text-transform:uppercase; letter-spacing:.04em;
}
.card{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:12px 14px; margin-bottom:10px;
  display:flex; gap:12px; align-items:flex-start; cursor:pointer;
  transition:transform .06s ease;
}
.card:active{transform:scale(.995)}
.card .time{min-width:64px; text-align:right; font-weight:600; font-size:13px; color:var(--brand); padding-top:2px}
.card .main{flex:1; min-width:0}
.card h3{margin:0 0 2px; font-size:15px; font-weight:650}
.card .meta{font-size:12.5px; color:var(--muted); display:flex; flex-wrap:wrap; gap:4px 10px}
.card .starbtn{border:none;background:none;font-size:18px;opacity:.45;padding:2px}
.card .starbtn.on{opacity:1}
.pill{
  display:inline-block; background:var(--pill); border-radius:999px; padding:2px 9px;
  font-size:11.5px; font-weight:600;
}
.ver-badge{font-size:11.5px; font-weight:600; border-radius:999px; padding:2px 9px}
.ver-verified{background:rgba(22,163,74,.12); color:var(--ok)}
.ver-listed{background:rgba(14,165,233,.12); color:var(--accent)}
.ver-stale{background:rgba(217,119,6,.12); color:var(--warn)}
.ver-unverified{background:rgba(220,38,38,.10); color:var(--bad)}
.dist{color:var(--accent); font-weight:600}
.empty{color:var(--muted); text-align:center; padding:60px 20px}

/* bottom nav (mobile) */
.bottomnav{
  position:fixed; bottom:0; left:0; right:0; z-index:30;
  background:var(--card); border-top:1px solid var(--line);
  display:flex; justify-content:space-around; padding:6px 0 max(6px, env(safe-area-inset-bottom));
}
.bottomnav button{
  border:none; background:none; color:var(--muted); font-size:17px;
  display:flex; flex-direction:column; align-items:center; gap:1px; padding:2px 18px;
}
.bottomnav button span{font-size:10.5px}
.bottomnav button.on{color:var(--brand)}

/* modal */
.modal{
  position:fixed; inset:0; z-index:50; background:rgba(0,0,0,.45);
  display:flex; align-items:flex-end; justify-content:center;
}
.sheet{
  background:var(--card); color:var(--ink); width:100%; max-width:640px;
  border-radius:18px 18px 0 0; padding:20px 18px 26px; position:relative;
  max-height:88vh; overflow-y:auto;
}
.sheet.narrow{max-width:420px}
.close{
  position:absolute; top:10px; right:12px; border:none; background:var(--chipbg);
  border-radius:50%; width:32px; height:32px; font-size:18px; color:var(--ink);
}
.sheet h2{margin:6px 0 8px; font-size:19px; padding-right:36px}
.m-head{display:flex; gap:8px; align-items:center; margin-top:4px}
.m-row{font-size:14px; margin:4px 0; color:var(--ink)}
.m-label{font-weight:700; font-size:13px; margin:14px 0 6px}
.m-hint{font-weight:400; color:var(--muted)}
.src{
  display:flex; align-items:center; gap:8px; padding:7px 0; border-top:1px solid var(--line);
  font-size:13.5px;
}
.src:first-child{border-top:none}
.src .tier{font-size:10.5px; font-weight:700; border-radius:5px; padding:2px 6px; background:var(--pill)}
.src .tier.t1{background:rgba(22,163,74,.14); color:var(--ok)}
.src .tier.t2{background:rgba(14,165,233,.14); color:var(--accent)}
.src .tier.t5,.src .tier.t6{background:rgba(217,119,6,.12); color:var(--warn)}
.src a{color:var(--brand); text-decoration:none; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.m-actions{display:flex; gap:10px; margin-top:14px}
.m-actions .btn.on{background:var(--brand); color:var(--brand-ink); border-color:var(--brand)}
.m-report{display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:14px; font-size:12.5px; color:var(--muted)}
.linkbtn{border:none; background:none; color:var(--brand); font-size:12.5px; padding:2px}
.m-similar .sim{
  padding:7px 0; border-top:1px solid var(--line); font-size:13.5px; cursor:pointer;
}
.m-similar .sim .when{color:var(--muted); font-size:12px}
.auth-btns{display:flex; flex-direction:column; gap:10px; margin:16px 0}
.auth-btns .btn{padding:11px; font-weight:600; text-align:center}

/* prefs */
.pref-section{margin:16px 0}
.pref-section h3{font-size:14px; margin:0 0 8px}
.int-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:6px}
.int-grid label{
  display:flex; gap:7px; align-items:center; font-size:13px;
  background:var(--chipbg); border:1px solid var(--line); border-radius:9px; padding:7px 9px;
}
.pref-row{display:flex; align-items:center; gap:10px; margin:8px 0; font-size:14px; flex-wrap:wrap}
.pref-row select,.pref-row input[type=text]{
  background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:8px; padding:7px 9px; font:inherit;
}
.suggest-box{display:flex; gap:8px; margin-top:6px}
.suggest-box input{flex:1}

.toast{
  position:fixed; bottom:80px; left:50%; transform:translateX(-50%);
  background:var(--ink); color:var(--bg); border-radius:10px; padding:10px 18px;
  font-size:14px; z-index:60; box-shadow:var(--shadow); max-width:88vw; text-align:center;
}

/* ---- tablet & desktop ---- */
@media (min-width:700px){
  body{padding-bottom:0}
  .bottomnav{
    position:sticky; top:0; bottom:auto; border-top:none;
    display:inline-flex; background:none; border:none;
  }
  /* desktop: nav moves into header area via order tweak */
  .top{padding:12px 22px}
  .filters{top:61px; padding:12px 22px 8px; max-width:1100px; margin:0 auto}
  .list{padding:8px 22px 60px}
  .modal{align-items:center}
  .sheet{border-radius:18px; max-height:84vh}
  .card .time{min-width:78px}
  .bottomnav{
    position:fixed; top:auto; bottom:18px; left:auto; right:18px; width:auto;
    background:var(--card); border:1px solid var(--line); border-radius:14px;
    box-shadow:var(--shadow); padding:4px 6px;
  }
  .bottomnav button{padding:6px 14px; flex-direction:row; gap:6px; font-size:15px}
  .bottomnav button span{font-size:12.5px}
}
@media (min-width:1100px){
  .list{max-width:960px}
}

/* --- unscheduled (no-date) cards, behind the "No-date events" toggle --- */
.card.unsched{opacity:.85}
.card.unsched .time{color:var(--muted); font-style:italic}
.unsched-text{font-size:14.5px; line-height:1.45}
.unsched-link{display:inline-block; margin-top:4px; font-size:13px}
