:root {
  color-scheme: light dark;
  --accent: #1a73e8;
  --muted: #80868b;
  --ok: #188038;
  --warn: #b06000;
  --line: color-mix(in srgb, currentColor 12%, transparent);
  --card: color-mix(in srgb, currentColor 4%, transparent);
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, sans-serif; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: Canvas; z-index: 1; }
#who { margin-left: auto; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
main { max-width: 720px; margin: 0 auto; padding: 16px; }
h1 { font-size: 26px; line-height: 1.2; margin: 32px 0 8px; }
h2 { font-size: 19px; margin: 4px 0 12px; }
h3 { font-size: 15px; margin: 20px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: #d93025; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
button { font: inherit; cursor: pointer; }
.primary { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 12px 18px; width: 100%; font-weight: 600; }
.primary:disabled { opacity: 0.6; }
.link { background: none; border: 0; color: var(--accent); padding: 4px 0; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cards li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.subj { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.to { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { font-size: 13px; margin-top: 4px; }
.status.opened { color: var(--ok); }
.status.maybe { color: var(--warn); }
.status.none { color: var(--muted); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.timeline .low { color: var(--muted); }
form { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input[type="text"], input[type="email"], textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: CanvasText; }
textarea { resize: vertical; }
select { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: CanvasText; }
#view-settings { display: grid; gap: 12px; align-content: start; }
.switch { display: flex; align-items: center; gap: 8px; color: CanvasText; font-size: 15px; }
#dev-form { display: flex; gap: 8px; margin-top: 16px; }
#dev-form input { flex: 1; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; border-top: 1px solid var(--line); background: Canvas; padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; background: none; border: 0; padding: 14px 0; color: var(--muted); }
.tabs button.active { color: var(--accent); font-weight: 600; }
