/* Hallmark · shape: app screen · genre: modern-minimal · theme: Dose (deal 3/3, seed minimal-russian-minecraft-fleet-354d·9508b097·2026-11-02·r0)
 * nav: operational tabs · signature: fleet table and command inspector · states: loading empty error full · dose: white
 * axes: light/system-sans/chromatic-green · posture: restrained · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R5 V4 · weakest: E, source-bound controls and empty states verified before publication */
:root {
  --app-header-h: 60px;
}

html { scroll-padding-top: calc(var(--app-header-h) + var(--space-md)); }
body { font-family: var(--font-body); }

.skip-link {
  position: absolute;
  left: var(--space-md);
  top: -100px;
  z-index: var(--z-toast);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border-radius: var(--radius-input);
  text-decoration: none;
}
.skip-link:focus { top: var(--space-xs); }

.mono { font-family: var(--font-outlier); font-variant-ligatures: none; }
.small { font-size: var(--text-sm); }
.tiny { font-size: var(--text-xs); }
.muted { color: var(--color-muted); }
.num { font-variant-numeric: tabular-nums; }
.error-text { color: var(--color-error); }

/* ---------------- login ---------------- */

.login-view {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--space-md);
}
.login-card {
  width: min(420px, 100%);
  background: var(--color-paper);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-card);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.login-card h1 { font-size: var(--text-display-s); max-width: none; }
.login-card .lead { color: var(--color-muted); margin: 0; }
.login-card form { display: flex; flex-direction: column; gap: var(--space-sm); }

/* ---------------- header ---------------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky-nav);
  background: var(--color-paper);
  border-bottom: var(--rule-hair) solid var(--color-rule);
}
.app-header-inner {
  max-width: var(--container);
  margin-inline: auto;
  min-height: var(--app-header-h);
  padding: var(--space-2xs) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-display);
}
.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--color-accent);
  flex: none;
}
.tabs { display: flex; gap: var(--space-2xs); flex-wrap: wrap; }
.tab {
  min-height: 44px;
  padding: 0 var(--space-sm);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--color-muted);
  font-weight: 600;
  cursor: pointer;
}
.tab:hover { background: var(--color-paper-2); color: var(--color-ink); }
.tab[aria-current="page"] { color: var(--color-ink); border-bottom-color: var(--color-accent); }
.header-actions { margin-left: auto; display: flex; gap: var(--space-xs); flex-wrap: wrap; }

.app-main {
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.tab-panel { display: flex; flex-direction: column; gap: var(--space-md); min-width: 0; }

/* ---------------- controls ---------------- */

.btn {
  min-height: 44px;
  padding: var(--space-2xs) var(--space-sm);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-input);
  background: var(--color-paper);
  color: var(--color-ink);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  text-align: center;
}
.btn:hover { background: var(--color-paper-2); border-color: var(--color-muted); }
.btn:active { background: var(--color-paper-3); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); border-color: var(--color-accent-deep); color: var(--color-accent-ink); }
.btn-primary:hover { background: var(--color-accent-deep); border-color: var(--color-accent-deep); }
.btn-danger { background: var(--color-error); border-color: var(--color-error); color: var(--color-accent-ink); }
.btn-danger:hover { background: color-mix(in oklab, var(--color-error) 85%, var(--color-ink)); border-color: color-mix(in oklab, var(--color-error) 85%, var(--color-ink)); }
.btn-danger-quiet { color: var(--color-error); border-color: color-mix(in oklab, var(--color-error) 45%, var(--color-rule)); }
.btn-small { min-height: 36px; padding: 0 var(--space-xs); font-size: var(--text-sm); }
.btn-block { width: 100%; }

.stop-btn {
  min-height: 44px;
  min-width: 140px;
  font-size: var(--text-md);
  letter-spacing: 0;
  font-weight: 700;
}

input, select, textarea {
  border-color: var(--color-muted);
  min-height: 44px;
  padding: var(--space-2xs) var(--space-xs);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-input);
  background: var(--color-paper);
  color: var(--color-ink);
}
input[type="checkbox"] {
  min-height: 0;
  width: 20px;
  height: 20px;
  padding: 0;
  accent-color: var(--color-accent);
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--color-focus);
  outline-offset: 2px; }

.field { display: flex; flex-direction: column; gap: var(--space-3xs); min-width: 0; }
.field-label { font-size: var(--text-sm); font-weight: 600; color: var(--color-ink-2); }
.field-hint { font-size: var(--text-xs); color: var(--color-muted); margin: 0; }
.field-inline { font-size: var(--text-sm); color: var(--color-muted); align-self: center; }
.check-field {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 44px;
  cursor: pointer;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}
.form-error { color: var(--color-error); font-size: var(--text-sm); margin: 0; }

.status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-input);
  background: var(--color-paper-2);
  font-size: var(--text-sm);
}
.status-bar .json { flex-basis: 100%; margin: 0; }

/* ---------------- filters / table ---------------- */

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.filters input[type="search"] { min-width: 220px; }
.filters select { min-width: 120px; }

.bots-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  gap: var(--space-md);
  align-items: start;
}
.bots-list { min-width: 0; display: flex; flex-direction: column; gap: var(--space-sm); }

.table-wrap {
  overflow-x: auto;
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-input);
  background: var(--color-paper);
}
.table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: var(--text-sm); }
.table-compact { min-width: 520px; }
.table th, .table td {
  padding: var(--space-xs);
  text-align: left;
  vertical-align: middle;
  border-bottom: var(--rule-hair) solid var(--color-rule);
}
.table th {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-muted);
  text-transform: none;
  white-space: nowrap;
  background: var(--color-paper-2);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--color-paper-2); }
.table tbody tr.is-selected { background: color-mix(in oklab, var(--color-accent-soft) 55%, var(--color-paper)); }
.col-check { width: 44px; text-align: center; }
.col-check input { margin: 0; }

.row-select {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.row-select:hover .row-label { text-decoration: underline; text-underline-offset: 0.16em; }
.row-label {
  display: block;
  max-width: 26ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.row-id { color: var(--color-muted); }
.row-sub { display: block; margin-top: var(--space-3xs); }

/* ---------------- badges ---------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  padding: 1px var(--space-2xs);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  color: var(--color-ink-2);
  background: var(--color-paper);
}
.badge-good {
  color: var(--color-accent-deep);
  border-color: color-mix(in oklab, var(--color-accent) 40%, var(--color-rule));
  background: color-mix(in oklab, var(--color-accent-soft) 55%, var(--color-paper));
}
.badge-bad {
  color: var(--color-error);
  border-color: color-mix(in oklab, var(--color-error) 40%, var(--color-rule));
  background: color-mix(in oklab, var(--color-error) 8%, var(--color-paper));
}
.badge-wait { background: var(--color-paper-3); }
.badge-idle, .badge-neutral { color: var(--color-muted); background: var(--color-paper-2); }

/* ---------------- states ---------------- */

.state {
  padding: var(--space-sm);
  border: var(--rule-hair) dashed var(--color-rule);
  border-radius: var(--radius-input);
  background: var(--color-paper-2);
  color: var(--color-muted);
  font-size: var(--text-sm);
}
.state-error { color: var(--color-error); border-color: color-mix(in oklab, var(--color-error) 40%, var(--color-rule)); }
.state-inline { margin: 0; }

/* ---------------- detail ---------------- */

.detail {
  position: sticky;
  top: calc(var(--app-header-h) + var(--space-sm));
  max-height: calc(100dvh - var(--app-header-h) - var(--space-lg));
  overflow: auto;
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-card);
  background: var(--color-paper);
  padding: var(--space-sm);
  min-width: 0;
}
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}
.detail-title-wrap { min-width: 0; }
.detail-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); justify-content: flex-end; }
.detail-head h2 { font-size: var(--text-lg); overflow-wrap: anywhere; }
.detail-head .muted { margin: var(--space-3xs) 0 0; }
.detail-tabs {
  display: flex;
  gap: var(--space-3xs);
  overflow-x: auto;
  border-bottom: var(--rule-hair) solid var(--color-rule);
  margin-bottom: var(--space-sm);
}
.detail-tabs button {
  min-height: 44px;
  padding: 0 var(--space-xs);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--color-muted);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.detail-tabs button:hover { background: var(--color-paper-2); color: var(--color-ink); }
.detail-tabs button[aria-selected="true"] { color: var(--color-ink); border-bottom-color: var(--color-accent); }

#detail-status { margin-bottom: var(--space-sm); }

.card {
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-input);
  background: var(--color-paper);
  padding: var(--space-sm);
  min-width: 0;
}
.card h3 { font-size: var(--text-title); margin-bottom: var(--space-xs); }
.detail .card {
  border: 0;
  border-top: var(--rule-hair) solid var(--color-rule);
  border-radius: 0;
  padding: var(--space-sm) 0;
}
.detail .card:first-of-type { border-top: 0; padding-top: 0; }
.detail .card:last-of-type { padding-bottom: 0; }

.kv {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(0, 1fr);
  gap: var(--space-3xs) var(--space-sm);
  margin: 0;
}
.kv dt { color: var(--color-muted); font-size: var(--text-sm); }
.kv dd { margin: 0; overflow-wrap: anywhere; font-size: var(--text-sm); }

/* ---------------- today / rewards ---------------- */

.today-vitals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}
.today-vital {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  min-width: 0;
  padding: var(--space-xs);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-input);
  background: var(--color-paper-2);
}
.today-vital-label { line-height: 1.2; }
.today-vital-value { font-weight: 600; overflow-wrap: anywhere; }
.reward-rows {
  display: grid;
  gap: var(--space-2xs);
  margin-top: var(--space-xs);
  padding-top: var(--space-xs);
  border-top: var(--rule-hair) solid var(--color-rule);
}
.reward-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
}
.reward-head {
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 600;
}
.reward-label { font-size: var(--text-sm); font-weight: 600; overflow-wrap: anywhere; }
.name-cell { min-width: 0; }
.row-role { display: block; margin-top: var(--space-3xs); color: var(--color-ink-2); }
.row-chips { display: flex; flex-wrap: wrap; gap: var(--space-3xs); margin-top: var(--space-3xs); }
.summary-chip { padding: 0 var(--space-2xs); font-size: var(--text-xs); line-height: 1.5; }
.reward-head .reward-label { font-size: var(--text-xs); font-weight: 600; }
.reward-col { justify-self: end; }
.reward-row .badge { justify-self: end; }
.today-catch { white-space: nowrap; }
.delivery-summary { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs); }

/* ---------------- RTP interval ---------------- */

.rtp-interval-wrap { margin-top: var(--space-xs); }
.rtp-interval {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--space-xs);
}
.rtp-interval .btn { white-space: nowrap; }

/* ---------------- distributor ---------------- */

.card-wide { grid-column: 1 / -1; }
.subhead {
  margin: 0 0 var(--space-xs);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink-2);
}
.distributor-block { display: flex; flex-direction: column; gap: var(--space-xs); min-width: 0; }
.distributor-block + .distributor-block {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: var(--rule-hair) solid var(--color-rule);
}
.distributor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
}
.role-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
}
.role-row-label { font-size: var(--text-sm); font-weight: 600; }
.role-row .btn { justify-self: start; }
.invite-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-2xs) 0;
  border-top: var(--rule-hair) solid var(--color-rule);
}
.invite-row:first-of-type { border-top: 0; }

.button-row { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-xs); }
.stop-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: var(--rule-hair) solid var(--color-rule);
  margin-bottom: var(--space-xs);
}
.dpad { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs); }
.dpad .btn { min-height: 48px; }

.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xs); }
.slot {
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-input);
  background: var(--color-paper-2);
  padding: var(--space-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 0;
}
.slot-empty { opacity: 0.7; }
.slot-head { display: flex; align-items: baseline; gap: var(--space-2xs); min-width: 0; }
.slot-num {
  flex: none;
  font-size: var(--text-xs);
  background: var(--color-paper-3);
  border-radius: 3px;
  padding: 0 var(--space-2xs);
}
.slot-name { font-weight: 600; font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-meta { overflow-wrap: anywhere; }
.slot-fp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-actions { display: flex; flex-wrap: wrap; gap: var(--space-2xs); margin-top: auto; }
.slot-actions .btn { padding: 0 var(--space-2xs); font-size: var(--text-xs); }

.inline-form { display: flex; gap: var(--space-xs); align-items: stretch; flex-wrap: wrap; }
.inline-form input { flex: 1 1 200px; min-width: 0; }
.coords { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; }
.coords input { width: 100px; }

.json-details { margin-top: var(--space-xs); }
.json-details summary {
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--color-muted);
  min-height: 32px;
  display: flex;
  align-items: center;
}
.json, .logs {
  margin: var(--space-2xs) 0 0;
  padding: var(--space-xs);
  max-height: 220px;
  overflow: auto;
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-input);
  background: var(--color-paper-2);
  font-family: var(--font-outlier);
  font-size: var(--text-xs);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.logs { min-height: 120px; max-height: 320px; }
.op-result { overflow-wrap: anywhere; }

/* ---------------- mass chat ---------------- */

.mass-chat {
  border: var(--rule-hair) solid color-mix(in oklab, var(--color-accent) 35%, var(--color-rule));
  border-radius: var(--radius-input);
  background: color-mix(in oklab, var(--color-accent-soft) 30%, var(--color-paper));
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.mass-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-xs); }
.target-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.target-list li {
  font-size: var(--text-xs);
  background: var(--color-paper);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: 3px;
  padding: 1px var(--space-2xs);
}
.results { display: flex; flex-direction: column; gap: var(--space-2xs); }
.mass-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-2xs) 0;
  border-top: var(--rule-hair) solid var(--color-rule);
  font-size: var(--text-sm);
}
.mass-result-label { font-weight: 600; min-width: 8ch; }

/* ---------------- queues / settings ---------------- */

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); align-items: start; }
.hosts-footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-xs);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-input);
  background: var(--color-paper-2);
}
.host-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-3xs) var(--space-2xs);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: 4px;
  background: var(--color-paper);
  font-size: var(--text-sm);
  min-width: 0;
}
.table-compact th, .table-compact td { padding: var(--space-2xs) var(--space-xs); }

.op { padding: var(--space-xs) 0; border-bottom: var(--rule-hair) solid var(--color-rule); }
.op:last-child { border-bottom: 0; }
.op-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }

.modules { display: flex; flex-wrap: wrap; gap: var(--space-md); }
.module {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-input);
  background: var(--color-paper-2);
}

#settings-fields { display: flex; flex-direction: column; gap: var(--space-xs); margin-bottom: var(--space-sm); }
#settings-form .btn { margin-top: var(--space-2xs); }
#settings-status { margin-top: var(--space-sm); }

.warp { padding: var(--space-sm) 0; border-top: var(--rule-hair) solid var(--color-rule); }
.warp:first-child { border-top: 0; padding-top: 0; }
.warp-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); margin-bottom: var(--space-2xs); }

/* ---------------- dialog ---------------- */

dialog {
  width: min(560px, calc(100% - var(--space-lg)));
  max-height: calc(100dvh - var(--space-lg));
  overflow: auto;
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-card);
  background: var(--color-paper);
  color: var(--color-ink);
  padding: var(--space-lg);
}
dialog::backdrop { background: color-mix(in oklab, var(--color-ink) 45%, transparent); }
dialog h2 { font-size: var(--text-lg); margin-bottom: var(--space-sm); }
.dialog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-xs); margin-top: var(--space-md); }
#add-account-result { margin-top: var(--space-sm); }

/* ---------------- responsive ---------------- */

@media (pointer: coarse) {
  .btn-small, .slot-actions .btn { min-height: 44px; }
}

@media (max-width: 1000px) {
  .bots-layout { grid-template-columns: minmax(0, 1fr); }
  .detail {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .app-header-inner { padding: var(--space-2xs) var(--space-md); gap: var(--space-xs); }
  .app-main { padding: var(--space-md); }
  .header-actions { margin-left: 0; }
  .filters { width: 100%; }
  .filters input[type="search"] { flex: 1 1 100%; min-width: 0; }
  .form-grid, .dialog-grid, .distributor-grid, .rtp-interval { grid-template-columns: minmax(0, 1fr); }
  .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail { padding: var(--space-xs); }
  .stop-btn { width: 100%; }
  .rtp-interval .btn { width: 100%; }
}

@media (max-width: 420px) {
  .slots { grid-template-columns: minmax(0, 1fr); }
  .today-vitals { grid-template-columns: minmax(0, 1fr); }
  .role-row { grid-template-columns: minmax(0, 1fr) auto; }
  .role-row .badge { grid-column: 1 / -1; justify-self: start; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dt { margin-top: var(--space-2xs); }
}

.slot-selected { border-color: var(--color-accent); background: var(--color-accent-soft); }

input, select, textarea { border-color: var(--color-muted); }
.csv-rows { max-height: 320px; overflow-y: auto; display: grid; gap: var(--space-xs); }
.csv-row { display: flex; justify-content: space-between; gap: var(--space-md); padding-block: var(--space-2xs); border-bottom: var(--rule-hair) solid var(--color-rule); }
#csv-dialog { width: min(620px, calc(100% - var(--space-lg))); }
#csv-form { display: grid; gap: var(--space-sm); }

.bots-layout.empty { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) {
  #overview-table { min-width: 0; }
  #overview-table th, #overview-table td { padding-inline: var(--space-xs); }
}

/* ---------------- fleet console (2026-11) ---------------- */

.fleet-summary { margin: 0; }
.fleet-toolbar { display: flex; flex-direction: column; gap: var(--space-xs); }
.view-tabs { display: flex; flex-wrap: wrap; gap: var(--space-3xs); }
.view-tab {
  min-height: 44px;
  padding: 0 var(--space-sm);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: 999px;
  background: var(--color-paper);
  color: var(--color-ink-2);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
}
.view-tab:hover { background: var(--color-paper-2); }
.view-tab[aria-selected="true"] {
  color: var(--color-ink);
  border-color: color-mix(in oklab, var(--color-accent) 55%, var(--color-rule));
  background: color-mix(in oklab, var(--color-accent-soft) 60%, var(--color-paper));
}
.view-tab .num { color: var(--color-muted); font-size: var(--text-xs); }
.fleet-count { margin: 0; }

.selection-bar {
  position: sticky;
  top: calc(var(--app-header-h) + var(--space-xs));
  z-index: var(--z-sticky-nav);
  box-shadow: 0 2px 10px color-mix(in oklab, var(--color-ink) 8%, transparent);
}
.selection-bar .mass-head { gap: var(--space-xs); }
.selection-bar .mass-head .btn { min-height: 36px; }
.mass-targets-wrap summary {
  cursor: pointer;
  min-height: 32px;
  display: flex;
  align-items: center;
  color: var(--color-muted);
  font-size: var(--text-sm);
}
.mass-targets-wrap .target-list { max-height: 110px; overflow: auto; padding-top: var(--space-2xs); }
.mass-chat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-xs);
  align-items: end;
}
.mass-chat-row .field { min-width: 0; }

.fleet-table { min-width: 680px; }
.fleet-table .name-cell { min-width: 210px; }
.fleet-table .row-sub { margin-top: 1px; }
.fleet-table .row-chips { margin-top: var(--space-2xs); }
.fleet-table td { vertical-align: top; }
.fleet-table .today-cell { white-space: nowrap; }
.fleet-table .today-catch { display: block; margin-top: 2px; }

.bots-layout { grid-template-columns: minmax(0, 1fr); }
.detail { max-width: none; }
.detail-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--color-paper);
  padding-bottom: var(--space-xs);
  margin-bottom: var(--space-xs);
}
.detail-tabs {
  position: sticky;
  top: 64px;
  z-index: 2;
  background: var(--color-paper);
}
.detail-title-wrap h2 { margin: 0; }

.slots-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2xs); }
.slots-compact .slot { padding: var(--space-2xs); gap: 2px; }
.slots-compact .slot-empty { opacity: 0.5; padding: var(--space-3xs) var(--space-2xs); }
.slots-compact .slot-empty .slot-actions { margin-top: 0; }
.slots-compact .slot-empty .btn { min-height: 28px; font-size: var(--text-xs); padding: 0 var(--space-3xs); }
.slots-compact .slot-meta { font-size: var(--text-xs); }
.slots-compact .slot-actions .btn { min-height: 30px; }

.bulk-settings { display: flex; flex-direction: column; gap: var(--space-sm); }
.bulk-settings h2 { margin: 0; }
.bulk-settings .form-grid { margin: 0; }
.bulk-settings .json-details { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-input); padding: var(--space-xs); }
.bulk-results-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.bulk-results-head select { min-width: 180px; }
#bulk-results { max-height: 220px; overflow: auto; }
#bulk-preview { margin: 0; }

.queues-table { min-width: 560px; }
.op-result { margin: var(--space-2xs) 0 0; }
.danger-details summary { color: var(--color-error); }

@media (min-width: 1280px) {
  .bots-layout.detail-open {
    grid-template-columns: minmax(0, 1fr) minmax(520px, 600px);
    align-items: start;
  }
  .bots-layout.detail-open .detail {
    position: sticky;
    top: calc(var(--app-header-h) + var(--space-sm));
    max-height: calc(100dvh - var(--app-header-h) - var(--space-lg));
    overflow: auto;
  }
}

@media (max-width: 1279px) {
  .bots-layout.detail-open .bots-list { display: none; }
  .bots-layout.detail-open .detail {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .detail-head { position: static; }
  .detail-tabs { position: static; }
}

@media (max-width: 760px) {
  .fleet-table { min-width: 0; }
  .fleet-table thead { display: none; }
  .fleet-table, .fleet-table tbody { display: block; width: 100%; }
  .fleet-table tr {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0 var(--space-xs);
    padding: var(--space-xs);
    border-bottom: var(--rule-hair) solid var(--color-rule);
  }
  .fleet-table tr:last-child { border-bottom: 0; }
  .fleet-table td { display: block; border: 0; padding: 2px 0; }
  .fleet-table td.col-check { grid-column: 1; grid-row: 1 / span 5; align-self: start; padding-top: var(--space-2xs); }
  .fleet-table td.name-cell,
  .fleet-table td[data-label] { grid-column: 2; }
  .fleet-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: var(--text-xs);
    color: var(--color-muted);
    margin-top: var(--space-2xs);
  }
  .fleet-table td.name-cell { min-width: 0; }
  .fleet-table .row-label { max-width: none; white-space: normal; }
  .fleet-table .row-chips { margin-top: var(--space-2xs); }
  .fleet-table td.col-check { width: 44px; }
  .fleet-table .today-cell { white-space: normal; }
  .selection-bar { position: static; box-shadow: none; }
  .mass-chat-row { grid-template-columns: minmax(0, 1fr); }
  .slots-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .slots-compact { grid-template-columns: minmax(0, 1fr); }
  .view-tab { min-height: 44px; }
}

@media (max-width: 760px) {
  #overview-table,
  #overview-table tbody,
  #overview-table tr,
  #overview-table td { display: block; width: 100%; }
  #overview-table tr { display: grid; grid-template-columns: 44px minmax(0, 1fr); width: auto; }
  #overview-table td { border: 0; }
  #overview-table td.col-check { grid-column: 1; grid-row: 1 / span 5; }
  #overview-table td.name-cell,
  #overview-table td[data-label] { grid-column: 2; }
}

/* Fleet review: two-line rows and an actual mobile inspector. */
.extra-filters { display: contents; }
#filters-toggle, #select-visible { display: none; }
.row-name-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.row-name-line .row-host { border: 1px solid var(--color-rule); padding: 0 4px; border-radius: 3px; }
.row-name-line .row-role { display: inline; margin: 0; font-size: var(--text-xs); }
.table.fleet-table td { padding: 8px; }
.fleet-table .row-select { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; min-height: 44px; padding: 0; }
.fleet-table .name-cell { min-width: 180px; }
.fleet-table .row-select .summary-chips { margin: 0; }
.fleet-table .row-sub { line-height: 1.35; }
.current-activity { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.capacity-block .kv { grid-template-columns: minmax(130px,1fr) minmax(0,1fr); }
.guard-banner { display:flex; gap:16px; align-items:center; justify-content:space-between; border:1px solid var(--color-error); padding:12px; border-radius:var(--radius-input); }
.guard-copy { display:flex; flex-direction:column; gap:4px; }
@media (max-width:1279px) {
  #tab-bots.inspector-open > .panel-head,
  #tab-bots.inspector-open > .fleet-toolbar,
  #tab-bots.inspector-open > .fleet-count,
  #tab-bots.inspector-open > .selection-bar { display:none; }
  #tab-bots.inspector-open .detail-head { position:sticky; top:0; }
}
@media (max-width:760px) {
  #filters-toggle { display:inline-flex; }
  .extra-filters { display:none; }
  .filters-expanded .extra-filters { display:flex; flex-wrap:wrap; gap:8px; width:100%; }
  .view-tabs { flex-wrap:nowrap; overflow-x:auto; padding-bottom:4px; }
  .view-tab { flex:none; }
  .filters > label[for="bot-search"] { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .filters input[type="search"] { min-width:0; flex:1; width:100px; }
  .fleet-table td[data-label]::before { display:none; }
  #overview-table tr { grid-template-columns:32px minmax(0,1fr) minmax(70px,.7fr); gap:5px 8px; padding:10px 6px; }
  #overview-table td.col-check { width:32px; grid-column:1; grid-row:1 / span 4; }
  #overview-table td.name-cell { grid-column:2 / span 2; }
  #overview-table td[data-label="Активность"] { grid-column:2; }
  #overview-table td[data-label="Здоровье"] { grid-column:3; }
  #overview-table td[data-label="Сегодня"] { grid-column:2; }
  #overview-table td[data-label="Позиция"] { grid-column:3; font-size:var(--text-xs); overflow-wrap:anywhere; }
  .table.fleet-table td { padding:0; }
  .fleet-table .row-select { min-height:44px; width:100%; }
  .guard-banner { align-items:stretch; flex-direction:column; }
  .slots-compact .slot-actions .btn, .slots-compact .slot-empty .btn { min-height:44px; }
}

@media (max-width:760px) {
  #overview-table thead { display:none; }
  #overview-table td[data-label] { display:block; }
  #select-visible { display:inline-flex; }
}

.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.summary-chip.badge-neutral { background:var(--color-paper); color:var(--color-muted); }
#mass-commands > .button-row { margin-top:8px; }
@media (min-width:900px) {
  #distributor-body { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px 32px; }
  #distributor-body > .distributor-block + .distributor-block { margin:0; padding:0; border:0; }
  #distributor-body .kv { grid-template-columns:minmax(140px,.8fr) minmax(0,1fr); }
  #warehouse-max-online { max-width:240px; }
}
@media (max-width:760px) {
  .today-cell [data-daily-playtime]::before { content:'Сегодня '; font:inherit; color:var(--color-muted); }
  .today-cell [data-daily-catches]::before { content:'Поимки '; font:inherit; color:var(--color-muted); }
  .today-vitals { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
