:root {
  --bg: #ffffff; --fg: #202124; --muted: #5f6368; --line: #e0e0e0; --card: #ffffff; --hover: #f1f3f4;
  --accent: #2449D8; --accent-fg: #ffffff; --shadow: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #202124; --fg: #e8eaed; --muted: #9aa0a6; --line: #3c4043; --card: #2d2e30; --hover: #35363a;
    --accent: #8ab4f8; --accent-fg: #202124; --shadow: 0 1px 2px rgba(0,0,0,.6), 0 1px 3px 1px rgba(0,0,0,.3);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; color: inherit; }
header.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
header.bar img { width: 32px; height: 32px; }
header.bar .title { font-size: 20px; font-weight: 500; white-space: nowrap; }
.iconbtn { border: 0; background: none; width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.iconbtn:hover { background: var(--hover); }
.iconbtn svg { width: 22px; height: 22px; fill: var(--muted); }
#login { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; padding: 16px; }
#login form { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
#login img { margin: 0 auto; }
#login h1 { margin: 0 0 8px; font-weight: 500; }
#login input { font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); }
#login button { padding: 12px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-fg); font-weight: 600; cursor: pointer; }
#login .msg { min-height: 1.4em; color: var(--muted); margin: 0; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 40px); opacity: 0; background: #323232; color: #fff; padding: 10px 18px; border-radius: 6px; transition: .2s; z-index: 200; pointer-events: none; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.fab { position: fixed; right: 20px; bottom: 20px; width: 56px; height: 56px; border-radius: 16px; border: 0; background: var(--accent); color: var(--accent-fg); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; z-index: 6; }
.fab svg { width: 26px; height: 26px; fill: currentColor; }
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: grid; place-items: center; padding: 16px; }
.sheet { width: 100%; max-width: 600px; max-height: calc(100vh - 32px); overflow: auto; background: var(--card); border-radius: 10px; box-shadow: var(--shadow); }
@media (max-width: 600px) { .sheet-bg { padding: 0; place-items: end stretch; } .sheet { max-height: 100vh; height: 100%; border-radius: 0; } }
.menu { position: absolute; right: 8px; top: 52px; background: var(--card); box-shadow: var(--shadow); border-radius: 6px; padding: 6px 0; z-index: 20; min-width: 180px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 16px; cursor: pointer; }
.menu button:hover { background: var(--hover); }
.loading { padding: 40px; text-align: center; color: var(--muted); }
