@font-face {
  font-family: Inter;
  src: url('/static/inter.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f2f7fb;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #f2f8fd;
  --line: #dce8f0;
  --ink: #16324a;
  --muted: #62788a;
  --accent: #0874b5;
  --accent-ink: #ffffff;
  --ok: #14734e;
  --wait: #8d6000;
  --bad: #b93640;
  --link: #086fa8;
  --stale: rgba(255, 111, 94, 0.12);
  --side: 264px;
  --font: Inter, "Segoe UI", system-ui, sans-serif;
  --font-display: Inter, "Segoe UI", sans-serif;
  --font-mono: "Cascadia Code", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(109, 204, 247, 0.15), transparent 50%),
    var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" 1, "kern" 1;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-card .brand-mark { letter-spacing: 0.12em; }

.login-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.login-card input {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font: 15px var(--font);
}

.login-card input:focus {
  outline: none;
  border-color: var(--accent);
}

.login-card .btn-solid { width: 100%; margin-top: 6px; }
.login-card .flash { margin: 0; }

.shell {
  display: grid;
  grid-template-columns: var(--side) 1fr;
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 18px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 8px;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.brand-sub {
  color: var(--muted);
  font-size: 12px;
}

.search-side {
  display: flex;
}

.search-side input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font: 13px var(--font-mono), ui-monospace, monospace;
}

.search-side input::placeholder { color: #6c8193; }
.search-side input:focus {
  outline: none;
  border-color: var(--accent);
}

.side nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
}

.side nav a:hover { background: var(--panel); text-decoration: none; }
.side nav a.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.side nav a.active .badge { color: var(--accent-ink); opacity: 0.7; }

.badge {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
}

.badge-ban { color: var(--bad); }

.flag-ban {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff0f1;
  color: var(--bad);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

.btn-danger {
  background: var(--bad);
  color: #ffffff;
}

.btn-ok {
  background: var(--ok);
  color: #ffffff;
}

.callout-body.nak-body {
  white-space: pre-wrap;
  margin-top: 6px;
}

.side-foot {
  margin-top: auto;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.main {
  padding: 28px 40px 64px;
  max-width: 1360px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hint { color: var(--muted); margin: 6px 0 0; }

.crumb {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.pills { display: flex; gap: 6px; flex-wrap: wrap; }

.pills a, .btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
}

.pills a.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  text-decoration: none;
}

.pills a:hover { text-decoration: none; border-color: #80bbdc; }

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

.toolbar .search {
  flex: 1;
  min-width: 240px;
  margin: 0;
}

.search { display: flex; gap: 8px; margin-bottom: 16px; }

.top-search {
  flex: 1 1 240px;
  max-width: 420px;
  margin: 0;
}

.search input, .search-side input {
  font-family: var(--font-mono), ui-monospace, monospace;
}

.search input {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.search button, .btn-solid {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font: 500 14px var(--font);
  cursor: pointer;
}

.btn-solid.btn-ok {
  background: var(--ok);
  color: #ffffff;
}

.btn-solid.btn-danger {
  background: var(--bad);
  color: #ffffff;
}

.kpis, .meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  position: relative;
  overflow: hidden;
}

.kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.7;
}

.kpi.warn::before { background: var(--wait); }
.kpi.bad::before { background: var(--bad); }
.kpi.ok::before { background: var(--ok); }

.kpi .label {
  font-family: var(--font-display);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.kpi .value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.kpi .value-sm {
  font-size: 16px;
  line-height: 1.3;
}

.kpi .sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  margin-bottom: 16px;
}

.grid-2.equal { grid-template-columns: 1fr 1fr; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
}

.card h2, .card-head {
  margin: 0;
  padding: 14px 16px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-head a { font-size: 12px; letter-spacing: 0; text-transform: none; }

.card-pad {
  padding: 16px;
}

.card-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  max-width: 62ch;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-label {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.settings-row .amt {
  width: 140px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: 0 12px;
  height: 40px;
  box-sizing: border-box;
  font: 13px/38px var(--font-mono), ui-monospace, monospace;
}

.settings-row .amt:focus {
  outline: none;
  border-color: var(--accent);
}

.settings-row .btn-solid {
  height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.card-pad-sm {
  padding: 12px 16px 4px;
}

.card-pad-sm .card-note {
  margin: 0;
}

.settings-table th,
.settings-table td {
  vertical-align: middle;
  padding: 12px 16px;
}

.settings-table tbody tr:last-child td {
  border-bottom: none;
}

.settings-table .col-status {
  width: 128px;
}

.settings-table .col-num {
  width: 88px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.settings-table th.col-num {
  text-align: right;
}

.settings-table .col-action {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.settings-table .col-action form {
  margin: 0;
  display: inline-flex;
}

.settings-table .col-action .btn-solid {
  min-width: 118px;
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reset-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
}

.reset-chip-k {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.reset-chip b {
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.limit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}

.limit-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.limit-card.is-on { box-shadow: inset 3px 0 0 var(--ok), inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.limit-card.is-warn { box-shadow: inset 3px 0 0 var(--wait), inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.limit-card.is-full {
  border-color: rgba(255, 111, 94, 0.28);
  box-shadow: inset 3px 0 0 var(--bad), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.limit-card.is-off { border-color: var(--line); }

.limit-body {
  padding: 18px 18px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.limit-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.limit-card h2 {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-transform: none;
}

.limit-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  min-height: 54px;
}

.limit-hero span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.limit-hero strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.limit-hero strong.is-off {
  color: var(--muted);
  font-size: 26px;
  font-weight: 500;
}

.limit-hero > div:last-child {
  text-align: right;
}

.limit-hero > div:last-child span {
  letter-spacing: 0.08em;
}

.limit-hero > div:last-child strong {
  font-size: 22px;
}

.limit-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  margin: 16px 0 0;
}

.limit-stats > div {
  padding: 10px 12px 0 0;
  border-top: 1px solid var(--line);
}

.limit-stats > div + div {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.limit-stats dt {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.limit-stats dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.limit-meter {
  margin-top: 14px;
}

.limit-meter progress {
  display: block;
  width: 100%;
  height: 10px;
  margin: 0;
  border: 0;
  border-radius: 99px;
  overflow: hidden;
  background: #e0eaf2;
  accent-color: var(--ok);
}

.limit-meter progress::-webkit-progress-bar {
  background: #e0eaf2;
  border-radius: 99px;
}

.limit-meter progress::-webkit-progress-value {
  background-color: var(--ok);
  border-radius: 99px;
}

.limit-meter progress::-moz-progress-bar {
  background-color: var(--ok);
  border-radius: 99px;
}

.limit-card.is-warn .limit-meter progress { accent-color: var(--wait); }
.limit-card.is-warn .limit-meter progress::-webkit-progress-value { background-color: var(--wait); }
.limit-card.is-warn .limit-meter progress::-moz-progress-bar { background-color: var(--wait); }
.limit-card.is-full .limit-meter progress { accent-color: var(--bad); }
.limit-card.is-full .limit-meter progress::-webkit-progress-value { background-color: var(--bad); }
.limit-card.is-full .limit-meter progress::-moz-progress-bar { background-color: var(--bad); }
.limit-card.is-off .limit-meter progress { accent-color: #e0eaf2; }

.limit-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.limit-foot {
  margin-top: auto;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  background: #f7fafc;
}

.limit-foot .limit-edit + .limit-edit {
  margin-top: 10px;
}

.limit-foot .limit-edit {
  grid-template-columns: 7.5rem minmax(0, 1fr) auto;
}

.limit-edit {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.limit-edit label {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.limit-edit .amt {
  width: 100%;
  min-width: 0;
  height: 38px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 10px;
  padding: 0 12px;
  font: 14px/38px var(--font-mono), ui-monospace, monospace;
}

.limit-edit .amt::placeholder {
  color: #6b6e76;
}

.limit-edit .amt:focus {
  outline: none;
  border-color: var(--accent);
}

.limit-edit .btn-solid {
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  white-space: nowrap;
}

.st-off {
  background: #e7eef4;
  color: var(--muted);
}

.card-head-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.plat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.plat-tile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.plat-tile:last-child { border-right: 0; }
.plat-tile.is-on {
  background: rgba(98, 227, 164, 0.08);
  box-shadow: inset 0 0 0 1px rgba(98, 227, 164, 0.18);
}
.plat-tile.is-off {
  background: rgba(255, 111, 94, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 111, 94, 0.2);
}
.plat-tile.is-on .plat-st { color: var(--ok); font-weight: 600; }
.plat-tile.is-off .plat-st { color: var(--bad); font-weight: 600; }

.plat-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.plat-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.plat-lines p { margin: 0; }

.plat-tile form { margin: 0; }
.plat-tile .btn-solid {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topic-lead {
  margin: 0;
  padding: 16px 18px 4px;
  font-size: 15px;
  line-height: 1.5;
}

.topic-lead b { font-weight: 600; }

.topic-table {
  table-layout: fixed;
  width: 100%;
  min-width: 760px;
}

.topic-table col.col-num { width: 88px; }
.topic-table col.col-money { width: 104px; }
.topic-table col.col-share { width: 176px; }

.topic-table th,
.topic-table td {
  vertical-align: middle;
}

.topic-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.topic-table thead th:nth-child(n + 2) {
  text-align: right;
}

.topic-cell {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.topic-name {
  min-width: 0;
}

.topic-cell .flag {
  flex: 0 0 auto;
  margin-left: 0;
}

.share-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.6em;
  gap: 8px;
  align-items: center;
}

.share-bar {
  width: 100%;
  height: 6px;
  margin: 0;
  border: 0;
  border-radius: 99px;
  overflow: hidden;
  background: #e7eef4;
  accent-color: var(--accent);
}

.share-bar::-webkit-progress-bar {
  background: #e7eef4;
  border-radius: 99px;
}

.share-bar::-webkit-progress-value {
  background: var(--accent);
  border-radius: 99px;
}

.share-bar::-moz-progress-bar {
  background: var(--accent);
  border-radius: 99px;
}

.share-row b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-family: var(--font-display);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

tr[data-href] { cursor: pointer; }
tr[data-href]:hover td, tr:hover td { background: var(--panel-2); }
tr.stale td { background: var(--stale); }

.mono {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 13px;
}

.num { font-variant-numeric: tabular-nums; }

.st {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
  white-space: nowrap;
}

.st-pending, .st-held, .st-need_info { background: #fff6d6; color: var(--wait); }
.st-queued { background: #e8f4fc; color: #086b9c; }
.st-accepted, .st-paid { background: #e9f7ef; color: var(--ok); }
.st-rejected { background: #fff0f1; color: var(--bad); }

.wait {
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono), ui-monospace, monospace;
}
.wait.stale { color: var(--bad); font-weight: 600; }

.empty { padding: 28px 16px; color: var(--muted); }

.details, .clip {
  white-space: pre-wrap;
  word-break: break-word;
}

.person .sub {
  color: var(--muted);
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 12px;
  margin-top: 2px;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e5f3fd;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  margin-right: 8px;
  vertical-align: middle;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding: 16px 16px 8px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  max-width: 28px;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  opacity: 0.85;
}

.bar-col span {
  color: var(--muted);
  font-size: 10px;
  font-family: var(--font-mono), ui-monospace, monospace;
}

.meter {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.meter-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; }
.meter-row span { color: var(--muted); font-size: 13px; }
.meter-row b { font-size: 13px; font-weight: 500; }
.track { height: 8px; background: #e7eef4; border-radius: 99px; overflow: hidden; }
.track i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}

.facts {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0;
  padding: 4px 0;
  width: 100%;
}

.facts dt,
.facts dd {
  margin: 0;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.facts dt {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-right: 0;
}

.facts dd {
  word-break: break-word;
  padding-left: 8px;
}
.facts dt:nth-last-child(2),
.facts dd:last-child { border-bottom: 0; }

.ext {
  color: var(--link);
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 13px;
}

.copy {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
  font-size: 13px;
}

.copy:hover { color: var(--accent); }

.pager {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 13px;
}

.pager a {
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink);
}

.flag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 99px;
  background: #fff6d6;
  color: var(--wait);
  margin-left: 6px;
}

.inline-form { display: inline; margin: 0; }
.inline-form .btn-solid {
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.neg { color: var(--bad); }
.pos { color: var(--ok); }

.id-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.filters input[type="search"] {
  flex: 1;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 10px;
  font: 14px var(--font-mono), ui-monospace, monospace;
}

.date-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.filters input[type="date"] {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: 13px var(--font-mono), ui-monospace, monospace;
  color-scheme: light;
}

.log-card { padding-bottom: 8px; }

.day-head {
  padding: 14px 16px 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-top: 1px solid var(--line);
}

.day-head:first-child { border-top: 0; }

.log-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.log-row:last-child { border-bottom: 0; }

.log-time {
  color: var(--muted);
  padding-top: 3px;
}

.log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.muted { color: var(--muted); }
.quiet { color: var(--muted); font-size: 12px; }

.log-quote {
  margin-top: 6px;
  padding: 10px 12px;
  background: #edf4f9;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-code {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.st-message { background: #e8f1ff; color: #345d9e; }
.st-button { background: #e5f3fd; color: var(--accent); }
.st-command { background: #f2edfc; color: #7043a7; }
.st-media { background: #fff6d6; color: var(--wait); }
.st-edit { background: #e8f7f6; color: #167169; }
.st-system { background: #fff0f1; color: var(--bad); }
.kind-system { background: rgba(255, 111, 94, 0.04); }

.kind-button { background: rgba(109, 204, 247, 0.05); }

.id-chip {
  font-family: var(--font-mono), ui-monospace, monospace;
  color: var(--accent);
  letter-spacing: 0.04em;
  font-weight: 500;
}
.id-chip:hover { text-decoration: underline; text-underline-offset: 3px; }

.dossier-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.dossier-kicker {
  font-family: var(--font-display);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.dossier-id {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  line-height: 1.1;
}

.st-lg {
  font-size: 14px;
  padding: 6px 14px;
}

.callout {
  padding: 14px 18px;
  border-radius: 14px;
  margin-bottom: 18px;
  font-size: 15px;
}
.callout.ok { background: #e9f7ef; color: var(--ok); }
.callout.wait { background: #fff6d6; color: var(--wait); }
.callout.bad { background: #fff0f1; color: var(--bad); }
.callout-body {
  margin-top: 8px;
  color: var(--ink);
  white-space: pre-wrap;
}

.shot {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 0;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 16px;
}
.shot:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.shot-kicker {
  font-family: var(--font-display);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.shot-url {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 13px;
  word-break: break-all;
  color: var(--ink);
}
.shot-go { color: var(--accent); font-weight: 600; }

.pay-box {
  margin: 12px 16px 8px;
  padding: 18px 20px;
  background: #edf4f9;
  border-radius: 12px;
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: pre-wrap;
  word-break: break-word;
}

.pay-box.compact {
  margin: 10px 0 0;
  padding: 10px 12px;
  font-size: 13px;
}

.flash {
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 14px;
}
.flash.ok { background: #e9f7ef; color: var(--ok); }
.flash.bad { background: #fff0f1; color: var(--bad); }
.flash.wait { background: #fff6d6; color: var(--wait); }

.desk {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px 14px;
  margin-bottom: 10px;
}

.desk-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}

.desk-head .muted { color: var(--muted); font-size: 13px; margin-left: 6px; }

.desk-sum {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-weight: 600;
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.desk-links {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 13px;
}

.review {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 18px;
}

.review .callout {
  margin: 0;
  border-radius: 0;
}

.review .desk-actions {
  margin: 0;
  padding: 12px 14px 14px;
}

.desk-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.desk-form {
  display: flex;
  gap: 6px;
  align-items: stretch;
  min-width: 0;
}

.desk-form.full { width: 100%; }
.desk-form.full .btn-solid { width: 100%; }
.desk-form.grow .reason { flex: 1; min-width: 0; }

.desk-actions input:not([type="hidden"]),
.desk-actions select.topic {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: 0 12px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  line-height: 38px;
  box-sizing: border-box;
    appearance: none;
  -webkit-appearance: none;
  font: 13px/38px var(--font-mono), ui-monospace, monospace;
}

.desk-actions select.topic {
  flex: 1;
  min-width: 0;
  appearance: auto;
  -webkit-appearance: menulist;
}

.desk-actions input.amt { width: 92px; }
.desk-actions input.reason { width: 100%; min-width: 0; }

.bal-card { margin-bottom: 22px; }
.bal-actions { margin-top: 0; }
.bal-actions .desk-form { flex-wrap: wrap; }
.bal-actions input.amt { width: 110px; }
.bal-actions input.reason { flex: 1; min-width: 180px; }

.desk-actions .btn-solid {
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding: 0 16px;
  font-size: 13px;
  line-height: 40px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.proof-body {
  padding: 12px 14px 16px;
}

.proof-tg {
  display: inline-flex;
  margin-bottom: 12px;
}

.proof-media {
  display: block;
  width: 100%;
  max-height: 520px;
  background: #edf4f9;
  border-radius: 10px;
}

.proof-fail {
  margin: 0;
  padding: 16px 18px;
  background: #fff6d6;
  color: var(--wait);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
}

.proof-dl {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
}

@media (max-width: 1100px) {
  .kpis, .meta { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-2.equal { grid-template-columns: 1fr; }
  .plat-grid { grid-template-columns: 1fr; }
  .plat-tile { border-right: 0; }
  .plat-tile + .plat-tile { border-top: 1px solid var(--line); }
  .facts { grid-template-columns: 1fr; }
  .facts dt { padding-bottom: 0; min-height: 0; border-bottom: 0; }
  .desk-actions { grid-template-columns: 1fr; }
  .log-row { grid-template-columns: 1fr; }
  .dossier-id { font-size: 28px; }
  .meter-row { grid-template-columns: 1fr; }
  .main { padding: 20px 20px 48px; }
}

.mobile-bar,
.menu-toggle,
.side-backdrop {
  display: none;
}

@media (max-width: 860px) {
  .mobile-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 10px 14px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
  }
  .mobile-bar .brand-mark {
    font-size: 16px;
    letter-spacing: 0.1em;
  }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: var(--ink);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
  }
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: min(86vw, 280px);
    height: 100vh;
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: none;
  }
  body.nav-open .side { transform: none; }
  .side-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.55);
  }
  body.nav-open .side-backdrop { display: block; }
  .main { padding: 16px 14px 40px; }
  h1 { font-size: 22px; }
  .kpis, .meta { gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi .value { font-size: 18px; }
  .card { overflow-x: auto; }
  table { min-width: 560px; }
  .topic-table { min-width: 760px; }
  .settings-table { min-width: 640px; }
  .settings-row .amt { width: 120px; }
  .limit-hero strong { font-size: 24px; }
  .desk-form {
    display: flex;
    flex-wrap: wrap;
  }
  .desk-form.grow { width: 100%; }
  .desk-form.grow .btn-solid { width: auto; }
  .desk-actions input.amt { width: 100%; }
  .filters input[type="search"] { min-width: 0; width: 100%; }
  .toolbar .search { min-width: 0; }
  input, select, textarea, button {
    font-size: 16px;
  }
  .pills a, .btn, .search button, .btn-solid {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }
  .dossier-id { font-size: 22px; }
}

@media (max-width: 720px) {
  .limit-grid { grid-template-columns: 1fr; }
  .limit-edit,
  .limit-foot .limit-edit {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .limit-edit label {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .kpis, .meta { grid-template-columns: 1fr; }
  table { min-width: 480px; }
}
