/* Regenify Map. Dark green glass. Leaf green is the highlight only. */
:root {
  --night: #060d08;
  --glass: rgba(8, 20, 13, .62);
  --glass-strong: rgba(8, 20, 13, .82);
  --glass-soft: rgba(242, 246, 239, .07);
  --edge: rgba(242, 246, 239, .14);
  --edge-leaf: rgba(94, 201, 62, .38);
  --leaf: #5ec93e;
  --leaf-bright: #8ae86b;
  --leaf-ink: #06210c;
  --teal: #2fc4c9;
  --white: #f2f6ef;
  --body: #cfdccb;
  --muted: #93a58e;
  --appt: #f97316;
  --danger: #ff6b6b;
  --blur: blur(18px) saturate(160%);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--night); font: 16px/1.4 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--white); overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; }

/* one glass recipe for every floating card */
.glass, .chip, .icon-btn, .pop, .hint, .toast, .sheet, .login-card, .fab {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--edge);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
}

/* login */
#login { display: grid; place-items: center; padding: 24px; background:
  radial-gradient(60% 45% at 50% 30%, rgba(94, 201, 62, .22), transparent 70%),
  radial-gradient(50% 40% at 80% 90%, rgba(47, 196, 201, .14), transparent 70%), var(--night); }
.login-card { border-radius: 24px; padding: 32px 24px 26px; width: min(360px, 100%); text-align: center; }
.login-mark { filter: drop-shadow(0 0 18px rgba(94, 201, 62, .45)); }
.login-card h1 { margin: 14px 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.login-card h1 span { color: var(--leaf); }
.login-card p { color: var(--muted); margin: 0 0 20px; }
#gbtn { display: flex; justify-content: center; min-height: 44px; }
#devlogin { display: flex; gap: 8px; margin-top: 14px; }
#devlogin input { flex: 1; }
#devlogin .btn { width: auto; margin: 0; padding: 12px 16px; font-size: 15px; }
.err { color: var(--danger) !important; margin-top: 12px !important; min-height: 1em; }

/* map */
#map { position: absolute; inset: 0; }
#glow { position: absolute; left: 0; right: 0; top: 0; height: calc(90px + var(--safe-t)); background: linear-gradient(rgba(6, 13, 8, .55), transparent); z-index: 550; pointer-events: none; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 3px solid var(--leaf-bright); border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,.4); pointer-events: none; z-index: 500; }
.topbar { position: absolute; top: calc(10px + var(--safe-t)); left: 10px; right: 10px; display: flex; gap: 8px; align-items: center; z-index: 600; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.topbar > * { flex: none; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; border-radius: 14px; padding: 0 12px 0 14px; height: 44px; font-size: 15px; font-weight: 600; color: var(--white); min-width: 0; flex: 0 1 auto; }
#filter-label { overflow: hidden; text-overflow: ellipsis; }
.count { color: var(--muted); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.count:empty { display: none; }
.caret { color: var(--leaf); flex: none; }
.dry { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #facc15; background: rgba(250, 204, 21, .14); border: 1px solid rgba(250, 204, 21, .45); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.icon-btn { margin-left: auto; width: 44px; height: 44px; border-radius: 14px; font-size: 19px; color: var(--white); }

.pop { position: absolute; top: calc(62px + var(--safe-t)); left: 10px; background: var(--glass-strong); border-radius: 18px; padding: 6px; z-index: 700; min-width: 240px; max-height: calc(100vh - 140px); overflow-y: auto; animation: pop .14s ease-out; }
@keyframes pop { from { transform: translateY(-6px); opacity: 0; } }
.pop-right { left: auto; right: 10px; }
.menu-head { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 12px 4px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; text-align: left; padding: 10px 12px; border-radius: 12px; font-size: 15px; color: var(--white); }
.menu-item:active { background: var(--glass-soft); }
.menu-item.on { background: rgba(94, 201, 62, .14); box-shadow: inset 0 0 0 1px var(--edge-leaf); font-weight: 600; }
.menu-item .grow { flex: 1; }
.menu-item .n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pin-ico { flex: none; display: block; }
.pin-ico.blank { width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed var(--edge); }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; padding: 6px 12px 12px; font-size: 13px; color: var(--body); }
.leg { display: flex; align-items: center; gap: 7px; }
.who { padding: 10px 14px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--edge); margin-bottom: 4px; }

/* the two round buttons: same size, same glass, leaf icon */
.fabs { position: absolute; right: 14px; bottom: calc(22px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px; z-index: 600; }
.fab { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; padding: 0; color: var(--leaf-bright); }
.fab-add { border-color: var(--edge-leaf); }
.fab:active { transform: scale(.94); }
/* you are here: a live pulsing dot */
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #4f8cff; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); position: relative; }
.me-dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; background: rgba(79, 140, 255, .55); animation: ping 1.8s ease-out infinite; z-index: -1; }
@keyframes ping { from { transform: scale(1); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }
/* a pin that just changed pops once */
.pin-pop { animation: pinpop .5s ease-out; }
@keyframes pinpop { 0% { transform: scale(.4); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }
.hint { position: absolute; left: 14px; right: 84px; bottom: calc(34px + var(--safe-b)); color: var(--body); padding: 11px 14px; border-radius: 14px; font-size: 14px; z-index: 550; pointer-events: none; transition: opacity .4s; }
.toast { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(160px + var(--safe-b)); background: var(--glass-strong); border-color: var(--edge-leaf); color: var(--white); padding: 12px 18px; border-radius: 14px; z-index: 900; max-width: 90%; text-align: center; }

/* sheet */
.scrim { position: fixed; inset: 0; background: rgba(2, 6, 3, .35); z-index: 800; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; background: var(--glass-strong); border-radius: 24px 24px 0 0; border-bottom: 0; z-index: 850; padding: 8px 16px calc(18px + var(--safe-b)); animation: up .18s ease-out; }
@media (max-width: 380px) { .chip { font-size: 14px; padding: 0 10px 0 12px; } .dry { font-size: 11px; padding: 0 8px; } }
@media (min-width: 640px) { .sheet { left: 50%; right: auto; width: 480px; transform: translateX(-50%); } }
@keyframes up { from { translate: 0 40px; opacity: .6; } }
.grab { width: 44px; height: 5px; border-radius: 3px; background: rgba(242, 246, 239, .25); margin: 4px auto 12px; }
.sheet h2 { margin: 0 0 2px; font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.sheet .sub { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.status-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0 0 14px; border-radius: 16px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--k) 26%, transparent), color-mix(in srgb, var(--k) 6%, transparent));
  border: 1px solid color-mix(in srgb, var(--k) 55%, transparent); }
.status-main { font-weight: 700; font-size: 17px; }
.status-sub { font-size: 13px; color: var(--body); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big { display: flex; align-items: center; justify-content: center; border: 1px solid var(--edge); border-radius: 16px; padding: 14px 10px; font-size: 15px; font-weight: 600; background: var(--glass-soft); color: var(--white); min-height: 56px; }
.big:active { transform: scale(.98); background: rgba(242, 246, 239, .12); }
.big.primary { grid-column: 1 / -1; background: linear-gradient(135deg, rgba(249, 115, 22, .95), rgba(234, 88, 12, .9)); border-color: rgba(255, 255, 255, .2); color: #fff; font-size: 17px; min-height: 62px; }
.row { display: flex; gap: 10px; margin: 10px 0; }
.row > * { flex: 1; }
label.f { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 12px 0 5px; }
input, textarea { width: 100%; font: inherit; font-size: 16px; padding: 12px; border: 1px solid var(--edge); border-radius: 12px; background: rgba(0, 0, 0, .25); color: var(--white); }
input:focus, textarea:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(94, 201, 62, .2); }
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { min-height: 70px; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1px solid var(--edge); background: var(--glass-soft); color: var(--white); border-radius: 999px; padding: 9px 14px; font-size: 15px; }
.chips button.on { background: rgba(94, 201, 62, .18); color: var(--leaf-bright); border-color: var(--leaf); font-weight: 600; }
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.days button { flex: none; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.slots button { border: 1px solid var(--edge); background: var(--glass-soft); color: var(--white); border-radius: 12px; padding: 10px 4px; }
.slots button.on { background: var(--leaf); color: var(--leaf-ink); border-color: var(--leaf); font-weight: 700; }
.btn { border: 0; border-radius: 16px; padding: 15px; font-size: 17px; font-weight: 700; background: var(--leaf); color: var(--leaf-ink); width: 100%; margin-top: 14px; box-shadow: 0 6px 18px rgba(94, 201, 62, .25); }
.btn.ghost { background: var(--glass-soft); color: var(--white); border: 1px solid var(--edge); box-shadow: none; }
.btn:disabled { opacity: .5; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 8px 10px; font-size: 15px; margin: 14px 0 12px; padding: 12px 14px; border-radius: 16px; background: var(--glass-soft); border: 1px solid var(--edge); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.kv a, .note-toggle { color: var(--leaf-bright); }
.history { font-size: 14px; color: var(--body); border-top: 1px solid var(--edge); padding-top: 10px; margin-top: 10px; }
.history strong { color: var(--white); }
.history div { padding: 4px 0; }
.note-toggle { background: none; border: 0; padding: 10px 0 4px; font-size: 15px; font-weight: 600; }
.stage { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.errbox { color: var(--danger); margin-top: 8px; min-height: 1em; }

/* Leaflet fallback tweaks */
.leaflet-control-attribution { font-size: 9px !important; background: rgba(6, 13, 8, .5) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.pinlogin { display: flex; flex-direction: column; gap: 10px; }
.pinlogin input { font-size: 17px; padding: 14px; border-radius: 14px; }
.pinlogin .btn { margin-top: 4px; }
