/* Theme: light by default; dark when the browser prefers it (unless forced light via
   data-theme="light") or when forced via data-theme="dark". theme.js sets data-theme. */
:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d2330; --muted: #667085; --line: #e4e7ec;
  --primary: #1f5eff; --danger: #c62828; --warn: #b26a00; --radius: 10px;
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #12151c; --card: #1b1f29; --text: #e6e8ee; --muted: #98a2b3; --line: #2c3240;
    --primary: #6b93ff; --danger: #ef5350; --warn: #ffb74d; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #12151c; --card: #1b1f29; --text: #e6e8ee; --muted: #98a2b3; --line: #2c3240;
  --primary: #6b93ff; --danger: #ef5350; --warn: #ffb74d; color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
[x-cloak] { display: none !important; }
a { color: var(--primary); }
.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .75rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
nav, .top-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.theme-toggle { font-size: .85rem; padding: .25rem .6rem; }
main { max-width: 960px; margin: 0 auto; padding: 1rem; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; margin-bottom: 1rem; color: inherit; text-decoration: none; }
.narrow { max-width: 420px; margin: 2rem auto; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.inline { display: inline; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; }
input, select, textarea, button, .button { font: inherit; padding: .5rem .75rem; border: 1px solid var(--line);
  border-radius: 8px; background: var(--card); color: var(--text); }
button, .button { cursor: pointer; text-decoration: none; display: inline-block; }
.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.danger { color: var(--danger); }
button.danger { border-color: var(--danger); }
.link { background: none; border: none; padding: 0; color: var(--primary); }
button:disabled { opacity: .5; cursor: default; }
.error { color: var(--danger); margin: 0; }
.flash { background: var(--card); border-left: 4px solid var(--primary); padding: .75rem 1rem; border-radius: 6px; }
.muted { color: var(--muted); }
.divider { text-align: center; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .4rem .5rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.status-paused td, .status-missed td { color: var(--warn); }
.status-planned td { color: var(--muted); }
td .tag { display: block; font-size: .75rem; color: var(--primary); }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; margin: 0 0 1rem; }
.summary div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; }
.summary dt { font-size: .8rem; color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; }
.summary .warning dd, .badge.warning { color: var(--warn); }
.badge { font-size: .8rem; padding: .1rem .5rem; border: 1px solid currentColor; border-radius: 999px; }
.events, .passkeys { list-style: none; padding: 0; margin: 0 0 1rem; }
.events li, .passkeys li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.events small, .passkeys small { display: block; }
.modal { position: fixed; inset: 0; background: rgb(0 0 0 / .4); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-box { background: var(--card); border-radius: var(--radius); padding: 1rem; max-width: 360px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 800px) { .two-col { grid-template-columns: 340px minmax(0, 1fr); } }
.total { font-size: 1.1rem; }
