:root {
  --shell: #20242b;
  --shell-soft: #2c3139;
  --page: #f4f6f8;
  --panel: #ffffff;
  --line: #dfe3e8;
  --line-dark: #cfd5dc;
  --text: #252a31;
  --muted: #717b88;
  --blue: #1677d2;
  --green: #198754;
  --red: #d83a3a;
  --amber: #d98b15;
}

html {
  position: relative;
  min-height: 100%;
  font-size: 14px;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--page);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif;
}

a { color: var(--blue); }

.btn,
.form-control,
.form-select,
.alert,
.card {
  border-radius: 3px;
}

.btn { font-size: .9rem; }
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 .18rem rgba(22, 119, 210, .18);
}

.admin-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.admin-header {
  min-height: 58px;
  color: #fff;
  background: var(--shell);
  border-bottom: 1px solid #11151a;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .2);
}

.admin-header-inner {
  width: 100%;
  min-height: 58px;
  padding: 0 24px;
  display: flex;
  align-items: stretch;
  gap: 26px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-decoration: none;
}

.admin-brand:hover { color: #fff; }

.admin-brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 4px;
  font-weight: 800;
  font-size: .85rem;
}

.admin-nav {
  display: flex;
  align-items: stretch;
}

.admin-nav a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 18px;
  color: #c9cdd3;
  text-decoration: none;
  transition: color .12s ease, background .12s ease;
}

.admin-nav a:hover,
.admin-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, .06);
}

.admin-nav a.active::after {
  position: absolute;
  right: 15px;
  bottom: 0;
  left: 15px;
  height: 3px;
  content: "";
  background: #409eff;
}

.admin-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.admin-user a {
  color: #d7dbe0;
  font-size: .85rem;
  text-decoration: none;
}

.admin-user form { margin: 0; }

.admin-logout {
  padding: 4px 12px;
  color: #e7e9ec;
  background: transparent;
  border: 1px solid #626a75;
  border-radius: 3px;
}

.admin-logout:hover { background: var(--shell-soft); }

.admin-main { flex: 1; }

.page-frame {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 18px 24px 34px;
}

.admin-footer {
  padding: 14px 24px;
  color: #929aa5;
  background: #fff;
  border-top: 1px solid var(--line);
  font-size: .8rem;
  text-align: center;
}

.page-toolbar {
  min-height: 46px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.page-toolbar h1 {
  margin: 0 0 3px;
  font-size: 1.3rem;
  font-weight: 700;
}

.page-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
}

.summary-strip,
.monitor-metrics {
  display: grid;
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--panel);
  border: 1px solid var(--line-dark);
  border-radius: 3px;
}

.dashboard-summary { grid-template-columns: repeat(4, 1fr); }

.summary-cell,
.monitor-metrics > div {
  min-width: 0;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--line);
}

.summary-cell:last-child,
.monitor-metrics > div:last-child { border-right: 0; }

.summary-cell span,
.monitor-metrics span {
  color: var(--muted);
  font-size: .8rem;
}

.summary-cell strong {
  font-size: 1.8rem;
  font-weight: 650;
}

.control-toolbar {
  min-height: 58px;
  margin-bottom: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
}

.connection-block {
  min-height: 40px;
  padding-right: 16px;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--line);
  white-space: nowrap;
}

.connection-caption { color: var(--muted); }

.status-dot {
  width: 9px;
  height: 9px;
  margin: 0 7px 0 1px;
  background: #8e97a3;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(142, 151, 163, .13);
}

.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(25, 135, 84, .13);
}

.status-dot.faulted {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(216, 58, 58, .13);
}

.current-group {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.current-group span,
.current-group small { color: var(--muted); }
.current-group strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.current-group small { font-size: .75rem; }

.toolbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.toolbar-actions .btn { min-width: 64px; padding: 6px 12px; }

.workspace-tabs {
  height: 43px;
  padding: 0 10px;
  display: flex;
  align-items: stretch;
  gap: 1px;
  background: #fff;
  border: 1px solid var(--line-dark);
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
}

.workspace-tabs a {
  position: relative;
  padding: 0 22px;
  display: flex;
  align-items: center;
  color: #505965;
  text-decoration: none;
}

.workspace-tabs a:hover { color: var(--blue); background: #f8fafc; }
.workspace-tabs a.active { color: var(--blue); font-weight: 650; }

.workspace-tabs a.active::after {
  position: absolute;
  right: 18px;
  bottom: -1px;
  left: 18px;
  height: 3px;
  content: "";
  background: var(--blue);
}

.draw-banner {
  min-height: 54px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 15px;
  color: #f2f4f7;
  background: #333941;
  border: 1px solid #272c32;
}

.draw-banner > span { color: #bdc4cd; }

.draw-banner > strong {
  min-width: 46px;
  color: #ffdc5e;
  font-family: Consolas, monospace;
  font-size: 1.8rem;
  line-height: 1;
  text-align: center;
}

.draw-banner > small { color: #c7cdd4; }

.monitor-metrics {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 0;
  border-radius: 0 0 3px 3px;
}

.monitor-metrics > div { padding: 11px 14px; }

.monitor-metrics strong {
  overflow: hidden;
  color: #252a31;
  font-family: Consolas, "Microsoft YaHei UI", sans-serif;
  font-size: 1.25rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitor-metrics .metric-small { font-size: .94rem; }

.monitor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(350px, 430px);
  gap: 12px;
  align-items: start;
}

.monitor-side {
  display: grid;
  gap: 12px;
}

.workspace-panel {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line-dark);
  border-radius: 3px;
}

.panel-heading {
  min-height: 45px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
}

.panel-heading > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.panel-heading h2,
.panel-heading strong {
  margin: 0;
  color: #303640;
  font-size: .98rem;
  font-weight: 700;
}

.panel-heading span { color: var(--muted); font-size: .78rem; }
.panel-heading a { font-size: .8rem; text-decoration: none; }

.monitor-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  color: var(--text);
  font-size: .86rem;
}

.monitor-table th {
  padding: 9px 12px;
  color: #6f7884;
  background: #f5f7f9;
  border-bottom: 1px solid var(--line);
  font-size: .76rem;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.monitor-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f3;
  vertical-align: middle;
}

.monitor-table tbody tr:last-child td { border-bottom: 0; }
.monitor-table tbody tr:hover td { background: #fbfcfd; }
.monitor-table td small { display: block; color: var(--muted); font-size: .72rem; }
.monitor-table td a { font-weight: 600; text-decoration: none; }
.monitor-table .bet-content { color: #293d58; font-family: Consolas, "Microsoft YaHei UI", sans-serif; }
.monitor-table .number-strong { font-weight: 700; font-variant-numeric: tabular-nums; }
.monitor-table .table-empty { padding: 42px 12px; color: #929aa5; text-align: center; }
.monitor-table.compact th,
.monitor-table.compact td { padding: 7px 9px; }
.bot-list-table td:first-child a { color: #273b52; font-weight: 700; }
.bot-list-table td:first-child a:hover { color: var(--blue); }

.compact-table-wrap { max-height: 260px; }
.player-monitor-panel { min-height: 448px; }
.recent-draw-panel .compact-table-wrap { max-height: 335px; overflow: auto; }

.message-panel { margin-top: 12px; }

.message-form {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}

.message-form textarea {
  min-height: 74px;
  padding: 9px 11px;
  resize: vertical;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  outline: none;
}

.message-form textarea:focus { border-color: #79aee0; box-shadow: 0 0 0 2px rgba(22, 119, 210, .1); }
.message-form .btn { min-width: 92px; }

.workspace-shortcuts {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.workspace-shortcuts a {
  min-height: 66px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  text-decoration: none;
}

.workspace-shortcuts a:hover { color: var(--blue); border-color: #91bce4; }
.workspace-shortcuts strong { font-size: 1.35rem; }
.workspace-shortcuts span { color: var(--muted); font-size: .8rem; }

.card {
  border: 1px solid var(--line-dark) !important;
  box-shadow: none !important;
}

.card-header {
  background: #fafbfc !important;
  border-bottom-color: var(--line);
}

.metric-card {
  min-height: 100px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
}

.metric-card span { color: var(--muted); font-size: .82rem; }
.metric-card strong { margin-top: 5px; font-size: 1.8rem; }
.empty-state { padding: 54px 18px; color: var(--muted); text-align: center; }
.page-narrow { max-width: 720px; margin: 0 auto; }
.login-wrap { min-height: calc(100vh - 190px); display: grid; place-items: center; }
.login-card { width: 100%; max-width: 420px; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; color: #fff; background: var(--blue); border-radius: 4px; font-weight: 800; font-size: 1.2rem; }
.data-count { padding: 12px; display: flex; flex-direction: column; background: #f8fafc; border: 1px solid var(--line); border-radius: 3px; }
.data-count strong { font-size: 1.35rem; }
.data-count span { color: var(--muted); font-size: .8rem; }
.detail-list dt { color: var(--muted); font-weight: 500; }
.table thead th { padding: .75rem; color: #6f7884; background: #f5f7f9; font-size: .76rem; font-weight: 600; }
.table tbody td { padding: .75rem; }
.module-link { min-height: 92px; padding: 13px; display: flex; flex-direction: column; gap: 4px; color: var(--text); background: #fff; border: 1px solid var(--line-dark); border-radius: 3px; text-decoration: none; transition: border-color .12s ease, background .12s ease; }
.module-link:hover { color: var(--blue); background: #fbfdff; border-color: #91bce4; }
.module-link span { color: var(--muted); font-size: .76rem; }

.bot-console-heading {
  min-height: 62px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.bot-console-heading h1 {
  margin: 4px 0 2px;
  font-size: 1.4rem;
  font-weight: 700;
}

.bot-console-heading p,
.bot-settings-header p,
.bot-settings-section-title p,
.bot-settings-tools p {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
}

.bot-console-back {
  color: #66717e;
  font-size: .8rem;
  text-decoration: none;
}

.bot-console-status {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.bot-console-status form { margin: 0 0 0 8px; }

.bot-console {
  min-height: 690px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
}

.bot-console-menu {
  position: relative;
  color: #fff;
  background: #1f2028;
  border-right: 1px solid #17181e;
}

.bot-console-menu-title {
  height: 58px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  color: #fff;
  background: #4d168b;
  font-size: 1rem;
  font-weight: 700;
}

.bot-console-menu-item {
  width: 100%;
  min-height: 48px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #d9d9df;
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  text-align: left;
}

.bot-console-menu-item.active {
  color: #fff;
  background: #2a2b35;
  border-left-color: #8a42d3;
  font-weight: 650;
}

.bot-console-menu-icon {
  width: 20px;
  color: #bea1db;
  font-size: 1rem;
  text-align: center;
}

.bot-console-menu-note {
  position: absolute;
  right: 20px;
  bottom: 20px;
  left: 20px;
  padding-top: 14px;
  color: #858792;
  border-top: 1px solid #343640;
  font-size: .76rem;
  line-height: 1.7;
}

.bot-console-content {
  min-width: 0;
  background: #fff;
}

.bot-settings-header {
  min-height: 72px;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.bot-settings-header h2 {
  margin: 0 0 4px;
  font-size: 1.18rem;
  font-weight: 700;
}

.bot-token-hint {
  padding: 6px 10px;
  color: #5f6874;
  background: #f4f6f8;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: Consolas, "Microsoft YaHei UI", sans-serif;
  font-size: .78rem;
}

.bot-console-content > .alert { margin: 18px 28px 0; }

.bot-automation-note {
  margin: 18px 28px 0;
  padding: 11px 14px;
  display: flex;
  gap: 12px;
  color: #2e5b3d;
  background: #f0f8f3;
  border: 1px solid #cbe5d3;
  border-radius: 3px;
  font-size: .84rem;
}

.bot-settings-form { padding: 4px 28px 24px; }

.bot-settings-section {
  padding: 24px 0;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 30px;
  border-bottom: 1px solid #e8ebef;
}

.bot-settings-section-title h3,
.bot-settings-tools h3 {
  margin: 0 0 5px;
  font-size: .98rem;
  font-weight: 700;
}

.bot-settings-fields {
  max-width: 760px;
  display: grid;
  gap: 18px;
}

.bot-settings-row {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.bot-settings-row > label {
  padding-top: 8px;
  color: #343a43;
  font-weight: 600;
  text-align: right;
}

.bot-settings-row > label span { color: var(--red); }
.bot-settings-row small { display: block; margin-top: 5px; color: var(--muted); font-size: .76rem; }

.bot-settings-actions {
  padding: 22px 0 2px 335px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.bot-settings-actions span { color: var(--muted); font-size: .78rem; }

.bot-settings-tools {
  margin: 0 28px 28px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #fafbfc;
  border: 1px solid var(--line);
}

.bot-settings-tools form { margin: 0; }

.bot-settings-tools.deposit-review-list {
  display: block;
}

.deposit-review-list > header {
  margin-bottom: 14px;
}

.bot-console-panel[hidden] { display: none; }

.group-message-note {
  margin: 18px 28px 0;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  color: #4f3a68;
  background: #f8f3fd;
  border: 1px solid #e0d0ef;
  border-radius: 3px;
  font-size: .84rem;
}

.group-message-form {
  padding: 20px 28px 28px;
}

.group-message-card {
  margin-bottom: 20px;
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 5px;
  box-shadow: 0 2px 7px rgba(31, 32, 40, .04);
}

.group-message-card-heading {
  min-height: 72px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #fafbfc;
  border-bottom: 1px solid #e7e9ed;
}

.group-message-card-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.group-message-card-heading h3 {
  margin: 0 0 3px;
  color: #292d34;
  font-size: 1rem;
  font-weight: 700;
}

.group-message-card-heading p {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
}

.group-message-order {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  color: #fff;
  background: #5b238f;
  border-radius: 50%;
  font-size: .82rem;
  font-weight: 700;
}

.group-message-editor {
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
}

.group-message-text > label,
.group-message-image > label:first-child {
  margin-bottom: 7px;
  display: block;
  color: #343a43;
  font-size: .84rem;
  font-weight: 700;
}

.group-message-text textarea {
  min-height: 170px;
  resize: vertical;
  line-height: 1.65;
}

.template-placeholders {
  margin-top: 9px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: .75rem;
}

.template-placeholders button {
  padding: 3px 8px;
  color: #5b238f;
  background: #f5eefb;
  border: 1px solid #ddc9ee;
  border-radius: 3px;
  font-size: .74rem;
}

.template-placeholders button:hover {
  color: #fff;
  background: #6b2ca3;
  border-color: #6b2ca3;
}

.template-image-preview {
  height: 150px;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f2f3f5;
  border: 1px dashed #bdc3ca;
  border-radius: 4px;
}

.template-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #18191e;
}

.template-image-preview span {
  color: #9198a1;
  font-size: .78rem;
}

.group-message-image small {
  margin-top: 5px;
  display: block;
  color: var(--muted);
  font-size: .74rem;
}

.start-button-settings {
  margin: 0 18px 18px;
  padding: 16px;
  background: #f8f9fb;
  border: 1px solid #e2e5e9;
  border-radius: 5px;
}

.start-button-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.start-button-add-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.start-button-heading h4 { margin: 0 0 3px; font-size: .94rem; font-weight: 700; }
.start-button-heading p { margin: 0; color: var(--muted); font-size: .76rem; }

.start-button-help {
  margin: 12px 0;
  padding: 9px 11px;
  color: #515967;
  background: #eef3f8;
  border-radius: 4px;
  font-size: .75rem;
}

.start-button-list { display: grid; gap: 9px; }

.start-button-item {
  padding: 10px;
  display: grid;
  grid-template-columns: 72px minmax(120px, 1fr) minmax(140px, 1fr) 118px minmax(160px, 1fr) 58px;
  align-items: end;
  gap: 9px;
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
}

.start-button-item label:not(.form-check) {
  margin-bottom: 4px;
  display: block;
  color: #69717c;
  font-size: .72rem;
}

.start-button-enabled { align-self: center; margin: 19px 0 0; }
.start-button-remove { margin-bottom: 1px; }

.template-remove-image {
  margin-top: 10px;
  color: #b33b3b;
  font-size: .78rem;
}

.group-message-actions {
  padding: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.group-message-actions span {
  color: var(--muted);
  font-size: .78rem;
}

.odds-command-note {
  margin: 18px 28px 0;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  color: #334f6d;
  background: #f1f7fc;
  border: 1px solid #cfe0ef;
  border-radius: 3px;
  font-size: .84rem;
}

.odds-command-form { padding: 20px 28px 28px; }

.player-query-section {
  margin-bottom: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 5px;
  box-shadow: 0 2px 7px rgba(31, 32, 40, .04);
}

.player-query-grid {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.player-query-card { display: grid; gap: 7px; }
.player-query-card > span { display: grid; gap: 2px; }
.player-query-card strong { color: #4d168b; font-size: .86rem; }
.player-query-card small { min-height: 2.3em; color: var(--muted); font-size: .7rem; line-height: 1.15; }
.player-query-card .form-control { min-height: 34px; padding: 5px 8px; font-size: .82rem; }

.odds-play-section,
.return-play-section {
  margin-bottom: 20px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 5px;
  box-shadow: 0 2px 7px rgba(31, 32, 40, .04);
}

.odds-play-heading,
.return-play-heading {
  min-height: 62px;
  padding: 13px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #fafbfc;
  border-bottom: 1px solid #e6e9ed;
}

.odds-play-heading h3,
.return-play-heading h3 {
  margin: 0 0 3px;
  font-size: 1rem;
  font-weight: 700;
}

.odds-play-heading p,
.return-play-heading p,
.return-special-title p {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
}

.odds-play-heading > span,
.return-odds-title span {
  padding: 3px 8px;
  color: #66319a;
  background: #f3eafa;
  border-radius: 10px;
  font-size: .7rem;
}

.odds-table-scroll { overflow-x: auto; }

.odds-command-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.odds-command-table th {
  padding: 9px 11px;
  color: #66707c;
  background: #f7f8fa;
  border-bottom: 1px solid #e5e8ec;
  font-size: .74rem;
  font-weight: 650;
  white-space: nowrap;
}

.odds-command-table td {
  padding: 10px 11px;
  border-bottom: 1px solid #edf0f3;
}

.odds-command-table tbody tr:last-child td { border-bottom: 0; }
.odds-command-table th:first-child,
.odds-command-table td:first-child { width: 74px; }
.odds-command-table th:not(:first-child):not(:last-child),
.odds-command-table td:not(:first-child):not(:last-child) { width: 145px; }
.odds-command-table th:last-child,
.odds-command-table td:last-child { min-width: 210px; }
.odds-play-name { color: #4d168b; font-weight: 750; text-align: center; white-space: nowrap; }
.odds-command-table .form-control { min-height: 38px; }

.odds-play-section-compact { margin-bottom: 14px; }
.odds-command-table-compact { min-width: 1080px; }
.odds-command-table-compact th { padding: 7px 8px; }
.odds-command-table-compact td { padding: 7px 8px; }
.odds-command-table-compact th:first-child,
.odds-command-table-compact td:first-child { width: 120px; }
.odds-command-table-compact th:not(:first-child):not(:last-child),
.odds-command-table-compact td:not(:first-child):not(:last-child) { width: 112px; }
.odds-command-table-compact th:last-child,
.odds-command-table-compact td:last-child { min-width: 285px; }
.odds-command-table-compact .form-control { min-height: 34px; padding: 5px 8px; font-size: .8rem; }

.compact-command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 8px;
}

.compact-command-grid label {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  color: #606974;
  font-size: .7rem;
}

.odds-check-card {
  margin: 0 0 14px;
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  color: #303741;
  background: #fffaf0;
  border: 1px solid #ecd9ad;
  border-radius: 5px;
  cursor: pointer;
}

.odds-check-card input { margin-top: 4px; }
.odds-check-card span { display: grid; gap: 3px; }
.odds-check-card small { color: #786a4d; font-size: .76rem; }

.number-play-section {
  margin-bottom: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 5px;
  box-shadow: 0 2px 7px rgba(31, 32, 40, .04);
}

.number-play-heading {
  min-height: 58px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #f4f8fb;
  border-bottom: 1px solid #e2e8ed;
}

.number-play-heading h3 { margin: 0 0 2px; font-size: 1rem; font-weight: 700; }
.number-play-heading p { margin: 0; color: var(--muted); font-size: .74rem; }
.number-separator-setting { display: grid; grid-template-columns: auto 180px; align-items: center; gap: 8px; color: #59636f; font-size: .74rem; white-space: nowrap; }
.number-separator-setting .form-control { min-height: 32px; padding: 4px 8px; font-size: .78rem; }

.number-table-grid {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.number-table-scroll { min-width: 0; overflow-x: auto; border: 1px solid #e4e7ea; border-radius: 4px; }
.number-command-table { width: 100%; min-width: 425px; border-collapse: collapse; }
.number-command-table th { padding: 6px; color: #66707c; background: #f7f8fa; border-bottom: 1px solid #e5e8ec; font-size: .68rem; font-weight: 650; white-space: nowrap; }
.number-command-table td { padding: 5px 6px; border-bottom: 1px solid #edf0f3; }
.number-command-table tbody tr:last-child td { border-bottom: 0; }
.number-command-table .form-control { min-height: 30px; padding: 3px 6px; font-size: .74rem; }
.number-command-table th:first-child,
.number-command-table td:first-child { width: 58px; }
.number-command-table th:nth-child(2),
.number-command-table td:nth-child(2),
.number-command-table th:nth-child(3),
.number-command-table td:nth-child(3),
.number-command-table th:nth-child(4),
.number-command-table td:nth-child(4) { width: 66px; }
.number-pair-name { color: #315c83; font-size: .76rem; font-weight: 750; text-align: center; white-space: nowrap; }
.number-command-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.number-command-pair label { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 3px; color: #66707a; font-size: .66rem; }
.number-play-help { margin: 0 10px 10px; padding: 7px 9px; color: #5c6873; background: #f7f9fa; border-radius: 3px; font-size: .7rem; }

.return-play-heading { background: #f8f3fc; }
.return-odds-grid { padding: 13px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.return-odds-card {
  padding: 11px;
  background: #fff;
  border: 1px solid #e0e3e7;
  border-radius: 4px;
}

.return-odds-title { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.return-odds-card > label { display: grid; gap: 5px; color: #59616d; font-size: .75rem; font-weight: 650; }
.return-command-list { margin-top: 9px; padding-top: 9px; display: grid; gap: 6px; border-top: 1px solid #eceef1; }
.return-command-list label { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 7px; color: #69717c; font-size: .72rem; }

.return-special-title { padding: 4px 17px 10px; }
.return-special-title h4 { margin: 0 0 3px; font-size: .9rem; font-weight: 700; }
.return-special-grid { padding: 0 17px 17px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }

.return-special-grid label {
  min-height: 48px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fafbfc;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  font-size: .8rem;
  cursor: pointer;
}

.return-rule-example {
  margin: 0 17px 17px;
  padding: 11px 13px;
  display: grid;
  gap: 4px;
  color: #355641;
  background: #f1f8f3;
  border: 1px solid #cce4d2;
  border-radius: 4px;
  font-size: .78rem;
}

.odds-command-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.odds-command-actions span { color: var(--muted); font-size: .78rem; }

@media (max-width: 1100px) {
  .player-query-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bot-settings-section { grid-template-columns: 155px minmax(0, 1fr); gap: 20px; }
  .bot-settings-row { grid-template-columns: 130px minmax(0, 1fr); }
  .bot-settings-actions { padding-left: 305px; }
  .group-message-editor { grid-template-columns: minmax(0, 1fr) 240px; }
  .start-button-item { grid-template-columns: 72px 1fr 1fr 118px 58px; }
  .start-button-url { grid-column: 2 / 5; }
  .return-odds-grid { grid-template-columns: 1fr; }
  .number-table-grid { grid-template-columns: 1fr; }
  .return-special-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitor-layout { grid-template-columns: 1fr; }
  .monitor-side { grid-template-columns: 1fr 1fr; }
  .monitor-metrics { grid-template-columns: repeat(4, 1fr); }
  .monitor-metrics > div { border-bottom: 1px solid var(--line); }
  .monitor-metrics > div:nth-child(4n) { border-right: 0; }
  .monitor-metrics > div:nth-last-child(-n+3) { border-bottom: 0; }
  .workspace-shortcuts { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .player-query-grid { grid-template-columns: 1fr; }
  .admin-header-inner { padding: 0 12px; flex-wrap: wrap; gap: 0; }
  .admin-brand { min-height: 54px; }
  .admin-nav { width: 100%; order: 3; border-top: 1px solid #363c45; }
  .admin-nav a { min-height: 40px; padding: 0 14px; }
  .admin-user { margin-left: auto; }
  .admin-user > a { display: none; }
  .page-frame { padding: 12px; }
  .bot-console-heading { align-items: flex-start; flex-direction: column; }
  .bot-console-status { width: 100%; }
  .bot-console-status form { margin-left: auto; }
  .bot-console { min-height: 0; grid-template-columns: 1fr; }
  .bot-console-menu { border-right: 0; }
  .bot-console-menu-title { height: 48px; }
  .bot-console-menu-note { display: none; }
  .bot-console-menu-item { min-height: 44px; }
  .bot-settings-header { padding: 16px; align-items: flex-start; flex-direction: column; }
  .bot-console-content > .alert,
  .bot-automation-note { margin: 14px 16px 0; }
  .group-message-note { margin: 14px 16px 0; flex-direction: column; gap: 4px; }
  .odds-command-note { margin: 14px 16px 0; flex-direction: column; gap: 4px; }
  .group-message-form { padding: 16px; }
  .odds-command-form { padding: 16px; }
  .group-message-editor { grid-template-columns: 1fr; }
  .group-message-image { max-width: 420px; }
  .start-button-heading { align-items: flex-start; flex-direction: column; }
  .start-button-item { grid-template-columns: 1fr; align-items: stretch; }
  .start-button-enabled { margin-top: 0; }
  .start-button-url { grid-column: auto; }
  .start-button-remove { justify-self: start; }
  .group-message-actions { align-items: flex-start; flex-direction: column; }
  .odds-command-actions { align-items: flex-start; flex-direction: column; }
  .return-play-heading { align-items: flex-start; flex-direction: column; }
  .number-play-heading { align-items: flex-start; flex-direction: column; }
  .number-separator-setting { width: 100%; grid-template-columns: 1fr; white-space: normal; }
  .return-odds-grid { padding: 14px; }
  .return-special-grid { padding: 0 14px 14px; grid-template-columns: 1fr; }
  .return-special-title { padding-right: 14px; padding-left: 14px; }
  .return-rule-example { margin: 0 14px 14px; }
  .bot-automation-note { flex-direction: column; gap: 4px; }
  .bot-settings-form { padding: 0 16px 20px; }
  .bot-settings-section { grid-template-columns: 1fr; gap: 16px; padding: 20px 0; }
  .bot-settings-row { grid-template-columns: 1fr; gap: 5px; }
  .bot-settings-row > label { padding-top: 0; text-align: left; }
  .bot-settings-actions { padding: 20px 0 0; align-items: flex-start; flex-direction: column; }
  .bot-settings-tools { margin: 0 16px 18px; align-items: flex-start; flex-direction: column; }
  .control-toolbar { align-items: stretch; flex-direction: column; }
  .connection-block { min-height: 30px; border-right: 0; border-bottom: 1px solid var(--line); }
  .current-group { flex-wrap: wrap; }
  .toolbar-actions { width: 100%; margin-left: 0; overflow-x: auto; }
  .workspace-tabs { overflow-x: auto; }
  .workspace-tabs a { padding: 0 15px; white-space: nowrap; }
  .monitor-metrics { grid-template-columns: repeat(2, 1fr); }
  .monitor-metrics > div,
  .monitor-metrics > div:nth-child(4n) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .monitor-metrics > div:nth-child(2n) { border-right: 0; }
  .monitor-metrics > div:last-child { border-bottom: 0; }
  .monitor-side { grid-template-columns: 1fr; }
  .message-form { grid-template-columns: 1fr; }
  .message-form .btn { min-height: 42px; }
  .workspace-shortcuts { grid-template-columns: repeat(2, 1fr); }
  .dashboard-summary { grid-template-columns: repeat(2, 1fr); }
  .summary-cell { border-bottom: 1px solid var(--line); }
  .summary-cell:nth-child(2n) { border-right: 0; }
  .summary-cell:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 480px) {
  .admin-brand span:last-child { font-size: .9rem; }
  .page-toolbar { align-items: flex-start; }
  .workspace-shortcuts { grid-template-columns: 1fr; }
}
