:root {
  --bg: #f5f5f3;
  --card: #ffffff;
  --fg: #1b1b1d;
  --mute: #6c6c72;
  --line: #e3e3df;
  --soft: #efefec;
  --accent: #1f9d63;
  --accent-fg: #ffffff;
  --danger: #c93a32;
  --ok: #1f9d63;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --card: #1a1a1d;
    --fg: #ececef;
    --mute: #95959c;
    --line: #2a2a2f;
    --soft: #232327;
    --accent: #6fd69a;
    --accent-fg: #0d2a19;
    --danger: #ff7a70;
    --ok: #6fd69a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 16px; margin: 0; display: flex; align-items: center; gap: 8px; }
.mute { color: var(--mute); margin: 0; }
a { color: inherit; }

.top {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  max-width: 1080px; margin: 0 auto; padding: 28px 16px 8px;
}
main { max-width: 1080px; margin: 0 auto; padding: 8px 16px 64px; display: grid; gap: 28px; }
section { display: grid; gap: 12px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 36px; }
.count { color: var(--mute); font-weight: 400; }

.card, .row {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.list { display: grid; gap: 8px; }
.row { padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; }
.row__main { min-width: 0; display: grid; gap: 4px; }
.row__title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; overflow-wrap: anywhere; }
.row__title a { text-decoration: none; }
.row__title a:hover { text-decoration: underline; }
.row__meta { color: var(--mute); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.row__actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.empty { color: var(--mute); padding: 18px 16px; border: 1px dashed var(--line); border-radius: var(--radius); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; }
.dot--on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.tag { font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 99px; background: var(--soft); color: var(--mute); }
.tag--danger { color: var(--danger); }

.btn {
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--line); background: var(--soft); color: var(--fg);
  border-radius: 10px; padding: 7px 12px; white-space: nowrap;
}
.btn:hover { border-color: var(--mute); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn--primary:hover { filter: brightness(1.06); border-color: var(--accent); }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--danger); }

input, select {
  font: inherit; color: var(--fg); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; }
.inline input { flex: 1 1 200px; }

.log { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); max-height: 420px; overflow: auto; }
.log__row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.log__row:first-child { border-top: 0; }
.log__time { color: var(--mute); font-variant-numeric: tabular-nums; }
.log__who { font-weight: 600; }

dialog {
  border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--fg);
  padding: 24px; width: min(480px, calc(100vw - 32px));
}
dialog::backdrop { background: rgb(0 0 0 / 0.45); }
dialog > * + * { margin-top: 12px; }
dialog form { display: flex; justify-content: flex-end; }
.code {
  font: 600 34px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.18em;
  text-align: center; padding: 18px; background: var(--soft); border-radius: 12px; cursor: pointer;
}
.cmd {
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0;
  background: var(--soft); border-radius: 10px; padding: 10px 12px; overflow-wrap: anywhere; white-space: pre-wrap; cursor: pointer;
}
summary { cursor: pointer; color: var(--mute); }
details > * + * { margin-top: 8px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px;
  max-width: calc(100vw - 32px);
}

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login__card { width: min(360px, 100%); padding: 28px; display: grid; gap: 12px; }
.err { color: var(--danger); margin: 0; }

@media (max-width: 640px) {
  .row { grid-template-columns: 1fr; }
  .row__actions { justify-content: flex-start; }
  .log__row { grid-template-columns: 1fr; gap: 2px; }
}
