:root {
    --bg:         #080c14;
    --surface:    #0f1628;
    --panel:      #111c30;
    --panel2:     #152038;
    --border:     #1a2d4a;
    --border-hi:  #1e3a5f;
    --blue:       #0ea5e9;
    --blue-dim:   #0878a8;
    --blue-glow:  rgba(14,165,233,0.20);
    --blue-vivid: #38bdf8;
    --green:      #22d3a0;
    --yellow:     #fbbf24;
    --red:        #f43f5e;
    --orange:     #fb923c;
    --muted:      #2d4a6b;
    --text:       #e2eaf4;
    --text-dim:   #5a7a9a;
    --text-mid:   #8baabf;
    --mono:       'JetBrains Mono', monospace;
    --sans:       'Exo 2', sans-serif;
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  html, body {
    height: 100%; background: var(--bg);
    color: var(--text); font-family: var(--sans);
    font-size: 15px; line-height: 1.5; overflow: hidden;
  }

  body::before {
    content: ""; position: fixed; inset: 0;
    background-image:
      linear-gradient(rgba(14,165,233,0.022) 1px, transparent 1px),
      linear-gradient(90deg, rgba(14,165,233,0.022) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none; z-index: 0;
  }

  body::after {
    content: ""; position: fixed; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--blue), var(--blue-vivid), var(--blue), transparent);
    z-index: 100;
  }

  .app {
    position: relative; z-index: 1;
    display: flex; flex-direction: column;
    height: 100vh; padding: 12px 16px 14px; gap: 10px;
  }

  /* ── HEADER ── */
  .header {
    display: flex; align-items: center; gap: 12px;
    padding-bottom: 10px; border-bottom: 1px solid var(--border); flex-shrink: 0;
  }

  .logo { display: flex; align-items: center; }

  .logo-img {
    height: 32px; width: auto;
    display: block;
    /* slight brightness boost so it pops on the dark bg */
    filter: brightness(1.05);
  }

  .hdivider { width: 1px; height: 26px; background: var(--border); flex-shrink: 0; }

  .hlabel { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
  .hlabel .accent { color: var(--blue-vivid); }

  .hspacer { flex: 1; }

  .status-badge {
    display: flex; align-items: center; gap: 7px; padding: 5px 14px;
    border: 1px solid var(--border); border-radius: 20px;
    font-family: var(--mono); font-size: 12px;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-dim); background: var(--surface); transition: all 0.3s;
  }

  .status-badge.connected  { border-color: var(--green); color: var(--green); background: rgba(34,211,160,0.06); box-shadow: 0 0 12px rgba(34,211,160,0.10); }
  .status-badge.connecting { border-color: var(--yellow); color: var(--yellow); background: rgba(251,191,36,0.06); }

  .sdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
  .status-badge.connected .sdot  { animation: spulse 2s ease-in-out infinite; }
  .status-badge.connecting .sdot { animation: sblink .7s step-end infinite; }
  @keyframes spulse { 0%,100%{opacity:1;box-shadow:0 0 5px currentColor}50%{opacity:.4;box-shadow:none} }
  @keyframes sblink { 0%,100%{opacity:1}50%{opacity:0} }

  /* ── STATS STRIP ── */
  .stats-bar {
    display: flex; align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.035), 0 1px 8px rgba(0,0,0,0.3);
  }

  .stat-sep {
    width: 1px; background: var(--border);
    flex-shrink: 0; align-self: stretch;
    margin: 8px 0;
  }

  .stat-seg {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 18px; min-width: 0;
    position: relative; transition: background 0.15s;
  }

  .stat-seg:hover { background: rgba(14,165,233,0.04); }

  .stat-seg-host { flex: 1; min-width: 0; }

  .stat-label {
    font-size: 10.5px; font-family: var(--mono);
    text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--text-dim); font-weight: 400;
    line-height: 1; white-space: nowrap; display: block;
  }

  .stat-value {
    font-size: 22px; font-weight: 800; color: #fff;
    line-height: 1; margin-top: 4px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; display: block;
  }

  .stat-value.mono { font-family: var(--mono); font-size: 14px; font-weight: 500; }
  .stat-value .sub { font-size: 14px; font-weight: 300; color: var(--text-dim); }

  .stat-seg-fps { gap: 14px; }
  .fps-num-wrap { flex-shrink: 0; min-width: 52px; }
  .fps-canvas-wrap {
    flex: 1; min-width: 180px; height: 58px;
    position: relative;
  }
  canvas#fpsChart { width: 100%; height: 58px; display: block; }

  /* scale labels on the canvas wrap */
  .fps-scale {
    position: absolute; top: 0; left: 0; bottom: 0;
    display: flex; flex-direction: column; justify-content: space-between;
    pointer-events: none;
  }

  .fps-scale-lbl {
    font-size: 10px; font-family: var(--mono);
    color: var(--muted); line-height: 1; white-space: nowrap;
    padding-right: 4px;
  }

  .fps-window-lbl {
    position: absolute; bottom: 2px; right: 2px;
    font-size: 10px; font-family: var(--mono);
    color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase;
    pointer-events: none;
  }

  /* ── NOTICES ── */
  .notice {
    display: flex; align-items: center; gap: 10px;
    border-radius: 6px; padding: 7px 13px;
    font-family: var(--mono); font-size: 12px;
    letter-spacing: 0.04em; flex-shrink: 0;
  }

  .n-warn { background: rgba(251,191,36,0.06); border: 1px solid rgba(251,191,36,0.22); color: var(--yellow); }
  .n-ok   { background: rgba(34,211,160,0.06);  border: 1px solid rgba(34,211,160,0.22);  color: var(--green); display: none; }
  .n-ok.visible { display: flex; }
  .ndot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; animation: spulse 2s ease-in-out infinite; }

  /* ── CONNECTION PANEL ── */
  .conn-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 2px solid var(--blue-dim);
    border-radius: 4px;
    flex-shrink: 0; overflow: hidden;
    transition: border-color 0.2s, border-left-color 0.2s;
    box-shadow: 0 1px 8px rgba(0,0,0,0.25);
  }

  .conn-panel:hover { border-left-color: var(--blue); }
  .conn-panel.open  { border-left-color: var(--blue); }

  .conn-toggle {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 14px; cursor: pointer; user-select: none;
    border-bottom: 1px solid transparent; transition: background 0.2s, border-color 0.2s;
  }

  .conn-toggle:hover { background: rgba(14,165,233,0.04); }
  .conn-panel.open .conn-toggle { border-bottom-color: var(--border); }

  .cticon {
    width: 20px; height: 20px;
    background: linear-gradient(135deg, var(--blue), var(--blue-dim));
    border-radius: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  }

  .cticon svg { width: 10px; height: 10px; fill: #fff; }

  .ctlabel { font-size: 12px; font-weight: 700; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-mid); flex: 1; }
  .chevron { font-size: 11px; color: var(--text-dim); transition: transform 0.25s; }
  .conn-panel.open .chevron { transform: rotate(180deg); }
  .conn-body { display: none; padding: 12px 14px; }
  .conn-panel.open .conn-body { display: block; }

  .conn-row { display: flex; gap: 9px; align-items: flex-end; flex-wrap: wrap; }
  .conn-meta-row {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-top: 10px;
  }
  .conn-check {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--mono); font-size: 11px;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-dim);
  }
  .conn-check input { accent-color: var(--blue); }
  .conn-meta-pill {
    display: inline-flex; align-items: center;
    min-height: 28px; padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(8,15,28,0.7);
    color: var(--text-mid);
    font-family: var(--mono); font-size: 10.5px;
    letter-spacing: 0.06em; text-transform: uppercase;
  }

  .field { display: flex; flex-direction: column; gap: 5px; }
  .field label { font-size: 11px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); }
  .field input {
    background: var(--panel); border: 1px solid var(--border); border-radius: 5px;
    color: var(--text); font-family: var(--mono); font-size: 13px;
    padding: 8px 10px; outline: none; width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  }
  .field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-glow); background: var(--panel2); }
  .field input::placeholder { color: var(--muted); }
  .field input:disabled { opacity: 0.4; cursor: not-allowed; }

  .f-ip { flex: 2; min-width: 130px; }
  .f-port { flex: 0 0 95px; }
  .f-pass { flex: 2; min-width: 130px; }

  .btn {
    padding: 8px 22px; border: 1px solid transparent; border-radius: 5px;
    font-family: var(--sans); font-size: 13px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
    transition: all 0.18s; flex-shrink: 0; align-self: flex-end; height: 36px;
  }

  .btn-connect { background: linear-gradient(135deg, #0ea5e9, #0068b5); border-color: var(--blue); color: #fff; box-shadow: 0 2px 12px rgba(14,165,233,0.28); }
  .btn-connect:hover:not(:disabled) { background: linear-gradient(135deg, #38bdf8, #0ea5e9); box-shadow: 0 4px 20px rgba(14,165,233,0.42); transform: translateY(-1px); }
  .btn-connect:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; transform: none; }

  .btn-disconnect { background: rgba(244,63,94,0.08); border-color: var(--red); color: var(--red); }
  .btn-disconnect:hover { background: rgba(244,63,94,0.16); transform: translateY(-1px); }

  /* ── MAIN AREA ── */
  .main-area {
    flex: 1; display: flex; gap: 10px; min-height: 0;
  }

  /* ── CONSOLE ── */
  .console-wrap {
    flex: 1; display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 7px; overflow: hidden; min-height: 0; min-width: 0;
    transition: border-color 0.2s;
  }

  .console-wrap:focus-within { border-color: var(--border-hi); }

  .console-bar {
    display: flex; align-items: center; padding: 0 14px;
    border-bottom: 1px solid var(--border); flex-shrink: 0;
    gap: 0; background: var(--panel);
    height: 36px;
  }

  /* tab-style title */
  .cbar-tab {
    display: flex; align-items: center; gap: 7px;
    height: 100%; padding: 0 14px 0 0;
    border-right: 1px solid var(--border);
    margin-right: 14px;
  }

  .cbar-tab-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--blue); opacity: 0.5;
    flex-shrink: 0;
  }

  .cbar-tab-dot.active { opacity: 1; animation: spulse 2s ease-in-out infinite; }

  .cbar-title {
    font-size: 12px; font-family: var(--mono);
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-dim); flex: 1;
  }

  .cbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

  .cbar-refresh {
    font-size: 10.5px; font-family: var(--mono);
    color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase;
  }

  .btn-clear {
    background: transparent; border: 1px solid var(--border-hi); border-radius: 4px;
    color: var(--text-dim); font-family: var(--mono); font-size: 11px;
    font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 4px 11px; cursor: pointer; transition: all 0.15s;
  }

  .btn-clear:hover { border-color: var(--blue); color: var(--blue); }
  .console-tools {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(8,15,28,0.82), rgba(8,15,28,0.62));
  }
  .console-search {
    min-width: 220px; flex: 1;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 5px; color: var(--text);
    font-family: var(--mono); font-size: 12px;
    padding: 7px 10px; outline: none;
  }
  .console-search:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-glow); }
  .console-filter-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .console-filter-btn {
    background: rgba(255,255,255,0.02); border: 1px solid var(--border);
    border-radius: 999px; color: var(--text-dim);
    font-family: var(--mono); font-size: 10.5px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    padding: 5px 10px; cursor: pointer; transition: all 0.15s;
  }
  .console-filter-btn:hover { border-color: var(--border-hi); color: var(--text); }
  .console-filter-btn.active {
    border-color: rgba(14,165,233,0.38);
    background: rgba(14,165,233,0.12);
    color: var(--blue-vivid);
  }
  .console-count {
    margin-left: auto;
    font-family: var(--mono); font-size: 10.5px;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--muted);
  }
  .console-tools-actions { display: flex; align-items: center; gap: 8px; }

  .console-out {
    flex: 1; overflow-y: auto; padding: 10px 14px;
    font-family: var(--mono); font-size: 13px; line-height: 1.75; scroll-behavior: smooth;
  }

  .console-out::-webkit-scrollbar { width: 4px; }
  .console-out::-webkit-scrollbar-track { background: transparent; }
  .console-out::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 4px; }
  .console-out::-webkit-scrollbar-thumb:hover { background: var(--blue-dim); }

  .line { display: flex; gap: 10px; padding: 2px 0; }

  .lts { color: var(--muted); flex-shrink: 0; user-select: none; font-size: 11px; padding-top: 2px; min-width: 66px; }

  .ltag {
    flex-shrink: 0; font-size: 10.5px; font-weight: 700;
    letter-spacing: 0.06em; padding: 2px 6px; border-radius: 3px;
    align-self: flex-start; margin-top: 1px; min-width: 44px; text-align: center;
  }

  .tag-sys  { background: rgba(90,122,154,0.18);  color: var(--text-dim); }
  .tag-send { background: rgba(14,165,233,0.18);  color: var(--blue-vivid); }
  .tag-recv { background: rgba(34,211,160,0.14);  color: var(--green); }
  .tag-warn { background: rgba(251,191,36,0.14);  color: var(--yellow); }
  .tag-err  { background: rgba(244,63,94,0.14);   color: var(--red); }
  .tag-chat { background: rgba(167,139,250,0.14); color: #c4b5fd; }

  .lmsg { color: var(--text); word-break: break-all; font-size: 13px; }
  .lmsg.dimmed { color: var(--text-dim); }

  .empty-hint {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 10px; padding: 30px; color: var(--text-dim);
    font-family: var(--mono); font-size: 12.5px;
    text-align: center; letter-spacing: 0.05em;
  }

  .eicon { width: 50px; height: 50px; border: 1px solid var(--border-hi); border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--panel); margin-bottom: 4px; }
  .eicon svg { width: 22px; height: 22px; opacity: 0.3; fill: var(--blue); }

  .input-bar {
    display: flex; border-top: 1px solid var(--border);
    flex-shrink: 0; background: var(--panel);
  }

  /* Mode selector sits left of prompt */
  .input-mode-wrap {
    display: flex; align-items: center;
    border-right: 1px solid var(--border);
    flex-shrink: 0; position: relative;
  }

  .input-mode-sel {
    appearance: none; -webkit-appearance: none;
    background: transparent;
    border: none; outline: none;
    color: var(--blue); font-family: var(--mono);
    font-size: 12.5px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    padding: 0 24px 0 13px;
    cursor: pointer; height: 100%;
  }

  .input-mode-sel option {
    background: var(--panel2); color: var(--text);
    font-size: 13px;
  }

  /* custom chevron */
  .input-mode-wrap::after {
    content: "▾";
    position: absolute; right: 7px;
    font-size: 10px; color: var(--text-dim);
    pointer-events: none;
  }

  /* Say mode colours the selector differently */
  .input-mode-sel.say-mode { color: #a78bfa; }

  .iprompt {
    padding: 0 12px; font-family: var(--mono); font-size: 13px;
    color: var(--blue); display: flex; align-items: center;
    user-select: none; border-right: 1px solid var(--border); flex-shrink: 0;
    transition: color 0.2s;
  }

  .iprompt.say-mode { color: #a78bfa; }

  .icmd {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text); font-family: var(--mono); font-size: 13px;
    padding: 11px 12px; caret-color: var(--blue);
  }

  .icmd::placeholder { color: var(--muted); }

  .btn-send {
    background: linear-gradient(135deg, #0ea5e9, #0068b5);
    border: none; border-left: 1px solid var(--blue-dim);
    color: #fff; font-family: var(--sans); font-size: 12.5px;
    font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    padding: 0 20px; cursor: pointer; transition: all 0.15s; flex-shrink: 0;
  }

  .btn-send:hover:not(:disabled) { background: linear-gradient(135deg, #38bdf8, #0ea5e9); }
  .btn-send:disabled { opacity: 0.3; cursor: not-allowed; }

  /* ── PLAYER LIST PANEL ── */
  .player-panel {
    width: 280px; flex-shrink: 0; display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 6px; overflow: hidden;
    box-shadow: 0 1px 8px rgba(0,0,0,0.25);
  }

  .player-bar {
    display: flex; align-items: center; padding: 0 12px;
    border-bottom: 1px solid var(--border); flex-shrink: 0;
    gap: 8px; background: var(--panel); height: 36px;
  }

  .player-bar-title {
    font-size: 12px; font-family: var(--mono);
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-dim); flex: 1;
  }

  .player-count-badge {
    background: rgba(14,165,233,0.14); border: 1px solid rgba(14,165,233,0.22);
    border-radius: 3px; padding: 2px 9px;
    font-size: 11px; font-family: var(--mono);
    color: var(--blue-vivid); font-weight: 700; letter-spacing: 0.04em;
  }

  .player-list { flex: 1; overflow-y: auto; padding: 8px 8px; }

  .player-list::-webkit-scrollbar { width: 3px; }
  .player-list::-webkit-scrollbar-track { background: transparent; }
  .player-list::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }

  /* accent color per player — cycles through hues */
  .player-item {
    display: flex; flex-direction: column;
    padding: 9px 10px 9px 12px;
    border-radius: 3px; margin-bottom: 5px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-left: 2px solid var(--accent, var(--blue-dim));
    transition: border-color 0.15s, background 0.15s, border-left-color 0.15s;
    gap: 6px;
  }

  .player-item:hover {
    background: var(--panel2);
    border-color: var(--border-hi);
    border-left-color: var(--accent, var(--blue));
  }

  /* top row: name + actions inline */
  .player-row1 {
    display: flex; align-items: center; gap: 6px; min-width: 0;
  }

  .player-name {
    flex: 1; font-size: 13.5px; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  }

  .player-actions { display: flex; gap: 4px; flex-shrink: 0; }

  /* search bar below player panel header */
  .player-search-wrap {
    padding: 7px 9px;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
    flex-shrink: 0;
  }

  .player-search {
    width: 100%; background: var(--bg);
    border: 1px solid var(--border); border-radius: 3px;
    color: var(--text); font-family: var(--mono); font-size: 12.5px;
    padding: 6px 10px; outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
  }

  .player-search:focus { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-glow); }
  .player-search::placeholder { color: var(--muted); }

  /* ping badge on player card */
  .player-ping {
    font-size: 11px; font-family: var(--mono); font-weight: 700;
    padding: 1px 6px; border-radius: 2px; flex-shrink: 0;
    letter-spacing: 0.04em;
  }

  .ping-good   { color: var(--green);  background: rgba(34,211,160,0.10); }
  .ping-ok     { color: var(--yellow); background: rgba(251,191,36,0.10); }
  .ping-bad    { color: var(--red);    background: rgba(244,63,94,0.10);  }

  /* ip + ping on same row */
  .player-ip-row {
    display: flex; align-items: center; gap: 6px;
  }

  /* bottom rows: ip then steam */
  .player-meta {
    display: flex; flex-direction: column; gap: 2px;
  }

  .player-ip {
    font-size: 12px; font-family: var(--mono); color: var(--text-mid);
    letter-spacing: 0.02em; flex: 1;
  }

  .player-steam {
    font-size: 11px; font-family: var(--mono); color: var(--muted);
    cursor: pointer; transition: color 0.15s; letter-spacing: 0.02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  .player-steam:hover { color: var(--blue-vivid); }

  .pbtn {
    font-size: 10.5px; font-family: var(--mono); font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase;
    border: 1px solid; border-radius: 2px; padding: 3px 8px;
    cursor: pointer; transition: all 0.12s; background: transparent;
  }

  .pbtn-kick { border-color: rgba(251,191,36,0.4); color: var(--yellow); }
  .pbtn-kick:hover { background: rgba(251,191,36,0.12); border-color: var(--yellow); }

  .pbtn-ban { border-color: rgba(244,63,94,0.4); color: var(--red); }
  .pbtn-ban:hover { background: rgba(244,63,94,0.12); border-color: var(--red); }

  .player-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; gap: 8px; color: var(--text-dim);
    font-family: var(--mono); font-size: 12px; text-align: center;
    letter-spacing: 0.05em; padding: 20px;
  }

  .player-empty svg { width: 26px; height: 26px; fill: var(--muted); margin-bottom: 4px; opacity: 0.5; }

  /* refresh spinner */
  .spin {
    width: 12px; height: 12px; border: 1.5px solid var(--border-hi);
    border-top-color: var(--blue); border-radius: 50%;
    animation: spin 0.8s linear infinite; display: none; flex-shrink: 0;
  }

  .spin.active { display: block; }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ── STATS BAR DRAWER BUTTONS ── */
  .stat-drawer-btns {
    display: flex; gap: 5px; align-items: center;
    padding: 6px 14px; flex-shrink: 0;
  }

  .d-open-btn {
    display: flex; align-items: center; gap: 5px;
    background: transparent; border: 1px solid var(--border);
    border-radius: 4px; padding: 5px 11px;
    font-size: 11px; font-family: var(--mono); font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-dim); cursor: pointer; transition: all 0.15s;
    white-space: nowrap;
  }

  .d-open-btn svg { width: 12px; height: 12px; fill: currentColor; flex-shrink: 0; }
  .d-open-btn:hover { border-color: var(--blue); color: var(--blue); }
  .d-open-btn.active { border-color: var(--blue); color: var(--blue); background: rgba(14,165,233,0.10); }

  /* ── BOTTOM DRAWER ── */
  .bottom-drawer {
    flex-shrink: 0; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 6px; max-height: 0;
    transition: max-height 0.28s ease, border-color 0.2s;
    display: flex;
    flex-direction: column;
  }

  .bottom-drawer.open { max-height: min(80vh, 880px); }

  .bottom-drawer.drawer-plugins.open { max-height: min(80vh, 880px); }
  .bottom-drawer.drawer-macros.open { max-height: min(80vh, 880px); }

  .dtab-bar {
    display: flex; align-items: center; height: 34px;
    border-bottom: 1px solid var(--border);
    background: var(--panel); flex-shrink: 0;
  }

  .dtab {
    height: 100%; padding: 0 18px;
    display: flex; align-items: center;
    font-size: 11px; font-family: var(--mono); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-dim); cursor: pointer;
    border: none; border-bottom: 2px solid transparent;
    background: transparent; transition: all 0.15s;
    user-select: none;
  }

  .dtab:hover { color: var(--text); }
  .dtab.active { color: var(--blue); border-bottom-color: var(--blue); }

  .dtab-close {
    margin-left: auto; margin-right: 10px;
    background: transparent; border: 1px solid var(--border); border-radius: 3px;
    font-size: 10px; font-family: var(--mono); font-weight: 700;
    color: var(--text-dim); cursor: pointer; padding: 3px 10px;
    letter-spacing: 0.06em; text-transform: uppercase;
    transition: all 0.15s;
  }

  .dtab-close:hover { border-color: var(--red); color: var(--red); }

  .drawer-body { padding: 12px 14px; overflow: hidden; flex: 1; min-height: 0; display: flex; }

  .bottom-drawer.drawer-plugins .drawer-body,
  .bottom-drawer.drawer-macros .drawer-body {
    flex: 1;
    min-height: 0;
    display: flex;
  }

  .dpane { display: none; }
  .dpane.active { display: flex; gap: 12px; align-items: stretch; flex: 1; min-height: 0; }

  .bottom-drawer.drawer-plugins .dpane.active {
    flex: 1;
    min-height: 0;
  }
  .bottom-drawer.drawer-macros .dpane.active {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
  }
  .bottom-drawer.drawer-macros .dpane.active::-webkit-scrollbar { width: 4px; }
  .bottom-drawer.drawer-macros .dpane.active::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 4px; }

  /* ── GAUGE PANE ── */
  .g-row { display: flex; gap: 10px; flex: 1; }

  .g-card {
    flex: 1; background: var(--panel); border: 1px solid var(--border);
    border-radius: 5px; padding: 8px 8px 6px;
    display: flex; flex-direction: column; align-items: center; min-width: 0;
  }

  .g-title {
    font-size: 10.5px; font-family: var(--mono);
    text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--text-dim); text-align: center; margin-bottom: 0;
  }

  .g-canvas-wrap { width: 100%; position: relative; }
  canvas.gc { width: 100%; display: block; height: 90px; }

  .g-val {
    font-size: 20px; font-weight: 800; color: #fff;
    line-height: 1; text-align: center;
    margin-top: -22px; position: relative; z-index: 1;
  }

  .g-unit {
    font-size: 9px; font-family: var(--mono); color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 0.1em; text-align: center;
    margin-top: 2px;
  }

  .g-range {
    display: flex; justify-content: space-between; width: 100%;
    font-size: 9px; font-family: var(--mono); color: var(--muted);
    margin-top: 3px; padding: 0 2px;
  }

  /* ── PLAYER TOOLS PANE ── */
  .tc-cards { display: flex; gap: 10px; flex: 1; }

  .tc-card {
    flex: 1; background: var(--panel); border: 1px solid var(--border);
    border-left: 2px solid var(--blue-dim);
    border-radius: 4px; padding: 10px 14px;
    display: flex; flex-direction: column; gap: 10px;
  }

  .tc-title {
    font-size: 10px; font-family: var(--mono); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--blue-vivid); display: block;
  }

  .tc-row {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  }

  .tc-lbl {
    font-size: 12px; font-family: var(--mono);
    color: var(--text-dim); flex-shrink: 0;
  }

  .tc-sel {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 3px; color: var(--text);
    font-family: var(--mono); font-size: 12px;
    padding: 5px 8px; outline: none; cursor: pointer;
    transition: border-color 0.15s; flex: 1; min-width: 80px;
  }

  .tc-sel-wide { flex: 2; min-width: 140px; }
  .tc-inp {
    background: var(--bg); border: 1px solid var(--border); border-radius: 3px;
    color: var(--text); font-family: var(--mono); font-size: 12px;
    padding: 5px 8px; outline: none; width: 60px; flex-shrink: 0;
    transition: border-color 0.15s;
  }

  .tc-sel:focus, .tc-inp:focus { border-color: var(--blue); }
  .tc-sel:disabled, .tc-inp:disabled { opacity: 0.4; cursor: not-allowed; }

  .tc-btn {
    background: linear-gradient(135deg, #0ea5e9, #0068b5);
    border: none; border-radius: 4px; color: #fff;
    font-family: var(--sans); font-size: 12px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    padding: 6px 16px; cursor: pointer; transition: all 0.15s;
    white-space: nowrap; flex-shrink: 0;
  }

  .tc-btn:hover:not(:disabled) { background: linear-gradient(135deg, #38bdf8, #0ea5e9); transform: translateY(-1px); }
  .tc-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

  .tc-btn-owner { background: linear-gradient(135deg, #22d3a0, #0d9e76); }
  .tc-btn-owner:hover:not(:disabled) { background: linear-gradient(135deg, #34d399, #22d3a0); }

  .tc-btn-mod { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
  .tc-btn-mod:hover:not(:disabled) { background: linear-gradient(135deg, #c4b5fd, #a78bfa); }

  .tc-btn-danger { background: linear-gradient(135deg, #f43f5e, #be123c); }
  .tc-btn-danger:hover:not(:disabled) { background: linear-gradient(135deg, #fb7185, #f43f5e); }

  .tc-inp-steam { width: 180px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; flex-shrink: 0; }
  .tc-sel-player { flex: 1; min-width: 160px; }
  .tc-row-wrap { flex-wrap: wrap; gap: 6px; }

  .tc-hint {
    font-size: 11px; color: var(--text-dim); margin-top: 6px;
    font-family: var(--mono); letter-spacing: 0.02em;
  }
  .tc-hint code {
    color: var(--blue-vivid, #38bdf8);
    background: rgba(14,165,233,0.1);
    padding: 1px 5px; border-radius: 3px;
  }


  /* Taller drawer for config tab */
  .bottom-drawer.open { max-height: min(80vh, 880px); }

  /* Config pane layout */
  .cfg-layout { display: flex; gap: 12px; width: 100%; }

  .cfg-col { display: flex; flex-direction: column; flex: 1; min-width: 0; }
  .cfg-col-desc { flex: 2; }

  .cfg-label {
    font-size: 10.5px; font-family: var(--mono);
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-dim); display: flex; align-items: center;
    gap: 6px; margin-bottom: 5px;
  }

  .cfg-loading {
    font-size: 9px; color: var(--muted); font-style: italic;
    text-transform: none; letter-spacing: 0;
  }

  .cfg-hint {
    font-size: 9.5px; color: var(--muted); font-family: var(--mono);
    letter-spacing: 0.04em; text-transform: none; font-weight: 400;
  }

  .cfg-row { display: flex; gap: 7px; align-items: center; }

  .cfg-inp {
    flex: 1; background: var(--bg); border: 1px solid var(--border);
    border-radius: 3px; color: var(--text);
    font-family: var(--mono); font-size: 12px;
    padding: 6px 9px; outline: none; transition: border-color 0.15s;
  }

  .cfg-inp:focus { border-color: var(--blue); }
  .cfg-inp::placeholder { color: var(--muted); }

  .cfg-field-group { display: flex; flex-direction: column; }

  .cfg-writecfg {
    background: linear-gradient(135deg, #22d3a0, #0d8060) !important;
  }

  /* Header image preview */
  .cfg-img-preview {
    width: 100%; height: 70px; border: 1px solid var(--border);
    border-radius: 4px; overflow: hidden; cursor: pointer;
    background: var(--bg); position: relative;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.15s;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }

  .cfg-img-preview:hover { border-color: var(--blue); }

  .cfg-img-preview img {
    width: 100%; height: 100%; object-fit: cover; display: block;
  }

  .cfg-img-placeholder {
    font-size: 10.5px; font-family: var(--mono); color: var(--muted);
    letter-spacing: 0.06em; pointer-events: none;
  }

  .cfg-img-overlay {
    position: absolute; inset: 0;
    background: rgba(14,165,233,0.7);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-family: var(--mono); font-weight: 700;
    color: #fff; letter-spacing: 0.1em; text-transform: uppercase;
    opacity: 0; transition: opacity 0.15s;
  }

  .cfg-img-preview:hover .cfg-img-overlay { opacity: 1; }

  /* Description line builder */
  .cfg-lines {
    display: flex; flex-direction: column; gap: 3px;
    max-height: 108px; overflow-y: auto; margin-bottom: 4px;
  }

  .cfg-lines::-webkit-scrollbar { width: 3px; }
  .cfg-lines::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }

  .cfg-line-row {
    display: flex; gap: 5px; align-items: center;
  }

  .cfg-line-num {
    font-size: 9.5px; font-family: var(--mono); color: var(--muted);
    width: 16px; text-align: right; flex-shrink: 0; user-select: none;
  }

  .cfg-line-inp {
    flex: 1; background: var(--bg); border: 1px solid var(--border);
    border-radius: 3px; color: var(--text);
    font-family: var(--mono); font-size: 12px;
    padding: 4px 8px; outline: none; transition: border-color 0.15s;
  }

  .cfg-line-inp:focus { border-color: var(--blue); }
  .cfg-line-inp::placeholder { color: var(--muted); }

  .cfg-line-del {
    background: transparent; border: none; color: var(--muted);
    font-size: 13px; cursor: pointer; padding: 0 3px; line-height: 1;
    transition: color 0.12s; flex-shrink: 0;
  }

  .cfg-line-del:hover { color: var(--red); }

  .cfg-add-line {
    background: transparent; border: 1px dashed var(--border);
    border-radius: 3px; color: var(--text-dim);
    font-family: var(--mono); font-size: 10.5px;
    padding: 4px 8px; cursor: pointer; width: 100%;
    transition: all 0.12s; text-align: left;
  }

  .cfg-add-line:hover { border-color: var(--blue); color: var(--blue); }

  /* Format preview */
  .cfg-fmt-preview {
    margin-top: 5px; background: var(--bg);
    border: 1px solid var(--border-hi); border-radius: 3px;
    padding: 6px 9px;
  }

  .cfg-fmt-preview-label {
    font-size: 9.5px; font-family: var(--mono); color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px;
  }

  .cfg-fmt-preview-text {
    font-family: var(--mono); font-size: 11.5px; color: var(--text);
    white-space: pre-wrap; word-break: break-all;
    max-height: 48px; overflow-y: auto; line-height: 1.5;
  }

  .cfg-fmt-btn {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 3px; color: var(--text-mid);
    font-family: var(--mono); font-size: 10.5px;
    padding: 3px 8px; cursor: pointer; transition: all 0.12s;
  }

  .cfg-fmt-btn:hover { border-color: var(--blue); color: var(--blue); }
  .cfg-tmpl { color: var(--blue-vivid); border-color: rgba(14,165,233,0.3); }
  .cfg-tmpl:hover { background: rgba(14,165,233,0.1); }

  .pm-layout {
    display: flex; gap: 12px; width: 100%;
    align-items: stretch;
  }

  .pm-card { min-width: 0; }
  .pm-controls { flex: 0 0 320px; }
  .pm-list-card { flex: 1; }
  .pm-status-row { min-height: 18px; }

  .bottom-drawer.drawer-plugins .pm-layout {
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: 10px;
  }

  .bottom-drawer.drawer-plugins .pm-controls { flex: 0 0 auto; }
  .bottom-drawer.drawer-plugins .pm-list-card {
    flex: 1;
    min-height: 0;
  }

  .pm-summary {
    display: flex; gap: 7px; flex-wrap: wrap;
  }

  .pm-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 9px; border-radius: 999px;
    border: 1px solid var(--border);
    font-family: var(--mono); font-size: 10.5px;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-dim);
  }

  .pm-pill strong {
    color: #fff; font-size: 11.5px; font-weight: 700;
  }

  .pm-pill-loaded {
    border-color: rgba(34,211,160,0.3);
    color: var(--green);
    background: rgba(34,211,160,0.08);
  }

  .pm-pill-unloaded {
    border-color: rgba(251,191,36,0.3);
    color: var(--yellow);
    background: rgba(251,191,36,0.08);
  }

  .pm-pill-failed {
    border-color: rgba(244,63,94,0.3);
    color: var(--red);
    background: rgba(244,63,94,0.08);
  }

  .pm-filter-stack {
    display: flex; flex-direction: column; gap: 7px;
  }
  .pm-search-inp { width: 100%; min-width: 0; }
  .pm-check {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--mono); font-size: 10.5px;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-dim);
  }
  .pm-check input { accent-color: var(--red); }
  .pm-load-inp { flex: 1; width: auto; min-width: 160px; }

  .pm-head,
  .pm-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.95fr) 104px 96px minmax(150px, 0.95fr) minmax(220px, 1.25fr) 152px;
    gap: 12px;
    align-items: center;
  }

  .pm-head {
    padding: 2px 8px 10px;
    border-bottom: 1px solid var(--border);
  }

  .bottom-drawer.drawer-plugins .pm-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--panel);
    padding-top: 2px;
  }

  .pm-col {
    font-size: 10px; font-family: var(--mono); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-dim);
  }

  .pm-list-wrap {
    flex: 1; min-height: 0; overflow-y: auto;
    padding-right: 6px;
  }

  .bottom-drawer.drawer-plugins .pm-list-wrap {
    min-height: 220px;
  }

  .pm-list-wrap::-webkit-scrollbar { width: 4px; }
  .pm-list-wrap::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 4px; }

  .pm-list {
    display: flex; flex-direction: column; gap: 10px;
    padding: 10px 2px 6px;
  }

  .pm-row {
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel);
    transition: border-color 0.15s, background 0.15s;
    align-items: start;
  }

  .pm-row:hover {
    border-color: var(--border-hi);
    background: var(--panel2);
  }

  .pm-cell {
    min-width: 0;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--text);
  }

  .pm-cell-name {
    display: flex; flex-direction: column; gap: 5px;
  }

  .pm-name {
    font-weight: 600;
    font-size: 13.5px;
    line-height: 1.35;
    white-space: normal; overflow: visible; text-overflow: clip;
  }

  .pm-file {
    font-size: 11px;
    font-family: var(--mono);
    color: var(--muted);
    line-height: 1.45;
    white-space: normal; overflow: visible; text-overflow: clip;
    word-break: break-word;
  }

  .pm-cell-version,
  .pm-cell-author,
  .pm-cell-detail {
    white-space: normal; overflow: visible; text-overflow: clip;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .pm-cell-version {
    font-weight: 600;
  }

  .pm-cell-author {
    color: var(--text-mid);
  }

  .pm-cell-detail {
    color: var(--text-mid);
  }

  .pm-state {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 76px; padding: 4px 8px; border-radius: 999px;
    font-family: var(--mono); font-size: 10px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    border: 1px solid transparent;
  }

  .pm-state-loaded {
    color: var(--green);
    border-color: rgba(34,211,160,0.28);
    background: rgba(34,211,160,0.12);
  }

  .pm-state-unloaded {
    color: var(--yellow);
    border-color: rgba(251,191,36,0.28);
    background: rgba(251,191,36,0.12);
  }

  .pm-state-failed {
    color: var(--red);
    border-color: rgba(244,63,94,0.28);
    background: rgba(244,63,94,0.12);
  }

  .pm-cell-actions {
    display: flex; gap: 8px; justify-content: flex-end;
    flex-wrap: wrap;
    align-self: center;
  }

  .pm-btn {
    min-width: 78px;
    padding-left: 12px; padding-right: 12px;
  }

  .pm-empty {
    display: flex; align-items: center; justify-content: center;
    min-height: 150px; padding: 20px;
    text-align: center;
    font-family: var(--mono); font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 0.05em;
  }

  .macro-layout {
    display: flex; flex-direction: column; gap: 10px; width: 100%;
    min-height: 0;
  }
  .macro-card { min-width: 0; }
  .macro-editor-card { flex: 0 0 auto; }
  .macro-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap;
  }
  .macro-name-inp { flex: 0 0 220px; min-width: 180px; }
  .macro-cmd-inp { flex: 1; min-width: 280px; }
  .macro-list {
    display: flex; flex-direction: column; gap: 8px;
    min-height: 0;
  }
  .macro-item {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--panel);
  }
  .macro-copy {
    min-width: 0; flex: 1;
    display: flex; flex-direction: column; gap: 4px;
  }
  .macro-name {
    color: var(--text);
    font-size: 13px; font-weight: 600;
  }
  .macro-command {
    color: var(--blue-vivid);
    font-family: var(--mono); font-size: 11px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .macro-note {
    color: var(--text-dim);
    font-size: 11px;
  }
  .macro-actions {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  }
  .macro-btn { min-width: 60px; }
  .macro-empty {
    min-height: 88px;
  }


  /* ═══════════════════════════════════════════════════════
     READABILITY + RESPONSIVE OVERHAUL
     ═══════════════════════════════════════════════════════ */

  /* ── Base size bump ── */
  html, body { font-size: 16px; }

  /* ── Bigger console text ── */
  .console-out  { font-size: 14px; line-height: 1.8; }
  .lmsg         { font-size: 14px; }
  .lts          { font-size: 12px; min-width: 72px; }
  .ltag         { font-size: 11px; min-width: 46px; padding: 2px 7px; }

  /* ── Input bar bigger ── */
  .icmd         { font-size: 14px; padding: 13px 12px; }
  .iprompt      { font-size: 14px; }
  .input-mode-sel { font-size: 13px; }
  .btn-send     { font-size: 13px; padding: 0 22px; }

  /* ── Player panel bigger ── */
  .player-bar   { height: 40px; }
  .player-bar-title { font-size: 13px; }
  .player-count-badge { font-size: 12px; padding: 3px 10px; }
  .player-name  { font-size: 14px; }
  .player-ip    { font-size: 12px; }
  .player-steam { font-size: 11px; }
  .player-ping  { font-size: 12px; padding: 2px 7px; }
  .player-search { font-size: 13px; padding: 7px 11px; }
  .pbtn         { font-size: 11px; padding: 3px 9px; }

  /* ── Stats strip bigger ── */
  .stat-label   { font-size: 11px; }
  .stat-value   { font-size: 24px; }
  .stat-value.mono { font-size: 15px; }
  .stat-value .sub { font-size: 15px; }
  .fps-scale-lbl { font-size: 11px; }
  .fps-window-lbl { font-size: 11px; }

  /* ── Connection panel bigger ── */
  .ctlabel      { font-size: 13px; }
  .field label  { font-size: 12px; }
  .field input  { font-size: 14px; padding: 9px 11px; }
  .btn          { font-size: 14px; height: 38px; padding: 8px 22px; }

  /* ── Console bar bigger ── */
  .cbar-title   { font-size: 13px; }
  .btn-clear    { font-size: 12px; padding: 5px 13px; }

  /* ── Status badge ── */
  .status-badge { font-size: 13px; padding: 6px 15px; }

  /* ── Header label ── */
  .hlabel       { font-size: 13px; }
  .logo-img     { height: 36px; }

  /* ── Notice ── */
  .notice       { font-size: 13px; }

  /* ── Drawer buttons ── */
  .d-open-btn   { font-size: 12px; padding: 6px 13px; }
  .dtab         { font-size: 12px; padding: 0 20px; }
  .dtab-close   { font-size: 11px; padding: 4px 12px; }

  /* ── Gauge ── */
  .g-title      { font-size: 12px; }
  .g-val        { font-size: 22px; }
  .g-unit       { font-size: 10px; }

  /* ── Player tools / config ── */
  .tc-title     { font-size: 11px; }
  .tc-lbl       { font-size: 13px; }
  .tc-sel       { font-size: 13px; padding: 6px 9px; }
  .tc-inp       { font-size: 13px; padding: 6px 9px; }
  .tc-btn       { font-size: 13px; padding: 7px 18px; }
  .cfg-label    { font-size: 12px; }
  .cfg-inp      { font-size: 13px; padding: 7px 10px; }
  .cfg-line-inp { font-size: 13px; }
  .cfg-textarea { font-size: 13px; }
  .cfg-fmt-btn  { font-size: 11.5px; padding: 4px 10px; }
  .cfg-hint     { font-size: 10.5px; }


  /* ═══════════════════════════════════════════════════════
     MOBILE — stack everything, make it scrollable
     ═══════════════════════════════════════════════════════ */

  @media (max-width: 767px) {

    /* ── Base ── */
    html, body { overflow: auto; height: auto; font-size: 14px; }

    .app {
      height: auto; min-height: 100vh;
      padding: 8px 10px 24px;
      gap: 8px; overflow: visible;
    }

    /* ── Header ── */
    .header { flex-wrap: wrap; gap: 8px; padding-bottom: 8px; }
    .hdivider, .hlabel, .hspacer { display: none; }
    .logo-img { height: 26px; }
    .status-badge { font-size: 11px; padding: 4px 10px; margin-left: auto; }

    /* ── Stats strip: scrolls horizontally, compact segments ── */
    .stats-bar {
      overflow-x: auto; flex-wrap: nowrap;
      -webkit-overflow-scrolling: touch;
      border-radius: 5px;
    }
    .stat-sep { margin: 6px 0; }
    .stat-seg { padding: 8px 12px; flex-shrink: 0; }
    .stat-seg-host { display: none; }
    .stat-sep-host { display: none; }
    .stat-label { font-size: 9px; }
    .stat-value { font-size: 17px; margin-top: 2px; }
    .stat-value.mono { font-size: 13px; }
    .stat-value .sub { font-size: 13px; }

    /* FPS chart: smaller on mobile */
    .stat-seg-fps { gap: 8px; }
    .fps-num-wrap { min-width: 40px; }
    .fps-canvas-wrap { width: 100px; height: 40px; min-width: 100px; }
    canvas#fpsChart  { height: 40px; }
    .fps-scale-lbl { font-size: 9px; }
    .fps-window-lbl { font-size: 9px; }

    /* Drawer buttons: icon only, no label */
    .stat-drawer-btns { padding: 6px 8px; gap: 4px; flex-shrink: 0; }
    .d-open-btn { padding: 7px 9px; font-size: 0; gap: 0; border-radius: 5px; }
    .d-open-btn svg { display: block; width: 16px; height: 16px; }
    .d-open-btn.active { background: rgba(14,165,233,0.15); }

    /* ── Notices ── */
    .notice { font-size: 11px; padding: 6px 10px; }

    /* ── Connection panel ── */
    .conn-toggle { padding: 8px 12px; }
    .ctlabel { font-size: 12px; }
    .conn-body { padding: 10px 12px; }
    .conn-row { flex-direction: column; gap: 8px; }
    .f-ip, .f-port, .f-pass { flex: none; width: 100%; }
    .field input { font-size: 15px; padding: 10px 12px; }
    .field label { font-size: 11px; }
    .conn-meta-row { flex-direction: column; align-items: stretch; gap: 8px; }
    .conn-meta-pill { width: 100%; justify-content: center; min-height: 34px; }
    .btn-connect, .btn-disconnect {
      width: 100%; justify-content: center;
      height: 46px; font-size: 15px; margin-top: 2px;
    }

    /* ── Main area: stacked ── */
    .main-area { flex-direction: column; gap: 8px; min-height: 0; }

    /* ── Console ── */
    .console-wrap { height: 320px; flex: none; border-radius: 5px; }
    .console-bar { height: 34px; padding: 0 10px; }
    .cbar-title { font-size: 11px; }
    .btn-clear { font-size: 11px; padding: 4px 10px; }
    .cbar-right { gap: 6px; }
    .cbar-refresh { display: none; }
    .console-tools { padding: 8px 10px; gap: 8px; }
    .console-search { min-width: 0; width: 100%; }
    .console-filter-group { width: 100%; }
    .console-count { margin-left: 0; }
    .console-tools-actions { width: 100%; justify-content: flex-end; }
    .console-out { font-size: 12.5px; padding: 8px 10px; line-height: 1.7; }
    .lts { font-size: 10.5px; min-width: 60px; }
    .ltag { font-size: 10px; min-width: 38px; padding: 2px 5px; }
    .lmsg { font-size: 12.5px; }

    /* ── Input bar ── */
    .input-mode-wrap { min-width: 0; }
    .input-mode-sel { font-size: 11px; padding: 0 18px 0 8px; }
    .iprompt { font-size: 12px; padding: 0 8px; }
    .icmd { font-size: 13px; padding: 11px 8px; }
    .btn-send { padding: 0 14px; font-size: 12px; letter-spacing: 0.06em; }

    /* ── Player panel ── */
    .player-panel { width: 100%; height: 280px; flex: none; border-radius: 5px; }
    .player-bar { height: 38px; padding: 0 10px; }
    .player-bar-title { font-size: 12px; }
    .player-count-badge { font-size: 11px; padding: 2px 8px; }
    .player-expand-btn { width: 26px; height: 26px; }
    .player-search { font-size: 12px; padding: 6px 9px; }
    .player-name { font-size: 13px; }
    .player-ip { font-size: 11px; }
    .player-steam { font-size: 10px; }
    .player-ping { font-size: 10px; padding: 1px 5px; }
    .pbtn { font-size: 10px; padding: 3px 7px; }
    .player-item { padding: 7px 8px 7px 10px; gap: 4px; }

    /* ── Bottom drawer ── */
    .bottom-drawer.open { max-height: min(80vh, 880px); }
    .dtab-bar { height: 32px; }
    .dtab { font-size: 10px; padding: 0 12px; }
    .dtab-close { font-size: 10px; padding: 3px 9px; }
    .drawer-body { padding: 8px 10px; }

    /* Performance gauges: 3 across, smaller */
    .g-row { gap: 5px; }
    .g-card { padding: 5px 4px 4px; }
    .g-title { font-size: 9px; letter-spacing: 0.08em; }
    .g-val { font-size: 15px; margin-top: -16px; }
    .g-unit { font-size: 8px; margin-top: 1px; }
    .g-range { font-size: 8px; }
    canvas.gc { height: 64px; }

    /* Player tools: stack cards */
    .tc-cards { flex-direction: column; gap: 7px; }
    .tc-card { padding: 8px 10px; gap: 7px; }
    .tc-title { font-size: 9px; }
    .tc-lbl { font-size: 12px; }
    .tc-sel { font-size: 12px; padding: 5px 7px; }
    .tc-inp { font-size: 12px; padding: 5px 7px; width: 54px; }
    .tc-btn { font-size: 11px; padding: 6px 12px; }
    .tc-row { flex-wrap: wrap; gap: 6px; }

    /* Server config: stack columns */
    .cfg-layout { flex-direction: column; gap: 8px; }
    .cfg-col { max-width: none !important; }
    .cfg-col-desc { flex: none; }
    .cfg-label { font-size: 10px; }
    .cfg-inp { font-size: 12px; padding: 6px 8px; }
    .cfg-line-inp { font-size: 12px; }
    .cfg-hint { font-size: 9px; }
    .cfg-fmt-btn { font-size: 10px; padding: 3px 8px; }
    .cfg-img-preview { height: 56px; }

    .pm-layout { flex-direction: column; gap: 8px; }
    .pm-controls { flex-basis: auto; }
    .pm-summary { gap: 5px; }
    .pm-pill { font-size: 9px; padding: 4px 7px; }
    .pm-pill strong { font-size: 10px; }
    .pm-head,
    .pm-row {
      grid-template-columns: minmax(110px, 1fr) 78px 92px;
      gap: 6px;
    }
    .pm-col-version,
    .pm-col-author,
    .pm-col-detail,
    .pm-cell-version,
    .pm-cell-author,
    .pm-cell-detail { display: none; }
    .pm-row { padding: 10px; }
    .pm-cell { font-size: 11px; }
    .pm-name { font-size: 12.5px; }
    .pm-file { font-size: 9.5px; }
    .pm-state { min-width: 64px; font-size: 9px; padding: 3px 6px; }
    .pm-cell-actions { gap: 4px; }
    .pm-btn { min-width: 56px; font-size: 10px; padding: 6px 10px; }
    .pm-empty { min-height: 120px; font-size: 11px; padding: 16px; }
    .pm-search-inp { width: 100%; }
    .macro-name-inp, .macro-cmd-inp { min-width: 0; width: 100%; flex: 1 1 100%; }
    .macro-item { align-items: flex-start; }
    .macro-actions { width: 100%; justify-content: flex-end; }

    /* Player popup: full width on mobile */
    .pp-modal { max-width: 100%; border-radius: 8px; }
    .pp-header { padding: 12px 14px 10px; }
    .pp-name { font-size: 15px; }
    .pp-flag-img { height: 20px; }
    .pp-body { padding: 10px 14px; gap: 8px; }
    .pp-stat { padding: 7px 10px; }
    .pp-stat-label { font-size: 9px; }
    .pp-stat-val { font-size: 13px; }
    .pp-stat-val.big { font-size: 17px; }
    .pp-stat-val.sm { font-size: 11px; }
    .pp-steam-id { font-size: 11px; }
    .pp-btn { font-size: 12px; padding: 8px; }
    .pp-msg-inp { font-size: 12px; padding: 6px 9px; }
    .pp-msg-btn { font-size: 12px; padding: 6px 12px; }

    /* Roster overlay: edge to edge */
    .roster-overlay { padding: 0; align-items: flex-end; }
    .roster-modal { border-radius: 10px 10px 0 0; max-width: 100%; min-height: 60vh; }
    .roster-header { padding: 12px 14px; gap: 8px; }
    .roster-title { font-size: 14px; }
    .roster-search { font-size: 12px; padding: 6px 10px; min-width: 0; flex: 1; }
    .roster-close { font-size: 11px; padding: 6px 12px; }
    .rt-head { grid-template-columns: 28px 1fr 70px 100px; padding: 5px 12px; }
    .rt-row  { grid-template-columns: 28px 1fr 70px 100px; padding: 0 12px; min-height: 38px; }
    .rt-hide-mobile { display: none; }
    .rt-cell { font-size: 12px; padding: 0 4px; }
    .rt-cell-num { font-size: 10px; }
    .rt-btn { font-size: 9px; padding: 3px 6px; }
    .roster-body { max-height: 55vh; }
  }


  /* ═══════════════════════════════════════════════════════
     TABLET — 768–1023px: side-by-side but adapted
     ═══════════════════════════════════════════════════════ */

  @media (min-width: 768px) and (max-width: 1023px) {

    .player-panel { width: 240px; }

    .stats-bar { flex-wrap: nowrap; overflow-x: auto; }
    .fps-canvas-wrap { width: 120px; }

    .bottom-drawer.open { max-height: min(80vh, 880px); }

    .d-open-btn svg { display: none; }
    .d-open-btn { padding: 5px 10px; }
    .pm-controls { flex-basis: 280px; }
    .pm-head,
    .pm-row {
      grid-template-columns: minmax(180px, 1.65fr) 88px 84px minmax(120px, 0.95fr) minmax(160px, 1.05fr) 138px;
    }
  }


  /* ═══════════════════════════════════════════════════════
     LARGE DESKTOP — 1400px+: give everything more room
     ═══════════════════════════════════════════════════════ */

  @media (min-width: 1400px) {
    html, body { font-size: 17px; }
    .console-out { font-size: 15px; }
    .lmsg        { font-size: 15px; }
    .player-panel { width: 320px; }
    .player-name  { font-size: 15px; }
    .lts          { font-size: 13px; min-width: 78px; }
  }


  /* ── PLAYER CARD: compact card gets an info button ── */
  .pbtn-info {
    border-color: rgba(14,165,233,0.4); color: var(--blue-vivid);
    margin-right: 2px;
  }
  .pbtn-info:hover { background: rgba(14,165,233,0.12); border-color: var(--blue); }

  .player-flag {
    display: flex; align-items: center; justify-content: center;
    min-width: 18px; flex-shrink: 0; line-height: 1;
  }

  .player-flag-img {
    display: block;
    width: auto;
    height: 12px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
  }

  .player-conntime {
    font-size: 10px; font-family: var(--mono); color: var(--muted);
    flex-shrink: 0;
  }

  /* ── PLAYER POPUP MODAL ── */
  .pp-overlay {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,0.72);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.18s;
  }

  .pp-overlay.open {
    opacity: 1; pointer-events: all;
  }

  .pp-modal {
    background: var(--surface);
    border: 1px solid var(--border-hi);
    border-radius: 10px;
    width: 100%; max-width: 480px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(14,165,233,0.08);
    overflow: hidden;
    transform: translateY(12px);
    transition: transform 0.18s;
  }

  .pp-overlay.open .pp-modal { transform: translateY(0); }

  /* Accent top border — colour set per-player via JS */
  .pp-modal-top {
    height: 3px;
    background: var(--blue);
    flex-shrink: 0;
  }

  .pp-header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--border);
  }

  .pp-flag {
    min-width: 32px; min-height: 24px;
    flex-shrink: 0; line-height: 1;
    display: flex; align-items: center; justify-content: center;
  }

  .pp-flag-img {
    display: block;
    width: auto;
    height: 24px;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.1);
  }

  .pp-name {
    font-size: 17px; font-weight: 700; color: #fff;
    flex: 1; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  .pp-close {
    background: transparent; border: 1px solid var(--border);
    border-radius: 5px; color: var(--text-dim);
    font-size: 14px; width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.15s; flex-shrink: 0;
  }

  .pp-close:hover { border-color: var(--red); color: var(--red); }

  .pp-body { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }

  /* Stat grid */
  .pp-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .pp-stat {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 5px; padding: 9px 12px;
  }

  .pp-stat-label {
    font-size: 9.5px; font-family: var(--mono);
    text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--text-dim); display: block; margin-bottom: 3px;
  }

  .pp-stat-val {
    font-size: 15px; font-weight: 600; color: #fff;
    font-family: var(--mono); word-break: break-all;
  }

  .pp-stat-val.big { font-size: 20px; font-weight: 800; }
  .pp-stat-val.sm  { font-size: 12px; }

  /* Steam link row */
  .pp-steam-row {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 5px;
  }

  .pp-steam-id {
    flex: 1; font-size: 12px; font-family: var(--mono); color: var(--text-mid);
    min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  .pp-steam-copy {
    background: transparent; border: 1px solid var(--border);
    border-radius: 3px; color: var(--text-dim);
    font-family: var(--mono); font-size: 10px;
    padding: 3px 8px; cursor: pointer; transition: all 0.12s; flex-shrink: 0;
  }

  .pp-steam-copy:hover { border-color: var(--blue); color: var(--blue); }

  .pp-steam-link {
    color: var(--blue-vivid); text-decoration: none;
    font-size: 10px; font-family: var(--mono);
    border: 1px solid rgba(14,165,233,0.3); border-radius: 3px;
    padding: 3px 8px; transition: all 0.12s; flex-shrink: 0;
  }

  .pp-steam-link:hover { background: rgba(14,165,233,0.1); }

  /* Action buttons in popup */
  .pp-actions {
    display: flex; gap: 8px;
  }

  .pp-btn {
    flex: 1; padding: 9px; border: 1px solid; border-radius: 5px;
    font-family: var(--sans); font-size: 13px; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase;
    cursor: pointer; transition: all 0.15s; text-align: center;
  }

  .pp-btn-kick { background: rgba(251,191,36,0.08); border-color: rgba(251,191,36,0.4); color: var(--yellow); }
  .pp-btn-kick:hover { background: rgba(251,191,36,0.16); border-color: var(--yellow); }

  .pp-btn-ban  { background: rgba(244,63,94,0.08);  border-color: rgba(244,63,94,0.4);  color: var(--red); }
  .pp-btn-ban:hover  { background: rgba(244,63,94,0.16); border-color: var(--red); }

  /* Loading spinner inside popup */
  .pp-loading {
    font-size: 11px; font-family: var(--mono); color: var(--muted);
    text-align: center; padding: 4px 0; letter-spacing: 0.06em;
  }

  /* Country name under flag */
  .pp-country {
    font-size: 11px; font-family: var(--mono); color: var(--text-dim);
    text-align: center; margin-top: 2px;
  }

  .pp-flag-wrap {
    display: flex; flex-direction: column; align-items: center;
    flex-shrink: 0;
  }


  /* ── Expand button in player panel header ── */
  .player-expand-btn {
    background: transparent; border: 1px solid var(--border);
    border-radius: 4px; color: var(--text-dim);
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.15s; flex-shrink: 0;
    margin-left: 4px;
  }
  .player-expand-btn svg { width: 15px; height: 15px; }
  .player-expand-btn:hover { border-color: var(--blue); color: var(--blue); }

  /* ── Roster overlay ── */
  .roster-overlay {
    position: fixed; inset: 0; z-index: 8000;
    background: rgba(0,0,0,0.80);
    backdrop-filter: blur(4px);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 24px 20px;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s;
    overflow-y: auto;
  }

  .roster-overlay.open {
    opacity: 1; pointer-events: all;
  }

  .roster-modal {
    background: var(--surface);
    border: 1px solid var(--border-hi);
    border-radius: 10px;
    width: 100%; max-width: 1100px;
    min-height: 300px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.7);
    overflow: hidden;
    transform: translateY(16px);
    transition: transform 0.2s;
  }

  .roster-overlay.open .roster-modal { transform: translateY(0); }

  .roster-header {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
    flex-wrap: wrap;
  }

  .roster-title-wrap { display: flex; align-items: baseline; gap: 10px; flex-shrink: 0; }

  .roster-title {
    font-size: 16px; font-weight: 800; color: #fff;
    letter-spacing: 0.06em; text-transform: uppercase;
  }

  .roster-count {
    font-size: 11px; font-family: var(--mono); color: var(--text-dim);
    letter-spacing: 0.06em;
  }

  .roster-search {
    flex: 1; min-width: 200px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 5px; color: var(--text);
    font-family: var(--mono); font-size: 13px;
    padding: 7px 12px; outline: none;
    transition: border-color 0.15s;
  }
  .roster-search:focus { border-color: var(--blue); }
  .roster-search::placeholder { color: var(--muted); }

  .roster-close {
    background: transparent; border: 1px solid var(--border);
    border-radius: 5px; color: var(--text-dim);
    font-family: var(--mono); font-size: 12px;
    padding: 7px 16px; cursor: pointer; transition: all 0.15s;
    flex-shrink: 0;
  }
  .roster-close:hover { border-color: var(--red); color: var(--red); }

  /* ── Roster table layout ── */
  .roster-body {
    padding: 0;
    display: flex; flex-direction: column;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
  }

  .roster-body::-webkit-scrollbar { width: 4px; }
  .roster-body::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 4px; }

  .roster-empty {
    text-align: center; padding: 48px;
    font-family: var(--mono); font-size: 13px; color: var(--text-dim);
  }

  /* Column header row */
  .rt-head {
    display: grid;
    grid-template-columns: 32px 130px 1fr 110px 100px 80px 90px 120px;
    gap: 0;
    padding: 6px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky; top: 0; z-index: 2;
  }

  .rt-col {
    font-size: 9.5px; font-family: var(--mono);
    text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--text-dim); padding: 0 6px;
    display: flex; align-items: center;
  }

  /* Data row */
  .rt-row {
    display: grid;
    grid-template-columns: 32px 130px 1fr 110px 100px 80px 90px 120px;
    gap: 0;
    padding: 0 16px;
    border-bottom: 1px solid rgba(26,45,74,0.5);
    cursor: pointer;
    transition: background 0.12s;
    min-height: 42px;
    align-items: center;
  }

  .rt-row:hover { background: rgba(14,165,233,0.05); }
  .rt-row:last-child { border-bottom: none; }

  .rt-cell {
    padding: 0 6px;
    font-size: 12.5px; font-family: var(--mono); color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: flex; align-items: center;
  }

  .rt-cell-flag {
    padding: 0 4px;
    gap: 6px; display: flex; align-items: center;
    overflow: hidden;
  }

  .rt-flag-img {
    display: block;
    width: auto;
    height: 12px;
    flex-shrink: 0;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
  }

  .rt-cell-flag-name {
    font-size: 11.5px; font-family: var(--mono); color: var(--text-dim);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 1;
  }

  .rt-cell-num {
    font-size: 11px; color: var(--text-dim); font-weight: 400;
    justify-content: flex-end; padding-right: 8px;
  }

  .rt-cell-name { font-weight: 600; color: #fff; gap: 0; }

  .rt-cell-steam { font-size: 11px; color: var(--muted); }

  .rt-cell-actions {
    display: flex; gap: 5px; align-items: center;
    padding: 0 4px;
  }

  .rt-btn {
    font-size: 10px; font-family: var(--mono); font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase;
    border: 1px solid; border-radius: 3px; padding: 3px 8px;
    cursor: pointer; transition: all 0.12s; background: transparent;
    white-space: nowrap;
  }

  .rt-btn-kick { border-color: rgba(251,191,36,0.4); color: var(--yellow); }
  .rt-btn-kick:hover { background: rgba(251,191,36,0.12); border-color: var(--yellow); }
  .rt-btn-ban  { border-color: rgba(244,63,94,0.4);  color: var(--red); }
  .rt-btn-ban:hover  { background: rgba(244,63,94,0.12); border-color: var(--red); }

  @media (max-width: 700px) {
    .rt-head  { grid-template-columns: 26px 26px 1fr 70px 90px; }
    .rt-row   { grid-template-columns: 26px 26px 1fr 70px 90px; }
    .rt-hide-mobile { display: none; }
    .roster-overlay { padding: 8px; }
  }

  /* ── Popup: add msg player field ── */
  .pp-msg-row {
    display: flex; gap: 7px; align-items: center;
  }
  .pp-msg-inp {
    flex: 1; background: var(--bg); border: 1px solid var(--border);
    border-radius: 4px; color: var(--text); font-family: var(--mono);
    font-size: 12px; padding: 6px 10px; outline: none;
    transition: border-color 0.15s;
  }
  .pp-msg-inp:focus { border-color: var(--blue); }
  .pp-msg-inp::placeholder { color: var(--muted); }
  .pp-msg-btn {
    background: linear-gradient(135deg, #0ea5e9, #0068b5);
    border: none; border-radius: 4px; color: #fff;
    font-family: var(--sans); font-size: 12px; font-weight: 700;
    padding: 6px 14px; cursor: pointer; flex-shrink: 0;
    transition: all 0.15s;
  }
  .pp-msg-btn:hover { background: linear-gradient(135deg, #38bdf8, #0ea5e9); }

   .tab-bar {
      display: flex;
      align-items: stretch;
      background: #070c14;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      min-height: 38px;
      overflow-x: auto;
      overflow-y: hidden;
      scrollbar-width: none;
      flex-shrink: 0
    }

    .tab-bar::-webkit-scrollbar {
      display: none
    }

    .tabs-list {
      display: flex;
      align-items: stretch;
      gap: 1px;
      flex: 1;
      min-width: 0
    }

    .tab-item {
      display: flex;
      align-items: center;
      gap: 7px;
      padding: 0 10px 0 12px;
      min-width: 130px;
      max-width: 210px;
      cursor: pointer;
      border-bottom: 2px solid transparent;
      color: rgba(255, 255, 255, 0.38);
      font-size: 11.5px;
      font-family: var(--mono, 'JetBrains Mono', monospace);
      white-space: nowrap;
      flex-shrink: 0;
      transition: color .15s, background .15s;
      user-select: none
    }

    .tab-item:hover:not(.active) {
      background: rgba(255, 255, 255, 0.03);
      color: rgba(255, 255, 255, 0.6)
    }

    .tab-item.active {
      border-bottom-color: #0ea5e9;
      color: rgba(255, 255, 255, 0.92);
      background: rgba(14, 165, 233, 0.07)
    }

    .tab-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      flex-shrink: 0;
      background: rgba(255, 255, 255, 0.15);
      transition: background .3s
    }

    .tab-dot.connected {
      background: #22d3a0
    }

    .tab-dot.connecting {
      background: #fbbf24;
      animation: tabpulse 1s ease-in-out infinite
    }

    .tab-dot.error {
      background: #f43f5e
    }

    @keyframes tabpulse {

      0%,
      100% {
        opacity: 1
      }

      50% {
        opacity: .35
      }
    }

    .tab-label {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis
    }

    .tab-close {
      background: none;
      border: none;
      color: rgba(255, 255, 255, 0.2);
      cursor: pointer;
      padding: 2px 3px;
      border-radius: 3px;
      font-size: 12px;
      line-height: 1;
      flex-shrink: 0;
      transition: color .15s, background .15s
    }

    .tab-close:hover {
      color: #f43f5e;
      background: rgba(244, 63, 94, 0.12)
    }

    .tab-add {
      background: none;
      border: none;
      color: rgba(255, 255, 255, 0.3);
      cursor: pointer;
      padding: 0 14px;
      font-size: 20px;
      line-height: 38px;
      flex-shrink: 0;
      transition: color .15s, background .15s;
      border-left: 1px solid rgba(255, 255, 255, 0.05)
    }

    .tab-add:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.04)
    }

    .tab-add:disabled {
      opacity: .25;
      cursor: not-allowed
    }