/* Tokens: neutral surfaces, one accent, reserved status colours. Dark values are selected, not flipped. */
:root {
  color-scheme: light;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f1f0ec;
  --border: rgba(11, 11, 11, 0.09);
  --border-strong: rgba(11, 11, 11, 0.16);
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6b6a65;
  --accent: #2a78d6;
  --accent-hover: #256abf;
  --accent-ink: #ffffff;
  --accent-soft: #e8f1fc;
  --up: #006300;
  --good: #0ca30c;
  --warning: #b77900;
  --warning-fill: #fab219;
  --critical: #c13030;
  --critical-fill: #d03b3b;
  --critical-soft: #fbeaea;
  --grid: #e9e8e2;
  --axis: #c3c2b7;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 1px 1px rgba(11, 11, 11, 0.02);
  --radius: 12px;
  --radius-sm: 8px;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #9a9990;
    --accent: #3987e5;
    --accent-hover: #5598e7;
    --accent-soft: #15263b;
    --up: #2fbf2f;
    --good: #0ca30c;
    --warning: #fab219;
    --critical: #e66767;
    --critical-soft: #3a1c1c;
    --grid: #2c2c2a;
    --axis: #383835;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232321;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #9a9990;
  --accent: #3987e5;
  --accent-hover: #5598e7;
  --accent-soft: #15263b;
  --up: #2fbf2f;
  --warning: #fab219;
  --critical: #e66767;
  --critical-soft: #3a1c1c;
  --grid: #2c2c2a;
  --axis: #383835;
  --shadow: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
  font-weight: 600;
}
h1 {
  font-size: 22px;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 15px;
}
h3 {
  font-size: 15px;
}
p {
  margin: 0;
}
.num {
  font-variant-numeric: tabular-nums;
}
.muted {
  color: var(--muted);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.skip:focus {
  top: 12px;
}

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 14px;
  border-right: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  text-decoration: none;
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.mark {
  width: 28px;
  height: 28px;
}
.mark rect {
  fill: var(--accent);
}
.mark path {
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav {
  display: grid;
  gap: 2px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.12s, color 0.12s;
}
.nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.nav a[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--border);
}
.nav svg,
.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon.sm {
  width: 16px;
  height: 16px;
}
.count {
  margin-left: auto;
  min-width: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
}
.side-foot {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--ink-2);
}
.side-foot .row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--axis);
}
.dot.on {
  background: var(--good);
}
.dot.off {
  background: var(--critical-fill);
}

main {
  padding: 28px 32px 64px;
  max-width: 1440px;
  width: 100%;
  outline: none;
}

/* ---------- page head ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head .sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.back:hover {
  color: var(--ink);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 550;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s, transform 0.08s;
}
.btn:hover {
  background: var(--surface-2);
}
.btn:active {
  transform: translateY(1px);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
}
.btn.ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.btn.danger {
  color: var(--critical);
}
.btn.danger.armed {
  background: var(--critical-fill);
  border-color: var(--critical-fill);
  color: #fff;
}
.btn.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}
.btn[disabled],
.btn[aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}

/* ---------- cards and grids ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
}
.card-head .meta {
  color: var(--muted);
  font-size: 13px;
}
.card-body {
  padding: 0 18px 18px;
}
.stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}
.halves {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

/* ---------- stat tiles ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.tile {
  padding: 16px 18px;
}
.tile .label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.tile .value {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.tile .foot {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tile .foot a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 550;
}
.tile .foot a:hover {
  text-decoration: underline;
}
.up {
  color: var(--up);
  font-weight: 600;
}

/* ---------- banner ---------- */
.banner {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.banner ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.banner li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--ink-2);
}
.banner li strong {
  color: var(--ink);
}
.banner code {
  font-size: 13px;
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 4px;
}
.check {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-top: 1px;
  border: 1.5px solid var(--axis);
}
.check.done {
  background: var(--good);
  border-color: var(--good);
  color: #fff;
}
.check.done .icon {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}

/* ---------- pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
}
.pill .dot {
  width: 7px;
  height: 7px;
}
.pill.good .dot {
  background: var(--good);
}
.pill.critical {
  background: var(--critical-soft);
  color: var(--critical);
}
.pill.critical .dot {
  background: var(--critical-fill);
}
.pill.accent {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- accounts table ---------- */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th {
  text-align: left;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
tbody tr:last-child td {
  border-bottom: 0;
}
th:first-child,
td:first-child {
  padding-left: 18px;
}
th:last-child,
td:last-child {
  padding-right: 18px;
}
th.r,
td.r {
  text-align: right;
}
tr.link {
  cursor: pointer;
  transition: background-color 0.12s;
}
tr.link:hover {
  background: var(--surface-2);
}
.who {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.who .name {
  font-weight: 600;
}
.who .note {
  color: var(--muted);
  font-size: 12.5px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
a.who:hover .name {
  text-decoration: underline;
}
.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: 650;
  font-size: 13px;
  text-transform: uppercase;
}
.avatar.lg {
  width: 44px;
  height: 44px;
  font-size: 17px;
}
.spark {
  display: block;
}
.spark path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.spark circle {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2;
}

/* ---------- issues ---------- */
.issues {
  list-style: none;
  margin: 0;
  padding: 0 18px 8px;
}
.issue {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.issue:first-child {
  border-top: 0;
  padding-top: 0;
}
.sev {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
}
.sev.critical {
  color: var(--critical);
}
.sev.warning {
  color: var(--warning);
}
.sev.info {
  color: var(--accent);
}
.issue p {
  font-size: 14px;
  color: var(--ink);
}
.issue .meta {
  display: flex;
  align-items: center;
  gap: 4px 10px;
  flex-wrap: wrap;
  min-height: 32px;
  font-size: 12.5px;
  color: var(--muted);
}
.issue .meta .btn {
  margin-left: auto;
  margin-right: -10px;
}
.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 36px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.empty .icon {
  width: 28px;
  height: 28px;
  color: var(--axis);
}
.empty strong {
  color: var(--ink);
  font-size: 15px;
}

/* ---------- review ---------- */
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface-2);
  margin-bottom: 20px;
  max-width: 100%;
  overflow-x: auto;
}
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 7px;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 550;
  font-size: 14px;
  white-space: nowrap;
}
.tabs a[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--border);
}
.tabs .n {
  color: var(--muted);
  font-weight: 500;
}
.draft {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
}
.draft .thread {
  padding: 18px;
  border-right: 1px solid var(--border);
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}
.draft .reply {
  padding: 18px;
  display: grid;
  gap: 10px;
  align-content: start;
}
.thread-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: 13px;
  color: var(--muted);
}
.thread-meta .sub {
  color: var(--ink);
  font-weight: 600;
}
.thread-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.thread-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}
.thread-title a {
  text-decoration: none;
}
.thread-title a:hover {
  text-decoration: underline;
}
.thread-body {
  color: var(--ink-2);
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
details.top {
  font-size: 14px;
}
details.top summary {
  cursor: pointer;
  color: var(--ink-2);
  font-weight: 550;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
}
details.top summary::-webkit-details-marker {
  display: none;
}
details.top summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
details.top[open] summary::before {
  transform: rotate(45deg);
}
details.top ol {
  margin: 6px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: var(--ink-2);
}
details.top li {
  overflow-wrap: anywhere;
}
.reply label {
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-2);
}
.reply label strong {
  color: var(--ink);
}
textarea,
input[type="text"],
input[type="url"] {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 10px 12px;
  font-size: 14.5px;
  line-height: 1.5;
  transition: border-color 0.12s, box-shadow 0.12s;
}
textarea {
  resize: vertical;
  min-height: 132px;
  max-height: 420px;
  field-sizing: content;
}
textarea:focus,
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.reply-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.chars {
  font-size: 12.5px;
  color: var(--muted);
}
.quote {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14.5px;
}
.ready {
  padding: 18px;
  display: grid;
  gap: 12px;
}
.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.inline-form input {
  flex: 1 1 260px;
}
.leaving {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s, transform 0.18s;
}

/* ---------- accounts ---------- */
.add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.field {
  display: grid;
  gap: 6px;
}
.field label {
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-2);
}
.field .hint {
  font-size: 12.5px;
  color: var(--muted);
}
.prefix {
  position: relative;
}
.prefix span {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.prefix input {
  padding-left: 28px;
}
.form-error {
  color: var(--critical);
  font-size: 13px;
  grid-column: 1 / -1;
}
.acct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
a.acct {
  display: grid;
  gap: 14px;
  padding: 18px;
  text-decoration: none;
  transition: transform 0.12s, border-color 0.12s;
}
a.acct:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.acct-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.acct .karma {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.acct .karma small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
  margin-left: 4px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
}
.chip button {
  border: 0;
  background: none;
  padding: 0;
  margin-right: -2px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
}
.chip button:hover {
  color: var(--critical);
}
.acct-foot {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}
.acct-foot strong {
  color: var(--ink);
  font-weight: 600;
}
.acct-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.acct-head .meta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}
.activity {
  list-style: none;
  margin: 0;
  padding: 0 18px 8px;
}
.activity li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.activity li:first-child {
  border-top: 0;
  padding-top: 0;
}
.activity .title {
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity .title a {
  text-decoration: none;
}
.activity .title a:hover {
  text-decoration: underline;
}
.activity .sub {
  color: var(--muted);
  font-size: 12.5px;
}
.activity .right {
  grid-row: span 2;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- chart ---------- */
.chart {
  position: relative;
  height: 240px;
}
.chart svg {
  display: block;
  width: 100%;
  height: 100%;
}
.chart .gridline {
  stroke: var(--grid);
  stroke-width: 1;
}
.chart .baseline {
  stroke: var(--axis);
  stroke-width: 1;
}
.chart text {
  fill: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.chart .line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart .area {
  fill: color-mix(in srgb, var(--accent) 9%, transparent);
}
.chart .end,
.chart .hover-dot {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2;
}
.chart .cross {
  stroke: var(--axis);
  stroke-width: 1;
}
.tip {
  position: absolute;
  top: 6px;
  pointer-events: none;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12.5px;
  white-space: nowrap;
  transform: translateX(-50%);
}
.tip strong {
  font-variant-numeric: tabular-nums;
}
details.data {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
details.data summary {
  cursor: pointer;
}
details.data table {
  margin-top: 8px;
  max-width: 320px;
}
details.data td,
details.data th {
  padding: 4px 8px;
}

/* ---------- sign-in ---------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  max-width: none;
}
.login-card {
  width: min(380px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
}
.login-card .mark {
  width: 36px;
  height: 36px;
}
.login-card .btn {
  min-height: 44px;
}
.side-foot .signout {
  justify-self: start;
  margin: 2px 0 -4px -10px;
}

/* ---------- toasts, loading ---------- */
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 8px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 32px));
}
.toast {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  animation: toast-in 0.18s ease-out;
}
.toast.error {
  background: var(--critical-fill);
  color: #fff;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.skeleton {
  display: grid;
  gap: 16px;
}
.skeleton div {
  height: 96px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.show-sm {
  display: none;
}

/* ---------- responsive ---------- */
@media (max-width: 1540px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 980px) {
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .add-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .draft {
    grid-template-columns: minmax(0, 1fr);
  }
  .draft .thread {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .halves {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 820px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .side {
    position: sticky;
    z-index: 5;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
  }
  .brand span {
    display: none;
  }
  .nav {
    display: flex;
    flex: 1;
    justify-content: flex-end;
  }
  .nav a {
    padding: 0 10px;
    min-height: 44px;
  }
  .side-foot {
    display: none;
  }
  main {
    padding: 20px 16px 56px;
  }
}
@media (max-width: 560px) {
  .hide-sm {
    display: none;
  }
  .show-sm {
    display: block;
    margin-top: 4px;
  }
  .who .note {
    max-width: 150px;
  }
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .tile .value {
    font-size: 24px;
  }
  .add-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .nav a span:not(.count) {
    display: none;
  }
  .nav a {
    min-width: 44px;
    justify-content: center;
  }
  .page-head .actions,
  .page-head .actions .btn {
    width: 100%;
  }
  .reply-foot .actions,
  .reply-foot .actions .btn {
    flex: 1 1 auto;
  }
  .btn {
    min-height: 44px;
  }
  .btn.small {
    min-height: 44px;
  }
}
@media (pointer: coarse) {
  .btn,
  .tabs a,
  details.top summary {
    min-height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
