﻿:root {
  --bg: #ececed;
  --chrome: #2b2f35;
  --chrome-2: #23272d;
  --red: #c51a1b;
  --red-hot: #e02122;
  --text: #333333;
  --text-dim: #6b7280;
  --white: #ffffff;
  --line: #d5d6d8;
  --green: #1aa05a;
  --panel: #ffffff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --font: "Roboto Condensed", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --header-h: 64px;
  --bottom-h: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

button, input {
  font-family: inherit;
  font-size: 16px;
}

.scroll-y {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scroll-y::-webkit-scrollbar { width: 0; height: 0; display: none; }

.mobile-only { display: none !important; }

.app {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) 240px;
  grid-template-rows: calc(var(--header-h) + var(--safe-t)) minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  height: 100vh;
  overflow: hidden;
}

.top {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px 16px;
  padding: var(--safe-t) 16px 0;
  height: calc(var(--header-h) + var(--safe-t));
  background: var(--chrome);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 5;
  overflow: hidden;
}

.icon-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 4px;
  background: #1c2025;
  color: var(--white);
  font-size: 20px;
  cursor: pointer;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
  flex: 0 0 auto;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  font-size: 17px;
  border-radius: 4px;
}

.brand-name {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.top-search, .mobile-search {
  display: flex;
  align-items: center;
  background: #1c2025;
  border-radius: 4px;
  padding: 0 12px;
  height: 36px;
}

.top-search {
  flex: 1 1 180px;
  max-width: 360px;
  min-width: 140px;
}

.top-search input, .mobile-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--white);
  font-size: 14px;
}

.mobile-search {
  flex: 0 0 auto;
  height: 40px;
  background: var(--white);
  border: 1px solid var(--line);
}
.mobile-search input { color: var(--text); font-size: 16px; }
.top-search input::placeholder { color: #8b919a; }
.search-ico { color: #8b919a; margin-right: 8px; flex: 0 0 auto; }

.top-nav { display: flex; gap: 2px; flex: 0 0 auto; }

.nav-tab {
  background: transparent;
  border: 0;
  color: #c5c9ce;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav-tab.active { color: var(--white); border-bottom-color: var(--red); }

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 6px 10px;
  border-radius: 3px;
  background: #3a4048;
  color: #d0d4d9;
}
.badge.on { background: var(--green); color: var(--white); }

.btn {
  border: 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  padding: 9px 12px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  min-height: 40px;
}
.btn.primary { background: var(--red); color: var(--white); }
.btn.primary:hover { background: var(--red-hot); }
.btn.danger { background: #5a1a1b; color: #ffd7d7; }
.btn.danger:disabled, .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: #d0d4d9; border: 1px solid #4a515a; }
.btn.tiny {
  padding: 6px 8px;
  font-size: 11px;
  min-height: 32px;
  background: transparent;
  color: var(--red);
  border: 1px solid #f0c4c4;
}
.btn.grow { flex: 1 1 auto; }

.side {
  background: var(--chrome);
  color: var(--white);
  padding: 10px 0 16px;
  min-height: 0;
  height: 100%;
}
.side-section { margin-bottom: 14px; }
.side-title {
  color: var(--red);
  font-weight: 700;
  font-size: 12px;
  padding: 8px 16px 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.side-item {
  display: block;
  width: 100%;
  text-align: left;
  color: #e8eaed;
  text-decoration: none;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.side-item:hover, .side-item.active { background: var(--chrome-2); }
.side-note {
  padding: 4px 16px 8px;
  color: #9aa1aa;
  font-size: 12px;
  line-height: 1.35;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 12px 14px;
  gap: 10px;
}

.hero-strip {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(120deg, #2b2f35 0%, #3a1516 55%, #c51a1b 140%);
  color: var(--white);
  border-radius: 4px;
  box-shadow: var(--shadow);
}
.hero-strip h1 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.hero-strip p {
  margin: 0;
  color: #d7dbe0;
  font-size: 13px;
  max-width: 480px;
  line-height: 1.3;
}

.kpi-row {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.kpi {
  min-width: 96px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 8px 10px;
}
.kpi.warn { border-color: rgba(197, 26, 27, 0.55); }
.kpi-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b8bec6;
  margin-bottom: 2px;
}
.kpi-value { font-size: 16px; font-weight: 700; white-space: nowrap; }

.mobile-actions { display: none; gap: 8px; }

.main-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 10px;
  overflow: hidden;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.panel-fill { flex: 1 1 auto; min-height: 0; }
.panel.hidden, section.hidden { display: none !important; }

.panel-head {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--red);
  padding-bottom: 6px;
}
.panel-head h2 {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.panel-body { flex: 1 1 auto; min-height: 0; }
.muted { color: var(--text-dim); font-size: 12px; font-weight: 600; }

.add-form {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}
.add-form input {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 10px;
  font-size: 16px;
  background: #f7f7f8;
}
.game-form {
  grid-template-columns: 1fr;
  margin-bottom: 14px;
}
.field-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.field-label select,
.field-label input {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 10px;
  font-size: 15px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  background: #f7f7f8;
}
.ab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ab-grid.hidden,
.wheel-grid.hidden,
.pairs-grid.hidden { display: none; }
.pairs-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pair-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
  background: #f7f7f8;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}
.pair-card.pair-card-triple {
  grid-template-columns: 1fr 1fr 1fr;
}
.pair-card .pair-user {
  font-size: 13px;
}
.pair-card .pair-user strong {
  display: block;
}
.pair-card .pair-meta {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}
.pair-card .pair-meta .pair-stake {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.pair-unpaired {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-dim);
}
.ab-col {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
  background: #f7f7f8;
}
.ab-h {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.ab-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 48px;
}
.ab-col li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.ab-total {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-weight: 700;
  font-size: 15px;
}
.check-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}
.check-label input {
  margin-top: 3px;
  width: auto;
  height: auto;
}
.check-label[hidden],
.field-label[hidden],
.losing-roulette-opts[hidden] {
  display: none !important;
}
.losing-roulette-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f7f7f8;
}
.losing-roulette-opts .muted {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-dim);
}
.losing-roulette-opts .check-label.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.stake-btns {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.stake-btn.active {
  background: var(--chrome-2);
  color: var(--white);
  border-color: var(--chrome-2);
}


.table-wrap { flex: 1 1 auto; min-height: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
}
td { padding: 10px 6px; border-bottom: 1px solid #eee; vertical-align: middle; }

.status-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: #ececed;
  color: #555;
}
.status-pill.connected, .status-pill.ready { background: #e5f6ec; color: var(--green); }
.status-pill.error { background: #fde8e8; color: var(--red); }
.status-pill.logging-in, .status-pill.launching { background: #fff4e5; color: #b86a00; }

.rules { list-style: none; margin: 0; padding: 0; }
.rules li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  font-size: 13px;
}
.rules span { color: var(--text-dim); }
.footnote { margin: 12px 0 0; font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.mobile-specials { margin-top: 14px; display: grid; gap: 8px; }

.wheel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 6px;
}
.num {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 7px 4px;
  text-align: center;
  background: #f7f7f8;
}
.num .n { display: block; font-weight: 700; font-size: 14px; }
.num .s { display: block; font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.num.zero { background: #e5f6ec; border-color: #b8e2c8; }
.num.red { background: #fde8e8; border-color: #f0c4c4; }
.num.black { background: #2b2f35; color: var(--white); border-color: #2b2f35; }
.num.black .s { color: #b8bec6; }

.log {
  flex: 1 1 auto;
  min-height: 0;
  font-size: 13px;
  background: #f7f7f8;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 8px;
}
.log-row {
  display: grid;
  grid-template-columns: 64px 48px 1fr;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1px solid #e6e6e7;
}
.log-row .lvl { font-weight: 700; text-transform: uppercase; font-size: 11px; }
.log-row .lvl.error { color: var(--red); }
.log-row .lvl.warn { color: #b86a00; }
.log-row .lvl.info { color: var(--green); }

.rail {
  background: var(--bg);
  border-left: 1px solid var(--line);
  padding: 12px 10px;
  min-height: 0;
  height: 100%;
}
.rail-title {
  color: var(--red);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}
.rail-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 11px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.rail-card-h { font-weight: 700; margin-bottom: 6px; font-size: 13px; }
.rail-card p { margin: 0; font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.rail-card.live .rail-card-h {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(26, 160, 90, 0.2);
}

.bottom-nav { display: none; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 40;
}
.drawer-backdrop[hidden] { display: none !important; }

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(300px, 86vw);
  height: 100dvh;
  background: var(--chrome);
  color: var(--white);
  z-index: 50;
  padding: calc(12px + var(--safe-t)) 0 calc(16px + var(--safe-b));
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 14px;
  border-bottom: 1px solid #3a4048;
  margin-bottom: 8px;
}
.drawer .icon-btn { display: inline-flex; }

@media (max-width: 1100px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: calc(var(--header-h) + var(--safe-t)) minmax(0, 1fr);
    --bottom-h: calc(58px + var(--safe-b));
  }
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }
  .mobile-specials.mobile-only { display: grid !important; }
  .bottom-nav.mobile-only { display: grid !important; }
  .icon-btn.menu-btn { display: inline-flex; }

  .top { gap: 10px; padding-left: 10px; padding-right: 10px; }
  .badge.mobile-only { margin-left: auto; }
  .brand-name { font-size: 18px; }

  .main {
    padding: 10px 10px calc(10px + var(--bottom-h));
    gap: 8px;
  }

  .hero-strip {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 10px;
  }
  .hero-strip h1 { font-size: 17px; }
  .hero-strip p { font-size: 12px; max-width: none; }

  .kpi-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .kpi { min-width: 0; }
  .kpi-value { font-size: 15px; }

  .mobile-actions { display: flex !important; flex: 0 0 auto; }
  .mobile-actions .btn.ghost {
    color: var(--text);
    border-color: var(--line);
    background: var(--white);
  }

  .panel-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
  }
  .panel-grid::-webkit-scrollbar { display: none; }
  #accounts { min-height: min(52vh, 420px); }
  #rules { min-height: 220px; }
  .add-form { grid-template-columns: 1fr; }
  .add-form .btn { width: 100%; }
  .wheel-grid { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
  .log-row { grid-template-columns: 52px 40px 1fr; font-size: 12px; }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--bottom-h);
    padding: 0 4px var(--safe-b);
    grid-template-columns: repeat(4, 1fr);
    align-items: stretch;
    background: var(--chrome);
    border-top: 1px solid #3a4048;
    z-index: 30;
  }
  .bottom-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 0;
    background: transparent;
    color: #9aa1aa;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    min-height: 52px;
  }
  .bottom-tab .bt-ico { font-size: 16px; line-height: 1; }
  .bottom-tab.active { color: var(--white); }
  .bottom-tab.active .bt-ico { color: var(--red); }
}

@media (max-width: 640px) {
  :root { --header-h: 56px; }
  .brand-name { display: none; }
  .hero-copy p { display: none; }
  .kpi-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi { padding: 6px; }
  .kpi-label { font-size: 9px; }
  .kpi-value { font-size: 13px; }
  #accounts { min-height: min(58vh, 480px); }
  table { font-size: 12px; }
}

@media (max-width: 400px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .mobile-actions .btn { padding: 10px 8px; font-size: 11px; }
}

/* ── Instant Desk feeders / report (ported from exch-final) ── */
:root {
  --im-red: #c51a1b;
  --im-header: #2b2f35;
  --im-charcoal: #43444a;
  --im-charcoal-light: #53555b;
  --im-muted: #a3a1a7;
  --im-gold: #d9af5b;
  --im-cyan: #00b2ff;
  --im-green: #00b181;
  --im-danger: #ff4148;
  --im-radius: 4px;
  --im-text-inv: #ffffff;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: url("https://mlib684.s3.eu-west-2.amazonaws.com/uploads/2/new1/mn_bg_brandname.svg")
    bottom right no-repeat;
  opacity: 0.12;
  z-index: 0;
}
.app { position: relative; z-index: 1; }

.im-form { display: flex; flex-direction: column; gap: 10px; padding: 0 0 8px; }
.im-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}
.im-field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); }
.im-field select,
.im-field input {
  height: 40px; border: 1px solid var(--line); border-radius: 3px; padding: 0 10px;
  font-size: 15px; font-weight: 600; text-transform: none; letter-spacing: 0;
  color: var(--text); background: #f7f7f8;
}
.im-user-wrap, .im-pass-wrap { position: relative; }
.im-pass-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 20;
  margin: 0; padding: 4px 0; list-style: none; max-height: 160px; overflow: auto;
  background: #1c2025; border: 1px solid #3a3f46; border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.im-pass-suggest[hidden] { display: none !important; }
.im-pass-suggest li {
  padding: 8px 12px; font-size: 13px; font-weight: 600; color: #fff;
  cursor: pointer; text-transform: none; letter-spacing: 0;
}
.im-pass-suggest li:hover, .im-pass-suggest li.active { background: rgba(197,26,27,0.35); }
.im-form-status { min-height: 16px; margin: 0; font-size: 12px; color: var(--text-dim); }
.im-form-status.ok { color: var(--im-green); }
.im-form-status.err { color: var(--im-danger); }

.feed-head { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.account-feed { display: flex; flex-direction: column; gap: 8px; min-height: 120px; max-height: min(42vh, 420px); padding-bottom: 8px; }
.im-acc-card {
  border: 1px solid var(--line); border-left: 3px solid #9aa1aa; border-radius: 4px;
  background: #f7f7f8; padding: 10px 12px;
}
.im-acc-card.online { border-left-color: var(--im-green); }
.im-acc-card.error { border-left-color: var(--im-danger); }
.im-acc-row { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.im-acc-name { display: block; font-size: 14px; font-weight: 700; color: var(--text); }
.im-acc-id-meta { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.im-domain-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--im-cyan); background: rgba(0,178,255,0.1); padding: 2px 6px; border-radius: 3px;
}
.im-acc-metrics { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.im-num { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; font-weight: 700; }
.im-num em { font-style: normal; font-size: 9px; letter-spacing: 0.06em; color: var(--text-dim); }
.im-num.bal { color: var(--im-green); }
.im-acc-actions { margin-top: 8px; display: flex; justify-content: flex-end; }

.im-report-btn {
  height: 36px; padding: 0 12px; border: 1px solid rgba(0,178,255,0.35);
  border-radius: 4px; background: rgba(0,178,255,0.12); color: #9fe6ff;
  font-family: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; cursor: pointer;
}
.im-report-btn:hover { background: rgba(0,178,255,0.24); color: #fff; }

.im-proxy-card {
  margin-top: 8px; border-radius: var(--im-radius); background: var(--im-header);
  border: 1px solid var(--im-charcoal-light); overflow: hidden;
}
.im-proxy-rail {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  column-gap: 10px; padding: 5px 10px; min-height: 32px; overflow: hidden;
}
.im-proxy-rail-left { justify-self: start; display: flex; align-items: center; min-width: 0; width: 100%; }
.im-proxy-rail-lead {
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--im-muted);
  font-family: inherit; font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; cursor: pointer; max-width: 48px; white-space: nowrap;
  transition: max-width 0.3s ease, opacity 0.2s ease;
}
.im-proxy-card[data-expanded="1"] .im-proxy-rail-lead { max-width: 0; opacity: 0; pointer-events: none; }
.im-proxy-rail-slide {
  flex: 0 1 0; min-width: 0; max-width: 0; opacity: 0; overflow: hidden;
  transition: max-width 0.3s ease, opacity 0.2s ease, flex-grow 0.3s ease;
}
.im-proxy-card[data-expanded="1"] .im-proxy-rail-slide { flex: 1 1 auto; max-width: 100%; opacity: 1; }
.im-proxy-field {
  width: 100%; height: 26px; padding: 0 8px; border: 1px solid var(--im-charcoal-light);
  border-radius: var(--im-radius); background: var(--im-header); color: #fff; font-size: 12px;
}
.im-proxy-field.is-bad { border-color: var(--im-danger); }
.im-proxy-field.is-ok { border-color: var(--im-green); }
.im-proxy-routes-link {
  justify-self: center; border: 0; background: none; color: var(--im-muted);
  font-size: 11px; cursor: pointer;
}
.im-proxy-routes-link:hover { color: #fff; text-decoration: underline; }
.im-proxy-rail-right { justify-self: end; display: flex; align-items: center; gap: 10px; }
.im-proxy-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #6a6e76;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.06);
}
.im-proxy-dot[data-tone="live"], .im-proxy-dot[data-tone="on"] { background: var(--im-green); }
.im-proxy-dot[data-tone="dead"] { background: var(--im-danger); }
.im-proxy-dot[data-tone="check"] { background: var(--im-gold); animation: im-proxy-pulse 1s ease-in-out infinite; }
.im-proxy-dot-btn { margin: 0; padding: 0; border: 0; cursor: pointer; }
@keyframes im-proxy-pulse { 0%,100%{opacity:1} 50%{opacity:0.45} }
.im-proxy-status {
  margin: 0; padding: 0 8px; max-height: 0; overflow: hidden; font-size: 10px; color: var(--im-muted);
}
.im-proxy-status:not(:empty) { max-height: 22px; padding: 0 8px 5px; }
.im-proxy-status.err { color: var(--im-danger); }
.im-proxy-status.ok { color: var(--im-green); }
.im-proxy-collapse-hit { display: none; width: 0; height: 24px; border: 0; background: transparent; cursor: pointer; }
.im-proxy-card[data-expanded="1"] .im-proxy-collapse-hit { display: block; width: 8px; }

.im-switch { position: relative; display: inline-flex; width: 34px; height: 18px; cursor: pointer; }
.im-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; z-index: 1; cursor: pointer; }
.im-switch-ui {
  position: absolute; inset: 0; border-radius: 999px; background: #1a1d22; border: 1px solid rgba(255,255,255,0.1);
}
.im-switch-ui::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: #8a8e96; transition: transform 0.2s ease;
}
.im-switch input:checked + .im-switch-ui { background: rgba(0,177,129,0.28); border-color: rgba(0,177,129,0.55); }
.im-switch input:checked + .im-switch-ui::after { transform: translateX(16px); background: var(--im-green); }

.im-proxy-modal {
  position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.im-proxy-modal[hidden] { display: none !important; }
.im-proxy-modal-backdrop { position: absolute; inset: 0; border: 0; background: rgba(0,0,0,0.55); cursor: pointer; }
.im-proxy-modal-sheet {
  position: relative; width: min(360px, 100%); background: var(--im-header); color: #fff;
  border-radius: 8px; border: 1px solid var(--im-charcoal-light); padding: 16px; z-index: 1;
}
.im-proxy-modal-head h3 { margin: 0 0 4px; font-size: 16px; }
.im-proxy-modal-head p { margin: 0 0 12px; color: var(--im-muted); font-size: 12px; }
.im-proxy-modal-body { display: flex; flex-direction: column; gap: 12px; }
.im-proxy-route { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.im-proxy-modal-foot { margin-top: 16px; }

.im-modal {
  position: fixed; inset: 0; z-index: 1300; display: flex; align-items: center; justify-content: center; padding: 16px;
}
.im-modal.hidden { display: none !important; }
.im-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.im-modal-card {
  position: relative; z-index: 1; width: min(420px, 100%); background: var(--im-header); color: #fff;
  border-radius: 8px; border: 1px solid var(--im-charcoal-light); padding: 18px; box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.im-modal-card h3 { margin: 0 0 6px; }
.im-modal-card > p { margin: 0 0 12px; color: var(--im-muted); font-size: 13px; }
.im-report-acc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; color: var(--im-muted); }
.im-report-acc-all {
  border: 1px solid rgba(255,255,255,0.12); background: transparent; color: #fff;
  border-radius: 4px; padding: 4px 8px; font-size: 11px; cursor: pointer;
}
.im-report-acc-list { max-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.im-report-acc-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 4px;
  background: rgba(255,255,255,0.04); font-size: 13px;
}
.im-report-acc-meta { margin-left: auto; color: var(--im-muted); font-size: 12px; }
.im-report-calc {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px;
  background: rgba(255,255,255,0.04); border-radius: 4px; padding: 10px;
}
.im-report-calc-lbl { display: block; font-size: 10px; color: var(--im-muted); text-transform: uppercase; }
.im-report-calc-val { font-size: 16px; font-weight: 700; }
.im-report-opt { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; }
.im-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
