:root, [data-theme="focus"] {
  --bg: #191B19;
  --panel: #242724;
  --soft: #1E211F;
  --line: #383D39;
  --text: #E7EAE7;
  --muted: #A1A7A2;
  --faint: #7A807B;
  --accent: #82AD91;
  --accent-ink: #121612;
  --mark: #82AD91;
  --ok: #78AD86;
  --warn: #C6A66D;
  --danger: #CC7777;
  --info: #8A99A3;
  --chat-them: #8A99A3;
  --shadow: #0004;
  --check-mark: #121612;
  --radius: 8px;
  --ui-blur: 12px;
  --log-h: 180px;
  --sidebar-w: 228px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.45, 0, 0.15, 1);
  --dur-fast: 160ms;
  --dur: 240ms;
  --dur-med: 320ms;
  --dur-slow: 420ms;
  color-scheme: dark;
}
@property --radius {
  syntax: '<length>';
  inherits: true;
  initial-value: 8px;
}
@property --ui-blur {
  syntax: '<length>';
  inherits: true;
  initial-value: 12px;
}
[data-theme="obsidian"] {
  --bg: #14151a;
  --panel: #1c1d23;
  --soft: #24252c;
  --line: #32333b;
  --text: #e4e2db;
  --muted: #9a9891;
  --faint: #737169;
  --accent: #c8bba4;
  --accent-ink: #1b1a16;
  --mark: #c8bba4;
  --danger: #c9b3ae;
  --chat-them: #b3c0be;
  --shadow: #0005;
  --check-mark: #1b1a16;
  color-scheme: dark;
}
[data-theme="graphite"] {
  --bg: #161a1f;
  --panel: #1e242b;
  --soft: #272e36;
  --line: #343c46;
  --text: #dce4eb;
  --muted: #8f9aa6;
  --faint: #6d7782;
  --accent: #7fadc4;
  --accent-ink: #12161a;
  --danger: #c4adad;
  --chat-them: #97b4c2;
  --shadow: #0005;
  --mark: #8fb4c9;
  --check-mark: #12161a;
  color-scheme: dark;
}
[data-theme="nord"] {
  --bg: #1d252d;
  --panel: #252f38;
  --soft: #2e3944;
  --line: #3b4855;
  --text: #e4ecf3;
  --muted: #90a0b0;
  --faint: #708090;
  --accent: #88b8c4;
  --accent-ink: #152026;
  --danger: #c4adb1;
  --chat-them: #98c0c8;
  --shadow: #0005;
  --mark: #8fbfc9;
  --check-mark: #152026;
  color-scheme: dark;
}
[data-theme="pine"] {
  --bg: #161c18;
  --panel: #1d241f;
  --soft: #262e27;
  --line: #333c34;
  --text: #dce6db;
  --muted: #8c988d;
  --faint: #6c766d;
  --accent: #8fb08e;
  --accent-ink: #141a15;
  --danger: #c4b0a8;
  --chat-them: #a2bda0;
  --shadow: #0005;
  --mark: #9bb89a;
  --check-mark: #141a15;
  color-scheme: dark;
}
[data-theme="dusk"] {
  --bg: #1b1714;
  --panel: #241f1b;
  --soft: #2d2722;
  --line: #3d342d;
  --text: #eee4d6;
  --muted: #9d8e7d;
  --faint: #776b5e;
  --accent: #c4a076;
  --accent-ink: #1a1612;
  --danger: #c9b0a4;
  --chat-them: #cbb088;
  --shadow: #0005;
  --mark: #c9a57a;
  --check-mark: #1a1612;
  color-scheme: dark;
}
[data-theme="paper"] {
  --bg: #ece6dc;
  --panel: #f4efe6;
  --soft: #e4ddd2;
  --line: #cfc6b8;
  --text: #2f2b26;
  --muted: #6d655c;
  --faint: #8a8278;
  --accent: #3f5344;
  --accent-ink: #f4f0e8;
  --danger: #7a4e46;
  --chat-them: #3f5a54;
  --shadow: #2c282418;
  --mark: #8a4f2c;
  --check-mark: #f4f0e8;
  color-scheme: light;
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text) 25%, transparent) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 22%, transparent); border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--text) 38%, transparent); }
*::-webkit-scrollbar-corner { background: transparent; }

html { interpolate-size: allow-keywords; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: 0;
  font-feature-settings: "kern" 1, "liga" 1;
  font-synthesis: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
button, input, textarea { font: inherit; color: inherit; background: transparent; }
button { cursor: pointer; }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { appearance: none; margin: 0; }
input[type=number] { appearance: textfield; }

.t-xl { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.t-lg { font-size: 18px; font-weight: 600; }
.t-md { font-size: 15px; font-weight: 400; }
.t-sm, .t-xs { font-size: 13px; font-weight: 400; color: var(--muted); }

.app-shell { display: flex; height: 100vh; background: var(--bg); overflow: hidden; position: relative; }
.surface-pulse {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  background: radial-gradient(240px circle at var(--pulse-x, 50%) var(--pulse-y, 50%), color-mix(in srgb, var(--text) 9%, transparent), transparent 68%);
}
.surface-pulse.on { animation: surface-pulse var(--dur-slow) var(--ease) both; }
@keyframes surface-pulse {
  0% { opacity: 0; }
  22% { opacity: 1; }
  100% { opacity: 0; }
}
.nav-backdrop { display: none; }
.app-core { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.app-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0fr;
  overflow: hidden;
  transition: grid-template-columns var(--dur-slow) var(--ease);
}
.app-shell.chat-open .app-body { grid-template-columns: minmax(0, 1fr) minmax(280px, min(420px, 38vw)); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.sidebar {
  width: var(--sidebar-w, 228px);
  flex: none;
  min-width: 200px;
  max-width: 320px;
  padding: 24px 16px 18px;
  background: var(--soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 12;
}
.sidebar-resize {
  width: 6px;
  flex: none;
  cursor: ew-resize;
  background: transparent;
  border-right: 1px solid var(--line);
}
.sidebar-resize:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 10px 20px;
}
.brand-name {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.2;
  color: var(--text);
}
.brand-by {
  font-size: 13px;
  font-weight: 500;
  color: var(--mark);
  line-height: 1.3;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px 0;
  flex: none;
}
.nav-list { display: flex; flex-direction: row; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.nav {
  border: 0;
  background: transparent;
  text-align: left;
  min-height: 42px;
  padding: 0 14px;
  border-radius: var(--radius);
  color: var(--muted);
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 500;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.nav:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.nav:active { opacity: .88; }
.nav.active { background: var(--accent); color: var(--accent-ink); }
.nav b {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  color: inherit;
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.nav.active b { background: color-mix(in srgb, var(--accent-ink) 16%, transparent); }
.nav b:empty, .nav b[data-empty="1"] { display: none; }

.cabinet {
  margin-top: auto;
  padding: 14px 12px 4px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cabinet-kicker { color: var(--muted); font-size: 13px; font-weight: 500; }
.cabinet strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cabinet-sub { color: var(--muted); font-size: 13px; }
.cabinet-sub b { color: var(--text); font-weight: 500; }
.brand-copy #logout-btn { width: fit-content; margin-top: 6px; }
.worker-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.worker-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.worker-head { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.worker-card input { min-width: 0; flex: 1; }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 28px 14px;
  gap: 16px;
  background: var(--bg);
  overflow: hidden;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 10px 9px;
  flex-direction: column;
  justify-content: space-between;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 99px;
}
.page-copy { min-width: 0; flex: 1; }
h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--text);
}
.page-desc {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 52ch;
}

.toolbar, .inline-actions, .log-tools, .button-row, .key-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar { position: relative; flex: none; }

.button {
  height: 38px;
  min-width: 96px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.button:hover { background: var(--panel); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.button:active { opacity: .86; }
.button:disabled { opacity: .55; pointer-events: none; }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.button.sand { background: #C9B48A; border-color: #C9B48A; color: #1A1712; }
.button.sand:hover, .button.sand.active { filter: brightness(1.06); background: #C9B48A; }
.button.danger { color: var(--danger); border-color: var(--line); }
.button.danger:hover { border-color: var(--danger); }
.button.mini { height: 32px; min-width: 72px; padding: 0 12px; font-size: 13px; font-weight: 500; }

.stats { display: flex; flex-direction: column; gap: 8px; }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  min-height: 64px;
}
.stat span { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.content { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.content.view-enter { animation: view-enter var(--dur-med) var(--ease) both; }
.content.hidden, .hidden { display: none !important; }
@keyframes view-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  min-height: 38px;
}
#accounts-state {
  display: none;
  flex: 1 0 100%;
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: #171717;
  border: 1px solid #292929;
  color: #fff;
  font-size: 14px;
}
#accounts-state:not(:empty) { display: block; }
.accounts-ready {
  flex: none;
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
  min-width: 4.8ch;
}
.nav b#nav-accounts-count {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.radius-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.radius-row b { min-width: 2.4ch; color: var(--text); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  margin: 14px 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(var(--accent), var(--accent)) 0 / var(--pct, 0%) 100% no-repeat,
    color-mix(in srgb, var(--text) 14%, var(--soft));
  outline: none;
  cursor: pointer;
  accent-color: var(--accent);
  transition: background-size var(--dur-fast) var(--ease);
}
input[type=range]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: transparent;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
input[type=range]:hover::-webkit-slider-thumb,
input[type=range]:active::-webkit-slider-thumb { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type=range]::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 14%, var(--soft));
}
input[type=range]::-moz-range-progress {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
}
input[type=range]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.test-friend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.test-friend input { flex: 1; min-width: 180px; }
.muted { color: var(--muted); margin: 0; font-size: 14px; }

.searchbox input:not([type=range]), .setting-card input:not([type=range]):not([type=checkbox]), .setting-card textarea, .account-card input:not([type=range]):not([type=checkbox]), .account-card textarea, .modal-card input:not([type=range]), .chat-compose input, .workspace-friends input {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  padding: 0 12px;
  outline: none;
  font-size: 15px;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.searchbox input::placeholder, .setting-card input::placeholder, .setting-card textarea::placeholder,
.account-card input::placeholder, .account-card textarea::placeholder, .modal-card input::placeholder, .chat-compose input::placeholder {
  color: var(--faint);
}
.searchbox input:not([type=range]):focus, .setting-card input:not([type=range]):focus, .setting-card textarea:focus,
.account-card input:not([type=range]):focus, .account-card textarea:focus, .modal-card input:not([type=range]):focus, .chat-compose input:focus {
  border-color: var(--accent);
}
.searchbox { width: min(280px, 100%); flex: none; }
.searchbox input { width: 100%; min-width: 0; }

.invite-accounts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.invite-account {
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.invite-account:hover { border-color: var(--accent); }
.invite-account.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.invite-account b { font-size: 18px; font-weight: 600; }
.invite-account span { color: var(--muted); font-size: 13px; }
.invite-list { min-height: 160px; }
.invite-head, .invite-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.15fr) minmax(150px, 0.95fr) minmax(140px, 1fr) minmax(130px, 1fr) 108px minmax(150px, 1.15fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 760px;
  padding: 8px 18px;
}
.invite-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 40px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.invite-row {
  min-height: 58px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.invite-row { transition: background-color var(--dur-fast) var(--ease); }
.invite-row:hover { background: color-mix(in srgb, var(--accent) 8%, var(--soft)); }
.invite-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  min-width: 0;
  overflow: visible;
}
.invite-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.person-unread {
  display: inline-block;
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-left: 4px;
  border-radius: 99px;
  background: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, #fff 22%, transparent);
  vertical-align: middle;
}
.invite-row.has-unread .invite-name,
.friend-row.has-unread .friend-meta b {
  color: #fff;
}
.invite-sid, .invite-state {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.invite-sid b, .invite-sid span, .invite-state span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
.invite-sid b { color: var(--text); font-weight: 500; }
.invite-state b { font-size: 14px; font-weight: 500; color: var(--text); }
.invite-time, .invite-dash {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.invite-dash { text-align: center; }
.invite-row.pinned { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.invite-from {
  justify-self: stretch;
  min-width: 0;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
button.invite-from:hover { border-color: var(--accent); }
span.invite-from {
  display: flex;
  align-items: center;
  color: var(--muted);
}
.invite-tools { display: contents; }
.button.mini.invite-pin { height: 30px; min-width: 108px; padding: 0 8px; font-size: 12px; font-weight: 500; }
.invite-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 8px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.invite-sid { display: flex; flex-direction: row; align-items: center; gap: 6px; }
.invite-sid span { display: none; }
.invite-time, .invite-dash { display: none; }
.proxy-ping {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  margin-left: 8px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.settings-save { margin: 18px 0 8px; display: flex; justify-content: flex-end; }
.invite-pin.on { border-color: var(--text); }
.invite-list { display: flex; flex-direction: column; gap: 18px; }
.invite-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.invite-gap {
  margin: 0;
  padding: 10px 18px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
#invites-view .table-card { background: transparent; border-color: transparent; }
.invite-note {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  padding: 0 8px;
  font-size: 12px;
}

.table-card {
  flex: 1;
  min-height: 180px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.table-scroll { flex: 1; min-height: 0; overflow: auto; }
.table-head, .player-row {
  display: grid;
  grid-template-columns: minmax(200px, 1.5fr) 84px 84px 84px 84px 80px minmax(140px, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  min-width: 820px;
}
.table-head {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 44px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.invite-row { min-width: 760px; }
.table-head .col-num, .value { text-align: right; }
.table-head .col-region, .table-head .col-status, .region-pill, .invite-status { text-align: left; }
.player-list { min-height: 160px; }
.player-record { border-bottom: 1px solid var(--line); }
.player-row { min-height: 58px; cursor: pointer; transition: background-color var(--dur-fast) var(--ease); }
.player-row:hover { background: color-mix(in srgb, var(--accent) 8%, var(--soft)); }
.player-record.open .player-row { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.region-pill, .invite-status { font-size: 14px; font-weight: 500; }
.invite-status { color: var(--muted); overflow: hidden; }
.player { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; background: var(--soft); flex: none; }
.player-name, .steam-link, .details-toggle, .connect-copy {
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  color: var(--text);
}
.player-meta { min-width: 0; }
.player-name {
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.player-name:hover, .steam-link:hover { color: var(--muted); }
.steam-link { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.value { text-align: right; color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.value.total { color: var(--accent); font-weight: 600; }
.empty {
  height: 100%;
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 15px;
  padding: 24px;
  text-align: center;
}
.player-details-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-med) var(--ease); }
.player-record.open .player-details-wrap { grid-template-rows: 1fr; }
.player-details {
  overflow: hidden;
  min-height: 0;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 18px 16px 60px;
  color: var(--muted);
  font-size: 14px;
  background: var(--soft);
}
.player-details b { color: var(--text); font-weight: 600; }
.faceit-match { color: var(--text); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--text); }
.faceit-match:hover { color: var(--muted); }
.connect-copy {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 13px;
  font-weight: 500;
}
.connect-copy:hover { border-color: var(--accent); }
.connect-copy.danger:hover { border-color: var(--danger); color: var(--danger); }
.chat-box {
  width: 100%;
  max-height: 200px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg);
}
.chat-line { color: var(--text); font-size: 14px; }
.chat-line b { margin-right: 6px; font-weight: 600; }
.chat-line.them b { color: var(--chat-them); }

.settings { overflow: auto; padding-right: 4px; min-height: 0; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; align-items: start; padding-bottom: 24px; }
.setting-card, .account-card, .table-card, .stat, .log-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.setting-card { padding: 18px 18px 16px; height: fit-content; align-self: start; }
.setting-card.collapsible { padding: 0; overflow: hidden; }
.setting-card.wide, .wide { grid-column: 1 / -1; }
.card-title { margin: 0 0 14px; color: var(--text); font-size: 18px; font-weight: 600; }
.setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 16px 18px;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.setting-toggle::after { content: '›'; color: var(--faint); font-size: 20px; transition: transform var(--dur) var(--ease), color var(--dur-fast) var(--ease); }
.setting-card.open .setting-toggle { margin-bottom: 0; }
.setting-card.open .setting-toggle::after { transform: rotate(90deg); color: var(--text); }
.setting-card.collapsible {
  display: grid;
  grid-template-rows: auto 0fr;
  transition: grid-template-rows var(--dur-med) var(--ease);
}
.setting-card.collapsible.open { grid-template-rows: auto 1fr; }
.setting-body { display: block; min-height: 0; overflow: hidden; padding: 0 18px 16px; }
.card-subtitle { margin: 14px 0 8px; color: var(--text); font-size: 15px; font-weight: 600; }
.card-subtitle:first-of-type { margin-top: 0; }
.proxy-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  min-height: 54px;
}
.proxy-title-row.proxy-sub {
  padding: 14px 0 8px;
  min-height: 0;
}
.proxy-label {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}
.proxy-sub .proxy-label { font-size: 15px; margin: 0; }
.proxy-check {
  flex: none;
  height: 32px;
  padding: 0 12px;
}
[data-proxy-fold] { cursor: pointer; }
[data-proxy-fold]::after {
  content: '›';
  margin-left: auto;
  color: var(--faint);
  font-size: 20px;
  transition: transform var(--dur) var(--ease), color var(--dur-fast) var(--ease);
}
.setting-card.open [data-proxy-fold]::after { transform: rotate(90deg); color: var(--text); }
.proxy-editor {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  background: #080808;
  border: 1px solid #292929;
  border-radius: 10px;
  overflow: hidden;
}
.proxy-editor.has-bad { border-color: #7a2f2f; }
.proxy-editor.has-rtts { grid-template-columns: minmax(0, 1fr) 72px; }
.proxy-rtts {
  display: none;
  grid-column: 2;
  grid-row: 1;
  box-sizing: border-box;
  margin: 0;
  min-height: 88px;
  padding: 10px 8px;
  border: 0;
  border-left: 1px solid #292929;
  color: #fff;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
  text-align: right;
  white-space: pre;
  overflow: hidden;
  pointer-events: none;
  background: #0c0c0c;
}
.proxy-editor.has-rtts .proxy-rtts { display: block; }
.proxy-marks,
.proxy-editor textarea {
  grid-column: 1;
  grid-row: 1;
  box-sizing: border-box;
  margin: 0;
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  border: 0;
  outline: none;
  resize: vertical;
  background: transparent;
  color: #fff;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
  overflow: auto;
  tab-size: 4;
}
.proxy-marks {
  z-index: 0;
  color: transparent;
  pointer-events: none;
  overflow: hidden;
}
.proxy-marks .bad {
  background: rgba(255, 70, 70, .28);
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.proxy-editor textarea {
  position: relative;
  z-index: 1;
  caret-color: #fff;
}
.maintain-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.template-tabs, .choice-row { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.choice-row { margin-bottom: 0; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 8px; }
.theme-swatch {
  height: auto;
  min-width: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.theme-swatch i {
  display: block;
  width: 100%;
  height: 20px;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
}
.theme-swatch[data-theme="focus"] i { background: linear-gradient(90deg, #1f1d1a 40%, #6f9b80); }
.theme-swatch[data-theme="obsidian"] i { background: linear-gradient(90deg, #111214 40%, #cfc3ad); }
.theme-swatch[data-theme="graphite"] i { background: linear-gradient(90deg, #14171c 40%, #8fb4c9); }
.theme-swatch[data-theme="nord"] i { background: linear-gradient(90deg, #1b2229 40%, #8fbfc9); }
.theme-swatch[data-theme="pine"] i { background: linear-gradient(90deg, #131815 40%, #9bb89a); }
.theme-swatch[data-theme="dusk"] i { background: linear-gradient(90deg, #181512 40%, #c9a57a); }
.theme-swatch[data-theme="paper"] i { background: linear-gradient(90deg, #efeae2 40%, #4a5c4e); }
.theme-swatch.active { border-color: var(--accent); color: var(--text); }

.reveal-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.reveal-field:last-child { border-bottom: 0; }
.reveal-label { color: var(--text); font-size: 15px; }
.reveal-side {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 128px;
  height: 34px;
}
.reveal-side.wide { min-width: 168px; }
.reveal-value {
  border: 0;
  background: none;
  color: var(--text);
  font-weight: 500;
  font-size: 15px;
  padding: 4px 6px;
  min-width: 28px;
  text-align: right;
  border-radius: 4px;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.reveal-value:hover { color: var(--muted); background: var(--soft); }
.reveal-input {
  position: absolute;
  right: 22px;
  width: 0;
  min-width: 0;
  height: 34px;
  padding: 0 0;
  margin: 0;
  border-color: transparent;
  opacity: 0;
  pointer-events: none;
  text-align: right;
  transition: width var(--dur) var(--ease), opacity var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.reveal-field.secret .reveal-input { right: 0; }
.reveal-field.open .reveal-value { opacity: 0; pointer-events: none; }
.reveal-field.open .reveal-input {
  width: var(--reveal-w, 72px);
  padding: 0 8px;
  opacity: 1;
  pointer-events: auto;
  border-color: var(--accent);
}
.reveal-field.secret.open .reveal-input { width: var(--reveal-w, 220px); text-align: left; }
.reveal-unit { color: var(--muted); font-size: 13px; min-width: .8em; position: relative; z-index: 1; }
.key-actions { margin-top: 12px; }
.key-state { color: var(--text); min-height: 1em; font-size: 14px; }
.setting-card textarea, .account-card textarea { width: 100%; height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.mode-btn.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.source-preview, .account-status { min-height: 20px; color: var(--muted); font-size: 14px; margin: 0; }

.accounts-toolbar { width: 100%; flex-wrap: wrap; align-items: center; }
.accounts-toolbar .button { flex: 0 0 auto; height: 38px; }
.accounts-toolbar .toolbar-end { margin-left: auto; }
.mafile-wrap { position: relative; }
.mafile-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 8;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  display: flex;
  flex-direction: column;
}
.mafile-menu button {
  border: 0;
  background: none;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
}
.mafile-menu button:hover { background: var(--soft); }
.filter-icons { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-icon-pick {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--text);
  padding: 0;
  min-width: 0;
}
.filter-icon-pick.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--soft)); }
.bulk-card { width: min(560px, calc(100vw - 32px)); }
.bulk-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow: auto; margin: 12px 0; }
.bulk-row { display: grid; grid-template-columns: 1fr 160px; gap: 8px; align-items: center; }
.notice-open.has-unread { border-color: #C9B48A; }
.notice-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #C9B48A;
  margin-left: 6px;
  box-shadow: 0 0 0 3px color-mix(in srgb, #C9B48A 28%, transparent);
}
.accounts-split { flex: 1; min-height: 0; display: flex; gap: 12px; }
.accounts-access {
  flex: 1;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.account-list { display: flex; flex-direction: column; gap: 10px; overflow: auto; flex: 1; min-height: 0; align-items: stretch; }
.account-group { display: flex; flex-direction: column; gap: 10px; }
.account-group + .account-group {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.account-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 2px;
}
.account-group-head strong { font-size: 14px; font-weight: 600; }
.account-card { display: flex; flex-direction: column; overflow: visible; flex: 0 0 auto; min-height: 0; }
.account-card.lost { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.account-card.need { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
.account-ids { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.account-reason { color: var(--danger); font-size: 12px; }
.account-card.open { border-color: var(--accent); }
.account-card.drag-over { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.account-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.account-avatar { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--soft); flex: none; }
.account-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.account-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 160px;
  padding: 2px 8px;
  border-radius: 99px;
  color: #121612;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  flex: none;
}
.filter-badge b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-badge em { font-style: normal; }
.work-switch {
  width: 42px;
  height: 24px;
  border: 0;
  border-radius: 99px;
  background: var(--line);
  position: relative;
  flex: none;
  padding: 0;
}
.work-switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.work-switch.on { background: var(--ok); }
.work-switch.on i { transform: translateX(18px); background: #121612; }
.cool-badge { color: var(--warn); font-size: 12px; font-weight: 600; flex: none; }
.filter-panel {
  width: 280px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: auto;
  min-height: 0;
}
.filter-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.filter-form, .filter-list { display: flex; flex-direction: column; gap: 8px; }
.filter-form-row { display: flex; gap: 8px; }
.filter-form-row input[type="color"] { width: 42px; height: 36px; padding: 4px; }
.filter-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  cursor: grab;
}
.filter-chip.editing { border-color: var(--accent); }
.filter-chip-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #121612;
  font-size: 12px;
  flex: none;
}
.filter-chip span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip-tools { display: flex; gap: 4px; }
.account-toggle {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 0;
}
.account-toggle .chevron { width: 16px; color: var(--faint); transition: transform var(--dur) var(--ease), color var(--dur-fast) var(--ease); flex: none; font-size: 18px; }
.account-card.open .chevron { transform: rotate(90deg); color: var(--text); }
.account-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.account-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 15px; }
.account-meta span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-body-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-med) var(--ease);
}
.account-card.open .account-body-wrap { grid-template-rows: 1fr; }
.account-body-wrap > .account-body { min-height: 0; overflow: hidden; }
.account-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
}
.account-health { color: var(--text); font-size: 14px; font-weight: 400; line-height: 1.55; white-space: pre-line; }
.account-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-creds {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
}
.account-creds div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
}
.account-creds span { color: var(--muted); font-size: 12px; }
.account-creds b { font-size: 14px; font-weight: 600; word-break: break-all; }
.account-confirm {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.log-panel {
  flex: none;
  height: var(--log-h, 180px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.log-panel header {
  min-height: 42px;
  padding: 0 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.log-window { flex: 1; overflow: auto; }
.log-panel.collapsed { height: 42px; }
.log-panel.collapsed .log-window, .log-panel.settings-hidden, .main-resize.hidden { display: none; }
.log-line { padding: 7px 14px; font: 13px/1.5 ui-monospace, Consolas, "Cascadia Mono", monospace; color: var(--muted); border-bottom: 1px solid var(--line); }
.log-time { color: var(--faint); margin-right: 10px; }
.log-line.ok { color: var(--text); }
.log-line.warn, .log-line.err { color: var(--danger); }
.log-line.dim { color: var(--faint); }
.steam-id { color: var(--text); cursor: pointer; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  user-select: none;
}
.check.compact {
  width: 100%;
  justify-content: flex-start;
  min-height: 40px;
  border-bottom: 1px solid var(--line);
}
.check.compact:last-child { border-bottom: 0; }
.log-tools .check { font-size: 13px; color: var(--muted); font-weight: 500; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.check-box {
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  display: grid;
  place-items: center;
  flex: none;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.check-box::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 1.5px solid var(--check-mark);
  border-bottom: 1.5px solid var(--check-mark);
  transform: rotate(-45deg) scale(.4);
  opacity: 0;
  margin-top: -1px;
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.check:hover .check-box { border-color: var(--muted); }
.check:active .check-box { opacity: .82; }
.check input:checked + .check-box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .check-box::after { opacity: 1; transform: rotate(-45deg) scale(1); }

.main footer { display: none; }
.main-resize { height: 8px; flex: none; cursor: ns-resize; background: transparent; }
.main-resize:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }

.copy-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translate3d(0, 6px, 0);
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.copy-toast.visible { opacity: 1; transform: translate3d(0, 0, 0); }

.notice-stack {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}
.soft-notice {
  pointer-events: auto;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-left: 3px solid var(--info);
  border-radius: var(--radius);
  padding: 12px 14px;
  min-height: 0;
  width: fit-content;
  max-width: 100%;
  align-self: end;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  animation: notice-in var(--dur) var(--ease) both;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.soft-notice strong { font-size: 15px; font-weight: 600; grid-column: 1; }
.soft-notice span { font-size: 14px; font-weight: 400; color: var(--muted); grid-column: 1; line-height: 1.4; }
.soft-notice .notice-x {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  border: 0;
  background: none;
  color: var(--faint);
  min-width: 24px;
  height: 24px;
  padding: 0;
  font-size: 16px;
}
.soft-notice .notice-progress {
  grid-column: 1 / -1;
  height: 3px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.soft-notice .notice-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width var(--dur) var(--ease); }
.soft-notice.ok { border-left-color: var(--ok); }
.soft-notice.warn { border-left-color: var(--warn); }
.soft-notice.err { border-left-color: var(--danger); }
.soft-notice.info { border-left-color: var(--info); }
.soft-notice.leaving { opacity: 0; transform: translate3d(0, 6px, 0); }
@keyframes notice-in {
  from { opacity: 0; transform: translate3d(0, 6px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.notice-open { min-width: 132px; position: relative; }
.notice-open b {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.notice-open b:empty, .notice-open b[data-empty="1"] { display: none; }
.notice-center {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(380px, calc(100vw - 24px));
  max-height: min(460px, 70vh);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  z-index: 25;
  overflow: hidden;
  transform-origin: top right;
  animation: view-enter var(--dur) var(--ease) both;
}
.notice-center header {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}
.notice-filters { display: flex; gap: 6px; padding: 10px 12px; flex-wrap: wrap; }
.notice-center .notice-list { overflow: auto; flex: 1; }
.notice-row { padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.notice-row:hover { background: var(--soft); }
.notice-row.unread { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.notice-row b { display: block; font-size: 15px; font-weight: 600; }
.notice-row span { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.notice-row em { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; font-style: normal; }
.notice-center-empty { padding: 28px 14px; text-align: center; color: var(--muted); font-size: 14px; }
.log-line.flash { background: color-mix(in srgb, var(--accent) 14%, transparent); }

.modal {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 56%, transparent);
  display: grid;
  place-items: center;
  z-index: 20;
  animation: view-enter var(--dur-med) var(--ease) both;
  backdrop-filter: blur(var(--ui-blur));
  -webkit-backdrop-filter: blur(var(--ui-blur));
}
.modal-card {
  width: min(440px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-card h3 { margin: 0; font-size: 20px; font-weight: 600; color: var(--text); }
.modal-card input { width: 100%; }

.chat-open {
  height: 30px;
  margin-left: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.chat-open:hover { border-color: var(--accent); color: var(--accent); }
.invite-status { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.chat-overlay { display: none; }
.chat-dock {
  min-width: 0;
  width: auto;
  border-left: 1px solid transparent;
  background: var(--panel);
  display: flex;
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translate3d(10px, 0, 0);
  pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease), border-color var(--dur-slow) var(--ease);
}
.app-shell.chat-open .chat-dock {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
  border-left-color: var(--line);
}
.chat-dock.hidden { display: flex !important; }
.chat-panel {
  width: 100%;
  height: 100%;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.chat-head .avatar { width: 40px; height: 40px; }
.chat-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.chat-user:hover, .chat-user:hover strong { color: var(--accent); }
.workspace-chat-head .chat-user { font-weight: 600; }
.chat-head-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-head-meta strong { color: var(--text); font-size: 16px; font-weight: 600; }
.chat-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--soft);
  touch-action: pan-y;
}
.chat-bubble {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-bubble.me {
  align-self: flex-end;
  background: color-mix(in srgb, var(--accent) 22%, var(--panel));
}
.chat-bubble.them {
  align-self: flex-start;
  background: var(--panel);
  border: 1px solid var(--line);
}
.chat-bubble time {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.chat-compose {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  flex: 0 0 auto;
}
.chat-compose input { flex: 1; }
.chat-state { margin: 0; padding: 0 16px 12px; min-height: 18px; flex: 0 0 auto; }
.skeleton { display: grid; gap: 10px; padding: 18px; }
.skeleton i {
  display: block;
  height: 16px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--text) 8%, var(--soft));
  animation: pulse .9s var(--ease-inout) infinite alternate;
}
.skeleton i:nth-child(2) { width: 72%; }
.skeleton i:nth-child(3) { width: 54%; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pulse { from { opacity: .55; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1600px) {
  .main { padding: 16px 22px 12px; }
  .topbar { padding: 12px 22px 0; }
}

@media (max-width: 1366px) {
  h1 { font-size: 26px; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1100px) {
  .sidebar { min-width: 200px; }
  .settings-grid { grid-template-columns: 1fr; }
  .page-head { flex-wrap: wrap; }
}

@media (max-width: 1024px) {
  .nav-toggle { display: flex; }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: color-mix(in srgb, var(--bg) 42%, transparent);
    opacity: 0;
    pointer-events: none;
    z-index: 11;
    transition: opacity var(--dur) var(--ease);
    backdrop-filter: blur(var(--ui-blur));
    -webkit-backdrop-filter: blur(var(--ui-blur));
  }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(260px, 86vw);
    min-width: 0;
    max-width: none;
    transform: translateX(-105%);
    transition: transform var(--dur-med) var(--ease);
    border-right: 1px solid var(--line);
  }
  body.nav-open .sidebar { transform: none; }
  .sidebar-resize { display: none; }
  .main { padding: 16px; }
  .topbar { padding: 10px 16px 0; }
}

@media (max-width: 768px) {
  h1 { font-size: 24px; }
  .page-desc { max-width: none; }
  .toolbar { width: 100%; }
  .toolbar .button { flex: 1; }
  .section-heading { flex-wrap: wrap; }
  .nav-list { overflow-x: auto; }
  .searchbox { width: 100%; }
  .log-panel header { flex-wrap: wrap; height: auto; padding: 8px 12px; }
}

@media (max-width: 520px) {
  .notice-open { min-width: 0; }
  .app-shell.chat-open .app-body { grid-template-columns: minmax(0, 1fr) 0fr; }
  .chat-dock { position: fixed; inset: 0; width: auto; min-width: 0; z-index: 20; }
}

.avatar-drop {
  min-height: 72px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  background: var(--bg);
}
.avatar-drop:focus, .avatar-drop.drag { border-color: var(--accent); color: var(--text); }
.account-profile { display: grid; gap: 10px; }
.workspace-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 48%, transparent);
  display: grid;
  place-items: center;
  z-index: 24;
  padding: 20px;
  animation: view-enter var(--dur-med) var(--ease) both;
  backdrop-filter: blur(var(--ui-blur));
  -webkit-backdrop-filter: blur(var(--ui-blur));
}
.workspace-panel {
  width: min(860px, calc(100vw - 48px));
  height: min(680px, calc(100vh - 48px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.workspace-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; overflow: hidden; }
.workspace-body.has-chat { grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); }
.workspace-body.has-chat.has-extra { grid-template-columns: minmax(120px, 200px) minmax(200px, 1fr) 210px; }
.workspace-panel.has-extra { width: min(1080px, calc(100vw - 48px)); }
.workspace-friends { display: flex; flex-direction: column; min-height: 0; height: 100%; overflow: hidden; padding: 12px; gap: 8px; }
.workspace-body.has-chat .workspace-friends { border-right: 1px solid var(--line); }
.workspace-friends input { width: 100%; flex: 0 0 auto; }
.friend-list { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 6px; }
.friend-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--bg);
}
.friend-row.active { border-color: var(--accent); }
.friend-row img { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; }
.friend-meta { min-width: 0; }
.friend-meta b { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
.friend-meta b span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.friend-meta span { color: var(--muted); font-size: 12px; }
.friend-value { font-size: 13px; font-weight: 600; color: var(--text); background: none; border: 0; }
.friend-actions { display: flex; gap: 4px; grid-column: 1 / -1; }
.workspace-chat { min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.workspace-chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex: 0 0 auto; }
.workspace-chat-head .chat-user { margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chat-extra { flex: 0 0 auto; }
.chat-extra { padding: 16px; border-left: 1px solid var(--line); background: var(--soft); display: flex; flex-direction: column; gap: 8px; font-size: 13px; min-height: 0; overflow: auto; }
.chat-extra.hidden { display: none; }
.inv-pop { margin-top: 4px; color: var(--muted); font-size: 12px; }

:root,
[data-theme],
[data-theme="focus"],
[data-theme="obsidian"],
[data-theme="graphite"],
[data-theme="nord"],
[data-theme="pine"],
[data-theme="dusk"],
[data-theme="paper"] {
  --bg: #080808;
  --panel: #171717;
  --soft: #101010;
  --line: #292929;
  --text: #ffffff;
  --muted: #999999;
  --faint: #737373;
  --accent: #ffffff;
  --accent-ink: #080808;
  --mark: #ffffff;
  --ok: #ffffff;
  --warn: #c8c8c8;
  --danger: #d4d4d4;
  --info: #b5b5b5;
  --chat-them: #cfcfcf;
  --shadow: #00000088;
  --check-mark: #080808;
  color-scheme: dark;
}

body, .app-shell, .main { background: #080808; color: #fff; }
.sidebar { background: #101010; width: 232px; min-width: 220px; border-right: 1px solid #292929; }
.brand { flex-direction: row; align-items: center; gap: 12px; padding: 4px 8px 18px; }
.brand-logo {
  width: 36px; height: 36px; flex: none; border: 1px solid #292929; border-radius: 10px;
  display: grid; place-items: center; background: #171717; color: #fff;
}
.brand-logo svg { width: 18px; height: 18px; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.brand-by { font-size: 11px; letter-spacing: .04em; color: #999; }
.brand-name { font-size: 16px; }
.brand-copy strong { font-size: 13px; font-weight: 500; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-list { flex-direction: column; align-items: stretch; gap: 4px; }
.nav { gap: 10px; color: #999; }
.nav svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav.active { background: #f2f2f2; color: #080808; }
.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 0;
}
.topbar .toolbar {
  grid-column: -1;
  justify-self: end;
  width: auto;
  margin-left: auto;
}
.topbar .toolbar .button { flex: none; }
.stats { flex-direction: row; justify-content: center; gap: 8px; }
.stat { background: #1d1d1d; border-color: #292929; min-height: 58px; padding: 8px 14px; min-width: 108px; }
.stat strong { font-size: 18px; margin-top: 2px; }
.table-card, .setting-card, .account-card, .log-panel, .chat-dock, .chat-panel { background: #171717; border-color: #292929; }
.table-head, .player-row {
  grid-template-columns: minmax(180px, 1.7fr) 88px 96px 96px 96px;
  min-width: 680px;
}
.player-invite { display: block; color: #999; font-size: 12px; margin-top: 2px; }
.value, .table-head .col-num { text-align: right; }
.app-body { grid-template-columns: minmax(0, 1fr) 320px !important; }
.chat-dock, .chat-dock.hidden, .app-shell.chat-open .chat-dock {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  border-left: 1px solid #292929;
  width: auto;
  min-width: 0;
}
.chat-head { flex-wrap: wrap; align-items: flex-start; }
.chat-kicker { width: 100%; display: flex; align-items: center; gap: 8px; }
.chat-kicker strong { font-size: 15px; }
.chat-count {
  height: 22px; padding: 0 8px; border: 1px solid #292929; border-radius: 99px;
  display: inline-flex; align-items: center; gap: 4px; color: #999; font-size: 12px; font-variant-numeric: tabular-nums;
}
#chat-unread::before { content: "непроч."; }
#chat-queue::before { content: "очередь"; }
.chat-toggle { display: none; }
.log-line { display: grid; grid-template-columns: 78px 52px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.log-kind { color: #999; font-size: 11px; letter-spacing: .04em; }
.log-text { min-width: 0; overflow-wrap: anywhere; }
.check-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid #292929; }
.check-row b, .check-row span { display: block; }
.check-row span, .check-row p { color: #999; margin: 0; white-space: pre-line; font-size: 13px; }
.button.sand, .button.primary { background: #fff; border-color: #fff; color: #080808; }
.button.sand:hover, .button.primary:hover { background: #e8e8e8; }
.button.danger { color: #fff; }

@media (max-width: 1100px) {
  .stats { justify-content: flex-start; overflow-x: auto; }
  .stat { min-width: 96px; }
}
@media (max-width: 1024px) {
  .app-body, .app-shell.chat-open .app-body { grid-template-columns: minmax(0, 1fr) !important; }
  .chat-toggle { display: inline-flex; }
  .chat-dock {
    position: fixed; top: 0; right: 0; bottom: 0; left: auto; width: min(420px, 100%); z-index: 30;
    transform: translate3d(104%, 0, 0);
  }
  .app-shell.chat-open .chat-dock { transform: none; }
}
@media (max-width: 720px) {
  .topbar { grid-template-columns: auto 1fr auto; }
  .chat-toggle { grid-column: 3; }
  .toolbar { grid-column: 1 / -1; }
}

.sidebar { width: 232px !important; min-width: 232px !important; max-width: 232px !important; }
.sidebar-resize { display: none !important; }
.app-body { transition: none !important; }
.stats.tab-only { display: none !important; }
.account-card:not(.open) { overflow: hidden; }
.account-body-wrap,
.player-details-wrap {
  display: none !important;
  transition: none !important;
}
.account-card.open .account-body-wrap,
.player-record.open .player-details-wrap {
  display: block !important;
}
.setting-card.collapsible {
  display: block !important;
  grid-template-rows: none !important;
  transition: none !important;
}
.setting-card.collapsible:not(.open) .setting-body { display: none !important; }
.content.view-enter {
  animation: view-enter 560ms cubic-bezier(0.22, 1, 0.36, 1) both !important;
  filter: none !important;
}
.modal, .nav-backdrop, .workspace-overlay, .chat-overlay {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.chat-mark {
  width: 28px; height: 28px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(155deg, #ffffff 0%, #c8c8c8 46%, #6a6a6a 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
.chat-mark svg { width: 16px; height: 16px; stroke: #111; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.chat-toggle { gap: 8px; }
.chat-thread, #workspace-thread { display: flex; flex-direction: column; }
.chat-empty, .friend-list > .muted:only-child, .check-wait {
  margin: auto;
  width: 100%;
  min-height: 96px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #999;
}
.check-form { display: flex; flex-direction: column; gap: 12px; align-items: stretch; margin: 0 0 12px; }
.check-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: #999; font-size: 13px; }
.check-field input, .check-field select {
  height: 38px; border: 1px solid #292929; border-radius: 10px; background: #171717; color: #fff; padding: 0 12px;
}
.check-modes { display: flex; gap: 8px; }
.check-modes .button { flex: 1; }
.check-modes .button.on { background: #fff; color: #080808; }
.check-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check-card {
  background: #171717; border: 1px solid #292929; border-radius: 12px; padding: 16px;
  min-height: 180px; display: flex; flex-direction: column;
}
.check-card h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.check-account-link {
  display: flex; gap: 12px; align-items: center; margin-top: 8px; padding: 10px 12px;
  border: 1px solid #292929; border-radius: 12px; background: #111; color: inherit;
  text-decoration: none;
}
.check-account-link img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: #080808; }
.check-account-link strong { display: block; color: #fff; }
.check-account-link span { display: block; color: #999; font-size: 13px; }
.check-line { display: flex; gap: 8px; margin: 0 0 8px; font-size: 14px; }
.check-line b { color: #999; font-weight: 500; flex: none; }
:is(button, .nav, .account-card, .player-row, .stat, .setting-card, .invite-row, .friend-row, .check-card, .check-field input, .check-field select) {
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
:is(button, .nav, .player-row, .stat, .invite-row, .friend-row, .check-card, .check-field input, .check-field select):hover {
  border-color: rgba(255,255,255,.78);
  box-shadow: none;
}
.setting-toggle:hover,
.setting-card:hover,
.nav.active:hover {
  box-shadow: none;
}
.setting-card:hover { border-color: rgba(255,255,255,.78); }
.setting-toggle:hover { border-color: transparent; }
#accounts-view :is(button, .account-card, .account-toggle, .searchbox):hover {
  box-shadow: none;
}
#accounts-view .account-toggle:hover .account-title strong {
  color: inherit;
  background: none;
  box-shadow: none;
}
#accounts-view .account-card {
  border: 1px solid #292929;
}
#accounts-view .account-card:hover {
  border-color: #ffffff;
  box-shadow: none;
}
#invites-view .searchbox:hover,
#invites-view .searchbox:hover input {
  border-color: #292929;
  box-shadow: none;
  outline: none;
}
.app-body,
.app-shell.chat-open .app-body { grid-template-columns: minmax(0, 1fr) !important; }
.chat-dock,
.chat-toggle { display: none !important; }
.parse-modes { display: flex; gap: 6px; margin-left: 4px; }
.parse-modes .mode-btn.active { background: #fff; color: #080808; border-color: #fff; }
.section-heading { overflow: visible; }
.dota-region-wrap { position: relative; z-index: 30; }
.dota-region-wrap .mode-btn.active { background: #fff; color: #080808; border-color: #fff; }
.dota-region-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 220px;
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #101010;
  border: 1px solid #292929;
  border-radius: 10px;
  box-shadow: 0 12px 28px #0008;
}
.dota-region-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: left;
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.dota-region-item:hover { background: #171717; }
.dota-region-item.active { background: #fff; color: #080808; }
#lolz_api_tokens, #faceit_api_keys {
  width: 100%; min-height: 88px; border: 1px solid #292929; border-radius: 10px;
  background: #080808; color: #fff; padding: 10px 12px; resize: vertical;
}
@media (max-width: 900px) {
  .check-board { grid-template-columns: 1fr; }
}

.tg-tabs, .tg-gate { display: none; }
html.tg-mini, html.tg-mini body, body.tg-mini {
  height: var(--tg-vh, 100dvh);
  min-height: var(--tg-vh, 100dvh);
  overflow: hidden;
  overscroll-behavior: none;
}
html.tg-mini .app-shell {
  height: var(--tg-vh, 100dvh);
  padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
}
html.tg-mini .sidebar,
html.tg-mini .nav-toggle,
html.tg-mini .nav-backdrop,
html.tg-mini .log-panel,
html.tg-mini .main-resize,
html.tg-mini footer,
html.tg-mini .surface-pulse,
html.tg-mini .sidebar-resize { display: none !important; }
html.tg-mini .tg-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: calc(58px + env(safe-area-inset-bottom, 0px));
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
  background: #101010;
  border-top: 1px solid #292929;
}
html.tg-mini .tg-tabs .nav {
  min-width: 0;
  height: 50px;
  padding: 4px 2px;
  gap: 2px;
  flex-direction: column;
  justify-content: center;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  color: #999;
  background: transparent;
}
html.tg-mini .tg-tabs .nav svg { width: 18px; height: 18px; }
html.tg-mini .tg-tabs .nav span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
html.tg-mini .tg-tabs .nav.active { background: #f2f2f2; color: #080808; }
html.tg-mini .topbar {
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 8px 12px 0;
  gap: 8px;
}
html.tg-mini .stats { justify-content: flex-start; overflow-x: auto; gap: 6px; }
html.tg-mini .stat { min-width: 78px; min-height: 48px; padding: 6px 10px; }
html.tg-mini .stat strong { font-size: 15px; }
html.tg-mini .main { padding: 10px 12px 12px; gap: 10px; }
html.tg-mini .section-heading,
html.tg-mini .players-tools,
html.tg-mini .accounts-toolbar,
html.tg-mini .button-row { flex-wrap: wrap; gap: 8px; }
html.tg-mini .button { min-height: 40px; }
html.tg-mini .searchbox,
html.tg-mini .searchbox input { width: 100%; }
html.tg-mini .table-card { border-radius: 12px; }
html.tg-mini .table-scroll { overflow: auto; }
html.tg-mini .table-head { display: none !important; }
html.tg-mini .table-head,
html.tg-mini .player-row {
  min-width: 0 !important;
  grid-template-columns: 1fr auto auto auto !important;
  grid-template-areas: "player player player player" "region dota rust cs";
  gap: 6px 8px;
  padding: 12px;
}
html.tg-mini .player { grid-area: player; }
html.tg-mini .region-pill { grid-area: region; font-size: 12px; color: #999; }
html.tg-mini .player-row > .value:nth-child(3) { grid-area: dota; }
html.tg-mini .player-row > .value:nth-child(4) { grid-area: rust; }
html.tg-mini .player-row > .value:nth-child(5) { grid-area: cs; }
html.tg-mini .player-row > .value {
  text-align: right;
  font-size: 13px;
}
html.tg-mini .player-row > .value::after {
  display: block;
  font-size: 10px;
  color: #999;
  font-weight: 500;
}
html.tg-mini .player-row > .value:nth-child(3)::after { content: "Dota"; }
html.tg-mini .player-row > .value:nth-child(4)::after { content: "Rust"; }
html.tg-mini .player-row > .value:nth-child(5)::after { content: "CS"; }
html.tg-mini .player-details { flex-wrap: wrap; gap: 8px; padding: 0 12px 12px; }
html.tg-mini .invite-head { display: none !important; }
html.tg-mini .invite-head,
html.tg-mini .invite-row {
  min-width: 0 !important;
  grid-template-columns: 1fr !important;
  gap: 6px;
  padding: 12px;
}
html.tg-mini .invite-tools { display: flex; flex-wrap: wrap; gap: 8px; }
html.tg-mini .invite-note { min-height: 40px; }
html.tg-mini .invite-from { height: 40px; }
html.tg-mini .accounts-split { display: block; }
html.tg-mini .account-card { padding: 12px; }
html.tg-mini .settings-grid { grid-template-columns: 1fr !important; }
html.tg-mini .check-board { grid-template-columns: 1fr; }
html.tg-mini .app-body,
html.tg-mini .app-shell.chat-open .app-body { grid-template-columns: minmax(0, 1fr) !important; }
html.tg-mini .chat-toggle { display: inline-flex !important; }
html.tg-mini .chat-dock {
  position: fixed;
  inset: 0;
  width: auto !important;
  min-width: 0 !important;
  z-index: 45;
  transform: translate3d(0, 104%, 0);
}
html.tg-mini .app-shell.chat-open .chat-dock { transform: none; }
html.tg-mini .workspace-overlay { padding: 0; }
html.tg-mini .workspace-panel,
html.tg-mini .workspace-panel.has-extra {
  width: 100%;
  height: 100%;
  border-radius: 0;
}
html.tg-mini .workspace-body,
html.tg-mini .workspace-body.has-chat,
html.tg-mini .workspace-body.has-chat.has-extra {
  grid-template-columns: 1fr;
}
html.tg-mini .modal-card { width: calc(100vw - 24px); max-height: 86dvh; overflow: auto; }
html.tg-mini .tg-gate {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  position: fixed;
  inset: 0;
  z-index: 80;
  padding: 28px 22px;
  background: #080808;
  color: #fff;
  text-align: center;
}
html.tg-mini .tg-gate.hidden { display: none; }
html.tg-mini #auth-gate { display: none !important; }
html.tg-mini #logout-btn { display: none !important; }
html.tg-mini .tg-gate strong { font-size: 20px; }
html.tg-mini .tg-gate p { margin: 0; color: #999; line-height: 1.45; }
html.tg-mini .notice-center { left: 8px; right: 8px; width: auto; }
html.tg-mini .parse-modes { width: 100%; }
html.tg-mini .toolbar { grid-column: 1 / -1; }
