/* трибуквы · админ – Admin Web mockups (1a users, 1b payments, 1c nodes,
   1d releases, 1e journal). Dark only, like the mockups. */

:root {
  color-scheme: dark;
  --bg: #070908;
  --panel: #101211;
  --divider: #222523;
  --surface: #181a19;
  --line: #3a403c;
  --text: #f4f6f5;
  --muted: #a8aeaa;
  --dim: #5b615d;
  --accent: #7ce321;
  --accent-deep: #2c7a14;
  --accent-soft: #18421a;
  --accent-text: #08220c;
  --warn: #f2bd54;
  --warn-soft: #3b2d14;
  --danger: #ff7474;
  --danger-soft: #3a1717;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius-card: 22px;
  --radius-panel: 24px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.2 Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: var(--accent); }
a:hover { color: var(--accent-deep); }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.warn { color: var(--warn); }
.danger { color: var(--danger); }
.ok { color: var(--accent); }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 52px; height: 52px; object-fit: contain; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 800; font-size: 17px; white-space: nowrap; }
.brand-tag { font-size: 11px; color: var(--accent-deep); font-weight: 600; }

/* Login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: min(420px, 100%);
  display: flex; flex-direction: column; gap: 14px;
  padding: 28px;
  border-radius: var(--radius-panel);
  background: var(--surface);
  border: 1px solid var(--line);
}
/* Sidebar: the logo on its own line, larger and centred, the name below. */
.sidebar .brand { flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.sidebar .brand img { width: 96px; height: 96px; }
.sidebar .brand-text { align-items: center; }
.brand-login { margin-bottom: 8px; }
.brand-login img { width: 56px; height: 56px; }
.login-api summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.login-api[open] summary { margin-bottom: 10px; }
.login-error { margin: 0; min-height: 18px; color: var(--danger); font-size: 13px; }
.hint { margin: 0; font-size: 12px; color: var(--muted); }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea {
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
/* The native arrow sits almost on the border; ours keeps a clear gap. */
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 48px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%239AA89E' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 20px center;
  background-size: 12px 8px;
  cursor: pointer;
}
.field textarea { height: auto; min-height: 120px; padding: 12px 14px; font-family: var(--mono); font-size: 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* A field and its button on one line: the button is as tall as the field. */
.field-inline { display: flex; gap: 10px; align-items: flex-end; }
.field-inline .field { flex: 1; min-width: 0; }
.field-inline > .btn, .field-inline > button.btn { height: 44px; padding: 0 18px; border-radius: 14px; font-size: 13px; flex: none; }
.field-inline > .grow { flex: 1; }
/* Fields that belong together, with their hint below. */
.field-group { display: flex; flex-direction: column; gap: 10px; }
/* An explanation with its actions: text on the left, buttons on the right;
   on a narrow card the buttons move under the text instead of squeezing it. */
.action-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--panel);
}
.action-row > .hint { flex: 1 1 280px; line-height: 1.45; }
.action-row > .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-left: auto; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.callout .btn { margin-left: 8px; }
.incident-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* Buttons */
.btn {
  height: 42px;
  padding: 0 18px;
  border-radius: 14px;
  border: 0;
  background: var(--divider);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.15); }
.btn:disabled { opacity: .45; cursor: default; filter: none; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-small { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 12px; }
.btn-wide { width: 100%; }
.link-btn {
  background: none; border: 0; padding: 0;
  color: var(--accent); font-weight: 600; font-size: 13px;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

/* App shell */
.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 248px; flex: none;
  background: var(--panel);
  border-right: 1px solid var(--divider);
  display: flex; flex-direction: column;
  padding: 18px 14px;
}
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 26px; }
.nav-item {
  height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px; font-weight: 500;
  text-align: left;
}
.nav-item:hover { background: var(--surface); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav-item svg { flex: none; }
.nav-item .label { flex: 1; }
.nav-badge { padding: 1px 8px; border-radius: 999px; background: var(--divider); color: var(--muted); font-size: 11px; font-weight: 700; }
.nav-badge.warn { background: var(--warn-soft); color: var(--warn); }
.nav-badge.danger { background: var(--danger-soft); color: var(--danger); }

.api-card {
  margin-top: auto;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px;
}
.api-card-row { display: flex; justify-content: space-between; }
.api-env { font-weight: 600; }
.api-env::before { content: "● "; }
#apiHost { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 64px; flex: none;
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px;
  border-bottom: 1px solid var(--divider);
  position: relative;
}
.search {
  position: relative;
  flex: 1; max-width: 450px; height: 40px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  color: var(--muted);
}
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font-size: 14px; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { font: 11px var(--mono); padding: 2px 6px; border-radius: 6px; background: var(--divider); color: var(--muted); }
.search-results {
  position: absolute; left: 0; right: 0; top: 46px; z-index: 20;
  max-height: 420px; overflow: auto;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  padding: 6px;
}
.search-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.search-item { display: flex; flex-direction: column; width: 100%; padding: 8px 10px; border-radius: 10px; border: 0; background: none; text-align: left; }
.search-item span:last-child { font-size: 12px; color: var(--muted); }
.search-item:hover, .search-item.active { background: var(--divider); }
.search-empty { padding: 12px; color: var(--muted); font-size: 13px; }

.session-info { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.session-info.warn { color: var(--warn); }
.avatar {
  width: 38px; height: 38px; flex: none;
  border-radius: 12px; border: 0;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 800; font-size: 13px;
}
.menu {
  position: absolute; right: 28px; top: 56px; z-index: 30;
  min-width: 220px;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column;
}
.menu button { text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 10px; }
.menu button:hover { background: var(--divider); }
.menu-caption { padding: 8px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--divider); margin-bottom: 4px; }

.content {
  flex: 1; min-height: 0;
  overflow: auto;
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px 28px;
}
.page-head { display: flex; align-items: flex-end; gap: 12px; }
.page-title { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--accent); }
.page-title h1 { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.2; }
.page-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat {
  padding: 16px 18px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0;
}
.stat-k { font-size: 13px; color: var(--muted); }
.stat-v { font-size: 30px; font-weight: 800; line-height: 1.17; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.page-body { flex: 1; display: flex; flex-direction: column; gap: 14px; }

/* Panels */
.panel {
  border-radius: var(--radius-panel);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  min-width: 0;
}
.panel-dark { background: var(--panel); }
.panel-head {
  padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.panel-title { font-size: 16px; font-weight: 700; }
.panel-note { font-size: 12px; color: var(--muted); }
.panel-empty { padding: 18px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--divider); }
.panel-pad { padding: 18px; display: flex; flex-direction: column; gap: 12px; }

.chips { display: flex; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--divider); flex-wrap: wrap; align-items: center; }
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 0;
  background: var(--divider);
  font-size: 12px; font-weight: 600;
  color: var(--text);
}
.chip.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.chip.warn { color: var(--warn); }
.chip.danger { color: var(--danger); }
.chip-note { margin-left: auto; font-size: 12px; color: var(--muted); }

/* Tables */
.table-head, .table-row {
  display: grid;
  align-items: center;
  padding: 12px 18px;
  gap: 8px;
}
.table-head { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.table-row { border-top: 1px solid var(--divider); font-size: 14px; }
.table-row.clickable { cursor: pointer; }
.table-row.clickable:hover { background: rgba(255, 255, 255, .025); }
.users-grid { grid-template-columns: 2fr 1.2fr 1.2fr 1fr 1.4fr 140px; }
.releases-grid { grid-template-columns: 1fr .8fr 1.6fr 1.4fr 1fr 1fr; padding-top: 14px; padding-bottom: 14px; }
.releases-grid .mono { font-size: 12px; }
.payments-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; padding-top: 11px; padding-bottom: 11px; }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.stack { display: flex; flex-direction: column; min-width: 0; }
.cell-user .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-user .sub { font-size: 11px; color: var(--muted); }
.initials {
  width: 32px; height: 32px; flex: none;
  border-radius: 10px;
  background: var(--divider);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.cell-action { text-align: right; }
.strong { font-weight: 600; }
.bold { font-weight: 700; }
.right { text-align: right; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent);
  white-space: nowrap;
}
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.muted { background: var(--divider); color: var(--muted); }
.pill-version { font-size: 12px; }

/* Layout grids */
.split-payments { flex: 1; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.split-nodes { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.split-logs { flex: 1; display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 14px; align-items: start; }
.split-overview { flex: 1; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.col > * { flex-shrink: 0; }

/* Revenue chart */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 170px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-v, .bar-k { font-size: 11px; color: var(--muted); white-space: nowrap; }
.bar-k { font-size: 12px; }
.bar-fill { width: 100%; border-radius: 8px 8px 0 0; background: rgba(124, 227, 33, .35); min-height: 2px; }
.bar-fill.current { background: var(--accent); }

/* Grace list */
.grace-item { display: flex; flex-direction: column; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--divider); }
.grace-top { display: flex; justify-content: space-between; font-size: 14px; gap: 8px; }
.grace-left { font-weight: 700; font-size: 13px; white-space: nowrap; }
.segments { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
.segments span { height: 5px; border-radius: 3px; background: rgba(242, 189, 84, .2); }
.grace-bottom { display: flex; gap: 8px; font-size: 12px; align-items: center; }
.grace-bottom .muted { flex: 1; }

/* Node cards */
/* Cards fill the row: two nodes take half each instead of two thirds. */
.node-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; align-content: start; }
.node-card {
  padding: 16px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px;
  text-align: left;
  min-width: 0;
}
.node-card:hover { border-color: #56605a; }
.node-card.offline { border-color: rgba(255, 116, 116, .45); }
.node-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.node-flag { font-size: 24px; line-height: 1; width: 28px; text-align: center; }
.node-names { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.node-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-sub { font-size: 11px; color: var(--muted); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.dot.offline { background: var(--danger); }
.dot.unknown { background: var(--muted); }
.load-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.meter { height: 6px; border-radius: 3px; background: var(--divider); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); }
.meter > span.warn { background: var(--warn); }
.node-facts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; font-size: 11px; color: var(--muted); }
.node-facts > div { display: flex; flex-direction: column; }
.node-facts b { font-size: 15px; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.node-facts > div { min-width: 0; }

/* Jobs */
.job { display: flex; gap: 10px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--divider); font-size: 13px; }
.job .dot { width: 8px; height: 8px; }
.job-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.job-main span:first-child { font-weight: 600; }
.job-main span:last-child { font-size: 11px; color: var(--muted); }
.job-status { font-size: 12px; font-weight: 600; white-space: nowrap; }

/* Releases */
.toggle { display: inline-block; width: 40px; height: 24px; border-radius: 999px; background: var(--line); position: relative; vertical-align: middle; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); }
.toggle.on { background: var(--accent); }
.toggle.on::after { left: 19px; background: var(--accent-text); }
.adopt { display: flex; align-items: center; gap: 8px; }
.adopt .meter { flex: 1; }
.adopt span:last-child { font-size: 12px; color: var(--muted); white-space: nowrap; }
.manifest {
  flex: 1;
  padding: 16px 18px;
  border-radius: var(--radius-panel);
  background: var(--panel);
  border: 1px solid var(--line);
  font: 12px/1.7 var(--mono);
  color: var(--muted);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Incidents */
.incident {
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
}
.incident.critical { background: #1d1414; border-color: rgba(255, 116, 116, .4); }
.incident-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.incident-title { font-weight: 700; font-size: 15px; }
.incident-detail { font-size: 12px; color: var(--muted); line-height: 1.4; }
.sev { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.sev.critical { background: var(--danger-soft); color: var(--danger); }
.sev.warning { background: var(--warn-soft); color: var(--warn); }
.sev.resolved { background: var(--accent-soft); color: var(--accent); }

/* Log stream */
.log-panel { display: flex; flex-direction: column; min-height: 320px; max-height: max(420px, calc(100vh - 305px)); }
.split-overview .log-panel { max-height: 420px; }
.log-lines { flex: 1; overflow: auto; padding: 6px 0; }
.log-line { display: flex; gap: 14px; padding: 7px 16px; font: 12px/1.5 var(--mono); }
.log-time { color: var(--dim); white-space: nowrap; }
.log-lvl { width: 44px; flex: none; font-weight: 700; }
.log-src { width: 70px; flex: none; color: var(--muted); }
.log-msg { flex: 1; min-width: 0; word-break: break-word; }
.lvl-INFO { color: var(--accent); }
.lvl-WARN { color: var(--warn); }
.lvl-ERROR { color: var(--danger); }

/* Overview mini lists */
.mini-row { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-top: 1px solid var(--divider); font-size: 13px; }
.mini-row .grow { flex: 1; min-width: 0; }

/* Modal / drawer */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, .6);
  display: flex; justify-content: center; align-items: flex-start;
  padding: 60px 16px;
  overflow: auto;
}
/* The drawer is exactly the window tall and scrolls inside itself, so its
   background always covers a long card. */
.overlay.drawer { justify-content: flex-end; align-items: stretch; padding: 0; overflow: hidden; }
.modal {
  width: min(520px, 100%);
  border-radius: var(--radius-panel);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column;
}
.modal.wide { width: min(820px, 100%); }
.drawer .modal { width: min(640px, 100%); border-radius: 24px 0 0 24px; height: 100%; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.drawer .modal-head { position: sticky; top: 0; z-index: 1; background: var(--surface); border-radius: 24px 0 0 0; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--divider); }
.modal-title { flex: 1; font-size: 18px; font-weight: 800; min-width: 0; }
.modal-close { width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--divider); color: var(--muted); font-size: 18px; line-height: 1; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 20px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.section-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--divider); }
.modal-body > .section-label:first-child, .modal-body > :first-child + .section-label { border-top: 0; padding-top: 0; margin-top: 0; }
.modal-body .hint { line-height: 1.45; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 12px; font-size: 13px; }
.kv > span:nth-child(odd) { color: var(--muted); }
.list { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--divider); font-size: 13px; }
.list-row:first-child { border-top: 0; }
.list-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-row .grow span:last-child { font-size: 11px; color: var(--muted); }
.list-empty { padding: 12px 14px; color: var(--muted); font-size: 13px; }
.secret-box {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  font: 12px/1.6 var(--mono);
  word-break: break-all;
  white-space: pre-wrap;
  max-height: 320px; overflow: auto;
}
.recovery-qr { width: min(320px, 100%); align-self: center; border-radius: 12px; background: #fff; padding: 12px; image-rendering: pixelated; }
.callout { padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.callout.info { background: var(--divider); color: var(--muted); }
details.advanced { border: 1px dashed var(--line); border-radius: 14px; padding: 10px 14px; }
details.advanced summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.advanced[open] summary { margin-bottom: 12px; }
details.advanced form { display: flex; flex-direction: column; gap: 12px; }

/* Markdown (playbook) */
.md { font-size: 14px; line-height: 1.55; }
.md h1 { font-size: 22px; margin: 0 0 10px; }
.md h2 { font-size: 17px; margin: 22px 0 8px; color: var(--accent); }
.md h3 { font-size: 15px; margin: 16px 0 6px; }
.md p, .md ul, .md ol { margin: 0 0 10px; }
.md ul, .md ol { padding-left: 22px; }
.md code { font-family: var(--mono); font-size: 12px; background: var(--divider); padding: 1px 5px; border-radius: 6px; }
.md pre { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; overflow: auto; }
.md pre code { background: none; padding: 0; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  max-width: min(560px, calc(100% - 32px));
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  font-size: 13px;
}
.toast.error { border-color: rgba(255, 116, 116, .5); color: var(--danger); }

.loading { opacity: .6; }

/* Narrow screens */
@media (max-width: 1280px) {
  .split-logs { grid-template-columns: 340px minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .sidebar { width: 76px; padding: 18px 10px; }
  .sidebar .brand-text, .nav-item .label, .api-card { display: none; }
  .nav-item { justify-content: center; padding: 0; position: relative; }
  .nav-badge { position: absolute; top: 2px; right: 2px; padding: 0 5px; font-size: 10px; }
  .brand img, .sidebar .brand img { width: 48px; height: 48px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-payments, .split-nodes, .split-logs, .split-overview { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .topbar { padding: 0 16px; }
  .session-info { display: none; }
  .content { padding: 16px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-actions { justify-content: flex-start; }
  .users-grid { grid-template-columns: 1.6fr 1fr 90px; }
  .users-grid > :nth-child(3), .users-grid > :nth-child(4), .users-grid > :nth-child(5) { display: none; }
  .releases-grid { grid-template-columns: 1fr 1fr 1fr; }
  .releases-grid > :nth-child(3), .releases-grid > :nth-child(4), .releases-grid > :nth-child(5) { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}

.callout + .stats, .page-body > .callout { flex: none; }

/* Readable event stream shared by overview and journal. */
.event-row { padding: 12px 16px; border-bottom: 1px solid var(--divider); }
.event-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 12px; }
.event-description { margin-top: 5px; line-height: 1.5; overflow-wrap: anywhere; }
.event-details { margin-top: 6px; color: var(--muted); font-size: 12px; }
.event-details summary { cursor: pointer; width: fit-content; color: var(--accent); }
.event-details summary:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.event-details pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.5 var(--mono); margin: 6px 0; }
