:root {
  --bg: #f6f5f1; --surface: #ffffff; --surface-2: #eeece6; --text: #1d1c1a; --muted: #5f5e5a; --border: #d9d6cc;
  --accent: #534ab7; --accent-text: #ffffff; --ok: #2f6b10; --warn: #8a4f08; --warn-bg: #faeeda; --danger: #a32d2d;
  --radius: 10px; --tap: 44px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151514; --surface: #1f1f1d; --surface-2: #2a2a27; --text: #f1efe8; --muted: #b4b2a9; --border: #3a3a36;
    --accent: #8f88e6; --accent-text: #111111; --ok: #97c459; --warn: #efb04a; --warn-bg: #3b2a10; --danger: #f09595; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#app { min-height: 100vh; display: flex; flex-direction: column; max-width: 760px; margin: 0 auto; }
.top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--bg); border-bottom: 1px solid var(--border); }
.brand { font-weight: 600; }
.screen { flex: 1; padding: 16px; padding-bottom: 96px; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; padding: 6px 8px;
  padding-bottom: max(6px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
.tabs a { flex: 1; max-width: 160px; min-height: var(--tap); display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); color: var(--muted); text-decoration: none; font-weight: 500; }
.tabs a.on { color: var(--text); background: var(--surface-2); }
button { min-height: var(--tap); padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.danger { color: var(--danger); }
button:disabled { opacity: .6; }
.chip { min-height: var(--tap); padding: 0 14px; font-size: 14px; border-radius: 999px; background: var(--surface-2); border: 0; }
.chip.ok { color: var(--ok); }
.chip.warn { color: var(--warn); background: var(--warn-bg); }
.chip.muted { color: var(--muted); }
input, textarea { width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit; }
textarea { min-height: 50vh; resize: vertical; line-height: 1.6; }
.bar { display: flex; gap: 8px; margin-bottom: 12px; }
.bar input { flex: 1; min-width: 0; }
.bar button { flex: none; }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; min-height: var(--tap); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none; }
.row .date { font-size: 13px; color: var(--muted); }
.row .line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor { display: flex; flex-direction: column; gap: 10px; }
.editor > a { min-height: var(--tap); display: inline-flex; align-items: center; color: var(--accent); }
.editor .actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hint, .empty { color: var(--muted); font-size: 14px; }
.banner { padding: 10px 12px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); font-size: 14px; }
.banner[hidden] { display: none; }
.error { color: var(--danger); font-size: 14px; min-height: 1.2em; margin: 0; }
.signin { display: flex; flex-direction: column; gap: 12px; max-width: 420px; margin: 12vh auto 0; padding: 16px; }
.card { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 12px; }
.card .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin: 8px 0; }
.card .two div { padding: 8px; background: var(--surface-2); border-radius: 8px; font-size: 14px; white-space: pre-wrap;
  overflow-wrap: anywhere; max-height: 200px; overflow: auto; }
.card .buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.fatal, .boot { padding: 24px 16px; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 18px; margin: 20px 0 8px; }
