:root {
  --bg: #f9f7f2; --card: #ffffff; --text: #1a1a1a; --muted: #6b6b6b;
  --accent: #b18cfe; --border: #e5e1d8; --radius: 16px;
  --tab-h: 60px; --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121212; --card: #1e1e1e; --text: #f0f0f0; --muted: #a0a0a0; --border: #2c2c2c; }
}
html.dark { --bg: #121212; --card: #1e1e1e; --text: #f0f0f0; --muted: #a0a0a0; --border: #2c2c2c; }
html.light { --bg: #f9f7f2; --card: #ffffff; --text: #1a1a1a; --muted: #6b6b6b; --border: #e5e1d8; }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); overscroll-behavior-y: none; transition: background 0.3s, color 0.3s; }
#app { display: flex; flex-direction: column; min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 10; padding: calc(var(--safe-top) + 12px) 20px 12px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.screen { flex: 1; padding: 16px 16px calc(var(--tab-h) + var(--safe-bottom) + 24px); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card h3 { font-size: 1rem; margin-bottom: 6px; }
.card p { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .big { font-size: 2.4rem; margin-bottom: 8px; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-around; height: calc(var(--tab-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--border); }
.tabbar button { flex: 1; border: none; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 0.65rem; cursor: pointer; transition: color 0.2s; }
.tabbar button.active { color: var(--accent); font-weight: 700; }
.tabbar button span { font-size: 1.25rem; }
.settings-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: none; }
.toggle { width: 48px; height: 28px; border-radius: 20px; background: var(--border); position: relative; cursor: pointer; transition: background 0.2s; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: white; transition: transform 0.2s; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(20px); }
.btn-sync { background: var(--accent); color: white; border: none; padding: 10px 16px; border-radius: 10px; font-weight: bold; cursor: pointer; margin-top: 10px; width: 100%; }
