:root {
  --bg: #f6f7f9; --card: #fff; --ink: #14181f; --muted: #667085; --line: #e3e6eb;
  --brand: #0b6e4f; --brand-ink: #fff; --danger: #b42318; --warn: #b54708;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #101317; --card: #181c22; --ink: #eef0f3; --muted: #98a2b3; --line: #2a3038; --brand: #3ccf91; --brand-ink: #06281b; --danger: #f97066; --warn: #fdb022; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif; }
header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
header[hidden] { display: none; }
.brand { font-weight: 700; font-size: 20px; color: var(--brand); text-decoration: none; margin-inline-end: auto; }
#who { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
main { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
h1 { font-size: 20px; margin: 4px 0 12px; }
h2 { font-size: 15px; margin: 0 0 10px; color: var(--muted); font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
button, .btn { font: inherit; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button.primary, .btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
button.danger { color: var(--danger); border-color: var(--danger); }
button.ghost { min-height: 36px; padding: 0 10px; border-color: transparent; background: transparent; color: var(--muted); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
textarea { min-height: 80px; }
label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > input, .row > select { flex: 1 1 140px; width: auto; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; }
.chip { flex: none; min-height: 36px; padding: 0 12px; border-radius: 18px; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.lead { display: block; color: inherit; text-decoration: none; }
.lead .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.code { font-weight: 700; font-family: ui-monospace, Menlo, monospace; direction: ltr; unicode-bidi: isolate; }
.meta { color: var(--muted); font-size: 14px; }
.badge { font-size: 13px; padding: 2px 10px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.badge.new { color: var(--warn); border-color: var(--warn); }
.badge.completed, .badge.confirmed { color: var(--brand); border-color: var(--brand); }
.badge.spam, .badge.cancelled, .badge.duplicate, .badge.no_response { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
dt { color: var(--muted); } dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.timeline li:first-child { border-top: 0; }
.err { color: var(--danger); font-size: 14px; margin-top: 4px; min-height: 1em; }
.login { max-width: 380px; margin: 12vh auto 0; }
#toast { position: fixed; inset-inline: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); max-width: 420px; margin-inline: auto; padding: 12px 16px; border-radius: 10px; background: var(--ink); color: var(--bg); opacity: 0; pointer-events: none; transition: opacity .2s; text-align: center; }
#toast.show { opacity: 1; }
.empty { text-align: center; color: var(--muted); padding: 32px 0; }
.between { justify-content: space-between; align-items: center; }
.mt { margin-top: 12px; }
#usersLink { color: var(--muted); font-size: 14px; text-decoration: none; padding: 8px; }
