/* Calendar — full dark theme. Background is always dark. */
:root{
  --bg:#0a0d13; --card:#131926; --card2:#182032;
  --ink:#eef1f6; --muted:#8b94a7;
  --line:#232c3f; --accent:#f0b429; --accent-ink:#1a1405;
  --chip:#182032; --radius:16px;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px rgba(0,0,0,.35);
  --danger:#ff7a7a;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased; padding-bottom:48px;
}

/* ---------- gate ---------- */
.gate{min-height:100dvh; display:flex; align-items:center; justify-content:center; padding:24px}
.gate[hidden]{display:none!important}
.gate-card{width:100%; max-width:360px; text-align:center; background:var(--card);
  border:1px solid var(--line); border-radius:20px; padding:36px 28px; box-shadow:var(--shadow)}
.gate-mark{color:var(--accent); font-size:34px; margin-bottom:6px}
.gate-title{font-size:26px; margin:0 0 6px; letter-spacing:-.02em}
.gate-hint{color:var(--muted); font-size:14px; margin:0 0 18px}
.gate-input{
  width:100%; border:1px solid var(--line); border-radius:12px; padding:13px 16px;
  font-size:17px; background:var(--bg); color:var(--ink); margin-bottom:12px; outline:none;
}
.gate-input:focus{border-color:var(--accent)}
.gate-btn{width:100%; padding:13px; font-size:16px}
.gate-err{color:var(--danger); font-size:14px; min-height:20px; margin:10px 0 0}
.gate-note{color:var(--muted); font-size:14px; line-height:1.6; margin:14px 0 0}
.gate-note a{color:var(--accent)}
.gate-sub2{display:block;margin-top:8px;font-size:.78rem;color:var(--muted);line-height:1.45}

/* ---------- base nav package (matches lathom.com home) ---------- */
header.home-chrome{position:sticky;top:0;z-index:60;background:rgba(10,14,20,.96);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.home-chrome-inner{max-width:760px;margin:0 auto;padding:4px 12px 3px;display:flex;align-items:flex-start;gap:.4rem}
.home-chrome .nav-group{display:flex;gap:.45rem;align-items:flex-start}
a.nav-pill-icon{flex:0 0 52px;width:52px;display:flex;flex-direction:column;align-items:center;text-decoration:none;padding:0;margin:0;background:transparent;border:0}
button.nav-pill-icon{flex:0 0 52px;width:52px;display:flex;flex-direction:column;align-items:center;text-decoration:none;padding:0;margin:0;background:transparent;border:0;cursor:pointer;font:inherit;color:inherit}
.nav-ico{display:block;width:52px;height:52px;overflow:hidden;border-radius:12px;border:1px solid #9aa6b8;background:#0a1018;line-height:0}
.nav-ico img{width:52px;height:52px;display:block;object-fit:cover}
.nav-ico svg{width:52px;height:52px;stroke:#5ee7ff;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
a.nav-pill-icon.on .nav-ico{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.nav-word{display:block;width:52px;margin:2px 0 0;font-size:11px;font-weight:600;color:var(--ink);line-height:1.15;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nav-spacer{flex:1 1 auto;align-self:stretch}
.chrome-marks{flex:0 0 auto;display:flex;align-items:flex-start}

/* ---------- app chrome ---------- */
.topbar{
  position:sticky; top:65px; z-index:20; background:rgba(10,13,19,.92);
  backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 18px; border-bottom:1px solid var(--line);
}
.brand{display:flex; align-items:baseline; gap:8px}
.brand-mark{color:var(--accent); font-size:20px}
.brand-name{font-size:22px; font-weight:700; letter-spacing:-.02em}
.view-switch{display:flex; background:var(--card); border:1px solid var(--line); border-radius:999px; padding:3px}
.vs-btn{
  border:0; background:transparent; color:var(--muted); border-radius:999px;
  padding:9px 20px; font-size:15px; font-weight:700; cursor:pointer; min-height:44px;
}
.vs-btn.on{background:var(--accent); color:var(--accent-ink)}
.vs-btn:active{transform:scale(.97)}

/* ---------- calendar chips ---------- */
.chips{display:flex; flex-wrap:wrap; gap:8px; padding:14px 18px 4px}
.chip{
  display:inline-flex; align-items:center; gap:.45rem;
  border:1px solid var(--line); background:var(--chip); color:var(--muted);
  border-radius:999px; padding:9px 14px; font-size:14px; font-weight:600; cursor:pointer;
  min-height:44px;
}
.chip .dot{width:11px; height:11px; border-radius:50%; flex:none}
.chip.on{color:var(--ink); border-color:var(--accent)}
.soon{
  font-size:11px; font-weight:700; background:var(--card2); border:1px solid var(--line);
  color:var(--muted); border-radius:999px; padding:2px 8px;
}

/* ---------- month view ---------- */
#calmain{max-width:760px; margin:0 auto; padding:0 18px}
.month-head{display:flex; align-items:center; justify-content:space-between; padding:14px 2px 8px}
.month-title{font-size:21px; font-weight:700; margin:0; letter-spacing:-.01em}
.mnav{
  border:1px solid var(--line); background:var(--card2); color:var(--ink);
  border-radius:12px; width:48px; height:44px; font-size:24px; line-height:1; cursor:pointer;
}
.mnav:active{transform:scale(.95)}
.dow{display:grid; grid-template-columns:repeat(7,1fr); padding:4px 0; color:var(--muted); font-size:13px; font-weight:600}
.dow span{text-align:center}
.grid{display:grid; grid-template-columns:repeat(7,1fr); gap:5px}
.day{
  border:1px solid var(--line); background:var(--card); border-radius:10px;
  min-height:104px; padding:6px 4px; cursor:pointer; color:var(--ink);
  display:flex; flex-direction:column; align-items:stretch; gap:3px; text-align:left;
}
.day .dnum{font-size:14px; font-weight:600; text-align:center}
.day.dim{opacity:.35}
.day.dim .mchip{opacity:.55}
.day.today .dnum{
  background:var(--accent); color:var(--accent-ink); border-radius:50%;
  width:26px; height:26px; display:flex; align-items:center; justify-content:center; margin:0 auto;
}
.day.sel{border-color:var(--accent); box-shadow:0 0 0 1px var(--accent)}
.mchips{display:flex; flex-direction:column; gap:3px; min-height:0; overflow:hidden}
.mchip{
  display:block; font-size:11px; font-weight:600; line-height:1.25;
  border-radius:6px; padding:3px 6px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  border:1px solid transparent;
}
.mchip.span{font-weight:700}
.mchip.cont-l{border-top-left-radius:0; border-bottom-left-radius:0; margin-left:-5px; padding-left:9px}
.mchip.cont-r{border-top-right-radius:0; border-bottom-right-radius:0; margin-right:-5px; padding-right:9px}
.mmore{font-size:10px; color:var(--muted); font-weight:700; padding:1px 6px}
.day:active{transform:scale(.98)}

/* ---------- add-event sheet + FAB ---------- */
.fab{
  position:fixed; right:22px; bottom:26px; z-index:80;
  width:62px; height:62px; border-radius:50%; border:0; cursor:pointer;
  background:var(--accent); color:var(--accent-ink);
  font-size:34px; font-weight:400; line-height:1;
  box-shadow:0 6px 20px rgba(0,0,0,.5);
}
.fab:active{transform:scale(.94)}
.sheet{
  position:fixed; inset:0; z-index:90; background:rgba(4,6,10,.7);
  display:flex; align-items:flex-end; justify-content:center;
}
.sheet[hidden]{display:none!important}
.sheet-card{
  width:100%; max-width:520px; background:var(--card); border:1px solid var(--line);
  border-bottom:0; border-radius:20px 20px 0 0; padding:22px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow:var(--shadow);
}
.sheet-title{font-size:20px; font-weight:700; margin:0 0 14px}
.fld{display:block; margin-bottom:12px}
.fld span{display:block; font-size:13px; font-weight:600; color:var(--muted); margin-bottom:6px}
.fld span em{font-style:normal; font-weight:400; opacity:.75}
.fld input, .fld select{
  width:100%; border:1px solid var(--line); border-radius:12px; padding:12px 14px;
  font-size:16px; background:var(--bg); color:var(--ink); outline:none; color-scheme:dark;
}
.fld input:focus, .fld select:focus{border-color:var(--accent)}
.fld-row{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.sheet-actions{display:flex; gap:10px; justify-content:flex-end; margin-top:6px}
.sheet-actions .btn{padding:12px 22px; font-size:15px}
.ev-body{flex:1}
.ev-del{
  border:1px solid var(--line); background:transparent; color:var(--muted);
  border-radius:50%; width:34px; height:34px; font-size:14px; cursor:pointer; flex:none;
}
.ev-del:active{transform:scale(.92)}

/* ---------- selected-day list ---------- */
.daylist{margin-top:14px}
.daylist h3{font-size:16px; font-weight:700; margin:0 0 8px}
.ev{
  display:flex; gap:12px; align-items:flex-start; background:var(--card);
  border:1px solid var(--line); border-radius:14px; padding:13px 15px; margin-bottom:8px;
}
.ev .bar{width:5px; align-self:stretch; border-radius:3px; flex:none}
.ev .etime{font-size:13px; color:var(--muted); font-weight:600; min-width:74px; padding-top:2px}
.ev .etitle{font-size:15px; font-weight:600; line-height:1.35}
.ev .enote{font-size:13px; color:var(--muted); margin-top:3px; line-height:1.4}
.hint{color:var(--muted); font-size:14px; text-align:center; padding:18px 8px; line-height:1.6}

/* ---------- agenda ---------- */
.agenda-title{font-size:21px; font-weight:700; margin:16px 0 10px; letter-spacing:-.01em}
.ag-day{font-size:15px; font-weight:700; color:var(--muted); margin:16px 0 8px}
.empty{
  text-align:center; color:var(--muted); font-size:15px; line-height:1.7;
  background:var(--card); border:1px dashed var(--line); border-radius:16px;
  padding:34px 22px; margin:14px 0;
}

.btn{
  border:1px solid var(--line); background:var(--card2); color:var(--ink);
  border-radius:999px; padding:9px 16px; font-size:14px; font-weight:600; cursor:pointer;
}
.btn.primary{background:var(--accent); border-color:var(--accent); color:var(--accent-ink)}
.btn:active{transform:scale(.97)}
