/* ─────────────────────────────────────────────────────────────
   Sugar Tracker · sugar.yaeger.info
   Dark, glassy, minimal, mobile-first.
   ───────────────────────────────────────────────────────────── */

:root {
  --bg-0: #0b1020;
  --bg-1: #111832;
  --bg-2: #1a2240;
  --card: rgba(255, 255, 255, 0.055);
  --card-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef2ff;
  --text-dim: #9aa4c7;
  --text-faint: #66708f;
  --accent: #34d399;        /* emerald — "good / low sugar" */
  --accent-2: #fb7185;      /* rose — "high sugar" */
  --accent-3: #fbbf24;      /* amber — spotlight */
  --accent-4: #60a5fa;      /* blue */
  --danger: #f87171;
  --ok: #4ade80;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  min-height: 100%;
  background:
    radial-gradient(1000px 500px at 90% -10%, rgba(96, 165, 250, 0.14), transparent 60%),
    radial-gradient(800px 500px at -10% 20%, rgba(52, 211, 153, 0.12), transparent 55%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 55%, var(--bg-2));
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

.app { max-width: 720px; margin: 0 auto; padding: 20px 16px 40px; min-height: 100vh; }

button { font-family: var(--font); cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: var(--font); }

::placeholder { color: var(--text-faint); }

/* ── Helpers ─────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Login ─────────────────────────────────────────────────── */
.login-wrap {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  text-align: center;
}

.login-logo { font-size: 56px; filter: drop-shadow(0 8px 24px rgba(52, 211, 153, 0.35)); animation: floaty 4s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.login-title { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.login-title span { background: linear-gradient(90deg, var(--accent), var(--accent-4)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-sub { color: var(--text-dim); font-size: 14px; margin-top: 6px; }

.login-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; max-width: 420px; }

.login-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.login-btn:hover { transform: translateY(-3px); background: var(--card-hover); border-color: var(--border-strong); }
.login-btn:active { transform: translateY(0) scale(0.97); }
.login-avatar { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; color: #0b1020; }
.login-name { font-weight: 600; font-size: 14px; }

.avatar-0 { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.avatar-1 { background: linear-gradient(135deg, #f472b6, #ec4899); }
.avatar-2 { background: linear-gradient(135deg, #38bdf8, #3b82f6); }
.avatar-3 { background: linear-gradient(135deg, #34d399, #10b981); }
.avatar-4 { background: linear-gradient(135deg, #a78bfa, #8b5cf6); }
.avatar-5 { background: linear-gradient(135deg, #fb7185, #f43f5e); }

.login-hint { color: var(--text-faint); font-size: 12px; margin-top: 4px; }

/* ── Top bar ─────────────────────────────────────────────── */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-emoji { font-size: 26px; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.brand-name small { color: var(--accent-3); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; display: block; }
.user-chip { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border); padding: 5px 6px 5px 5px; border-radius: 999px; backdrop-filter: blur(10px); }
.chip-avatar { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #0b1020; }
.chip-name { font-size: 13px; font-weight: 600; padding-right: 4px; }
.logout-btn { color: var(--text-dim); font-size: 15px; padding: 6px 8px; border-radius: 8px; transition: color 0.15s ease, background 0.15s ease; }
.logout-btn:hover { color: var(--danger); background: rgba(248, 113, 113, 0.12); }
/* ── Tabs ─────────────────────────────────────────────────── */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 5px; margin-bottom: 18px; backdrop-filter: blur(10px); }
.tab-btn { padding: 10px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-dim); display: flex; align-items: center; justify-content: center; gap: 6px; transition: all 0.15s ease; }
.tab-btn.active { background: linear-gradient(90deg, rgba(52, 211, 153, 0.25), rgba(96, 165, 250, 0.25)); color: var(--text); }
.tab-btn:not(.active):hover { color: var(--text); }

/* ── Cards ───────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; backdrop-filter: blur(14px); box-shadow: var(--shadow); margin-bottom: 16px; }
.card h2, .card-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }

/* ── Search / add ────────────────────────────────────────── */
.search-shell { position: relative; }
.search-row { display: flex; gap: 8px; }
.search-input { flex: 1; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--border-strong); border-radius: 12px; padding: 13px 14px; color: var(--text); font-size: 15px; outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 12px; font-size: 14px; font-weight: 700; padding: 0 16px; transition: transform 0.1s ease, filter 0.15s ease, opacity 0.15s ease; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #2bbf8c); color: #052e22; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { background: var(--card); border: 1px solid var(--border-strong); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--card-hover); }
.btn-scan { width: 46px; padding: 0; font-size: 19px; position: relative; }
.btn-scan.on { background: linear-gradient(135deg, var(--accent-3), #f59e0b); color: #422006; }

/* autofill dropdown */
.autofill { margin-top: 6px; background: #141c38; border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; max-height: 320px; overflow-y: auto; }
.autofill-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.1s ease; }
.autofill-item:last-child { border-bottom: none; }
.autofill-item:hover, .autofill-item.hi { background: rgba(96, 165, 250, 0.12); }
.autofill-item .f-name { font-size: 14px; font-weight: 600; }
.autofill-item .f-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.autofill-item .f-cat { font-size: 11px; color: var(--text-faint); text-transform: capitalize; }
.autofill-item .f-serving { font-size: 11px; color: var(--text-faint); }
.autofill-item .f-sugar { font-size: 13px; font-weight: 700; }
.autofill-empty { padding: 14px; color: var(--text-dim); font-size: 13px; text-align: center; }
.autofill-custom { border-bottom: 2px solid var(--border-strong); background: rgba(76, 184, 146, 0.06); }
.autofill-custom:hover { background: rgba(76, 184, 146, 0.14); }
.autofill-custom-chip { flex-shrink: 0; background: linear-gradient(135deg, #57c39a, #3fae85); color: #fff; font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; letter-spacing: 0.03em; }

.sugar-badge-low { color: var(--accent); }
.sugar-badge-med { color: var(--accent-3); }
.sugar-badge-high { color: var(--accent-2); }

.estimate-copy { margin-top: 12px; font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, 0.25); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Today's entries ─────────────────────────────────────── */
.today-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.today-stat { background: rgba(0, 0, 0, 0.22); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.today-stat .value { font-size: 20px; font-weight: 800; }
.today-stat .value.accent { color: var(--accent); }
.today-stat .label { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

.entry-list { list-style: none; }
.entry-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.entry-item:last-child { border-bottom: none; }
.entry-emoji { font-size: 22px; width: 32px; text-align: center; flex-shrink: 0; }
.entry-main { flex: 1; min-width: 0; }
.entry-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-sub { font-size: 12px; color: var(--text-faint); margin-top: 1px; }
.entry-sugar { font-size: 15px; font-weight: 800; }
.entry-del { width: 30px; height: 30px; border-radius: 8px; color: var(--text-faint); font-size: 15px; transition: color 0.15s ease, background 0.15s ease; display: flex; align-items: center; justify-content: center; }
.entry-del:hover { color: var(--danger); background: rgba(248, 113, 113, 0.12); }
.entry-edit { width: 30px; height: 30px; border-radius: 8px; color: var(--text-faint); font-size: 14px; transition: color 0.15s ease, background 0.15s ease; display: flex; align-items: center; justify-content: center; }
.entry-edit:hover { color: var(--accent); background: rgba(52, 211, 153, 0.12); }
.entry-item.editing { display: block; }
.entry-edit-form { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.ee-row { display: flex; align-items: center; gap: 8px; }
.entry-edit-form input { background: rgba(0, 0, 0, 0.28); border: 1px solid var(--border-strong); border-radius: 10px; padding: 9px 11px; color: var(--text); font-size: 14px; outline: none; }
.entry-edit-form input:focus { border-color: var(--accent); }
.ee-food { width: 100%; }
.ee-sugar { width: 90px; }
.ee-serving { flex: 1; }
.ee-unit { color: var(--text-dim); font-size: 13px; }
.ee-actions { display: flex; gap: 8px; margin-top: 2px; }
.ee-actions .btn { padding: 8px 14px; font-size: 13px; }

.empty-state { text-align: center; padding: 24px 10px; color: var(--text-dim); font-size: 14px; }
.empty-state .big { font-size: 34px; display: block; margin-bottom: 8px; }

/* ── Leaderboard ─────────────────────────────────────────── */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; margin-bottom: 16px; }
.podium-card { text-align: center; padding: 16px 8px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: rgba(0, 0, 0, 0.22); backdrop-filter: blur(10px); }
.podium-card.first { background: linear-gradient(180deg, rgba(251, 191, 36, 0.16), rgba(0, 0, 0, 0.22)); border-color: rgba(251, 191, 36, 0.4); order: 2; padding-top: 24px; }
.podium-card.second { order: 1; }
.podium-card.third { order: 3; }
.podium-rank { font-size: 22px; line-height: 1; }
.podium-rank .medal { filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
.podium-avatar { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; color: #0b1020; margin: 8px auto 6px; border: 3px solid rgba(255, 255, 255, 0.12); }
.podium-name { font-size: 13px; font-weight: 700; }
.podium-sugar { font-size: 15px; font-weight: 800; margin-top: 2px; }
.podium-sugar.low { color: var(--accent); }
.podium-sugar.mid { color: var(--accent-3); }
.podium-sugar.high { color: var(--accent-2); }
.podium-label { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.podium-crown { font-size: 18px; display: block; height: 22px; line-height: 22px; }

.lb-rows { list-style: none; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--border); }
.lb-row:last-child { border-bottom: none; }
.lb-row.me .lb-name { color: var(--accent); }
.lb-rank { width: 26px; font-size: 13px; font-weight: 700; color: var(--text-faint); text-align: center; }
.lb-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: #0b1020; }
.lb-name { flex: 1; font-size: 14px; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-counts { text-align: right; font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.lb-counts strong { color: var(--text); }
.lb-total { text-align: right; font-size: 14px; font-weight: 800; min-width: 64px; white-space: nowrap; }

.inactive-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.inactive-chip { display: flex; align-items: center; gap: 8px; background: rgba(0, 0, 0, 0.22); border: 1px dashed var(--border); border-radius: 999px; padding: 6px 14px 6px 7px; color: var(--text-dim); font-size: 13px; }
.inactive-chip .lb-avatar { width: 28px; height: 28px; font-size: 12px; }
.inactive-note { font-size: 12px; color: var(--text-faint); margin-top: 10px; }

/* ── QR scanner ──────────────────────────────────────────── */
.scanner-wrap { margin-top: 14px; }
.scanner-frame { border: 2px dashed var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: rgba(0, 0, 0, 0.4); min-height: 220px; display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 13px; text-align: center; padding: 16px; }
.scanner-frame video { width: 100%; border-radius: 10px; }
.scanner-stop { margin-top: 10px; width: 100%; text-align: center; padding: 10px; }

/* ── Toast ───────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 80px); background: #141c38; border: 1px solid var(--border-strong); color: var(--text); border-radius: 999px; padding: 12px 20px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); z-index: 100; opacity: 0; transition: transform 0.25s ease, opacity 0.25s ease; max-width: 90vw; text-align: center; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { border-color: rgba(248, 113, 113, 0.5); color: #fecaca; }

.footer { text-align: center; color: var(--text-faint); font-size: 12px; margin-top: 30px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 440px) {
  .login-grid { grid-template-columns: repeat(2, 1fr); }
  .podium { gap: 6px; }
  .today-stats { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .today-stat { padding: 10px 4px; }
  .today-stat .value { font-size: 17px; }
  .lb-counts { display: none; }
  .app { padding: 16px 12px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

/* ═══════════════════════════════════════════════════════════
   PASTEL REBUILD — soft mint / cream family theme (overrides)
   ═══════════════════════════════════════════════════════════ */
:root {
  --bg-0: #f6f1e6;
  --bg-1: #f0ead9;
  --card: #fffdf8;
  --card-hover: #fffbf2;
  --border: #ece4d2;
  --border-strong: #e0d5bd;
  --text: #3d3830;
  --text-dim: #7c7465;
  --text-faint: #aaa294;
  --accent: #4cb892;
  --accent-2: #e8826b;
  --accent-3: #e0a755;
  --accent-4: #8fb8e0;
  --danger: #e36a5c;
  --shadow: 0 10px 34px rgba(96, 78, 50, 0.10);
  --font: "Nunito", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html, body {
  background:
    radial-gradient(900px 480px at 82% -8%, rgba(120, 200, 160, 0.16), transparent 60%),
    radial-gradient(760px 460px at -8% 8%, rgba(224, 167, 85, 0.12), transparent 55%),
    linear-gradient(180deg, #f8f4ea, var(--bg-0) 55%, var(--bg-1));
  background-attachment: fixed;
  color: var(--text);
}
/* subtle grain */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}
.app { position: relative; z-index: 1; }

button, input { font-family: var(--font); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px 18px 20px;
  margin-bottom: 16px;
}
.card h2 { font-size: 15px; font-weight: 800; color: var(--text); letter-spacing: -0.01em; margin-bottom: 12px; }

/* ── Top bar & tabs ── */
.topbar { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 14px; }
.brand-emoji { filter: drop-shadow(0 4px 10px rgba(76, 184, 146, 0.4)); }
.brand-name { font-weight: 800; color: var(--text); }
.brand-name small { color: var(--text-faint); display: block; font-weight: 600; }
.user-chip { background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 5px 8px 5px 5px; box-shadow: var(--shadow); }
.chip-avatar, .login-avatar, .lb-avatar, .podium-avatar {
  border-radius: 50% 46% 55% 45% / 48% 50% 50% 52%;
  background: #eaf8f0; color: var(--accent); font-weight: 800;
}
.logout-btn { color: var(--text-faint); }
.logout-btn:hover { color: var(--danger); }

.tabs { display: flex; gap: 8px; background: var(--card); border: 1px solid var(--border); padding: 5px; border-radius: 999px; margin-bottom: 18px; box-shadow: var(--shadow); }
.tab-btn { flex: 1; border-radius: 999px; padding: 9px 0; font-weight: 700; color: var(--text-dim); transition: background 0.15s ease, color 0.15s ease; }
.tab-btn.active { background: linear-gradient(135deg, #d8f2e4, #c9ecd9); color: #1e6e50; box-shadow: inset 0 0 0 1px rgba(76,184,146,0.25); }

/* ── Search / buttons ── */
.search-input { background: #fff; border: 1px solid var(--border-strong); color: var(--text); border-radius: 14px; }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(76, 184, 146, 0.18); }
.btn { border-radius: 14px; }
.btn-primary { background: linear-gradient(135deg, #57c39a, #3fae85); color: #fff; box-shadow: 0 6px 16px rgba(63,174,133,0.28); }
.btn-ghost { background: #fff; border: 1px solid var(--border-strong); color: var(--text); }
.autofill { background: #fff; border: 1px solid var(--border-strong); color: var(--text); box-shadow: var(--shadow); }
.autofill-item:hover, .autofill-item.hi { background: #f2faf6; }
.autofill-item .f-cat, .autofill-item .f-serving { color: var(--text-faint); }

/* ── Family bar ── */
.family-bar { display: flex; justify-content: center; gap: 16px; margin: 2px 0 6px; }
.fam { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.fam-drop { position: relative; width: 44px; height: 52px; overflow: hidden; border: 1.5px solid rgba(0,0,0,0.05); box-shadow: inset 0 -6px 12px rgba(255,255,255,0.6), 0 4px 10px rgba(96,78,50,0.08); }
.fam-a { border-radius: 50% 50% 52% 48% / 60% 60% 40% 40%; }
.fam-b { border-radius: 48% 52% 46% 54% / 62% 58% 42% 38%; }
.fam-c { border-radius: 52% 48% 50% 50% / 58% 62% 38% 42%; }
.fam-d { border-radius: 46% 54% 52% 48% / 60% 56% 44% 40%; }
.fam-fill { position: absolute; left: 0; right: 0; bottom: 0; transition: height 0.6s ease; }
.fam-fill.good { background: linear-gradient(180deg, #bfe8d3, #8fd4b4); }
.fam-fill.warn { background: linear-gradient(180deg, #f6dfb2, #eac37c); }
.fam-fill.over { background: linear-gradient(180deg, #f6c9b6, #ec9880); }
.fam-init { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%); font-weight: 800; font-size: 15px; color: var(--text); }
.fam.active .fam-drop { box-shadow: 0 0 0 3px rgba(76,184,146,0.35), 0 6px 14px rgba(76,184,146,0.25); }
.fam-name { font-size: 11px; font-weight: 700; color: var(--text-dim); }
.fam.active .fam-name { color: #1e6e50; }

/* ── Sugar Drop ── */
.drop-card { text-align: center; padding-top: 20px; }
.drop-stage { position: relative; width: 260px; height: 300px; margin: 4px auto 10px; }
.drop-ring { position: absolute; inset: 0; }
.ring-track { fill: none; stroke: rgba(0,0,0,0.06); stroke-width: 9; }
.ring-fill { fill: none; stroke-width: 9; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 51.33%; transition: stroke 0.4s ease, stroke-dasharray 0.6s ease; }
.drop-sphere {
  position: absolute; left: 50%; top: 154px; transform: translate(-50%, -50%);
  width: 236px; height: 236px; border-radius: 50%;
  background:
    radial-gradient(120px 90px at 32% 26%, rgba(255,255,255,0.9), rgba(255,255,255,0.12) 45%, rgba(255,255,255,0.02) 60%),
    radial-gradient(circle at 50% 120%, rgba(143,197,164,0.18), transparent 55%),
    linear-gradient(160deg, #fdfcf8, #f0efe6);
  box-shadow: inset 0 -18px 34px rgba(120,140,110,0.12), inset 0 12px 24px rgba(255,255,255,0.7), 0 16px 40px rgba(96,78,50,0.14);
  overflow: hidden;
}
.drop-sphere canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.drop-shine { position: absolute; left: 24%; top: 14%; width: 34%; height: 22%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,0.85), transparent); filter: blur(2px); pointer-events: none; }
.drop-label { font-size: 14.5px; font-weight: 800; margin-top: 10px; }
.drop-label.good { color: #1e6e50; } .drop-label.warn { color: #96621c; } .drop-label.over { color: #b8503c; }
.drop-sub { font-size: 12.5px; color: var(--text-faint); margin-top: 3px; font-weight: 600; }

/* ── This Week ── */
.week-title { margin-bottom: 14px; }
.week-note { font-size: 11.5px; font-weight: 600; color: var(--text-faint); }
.week-plot { position: relative; height: 150px; padding: 0 6px; }
.week-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 6px; }
.wcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.wbar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.wbar { width: 72%; max-width: 26px; border-radius: 8px 8px 5px 5px; background: linear-gradient(180deg, #a9e0c6, #7fd0ab); transition: height 0.5s ease; position: relative; }
.wbar.over { background: linear-gradient(180deg, #f2b6a4, #e98a70); }
.wday { font-size: 11px; font-weight: 700; color: var(--text-faint); }
.week-target { position: absolute; left: 6px; right: 6px; border-top: 2px dotted #c9bfa6; }
.week-legend { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 10px; font-size: 11.5px; color: var(--text-dim); font-weight: 600; }
.week-legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.mint { background: #7fd0ab; } .dot.coral { background: #e98a70; }
.week-legend .tick { width: 14px; border-top: 2px dotted #c9bfa6; display: inline-block; }

/* ── Entries / misc light tweaks ── */
.entry-item { border-bottom: 1px solid var(--border); }
.entry-name { color: var(--text); }
.entry-sub { color: var(--text-faint); }
.today-stat .value { color: var(--text); }
.entry-edit-form input { background: #fff; border: 1px solid var(--border-strong); color: var(--text); }
.empty-state { color: var(--text-dim); }
.footer { color: var(--text-faint); text-align: center; font-size: 12px; margin-top: 18px; }
.toast { background: #3d3830; }

/* ── Leaderboard charts ── */
.chart { width: 100%; height: auto; display: block; }
.chart .cg { stroke: rgba(0,0,0,0.06); stroke-width: 1; }
.chart .cgt { fill: var(--text-faint); font-size: 11px; font-weight: 600; text-anchor: middle; }
.chart .cgd { fill: var(--text-faint); font-size: 9.5px; text-anchor: middle; opacity: 0.8; }
.chart .cap { stroke: var(--accent-2); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: 0.9; }
.chart .capt { fill: var(--accent-2); font-size: 10.5px; font-weight: 700; }
.chart .cline { fill: none; stroke-width: 2.75; stroke-linejoin: round; stroke-linecap: round; opacity: 0.92; }
.chart .cbar { opacity: 0.85; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 10px; }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-dim); }
.chart-legend .lg i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }

