:root {
  --ink: #0f172a;
  --panel: #16213a;
  --line: #243252;
  --text: #e6edf7;
  --muted: #8d9bb7;
  --signal: #3ddc7a;
  --on-signal: #052e16;
  --danger: #f87171;
  --ok: #86efac;
  --warn: #fbbf24;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ink); color: var(--text);
  font: 16px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
a { color: var(--signal); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

.wrap { max-width: 640px; margin: 0 auto; padding: 20px 16px 64px; }

/* header */
.top { display: flex; align-items: center; gap: 12px; padding: 4px 0 20px; border-bottom: 1px solid var(--line); }
.top h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; flex: 1; }
.top .who { color: var(--muted); font-size: 14px; }
.mark { width: 36px; height: 36px; flex: none; }
.mark .plane { transform-box: fill-box; transform-origin: center; }
.mark.pulse .plane { animation: fly .9s ease-out 1; }
@keyframes fly { 0% { transform: translate(0,0); } 35% { transform: translate(34px,-34px); opacity: .6; } 36% { transform: translate(-34px,34px); opacity: 0; } 100% { transform: translate(0,0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mark.pulse .plane { animation: none; } }

/* the title is a link back to the home page */
.top h1 a { color: inherit; text-decoration: none; }
.top h1 a:hover { text-decoration: underline; }

nav { display: flex; gap: 20px; padding: 12px 0; font-size: 15px; }
nav a { color: var(--muted); text-decoration: none; }
nav a[aria-current="page"] { color: var(--text); border-bottom: 2px solid var(--signal); }

/* buttons and fields */
button, .btn { font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: 10px 18px; cursor: pointer;
  background: var(--signal); color: var(--on-signal); }
button:disabled { opacity: .5; cursor: default; }
button.quiet { background: transparent; color: var(--muted); font-weight: 500; padding: 6px 8px; }
button.quiet:hover { color: var(--text); }
button.off { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
label { display: block; font-size: 14px; color: var(--muted); margin: 16px 0 6px; }
input, textarea { width: 100%; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; }
textarea { min-height: 96px; resize: vertical; }
.msg { min-height: 1.5em; font-size: 14px; color: var(--muted); }
.msg.err { color: var(--danger); }

/* alerts bar */
.alerts { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.alerts .text { flex: 1; min-width: 0; }
.alerts strong { display: block; font-weight: 600; }
.alerts span { color: var(--muted); font-size: 14px; }

/* feed */
.feed { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.item .src { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.item .t { font-weight: 600; margin-top: 2px; }
.item .time { grid-column: 2; grid-row: 2; align-self: start; margin-top: 2px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item .b { grid-column: 1 / -1; color: #c3cde0; overflow-wrap: anywhere; }
.chip { font-size: 12px; padding: 1px 8px; border-radius: 99px; box-shadow: inset 0 0 0 1px currentColor; }
.chip.queued { color: var(--warn); }
.chip.failed { color: var(--danger); }
.empty { padding: 40px 0; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }

/* login */
.login { max-width: 380px; margin: 14vh auto 0; padding: 0 16px; }
.login .mark { width: 56px; height: 56px; }
.login h1 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin: 20px 0 4px; }
.login p { color: var(--muted); margin: 0 0 8px; }
.login button { width: 100%; margin-top: 24px; padding: 12px; }

/* pairing number */
.code { margin: 24px 0 8px; padding: 20px 0; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  font-size: 52px; font-weight: 600; letter-spacing: .12em; text-indent: .12em; font-variant-numeric: tabular-nums; color: var(--signal); }
.fine { font-size: 14px; margin-top: 24px; }
code { background: var(--panel); padding: 1px 6px; border-radius: 4px; font-size: 14px; }

/* admin */
.sec { font-size: 17px; font-weight: 600; margin: 28px 0 12px; }
.dev { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.dev[hidden] { display: none; }
.dev .num { font-size: 24px; font-weight: 600; letter-spacing: .08em; color: var(--signal); font-variant-numeric: tabular-nums; }
.dev .nm { font-weight: 600; }
.dev .what { grid-column: 1; color: var(--muted); font-size: 14px; }
.dev form { grid-column: 2; grid-row: 1 / span 2; }
.dev .row { grid-column: 1 / -1; grid-row: auto; display: flex; gap: 8px; margin-top: 8px; }
.dev .row input { flex: 1; min-width: 0; }
button.danger:hover { color: var(--danger); }

/* admin: API keys */
.hint { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.keyform { display: flex; gap: 8px; margin: 12px 0 4px; }
.keyform input { flex: 1; min-width: 0; }
.newkey { margin: 12px 0; padding: 16px; border: 1px solid var(--signal); border-radius: 12px; }
.newkey strong { display: block; margin-bottom: 8px; }
.newkey code { display: block; padding: 10px 12px; font-size: 14px; overflow-wrap: anywhere; user-select: all; border: 1px solid var(--line); }
.newkey .keyact { display: flex; align-items: center; gap: 12px; margin: 10px 0 6px; }
.newkey .keyact .msg { min-height: 0; }
.newkey small { color: var(--muted); }

/* actions on each notification */
.item .act { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.item .act:empty { display: none; }
.item .act .link { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .act button, .item .act .chip { margin-left: auto; flex: none; }
.item .act .link + button, .item .act .link + .chip { margin-left: auto; }
button.sm { padding: 6px 14px; font-size: 14px; }
.chip.done { color: var(--ok); }
.item { transition: opacity .2s ease, transform .2s ease; }
.item.leaving { opacity: 0; transform: translateX(14px); }
@media (prefers-reduced-motion: reduce) { .item { transition: none; } }

/* search and paging */
.search { padding: 4px 0 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.more { display: block; margin: 20px auto 0; }
.more[hidden] { display: none; }
nav { flex-wrap: wrap; }

/* admin tabs */
.panel[hidden] { display: none; }
#tabs { border-bottom: 1px solid var(--line); gap: 18px; margin-bottom: 16px; padding-bottom: 0; }
#tabs a { padding: 4px 0 10px; border-bottom: 2px solid transparent; }
#tabs a[aria-current="page"] { border-bottom-color: var(--signal); }
.findbar { display: flex; gap: 8px; align-items: stretch; }
.findbar input { flex: 1; min-width: 0; }
.findbar form { margin: 0; }
.findbar button { white-space: nowrap; height: 100%; }

/* acknowledge all */
.bulk { display: flex; justify-content: flex-end; padding: 10px 0 0; }
