
:root {
  color-scheme: dark;
  --night: #1a2230;
  --navy: #242e40;
  --navy-raised: #2b3648;
  --line: #354157;
  --teal: #76aebd;
  --teal-bright: #8fc1ce;
  --mauve: #b99ba9;
  --mist: #cdc6c8;
  --text: #e4dfe1;
  --slate: #8f98a9;
  --rose: #e2a3b4;
  --split: linear-gradient(90deg, var(--teal) 0 50%, var(--mauve) 50% 100%);
  --font: "Avenir Next", Avenir, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { background: var(--night); }
body { margin: 0; background: var(--night); color: var(--text);
  font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--teal-bright); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
b { font-weight: 600; }

/* Header */
header { background: var(--navy); border-bottom: 1px solid var(--line); }
.bar { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: flex;
  align-items: center; gap: 28px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--mist);
  text-decoration: none; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.brand .mark { width: 30px; height: 30px; }
.brand span { color: var(--slate); font-weight: 500; }
nav { display: flex; gap: 22px; flex: 1; flex-wrap: wrap; align-self: stretch; }
nav a { position: relative; display: flex; align-items: center; color: var(--slate);
  text-decoration: none; font-weight: 500; }
nav a:hover { color: var(--text); }
nav a.active { color: var(--text); }
nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 3px; background: var(--split); }

/* Avatar and account menu. <details> opens and closes it without JavaScript. */
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  background: var(--mauve); color: var(--night); font-weight: 600; font-size: 16px; line-height: 1; }
.avatar.large { width: 72px; height: 72px; font-size: 30px; }
/* Flex rather than block, so the avatar isn't set on a text line with space
   below it for descenders, which pushed it above the header's centre line */
.account { position: relative; margin-left: auto; display: flex; align-items: center; }
.account summary { list-style: none; cursor: pointer; border-radius: 50%; display: flex; }
.account summary::-webkit-details-marker { display: none; }
.account summary .avatar { box-shadow: 0 0 0 2px var(--navy), 0 0 0 3px var(--line); }
.account summary:hover .avatar, .account[open] summary .avatar { box-shadow: 0 0 0 2px var(--navy), 0 0 0 4px var(--mauve); }
/* Clicking anywhere outside the open menu lands on this overlay, which is part
   of <summary>, so it closes the menu */
.account[open] summary::before { content: ""; position: fixed; inset: 0; z-index: 10; cursor: default; }
.menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 11; min-width: 220px;
  background: var(--navy-raised); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; box-shadow: 0 12px 32px rgba(10, 14, 22, 0.55); }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head b { display: block; color: var(--text); }
.menu-head span { display: block; color: var(--slate); font-size: 13px; overflow-wrap: anywhere; }
.menu form { margin: 0; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 8px 10px;
  border: 0; border-radius: 6px; background: none; color: var(--text); font-weight: 500;
  text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover { background: rgba(118, 174, 189, 0.12); color: var(--text); }
.menu a.active { color: var(--teal-bright); }

/* Page */
main { max-width: 1200px; margin: 0 auto; padding: 32px 16px 56px; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.015em;
  margin: 0 0 6px; color: var(--mist); }
.summary { margin: 0 0 24px; color: var(--slate); font-size: 16px; max-width: 70ch; }
.summary b { color: var(--teal); }

/* Tables */
.panel { background: var(--navy); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 11px 16px; vertical-align: top; }
th { font-size: 13px; font-weight: 600; color: var(--slate); white-space: nowrap;
  border-bottom: 1px solid var(--line); background: var(--navy-raised); }
td { border-bottom: 1px solid rgba(53, 65, 87, 0.6); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(118, 174, 189, 0.05); }
td.nowrap { white-space: nowrap; }
td.msg { white-space: pre-wrap; word-break: break-word; font-family: var(--mono);
  font-size: 13px; color: var(--mist); }
.id { display: block; color: var(--slate); font-size: 12.5px; }
.muted { color: var(--slate); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12.5px;
  font-weight: 500; white-space: nowrap; }
.pill.dm { background: rgba(118, 174, 189, 0.2); color: var(--teal-bright); }
.pill.ntfy { background: rgba(185, 155, 169, 0.32); color: #e6cfda; }
.pill.everyone { border: 1px solid var(--mist); color: var(--mist); padding: 0 8px; }
.pill.level-warn { background: rgba(185, 155, 169, 0.32); color: #e6cfda; }
.pill.level-error { background: rgba(226, 163, 180, 0.22); color: var(--rose); }
td.msg-error { color: var(--rose); }
code { font-family: var(--mono); font-size: 0.9em; color: var(--mist); }
.empty { padding: 40px 16px; text-align: center; color: var(--slate); }

/* Forms */
form.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
input, select, button { font: inherit; padding: 9px 12px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--night); color: var(--text); }
input::placeholder { color: var(--slate); }
input:focus-visible, select:focus-visible { border-color: var(--teal); outline-offset: 0; }
input[type=search] { flex: 1; min-width: 200px; }
button { background: var(--teal); color: var(--night); border-color: var(--teal);
  font-weight: 600; cursor: pointer; }
button:hover { background: var(--teal-bright); border-color: var(--teal-bright); }
button.link { background: none; border: 0; color: var(--slate); padding: 0; font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px; }
button.link:hover { color: var(--text); background: none; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: wrap; margin-top: 16px; color: var(--slate); font-size: 14px; }
.pager nav { flex: 0; gap: 16px; align-self: auto; }

/* Sign in */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login { position: relative; width: 100%; max-width: 380px; background: var(--navy);
  border: 1px solid var(--line); border-radius: 14px; padding: 40px 32px 32px; overflow: hidden; }
.login::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--split); }
.login .mark { display: block; width: 88px; height: 88px; margin: 0 auto 20px; }
.login h1 { text-align: center; margin-bottom: 24px; }
.login label { display: block; font-size: 14px; font-weight: 500; color: var(--mist); margin: 14px 0 6px; }
.login input { width: 100%; }
.login button { width: 100%; margin-top: 24px; padding: 11px 12px; }
.error { background: rgba(226, 163, 180, 0.12); border: 1px solid rgba(226, 163, 180, 0.35);
  color: var(--rose); padding: 9px 12px; border-radius: 7px; font-size: 14px; }
.notice { background: rgba(118, 174, 189, 0.12); border: 1px solid rgba(118, 174, 189, 0.4);
  color: var(--teal-bright); padding: 9px 12px; border-radius: 7px; font-size: 14px; margin-bottom: 20px; max-width: 560px; }

/* Profile */
.card { background: var(--navy); border: 1px solid var(--line); border-radius: 10px;
  padding: 24px; max-width: 560px; margin-bottom: 20px; }
.card h2 { font-size: 18px; font-weight: 600; color: var(--mist); margin: 0 0 4px; }
.card > p { margin: 0 0 18px; color: var(--slate); font-size: 14px; }
.card .error { margin-bottom: 14px; }
.card label { display: block; font-size: 14px; font-weight: 500; color: var(--mist); margin: 14px 0 6px; }
.card input { width: 100%; }
.card button { margin-top: 20px; }
.picture { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.picture p { margin: 0; color: var(--slate); font-size: 14px; }
.hint { color: var(--slate); font-size: 13px; margin: 6px 0 0; }

@media (max-width: 640px) {
  .bar { gap: 12px 20px; padding-top: 12px; }
  nav { order: 3; flex-basis: 100%; min-height: 44px; }
  h1 { font-size: 22px; }
  .login { padding: 32px 20px 24px; }
}
