/* Life OS — mobile-first. В Telegram цвета берутся из темы Telegram (--tg-theme-*). */
:root {
  --bg: #f4f5f7; --card: #ffffff; --text: #111827; --muted: #6b7280;
  --line: #e5e7eb; --accent: #2563eb; --warn: #dc2626; --ok: #16a34a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --card: #1a1d24; --text: #e5e7eb; --muted: #9ca3af;
          --line: #2a2f3a; --accent: #60a5fa; --warn: #f87171; --ok: #4ade80; color-scheme: dark; }
}
html.tg {
  --bg: var(--tg-theme-secondary-bg-color, var(--bg));
  --card: var(--tg-theme-bg-color, var(--card));
  --text: var(--tg-theme-text-color, var(--text));
  --muted: var(--tg-theme-hint-color, var(--muted));
  --accent: var(--tg-theme-link-color, var(--accent));
  --line: color-mix(in srgb, var(--tg-theme-hint-color, #888) 25%, transparent);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }
.page { max-width: 640px; margin: 0 auto;
        padding: calc(12px + env(safe-area-inset-top, 0px)) 14px calc(84px + env(safe-area-inset-bottom, 0px)); }
.head { padding: 6px 4px 12px; }
.head h1 { margin: 0; font-size: 26px; }
.back { color: var(--accent); font-size: 14px; }
.muted, .meta { color: var(--muted); }
.meta { font-size: 13px; }
.warn { color: var(--warn); }
.card { background: var(--card); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; }
.card h2 { font-size: 15px; margin: 4px 0 6px; display: flex; gap: 8px; align-items: baseline; }
.count { color: var(--muted); font-weight: 400; }
.big { margin-left: auto; font-size: 18px; }
ul { list-style: none; margin: 0; padding: 0; }
.row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.time { min-width: 44px; color: var(--muted); font-variant-numeric: tabular-nums; }
.key { min-width: 104px; }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px;
       padding: 1px 8px; white-space: nowrap; }
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted);
         background: transparent; flex: none; margin-top: 1px; cursor: pointer; padding: 0; }
.check.on { background: var(--ok); border-color: var(--ok); }
.done { opacity: .7; }
.prio { font-size: 11px; border-radius: 6px; padding: 1px 6px; color: #fff; background: var(--muted); }
.prio.p4 { background: var(--warn); } .prio.p3 { background: #ea580c; } .prio.p2 { background: var(--accent); }
.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.note { padding: 8px 0; color: var(--muted); }
.empty { text-align: center; padding: 48px 0; color: var(--muted); font-size: 18px; }
.search, textarea { width: 100%; font: inherit; color: var(--text); background: var(--card);
                    border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
textarea { resize: vertical; min-height: 110px; }
.capture button { width: 100%; font: inherit; font-weight: 600; border: 0; border-radius: 12px;
                  padding: 12px; background: var(--accent); color: #fff; cursor: pointer; }
.capture button[disabled] { opacity: .6; }
.htmx-indicator { display: none; } .htmx-request .htmx-indicator { display: inline; }
.answer .md { white-space: pre-wrap; }
.spark { width: 100%; height: 48px; display: block; margin: 4px 0; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.login { text-align: center; padding-top: 30vh; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around;
        background: var(--card); border-top: 1px solid var(--line);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
.tabs a { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--muted);
          min-width: 60px; }
.tabs a span { font-size: 20px; line-height: 1.2; }
.tabs a.on { color: var(--accent); }
@media (min-width: 900px) { .page { padding-top: 32px; } }
