:root {
  --bg: #f4f1ea;
  --card: #fffdf8;
  --ink: #1f1d1a;
  --muted: #6f6a61;
  --line: #e4ded2;
  --accent: #c2603a;
  --accent-ink: #fff;
  --urgent: #b3261e;
  --ok: #3b7a57;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a18;
    --card: #252320;
    --ink: #f1ede4;
    --muted: #a39d92;
    --line: #37342f;
    --accent: #e07a52;
    --accent-ink: #1b1a18;
    --urgent: #f2766b;
    --ok: #7fc39b;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* buttons set display, which would otherwise override the hidden attribute */
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  padding: env(safe-area-inset-top) 16px calc(env(safe-area-inset-bottom) + 24px);
  -webkit-font-smoothing: antialiased;
}
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 8px; }
h1 { font-size: 26px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 26px 0 10px; }
.muted { color: var(--muted); margin: 2px 0 0; font-size: 14px; }
.error { color: var(--urgent); }
.note { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
code { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; font-size: 14px; }

button, .btn {
  appearance: none; border: 0; border-radius: 10px; font: inherit; font-size: 15px; font-weight: 600;
  padding: 10px 14px; background: var(--accent); color: var(--accent-ink); text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px;
}
button.secondary, .btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.ghost { background: transparent; color: var(--muted); font-size: 22px; padding: 6px 10px; }
button:disabled { opacity: 0.5; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 10px 0;
  transition: opacity 0.25s, transform 0.25s;
}
.card.leaving { opacity: 0; transform: translateX(24px); }
.card.urgent { border-left: 4px solid var(--urgent); }
.card.highlight { box-shadow: 0 0 0 2px var(--accent); }
.who { font-weight: 650; font-size: 17px; color: var(--ink); text-decoration: none; }
.who::after { content: " ›"; color: var(--muted); }
.meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.summary { margin: 8px 0 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn, .actions button { flex: 1 1 auto; min-width: 84px; }
.empty { text-align: center; padding: 40px 0; color: var(--muted); }
.empty strong { display: block; font-size: 22px; color: var(--ok); margin-bottom: 6px; }
details summary { cursor: pointer; color: var(--muted); font-size: 14px; margin: 22px 0 6px; }
.fyi { font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.fyi:last-child { border-bottom: 0; }

#pair form { display: flex; gap: 8px; margin-top: 12px; }
#pair button { flex: none; }
#pair input {
  flex: 1; min-width: 0; width: 100%; font: inherit; font-size: 22px; letter-spacing: 0.3em; text-align: center; padding: 10px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
#footer { margin-top: 28px; text-align: center; }
#footer button { width: 100%; }
#footer .muted { margin-top: 10px; }
#setup { margin-top: 10px; }
#setup button { width: 100%; margin-top: 8px; }
#toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 16px);
  background: var(--ink); color: var(--bg); padding: 12px 14px; border-radius: 12px; font-size: 14px; text-align: center;
}

.note.warn { border-color: var(--urgent); }
#subtitle.error { color: var(--urgent); }
#status span.error { color: var(--urgent); }
.swept { padding: 10px 0 6px; border-bottom: 1px solid var(--line); transition: opacity 0.25s; }
.swept.leaving { opacity: 0; }
.swept-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.swept-row { display: block; padding: 6px 0 2px 14px; color: var(--ink); text-decoration: none; font-size: 14px; }
.swept-line { display: flex; justify-content: space-between; gap: 10px; }
.swept-line span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.swept-line time { color: var(--muted); font-size: 12px; white-space: nowrap; }
button.small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
