:root {
  --bg: #0b0f13;
  --panel: #121820;
  --panel2: #171f28;
  --line: #26313b;
  --text: #f0f3f5;
  --muted: #a3afb8;
  --mint: #57d6ad;
  --gold: #e6bd6a;
  --danger: #ef8074;
  --shadow: 0 18px 48px #0005;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "PingFang SC",
    "Noto Sans SC",
    sans-serif;
}

body {
  background: var(--bg);
}
.eyebrow {
  display: none;
}
aside {
  background: #0d1218f2;
}
main {
  max-width: 1480px;
  margin: 0 auto;
}
header {
  margin-bottom: 24px;
}
header h2 {
  font-size: 26px;
  letter-spacing: -0.03em;
}
.panel,
.metrics article {
  background: var(--panel);
  border-color: var(--line);
  border-radius: 12px;
}
.metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.list-item {
  color: var(--text);
  text-align: left;
}
.list-item > span:last-child {
  color: var(--mint);
}
.hero {
  background: linear-gradient(110deg, #17251f, #121820 60%);
  border-color: #315346;
  border-radius: 12px;
  box-shadow: none;
}
.hero h3 {
  font-size: 26px;
}
button {
  border-radius: 8px;
}
input,
select {
  border-radius: 7px;
  background: #0c1218;
  border-color: #34414c;
}
.field-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}
.action-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}
.text-status {
  color: var(--muted);
  font-size: 12px;
  margin-right: 5px;
}
.connection-main {
  min-width: 0;
  flex: 1;
}
.connection-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
}
.connection-meta small {
  color: var(--muted);
}
.role-badge,
.disabled-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}
.role-badge.operator {
  background: #e8f1ff;
  color: #145dbf;
}
.role-badge.robot {
  background: #e5f6ed;
  color: #18794e;
}
.role-badge.ordinary {
  background: #f0f2f5;
  color: #4f5c69;
}
.disabled-badge {
  background: #fff0ed;
  color: #b42318;
}
.connection-auth-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 8px 12px;
  max-width: 720px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #cbdcf3;
  border-radius: 9px;
  background: #f5f9ff;
}
.connection-auth-form label {
  display: grid;
  gap: 6px;
  color: #445160;
  font-size: 12px;
  font-weight: 650;
}
.connection-auth-form input {
  min-height: 38px;
}
.connection-auth-form > div {
  display: flex;
  gap: 7px;
}
.connection-auth-form .field-error {
  grid-column: 1 / -1;
  min-height: 0;
}
.group-choice {
  background: #fff;
  color: #17212b;
  box-shadow: none;
}
.group-choice:hover {
  background: #f5f8fc;
  color: #17212b;
  border-color: #b8c9de;
}
.group-choice:focus-visible {
  background: #fff;
  color: #17212b;
  border-color: #1769e0;
  outline: 3px solid rgba(23, 105, 224, 0.18);
  outline-offset: 2px;
}
.group-choice.selected,
.group-choice.selected:hover,
.group-choice.selected:focus-visible {
  background: #edf5ff;
  color: #17212b;
  border-color: #8db8ef;
}
.group-choice:disabled {
  opacity: 1;
  background: #f0f3f7;
  color: #445160;
  border-color: #cfd8e3;
}
.group-choice > span:last-child,
.group-choice .group-action {
  color: #1769e0;
  font-weight: 750;
}
.group-choice:disabled .group-action {
  color: #596b7d;
}

.page-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.page-tools h3 {
  margin: 0 0 4px;
  font-size: 18px;
}
.page-tools p {
  margin: 0;
  color: var(--muted);
}
.search-field {
  width: min(320px, 100%);
}
.player-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.status-filter {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c1218;
}
.status-filter button {
  min-height: 34px;
  padding: 6px 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  box-shadow: none;
}
.status-filter button:hover {
  color: var(--text);
  background: #152019;
}
.status-filter button.active {
  color: var(--mint);
  background: #183128;
}
.player-summaries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 12px;
}
.player-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
}
.summary-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.summary-identity h4 {
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.summary-identity small {
  color: var(--muted);
}
.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 9px;
  background: #1b2c27;
  color: var(--mint);
  font-weight: 800;
}
.player-summary dl {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 2px 0 0;
}
.player-summary dl div {
  padding: 9px;
  background: #0d1319;
  border-radius: 7px;
}
.player-summary dt {
  color: var(--muted);
  font-size: 10px;
}
.player-summary dd {
  margin: 4px 0 0;
  font:
    600 12px ui-monospace,
    monospace;
}
.player-summary > button {
  grid-column: 1 / -1;
}
.player-summary .connection-state {
  display: inline-flex;
  align-items: center;
  align-self: start;
  gap: 6px;
  padding: 6px 0;
  border-radius: 0;
  background: transparent;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}
.player-summary .connection-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.player-summary .connection-state.online {
  background: transparent;
  color: var(--mint);
}
.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.odds-tree {
  display: grid;
  gap: 10px;
}
.odds-branch {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
}
.odds-branch > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 17px;
  cursor: pointer;
  list-style: none;
}
.odds-branch > summary::-webkit-details-marker {
  display: none;
}
.odds-branch > summary label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.odds-branch > summary input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}
.odds-branch > summary span {
  display: grid;
  gap: 2px;
}
.odds-branch > summary small {
  color: #596573;
  font-size: 11px;
  font-weight: 400;
}
.odds-branch > summary i {
  color: #596573;
  font-size: 11px;
  font-style: normal;
}
.odds-branch[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #f2f6fb;
}
.odds-branch[open] > summary i {
  color: #1769e0;
}
.odds-branch-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
  padding: 14px;
}
.payout-limit {
  display: grid;
  grid-template-columns: minmax(220px, 340px) auto 1fr;
  align-items: end;
  gap: 10px;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
}
.payout-limit label,
.odd-input {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}
.payout-limit small,
.odd-input small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}
.odds-guide-actions {
  display: flex;
  justify-content: flex-end;
  margin: 2px 0 12px;
}
.odds-guide-copybar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
}
.odds-guide-text {
  max-height: 560px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
  color: var(--text);
  font:
    13px/1.8 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}
.odds-toolbar label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.odds-toolbar label input {
  width: auto;
  min-height: auto;
}
.odds {
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
}
.odd-row {
  grid-template-columns: minmax(70px, 1fr) minmax(0, 0.9fr) minmax(0, 1fr);
}
.odd-row > span {
  min-width: 0;
}
.odd-input input {
  min-width: 0;
}
.history-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding-bottom: 2px;
}
.history-tabs button {
  flex: 0 0 auto;
  background: #131b22;
  color: var(--muted);
  border: 1px solid var(--line);
}
.history-tabs button[aria-selected="true"] {
  background: #1a3029;
  color: var(--text);
  border-color: #315346;
}
.history-tabs span {
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 99px;
  background: #0b1116;
  font-size: 10px;
}
.history-pane > h3 {
  margin: 0 0 16px;
}

dialog {
  color: var(--text);
}
dialog::backdrop {
  background: #020507b8;
  backdrop-filter: blur(3px);
}
.sheet {
  width: min(700px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 1px solid #34414c;
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.player-editor {
  min-height: min(760px, calc(100vh - 30px));
  display: flex;
  flex-direction: column;
}
.sheet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: start;
  justify-content: space-between;
  padding: 22px 24px;
  background: #121820f5;
  border-bottom: 1px solid var(--line);
}
.sheet-head p,
.sheet-head h2 {
  margin: 0;
}
.sheet-head p,
.sheet-head small {
  color: var(--muted);
  font-size: 12px;
}
.sheet-head h2 {
  margin: 3px 0;
  font-size: 22px;
}
.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 23px;
}
.unsaved {
  padding: 9px 24px;
  background: #362b16;
  color: var(--gold);
  font-size: 12px;
}
.config-section {
  margin: 0 24px;
  border-bottom: 1px solid var(--line);
}
.config-section > summary {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 17px 0;
  cursor: pointer;
  list-style: none;
}
.config-section > summary::-webkit-details-marker {
  display: none;
}
.config-section > summary > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1d2b27;
  color: var(--mint);
  font-size: 11px;
}
.config-section > summary small {
  color: var(--muted);
}
.config-body {
  padding: 0 0 18px;
}
.sheet-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: auto;
  padding: 16px 24px;
  background: #121820f5;
  border-top: 1px solid var(--line);
}
.editor-error {
  margin: 10px 24px 0;
}

.confirm-dialog {
  width: min(430px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid #3a4651;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.confirm-dialog h3 {
  margin: 0 0 10px;
}
.confirm-dialog p {
  color: var(--muted);
  line-height: 1.6;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

.ledger-table {
  overflow-x: auto;
}
.ledger-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 16px 0;
}
.ledger-empty td {
  padding: 30px !important;
  color: var(--muted);
  text-align: center;
}
.ledger-table table {
  width: 100%;
  border-collapse: collapse;
}
.ledger-table th {
  padding: 11px 14px;
  background: #18222a;
  color: var(--muted);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
}
.ledger-table td {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}
.ledger-table td strong,
.ledger-table td small {
  display: block;
}
.ledger-table td small {
  margin-top: 3px;
  color: var(--muted);
}
.ledger-status {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  margin: 0 0 0 10px !important;
  color: var(--danger) !important;
  font-weight: 600;
}
.ledger-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.ledger-status.online {
  color: var(--mint) !important;
}
.ledger-table input {
  min-width: 140px;
}
.ledger-actions {
  display: flex;
  gap: 7px;
}
.ledger-row-error {
  width: 250px;
  height: 42px;
  overflow: auto;
  margin: 5px 0 0;
  color: #b42318;
  font-size: 10px;
  line-height: 1.35;
}
.ledger-table input[aria-invalid="true"] {
  border-color: #c4382b;
  box-shadow: 0 0 0 3px rgba(196, 56, 43, 0.1);
}
.point-history-dialog {
  width: min(980px, calc(100vw - 28px));
}
.point-history-shell {
  min-height: min(680px, calc(100vh - 30px));
  display: flex;
  flex-direction: column;
}
.point-history-content {
  padding: 22px 24px 28px;
}
.point-history-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.point-history-summary article {
  padding: 14px 16px;
  border: 1px solid #dfe4ea;
  border-radius: 9px;
  background: #f7f9fb;
}
.point-history-summary span {
  display: block;
  color: #687482;
  font-size: 11px;
}
.point-history-summary strong {
  display: block;
  margin-top: 6px;
  color: #17212b;
  font-size: 18px;
}
.point-chart-legend {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0 0 8px;
  color: #445160;
  font-size: 12px;
}
.point-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.point-chart-legend span::before {
  content: "";
  width: 24px;
  border-top: 3px solid #1769e0;
}
.point-chart-legend .investment::before {
  border-top-color: #d98212;
  border-top-style: dashed;
}
.point-chart-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #dfe4ea;
  border-radius: 10px;
  background: #fff;
}
.point-chart {
  display: block;
  width: 100%;
  min-width: 680px;
  height: auto;
}
.chart-grid line {
  stroke: #e3e8ee;
  stroke-width: 1;
}
.chart-grid text {
  fill: #687482;
  font-size: 11px;
}
.chart-grid .axis-title {
  fill: #445160;
  font-weight: 700;
}
.balance-line,
.investment-line {
  fill: none;
  vector-effect: non-scaling-stroke;
}
.balance-line {
  stroke: #1769e0;
  stroke-width: 3;
}
.investment-line {
  stroke: #d98212;
  stroke-width: 2.5;
  stroke-dasharray: 8 6;
}
.balance-point {
  fill: #fff;
  stroke: #1769e0;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}
.point-history-note {
  margin: 13px 0 0;
  color: #687482;
  font-size: 11px;
  line-height: 1.6;
}
.point-history-empty {
  margin-top: 12px;
}
.point-history-content .error-state {
  display: grid;
  justify-items: center;
  gap: 14px;
  color: #a82b20;
}

@media (min-width: 901px) {
  .ledger-table th:last-child,
  .ledger-table td:last-child {
    width: 250px;
  }
}

@media (max-width: 900px) {
  html {
    scroll-padding-bottom:calc(120px + env(safe-area-inset-bottom));
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #shell {
    display: block;
  }
  #shell > main {
    padding-bottom: 120px;
  }
  #players :is(button,input,select,a,[tabindex]):not([tabindex="-1"]) {
    scroll-margin-block-end:calc(120px + env(safe-area-inset-bottom));
  }
  aside {
    position: relative;
    height: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    backdrop-filter: none;
  }
  .brand {
    padding: 0;
  }
  .brand > span {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    font-size: 16px;
  }
  .aside-foot {
    display: flex;
    margin: 0;
    padding: 0;
    border: 0;
    gap: 8px;
  }
  nav {
    position: fixed;
    z-index: 20;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 7px max(8px, env(safe-area-inset-right))
      calc(7px + env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
    background: #0d1218f7;
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 28px #0007;
  }
  nav button {
    min-height: 38px;
    padding: 7px 5px;
    text-align: center;
    font-size: 12px;
  }
  nav button.active:before {
    display: none;
  }
  main {
    padding: 22px 18px 126px;
  }
  .page-tools {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .search-field {
    width: 100%;
  }
  .player-tools {
    align-items: stretch;
    flex-direction: column-reverse;
  }
  .ledger-tools {
    align-items: stretch;
    flex-direction: column-reverse;
  }
  .status-filter {
    align-self: flex-start;
  }
  .panel-title:has(.panel-actions) {
    align-items: flex-start;
    gap: 14px;
  }
}

@media (max-width: 620px) {
  .metrics {
    grid-template-columns: 1fr;
  }
  .connection-card {
    align-items: flex-start;
    flex-direction: column;
  }
  .card-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .connection-main {
    width: 100%;
  }
  .connection-auth-form {
    grid-template-columns: 1fr;
  }
  .connection-auth-form > div {
    display: grid;
    grid-template-columns: 1fr;
  }
  .connection-auth-form .field-error {
    grid-column: auto;
  }
  .action-pair {
    grid-template-columns: 1fr;
  }
  .player-summaries {
    grid-template-columns: 1fr;
  }
  .panel-title:has(.panel-actions) {
    display: grid;
  }
  .panel-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .odds-branch-items {
    grid-template-columns: 1fr;
  }
  .payout-limit {
    grid-template-columns: 1fr auto;
  }
  .payout-limit > small {
    grid-column: 1 / -1;
  }
  .player-summary dl {
    grid-template-columns: 1fr 1fr;
  }
  .sheet {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }
  .sheet-head,
  .sheet-actions {
    padding-left: 18px;
    padding-right: 18px;
  }
  .config-section {
    margin: 0 18px;
  }
  .ledger-table {
    border: 0;
    overflow: visible;
  }
  .ledger-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .ledger-table table,
  .ledger-table tbody,
  .ledger-table tr,
  .ledger-table td {
    display: block;
    width: 100%;
  }
  .ledger-table tr {
    margin-bottom: 10px;
    padding: 12px;
    background: #10171e;
    border: 1px solid var(--line);
    border-radius: 9px;
  }
  .ledger-table td {
    display: grid;
    grid-template-columns: 100px 1fr;
    align-items: center;
    padding: 7px 0;
    border: 0;
  }
  .ledger-table td:before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
  }
  .ledger-table td button,
  .ledger-table td input {
    width: 100%;
  }
  .ledger-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .ledger-row-error {
    width: 100%;
  }
  .point-history-dialog {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }
  .point-history-content {
    padding: 18px;
  }
  .point-history-summary {
    grid-template-columns: 1fr;
  }
}

/* Fly-order pages intentionally form a separate product area. */
.nav-divider { display: block; height: 1px; margin: 15px 8px 8px; background: var(--line); }
.nav-group-label { padding: 3px 13px 2px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.fly-settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.fly-settings-grid .panel { margin-bottom: 16px; }
.toggle-label { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.toggle-label input { width: 18px; height: 18px; margin: 0; }
.fly-player-panel { margin-top: 16px; }
.fly-player-form { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(160px, .7fr) auto; gap: 12px; align-items: end; }
.fly-player-form label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.fly-player-form .field-error { grid-column: 1 / -1; margin: 0; }
.fly-rule-list { display: grid; gap: 8px; margin-top: 18px; }
.fly-rule-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 12px; align-items: center; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); }
.fly-rule-row strong, .fly-rule-row small { display: block; }
.fly-rule-row small { color: var(--muted); margin-top: 3px; }
.fly-robot-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.fly-robot-meta span { padding: 11px; border-radius: 10px; background: var(--panel2); }
.fly-robot-meta small, .fly-robot-meta b { display: block; }
.fly-robot-meta small { color: var(--muted); margin-bottom: 5px; }
.fly-statistics-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 25px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.fly-statistics-head h3 { margin: 4px 0 7px; font-size: 25px; }
.fly-statistics-head p { margin-bottom: 0; color: var(--muted); }
.fly-statistics-table { overflow-x: auto; }
.fly-statistics-table table { width: 100%; min-width: 980px; border-collapse: collapse; }
.fly-statistics-table th, .fly-statistics-table td { padding: 12px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.fly-statistics-table th:first-child, .fly-statistics-table td:first-child { text-align: left; position: sticky; left: 0; background: var(--panel); }
.fly-statistics-table td small { display: block; color: var(--muted); margin-top: 3px; }
.fly-profit-positive { color: #167f5b; }
.fly-profit-negative { color: var(--danger); }

@media (max-width: 900px) {
  nav .nav-divider { width: 1px; height: 34px; margin: 1px 8px; flex: 0 0 1px; }
  nav .nav-group-label { display: none; }
  .fly-settings-grid { grid-template-columns: 1fr; }
  .fly-statistics-head { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 620px) {
  .fly-player-form { grid-template-columns: 1fr; }
  .fly-player-form .field-error { grid-column: auto; }
  .fly-rule-row { grid-template-columns: 1fr; align-items: stretch; }
  .fly-robot-meta { grid-template-columns: 1fr; }
  .fly-statistics-head { padding: 18px; }
}

/* Product console visual system */
:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel2: #f7f9fb;
  --line: #dfe4ea;
  --text: #17212b;
  --muted: #687482;
  --mint: #1677ff;
  --gold: #b56a00;
  --danger: #c4382b;
  --shadow: 0 12px 32px rgba(23, 33, 43, 0.08);
}
body {
  background: var(--bg);
  color: var(--text);
}
.eyebrow {
  display: none;
}
button {
  border-radius: 7px;
  background: #1769e0;
  color: #fff;
  box-shadow: 0 1px 2px rgba(20, 43, 72, 0.15);
}
button:hover {
  filter: none;
  background: #0f5fcf;
  transform: none;
}
button:focus-visible {
  outline: 3px solid rgba(23, 105, 224, 0.22);
  outline-offset: 2px;
}
.set-billing-name:focus {
  outline: 3px solid rgba(23, 105, 224, 0.22);
  outline-offset: 2px;
}
button:disabled {
  background: #aeb8c4;
  color: #f4f6f8;
}
.secondary,
.ghost {
  background: #fff;
  color: #344150;
  border-color: #cfd6df;
  box-shadow: none;
}
.secondary:hover,
.ghost:hover {
  background: #f5f7fa;
}
#shell {
  grid-template-columns: 224px 1fr;
}
aside {
  padding: 22px 14px;
  background: #111a24;
  border: 0;
  color: #fff;
}
.brand {
  padding: 0 8px 26px;
}
.brand > span {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: #1769e0;
  font:
    700 18px ui-monospace,
    monospace;
}
.brand small {
  color: #7f8c99;
  letter-spacing: 0.04em;
}
nav {
  gap: 3px;
}
nav button {
  min-height: 42px;
  padding: 10px 12px;
  color: #9ba7b3;
  border: 0;
  border-radius: 7px;
  font-weight: 600;
}
nav button:hover {
  background: #192533;
  color: #fff;
}
nav button.active {
  background: #233246;
  color: #fff;
  border: 0;
}
nav button.active:before {
  width: 3px;
  height: 18px;
  margin: 0 10px 0 -12px;
  border-radius: 0 3px 3px 0;
  background: #4c9aff;
  box-shadow: none;
  vertical-align: middle;
}
.aside-foot {
  border-color: #293542;
  color: #a7b1bc;
}
.aside-foot .ghost {
  background: transparent;
  border-color: #354353;
  color: #c5ccd3;
}
main {
  max-width: 1380px;
  padding: 34px clamp(28px, 4vw, 56px) 60px;
}
#shell > main {
  min-width: 0;
  max-width: calc(100vw - 224px);
}
header {
  margin-bottom: 25px;
}
header h2 {
  color: #17212b;
  font-size: 25px;
  letter-spacing: -0.025em;
}
header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.pill {
  padding: 7px 11px;
  background: #eef1f4;
  border-color: #d9dfe6;
  color: #566271;
  font-weight: 650;
}
.pill.running {
  background: #e8f7ef;
  border-color: #b8e4cb;
  color: #18794e;
}
.pill.interrupted {
  background: #fff0ed;
  border-color: #f2c2ba;
  color: #b42318;
}
.hero {
  min-height: 190px;
  padding: 34px 38px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(120deg, #172b46 0%, #193b62 60%, #155c8c 100%);
  box-shadow: 0 12px 28px rgba(22, 46, 77, 0.17);
}
.hero h3 {
  margin: 13px 0 8px;
  color: #fff;
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: -0.03em;
}
.hero p {
  color: #b8cce1;
}
.hero .secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
.engine-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d3deea;
  font-size: 12px;
  font-weight: 650;
}
.engine-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff8173;
  box-shadow: 0 0 0 4px rgba(255, 129, 115, 0.15);
}
.engine-dot.online {
  background: #45d49a;
  box-shadow: 0 0 0 4px rgba(69, 212, 154, 0.15);
}
.issues {
  margin: 13px 0 0;
}
.issues:empty {
  display: none;
}
.issues span {
  padding: 9px 12px;
  border: 1px solid #f0c8c2;
  border-radius: 7px;
  background: #fff2f0;
  color: #a82b20;
}
.readiness {
  display: grid;
  grid-template-columns: 170px 1fr;
  align-items: center;
  gap: 24px;
  margin-top: 18px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.readiness h3 {
  margin: 0 0 3px;
  font-size: 14px;
}
.readiness p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.readiness ul {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.readiness li {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #7a8591;
  font-size: 12px;
  white-space: nowrap;
}
.readiness li span {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #c4cbd3;
}
.readiness li.ready {
  color: #18794e;
}
.readiness li.ready span {
  background: #2eae72;
  box-shadow: 0 0 0 3px #e4f5eb;
}
.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 20px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.metrics article {
  min-height: 118px;
  padding: 20px 22px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}
.metrics article:last-child {
  border-right: 0;
}
.metrics strong {
  margin: 12px 0 7px;
  color: #17212b;
  font:
    650 25px ui-monospace,
    monospace;
}
.metrics strong b {
  font: inherit;
}
.metrics strong i {
  color: #b6bec8;
  font-style: normal;
  font-weight: 400;
}
.metrics small {
  color: #7b8794;
}
.activity-panel {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.activity-panel .panel-title {
  padding: 19px 22px 15px;
  margin: 0;
  border-bottom: 1px solid #edf0f3;
}
.activity-panel .panel-title h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.activity-panel .panel-title p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.text-button {
  padding: 6px;
  background: transparent;
  color: #1769e0;
  box-shadow: none;
  font-size: 12px;
}
.text-button:hover {
  background: #edf4ff;
}
.activity-panel .timeline.empty {
  padding: 54px;
  border: 0;
  border-radius: 0;
  color: #8a95a1;
}
.activity-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 22px;
  border-bottom: 1px solid #edf0f3;
}
.activity-row:last-child {
  border-bottom: 0;
}
.activity-row div {
  display: grid;
  gap: 3px;
}
.activity-row small {
  color: var(--muted);
}
.activity-marker {
  width: 9px;
  height: 9px;
  border: 2px solid #aeb8c4;
  border-radius: 50%;
}
.activity-marker.current {
  border-color: #1769e0;
  background: #1769e0;
  box-shadow: 0 0 0 4px #e5f0ff;
}
.waiting-state {
  display: grid;
  justify-items: center;
  gap: 7px;
}
.waiting-state > span {
  width: 19px;
  height: 19px;
  border: 2px solid #d6dce3;
  border-top-color: #1769e0;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.waiting-state small {
  color: var(--muted);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.panel,
.player-summary {
  background: #fff;
  border-color: var(--line);
  border-radius: 11px;
  box-shadow: 0 1px 2px rgba(23, 33, 43, 0.025);
}
.player-summary {
  color: #17212b;
}
.player-summary:hover {
  border-color: #c8d1dc;
  box-shadow: 0 6px 18px rgba(23, 33, 43, 0.07);
}
.player-summary:focus-within {
  border-color: #6aa4ef;
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.1);
}
.avatar {
  background: #e7f0fd;
  color: #1769e0;
}
.player-summary dl div {
  background: #f3f6f9;
}
.player-summary dt {
  color: #596573;
}
.player-summary dd {
  color: #17212b;
}
.history-tabs {
  padding: 4px;
  border: 1px solid #dce2e8;
  border-radius: 9px;
  background: #eef1f4;
}
.history-tabs button {
  background: transparent;
  color: #566271;
  border-color: transparent;
  box-shadow: none;
}
.history-tabs button:hover {
  background: #e3e8ed;
  color: #263442;
}
.history-tabs button:focus-visible {
  outline: 3px solid rgba(23, 105, 224, 0.2);
  outline-offset: -1px;
}
.history-tabs button[aria-selected="true"] {
  background: #fff;
  color: #1769e0;
  border-color: #cfd6df;
  box-shadow: 0 1px 3px rgba(23, 33, 43, 0.1);
}
.history-tabs span {
  background: #dfe5eb;
  color: #475463;
}
.history-tabs button[aria-selected="true"] span {
  background: #e5f0ff;
  color: #145dbf;
}
.sheet {
  border-color: #d9e0e7;
  background: #fff;
}
.sheet-head,
.sheet-actions {
  background: rgba(255, 255, 255, 0.97);
}
.sheet-head h2,
.config-section strong {
  color: #17212b;
}
.config-section > summary > span {
  background: #e7f0fd;
  color: #1769e0;
}
.unsaved {
  background: #fff4db;
  color: #8b5b00;
}
.play-group {
  background: #fff;
  border-color: #dfe4ea;
}
.play-options {
  border-color: #e5e9ee;
}
.play-options label {
  border-color: #d8dfe6;
  color: #445160;
}
.uniform-amounts {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 10px;
}
.uniform-amounts label,
.play-amount-row label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: #647183;
}
.uniform-amounts > small {
  grid-column: 1 / -1;
  color: #788596;
}
.uniform-amount-error {
  grid-column: 1 / -1;
}
.play-amount-options {
  display: grid;
  gap: 8px;
}
.play-amount-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(90px, .65fr) minmax(90px, .65fr);
  gap: 8px;
  align-items: end;
}
.play-amount-row > label:first-child {
  display: flex;
  align-items: center;
  min-height: 42px;
}
.play-amount-error {
  grid-column: 2 / -1;
  margin: 0;
}
.panel {
  padding: 24px;
}
.panel h3,
.page-tools h3 {
  color: #17212b;
}
input,
select {
  min-height: 42px;
  border-color: #cfd6df;
  background: #fff;
  color: #17212b;
}
input:focus,
select:focus {
  border-color: #1769e0;
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.12);
}
.form-grid label,
.login label {
  color: #445160;
}
.list-item,
.card,
.play-group,
.odd-row {
  background: #fff;
  border-color: #dfe4ea;
}
.list-item > span:last-child {
  color: #1769e0;
}
.timeline.empty,
.list.empty {
  border-color: #d6dce3;
  color: #82909e;
}
.login {
  background: linear-gradient(135deg, #111a24, #193651);
}
.login-card {
  padding: 42px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}
.login-card .mark {
  border: 0;
  border-radius: 9px;
  background: #1769e0;
  color: #fff;
}
.login h1 {
  margin-top: 24px;
  color: #17212b;
  font-size: 28px;
}
.login p {
  color: #687482;
}
.login-card input {
  border-color: #b8c3cf;
  background: #fff;
  color: #17212b;
  caret-color: #17212b;
  -webkit-text-fill-color: #17212b;
}
.login-card input:focus {
  border-color: #1769e0;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.14);
}
.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover,
.login-card input:-webkit-autofill:focus {
  -webkit-text-fill-color: #17212b;
  box-shadow:
    0 0 0 1000px #fff inset,
    0 0 0 3px rgba(23, 105, 224, 0.14);
}
.status-filter {
  border-color: #d7dde4;
  background: #f3f5f7;
}
.status-filter button {
  color: #687482;
}
.status-filter button.active {
  background: #fff;
  color: #1769e0;
  box-shadow: 0 1px 3px rgba(23, 33, 43, 0.12);
}
.ledger-table th {
  background: #f5f7f9;
}
.ledger-table td {
  border-color: #e8ebef;
}
.formula {
  background: #f4f7fb;
  border-color: #d6e2f0;
  color: #315982;
}
.send-issue-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 18px 0;
  padding: 18px 20px;
  border: 1px solid #e5b15e;
  border-left: 5px solid #d98212;
  border-radius: 12px;
  background: #fff8ea;
  color: #5d3b08;
}
.send-issue-banner[hidden] {
  display: none;
}
.send-issue-banner p {
  margin: 5px 0;
  color: #704c16;
}
.send-issue-banner small {
  color: #765c34;
}
.send-issue {
  align-items: stretch;
  gap: 24px;
  border-left: 5px solid #d98212;
}
.send-issue.critical {
  border-left-color: #c63c32;
}
.send-issue-main {
  min-width: 0;
  flex: 1;
}
.send-issue-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.send-issue-main p {
  margin: 9px 0;
  overflow-wrap: anywhere;
  color: #374453;
}
.send-issue-main small,
.send-issue-impact small {
  display: block;
  color: #687482;
}
.issue-state {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.issue-state.active {
  background: #ffe2de;
  color: #a52e25;
}
.issue-state.recovered {
  background: #dff3e9;
  color: #16724c;
}
.send-issue-impact {
  width: min(280px, 34%);
  padding-left: 20px;
  border-left: 1px solid #e4e8ed;
}
.send-issue-impact > span {
  display: block;
  margin-bottom: 5px;
  color: #687482;
  font-size: 12px;
}
.send-issue-impact strong {
  display: block;
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  aside {
    background: #111a24;
  }
  nav {
    background: #111a24fa;
    border-color: #2a3745;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metrics article:nth-child(2) {
    border-right: 0;
  }
  .metrics article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
  .readiness {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .readiness ul {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 620px) {
  main {
    padding: 20px 14px 122px;
  }
  header h2 {
    font-size: 22px;
  }
  .hero {
    min-height: 0;
    padding: 24px 20px;
  }
  .hero-actions {
    width: 100%;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .metrics article {
    min-height: 105px;
    padding: 17px;
    border-bottom: 1px solid var(--line);
  }
  .metrics article:nth-child(even) {
    border-right: 0;
  }
  .metrics article:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
  .metrics strong {
    font-size: 21px;
  }
  .activity-panel .timeline.empty {
    padding: 38px 20px;
  }
  .readiness ul {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 12px;
  }
  .ledger-table tr {
    background: #fff;
    border-color: var(--line);
  }
  .send-issue-banner,
  .send-issue {
    align-items: flex-start;
    flex-direction: column;
  }
  .send-issue-banner button {
    width: 100%;
  }
  .send-issue-impact {
    width: 100%;
    padding: 14px 0 0;
    border-left: 0;
    border-top: 1px solid #e4e8ed;
  }
}

.template-editor {
  display: grid;
  gap: 16px;
}
.template-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}
.template-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.template-card header p {
  margin: 4px 0 0;
  color: var(--muted);
}
.template-card textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
}
.template-card .template-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto auto;
  gap: 10px;
  margin-top: 10px;
  align-items: start;
}
.template-image { display:inline-flex; align-items:center; gap:6px; min-height:40px; color:#536273; font-size:13px; font-weight:700; white-space:nowrap; }
.template-image input { width:18px; min-height:18px; margin:0; }
.template-card .template-variables {
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
}
.template-card .add-template {
  margin-top: 10px;
}

/* r41 interaction and data-visualization polish */
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23445160' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}
select:hover {
  border-color: #aeb9c5;
}
select:disabled {
  background-color: #f1f3f5;
  color: #7b8794;
  cursor: not-allowed;
  opacity: 1;
}

.icon-button,
.icon-button:hover,
.icon-button:focus,
.icon-button:focus-visible,
.icon-button:active {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #cfd7e0;
  border-radius: 10px;
  background: #fff;
  color: #526171;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  box-shadow: 0 2px 7px rgba(23, 33, 43, 0.08);
  filter: none;
  transform: none;
}
.icon-button:hover {
  border-color: #aab7c5;
  background: #f4f7fa;
  color: #17212b;
}
.icon-button:focus-visible {
  border-color: #1769e0;
  color: #17212b;
  outline: 3px solid rgba(23, 105, 224, 0.24);
  outline-offset: 3px;
}
.icon-button:active {
  background: #e8f1fd;
  color: #0f5fcf;
  box-shadow: inset 0 1px 2px rgba(23, 33, 43, 0.12);
}

:is(.config-section > summary, .odds-branch > summary, .play-group > summary) {
  position: relative;
  border-radius: 8px;
  outline: none;
}
:is(
  .config-section > summary,
  .odds-branch > summary,
  .play-group > summary
)::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid #687482;
  border-bottom: 2px solid #687482;
  transform: rotate(45deg) translate(-1px, -1px);
  transform-origin: center;
  pointer-events: none;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease;
}
:is(.config-section, .odds-branch, .play-group)[open] > summary::after {
  border-color: #1769e0;
  transform: rotate(225deg) translate(-1px, -1px);
}
:is(
  .config-section > summary,
  .odds-branch > summary,
  .play-group > summary
):hover {
  background: #f5f8fc;
}
:is(
  .config-section > summary,
  .odds-branch > summary,
  .play-group > summary
):focus-visible {
  outline: 3px solid rgba(23, 105, 224, 0.2);
  outline-offset: 2px;
}
.config-section > summary {
  grid-template-columns: 28px minmax(0, 1fr) auto 20px;
  padding: 17px 10px;
  margin: 0 -10px;
}
.odds-branch > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 20px;
}
.odds-branch > summary label {
  min-width: 0;
}
.play-group > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 10px;
}
.play-group > summary .play-group-select {
  display: grid;
  place-items: center;
  min-width: 28px;
  min-height: 44px;
  padding: 0;
  cursor: pointer;
}

.ledger-panel {
  padding: 0;
  overflow: hidden;
}
.ledger-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px 22px;
  border-bottom: 1px solid #e4e9ef;
}
.ledger-heading h3 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.02em;
}
.ledger-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.ledger-safety {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #cce1d6;
  border-radius: 999px;
  background: #f0faf5;
  color: #287355;
  font-size: 11px;
  font-weight: 700;
}
.ledger-safety::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #27a36a;
}
.ledger-tools {
  align-items: end;
  justify-content: space-between;
  margin: 0;
  padding: 18px 28px;
  background: #fafbfd;
  border-bottom: 1px solid #e4e9ef;
}
.ledger-tools > div {
  display: grid;
  gap: 7px;
}
.ledger-tool-label {
  display: block;
  color: #667382;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.ledger-search {
  display: grid;
  width: min(340px, 100%);
  gap: 7px;
}
.ledger-search input {
  min-height: 40px;
  background: #fff;
}
.ledger-table {
  border: 0;
  border-radius: 0;
  overflow-x: auto;
}
.ledger-table table {
  table-layout: fixed;
  min-width: 1280px;
}
.ledger-account-column {
  width: 22%;
}
.ledger-current-column {
  width: 13%;
}
.ledger-money-column {
  width: 16%;
}
.ledger-action-column {
  width: 17%;
}
#players .ledger-table table {
  min-width: 1080px;
}
#players .ledger-account-column {
  width: 16%;
}
#players .ledger-current-column {
  width: 8%;
}
#players .ledger-money-column {
  width: 9%;
}
#players .ledger-public-page-column {
  width: 25%;
}
#players .ledger-action-column {
  width: 17%;
}
.ledger-table th {
  padding: 11px 18px;
  background: #fff;
  border-bottom: 1px solid #e4e9ef;
  color: #66727f;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.ledger-table td {
  padding: 16px 18px;
  vertical-align: middle;
}
.ledger-table tbody tr {
  transition: background-color 0.16s ease;
}
.ledger-table tbody tr:hover {
  background: #f8fbff;
}
.ledger-account {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}
.ledger-account > span:last-child {
  min-width: 0;
}
.ledger-account-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  background: #e8f1fd;
  color: #1769e0;
  font-size: 13px;
  font-weight: 800;
}
.ledger-account-avatar.robot {
  background: #e9f7f0;
  color: #16724c;
}
.ledger-account-avatar.ordinary {
  background: #f0f2f5;
  color: #596573;
}
.ledger-account strong {
  display: block;
  color: #17212b;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.ledger-account small {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 8px;
}
.ledger-account small b {
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef3f8;
  color: #506071;
  font-size: 9px;
  font-weight: 750;
}
.ledger-account small i {
  font-style: normal;
  overflow-wrap: anywhere;
}
.ledger-financial > span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}
.ledger-financial strong {
  color: #17212b;
  font:
    740 14px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.ledger-financial small {
  color: #7a8795;
  font-size: 10px;
}
.ledger-financial em {
  display: block;
  margin-top: 4px;
  color: #687482;
  font-size: 9px;
  font-style: normal;
}
.ledger-financial.profit strong {
  color: #126c52;
}
.ledger-financial.investment strong {
  color: #9a5a08;
}
.current-points {
  color: #17212b;
  font: inherit;
}
.ledger-current-value {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}
.current-points strong {
  display: inline !important;
  color: #17212b;
  font:
    700 15px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.current-points small {
  display: inline !important;
  margin-left: 4px !important;
  font-size: 10px;
}
.ledger-table .ledger-money-input {
  width: 100%;
  min-width: 0;
  max-width: 190px;
  min-height: 40px;
  padding: 9px 11px;
  font:
    600 13px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.ledger-table .adjustment-input {
  border-color: #bfd3ed;
  background: #f7faff;
}
.ledger-actions {
  align-items: center;
  gap: 8px;
}
.ledger-actions button {
  min-height: 38px;
  white-space: nowrap;
}
.ledger-row-error {
  width: auto;
  height: auto;
  min-height: 0;
  margin: 7px 0 0;
  overflow: visible;
  font-size: 10px;
}
.ledger-row-error:empty {
  display: none;
}
.ledger-help {
  margin: 0;
  padding: 13px 28px 16px;
  border-top: 1px solid #eef1f4;
  color: #778391;
  font-size: 11px;
}

.point-history-dialog {
  width: min(1060px, calc(100vw - 28px));
}
.point-history-content {
  padding: 24px 28px 30px;
}
.point-history-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.point-history-summary article {
  padding: 15px 17px;
  border-color: #e1e7ed;
  border-radius: 11px;
  background: #f8fafc;
}
.point-history-summary strong {
  font:
    700 18px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.point-history-summary strong small {
  color: #778391;
  font:
    650 11px ui-sans-serif,
    system-ui,
    sans-serif;
}
.point-chart-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 2px 10px;
}
.point-chart-heading > div:first-child {
  display: grid;
  gap: 4px;
}
.point-chart-heading > div:first-child strong {
  font-size: 15px;
}
.point-chart-heading > div:first-child small {
  color: #778391;
  font-size: 11px;
}
.point-chart-legend {
  flex-wrap: wrap;
  justify-content: flex-end;
  margin: 0;
}
.point-chart-card {
  overflow: hidden;
  border: 1px solid #dfe6ed;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(23, 33, 43, 0.045);
}
.point-chart-scroll {
  border: 0;
  border-radius: 0;
}
.point-chart {
  min-width: 720px;
}
.chart-grid line {
  stroke: #e8edf2;
  stroke-dasharray: 3 5;
}
.chart-grid text {
  fill: #718092;
  font-size: 10px;
}
.chart-grid .axis-title {
  fill: #667587;
  font-size: 10px;
  letter-spacing: 0.04em;
}
.balance-area {
  fill: url(#balanceAreaGradient);
}
.balance-line {
  stroke: #2979e7;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.investment-line {
  stroke: #d36f00;
  stroke-width: 2;
  stroke-dasharray: 6 6;
  stroke-linecap: butt;
  stroke-linejoin: round;
}
.chart-data-point {
  fill: transparent;
  stroke: transparent;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}
.chart-data-point:hover,
.chart-data-point:focus {
  fill: #fff;
  stroke: #2979e7;
  outline: none;
}
.balance-point.latest {
  fill: #fff;
  stroke: #2979e7;
  stroke-width: 3;
  filter: drop-shadow(0 2px 4px rgba(41, 121, 231, 0.3));
}
.point-chart-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid #e4e9ef;
  background: #fbfcfd;
}
.point-chart-footer > span {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  color: #687482;
}
.point-chart-footer > span:first-child {
  justify-content: flex-start;
}
.point-chart-footer > span:last-child {
  justify-content: flex-end;
}
.point-chart-footer b {
  color: #344150;
  font:
    650 11px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  overflow-wrap: anywhere;
}
.point-chart-footer small {
  font-size: 10px;
  white-space: nowrap;
}
.point-history-note {
  margin-top: 14px;
}

@media (max-width: 900px) {
  .ledger-tools {
    align-items: end;
    flex-direction: row;
  }
  .ledger-table table {
    min-width: 1280px;
  }
  #players .ledger-table table {
    min-width: 1080px;
  }
}

@media (max-width: 620px) {
  .ledger-panel {
    overflow: visible;
    background: transparent;
    box-shadow: none;
  }
  .ledger-heading {
    display: grid;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px 12px 0 0;
    background: #fff;
  }
  .ledger-safety {
    justify-self: start;
  }
  .ledger-tools {
    align-items: stretch;
    flex-direction: column;
    padding: 16px 20px;
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
  }
  .ledger-search {
    width: 100%;
  }
  .ledger-table table {
    min-width: 0;
  }
  #players .ledger-table table {
    min-width: 0;
  }
  .ledger-table tr {
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(23, 33, 43, 0.035);
  }
  .ledger-table td {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
  }
  .ledger-account-avatar {
    display: none;
  }
  .ledger-table .ledger-money-input {
    max-width: none;
  }
  .current-points strong {
    font-size: 14px;
  }
  .ledger-help {
    padding: 4px 2px 0;
    border: 0;
    line-height: 1.55;
  }
  .point-history-content {
    padding: 18px;
  }
  .point-chart-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .point-chart-legend {
    justify-content: flex-start;
  }
  .point-history-summary,
  .point-chart-footer {
    grid-template-columns: 1fr;
  }
  .point-chart-footer > span,
  .point-chart-footer > span:first-child,
  .point-chart-footer > span:last-child {
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(
    .config-section > summary,
    .odds-branch > summary,
    .play-group > summary
  )::after {
    transition: none;
  }
}

/* Unified robot and player management */
.management-hero {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(560px, 1.25fr);
  align-items: center;
  gap: 32px;
  margin-bottom: 18px;
  padding: 26px 28px;
  overflow: hidden;
  border: 1px solid #cfe0f5;
  border-radius: 16px;
  background:
    radial-gradient(
      circle at 92% -20%,
      rgba(23, 105, 224, 0.14),
      transparent 42%
    ),
    linear-gradient(135deg, #fff, #f6faff);
  box-shadow: 0 10px 32px rgba(23, 33, 43, 0.055);
}
.management-hero h3 {
  margin: 4px 0 8px;
  color: #17212b;
  font-size: 24px;
  letter-spacing: -0.03em;
}
.management-hero p:not(.eyebrow) {
  margin: 0;
  color: #657385;
  line-height: 1.65;
}
.pool-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.pool-metrics article {
  min-width: 0;
  padding: 16px;
  border: 1px solid #dce6f1;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}
.pool-metrics span,
.pool-metrics small {
  display: block;
  color: #738092;
  font-size: 10px;
}
.pool-metrics strong {
  display: block;
  margin: 7px 0 4px;
  color: #17212b;
  font:
    750 19px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  overflow-wrap: anywhere;
}
.management-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.compact-panel {
  min-width: 0;
}
.compact-panel .panel-title p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.compact-ledger {
  margin: 0 -22px -22px;
  border-top: 1px solid var(--line);
}
.compact-ledger table {
  min-width: 1280px;
}
.management-list {
  display: grid;
  gap: 12px;
}
.management-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid #dce3eb;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(23, 33, 43, 0.045);
}
.management-card.is-disabled {
  background: #f7f8fa;
}
.management-card.is-disabled > :not(.connection-auth-form) {
  opacity: 0.68;
}
.management-identity {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 18px 20px;
}
.management-identity h4 {
  margin: 0;
  color: #17212b;
  font-size: 16px;
}
.management-identity > div > small {
  color: #748191;
  font-size: 11px;
}
.management-identity .connection-session-error {
  margin: 5px 0 0;
  color: #9a4d00;
  font-size: 12px;
  font-weight: 700;
}
.identity-title {
  display: flex;
  align-items: center;
  gap: 9px;
}
.management-balance {
  color: #17212b;
  font:
    750 18px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  white-space: nowrap;
}
.management-balance small {
  color: #7d8896;
  font:
    650 10px ui-sans-serif,
    system-ui,
    sans-serif;
}
.management-financials {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #e8edf2;
  background: linear-gradient(90deg, #fbfcfe, #f7fbff);
}
.management-financials > span {
  min-width: 0;
  padding: 14px 20px;
  border-right: 1px solid #e8edf2;
}
.management-financials > span:last-child {
  border-right: 0;
}
.management-financials small,
.management-financials em {
  display: block;
  color: #7b8795;
  font-size: 10px;
  font-style: normal;
}
.management-financials b {
  display: block;
  margin: 6px 0 3px;
  color: #17212b;
  font:
    750 17px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  overflow-wrap: anywhere;
}
.management-financials b i {
  color: #7d8896;
  font:
    650 10px ui-sans-serif,
    system-ui,
    sans-serif;
}
.management-financials .profit b {
  color: #126c52;
}
.management-financials .investment b {
  color: #9a5a08;
}
.robot-config-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid #e8edf2;
  background: #fafbfd;
}
.robot-config-strip span {
  display: grid;
  gap: 3px;
  padding: 12px 20px;
  border-right: 1px solid #e8edf2;
}
.robot-config-strip span:last-child {
  border-right: 0;
}
.robot-config-strip small {
  color: #7b8795;
  font-size: 10px;
}
.robot-config-strip b {
  color: #334152;
  font-size: 12px;
}
.robot-operations {
  display: grid;
  gap: 18px;
  padding: 15px 20px;
}
.robot-lower-row { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; min-width:0; }
.robot-transfer,
.robot-adjust {
  display: grid;
  grid-template-columns: minmax(150px, 190px) auto auto;
  align-items: end;
  gap: 8px;
}
.robot-auto-adjust { display:grid; grid-template-columns:auto minmax(140px,1fr) minmax(140px,1fr) minmax(150px,.8fr) auto; align-items:end; gap:10px; width:100%; }
.robot-auto-adjust label { display:grid; gap:5px; color:#697687; font-size:10px; font-weight:700; }
.robot-auto-adjust input[type="text"],.robot-auto-adjust input[type="number"] { width:100%; min-height:38px; padding:8px 10px; }
.robot-auto-adjust .auto-adjust-switch { display:flex; align-items:center; min-height:38px; gap:7px; padding:0 4px; font-size:12px; }
.robot-auto-adjust .auto-adjust-switch input { width:18px; min-height:18px; margin:0; }
.robot-auto-adjust .field-error { grid-column:1/-1; margin:0; }
.robot-auto-adjust .field-error:empty { display:none; }
.robot-transfer label,
.robot-adjust label {
  display: grid;
  gap: 5px;
  color: #697687;
  font-size: 10px;
  font-weight: 700;
}
.robot-transfer input,
.robot-adjust input {
  min-height: 38px;
  padding: 8px 10px;
}
.robot-transfer .field-error,
.robot-adjust .field-error {
  grid-column: 1/-1;
  width: auto;
  height: auto;
  min-height: 0;
  margin: 0;
  overflow: visible;
  overflow-wrap: anywhere;
}
.robot-transfer .field-error:empty,
.robot-adjust .field-error:empty {
  display: none;
}
.robot-operations .card-actions {
  justify-content: flex-end;
}
.robot-command-options { display:grid; gap:8px; margin-top:14px; padding-top:16px; border-top:1px solid #dfe7f0; }
.robot-command-options > div:first-child { display:flex; justify-content:space-between; gap:12px; align-items:baseline; }
.robot-command-options > div:first-child small { color:#768394; }
.robot-command-row { display:grid; grid-template-columns:minmax(90px,1fr) minmax(150px,220px); gap:12px; align-items:center; padding:9px 11px; border:1px solid #dfe7f0; border-radius:10px; }
.robot-command-row label { display:flex; align-items:center; gap:8px; margin:0; }
.robot-command-row input[type="checkbox"] { width:18px; min-height:18px; }
.robot-command-row input[type="number"] { width:92px; min-height:36px; padding:7px 9px; }
.connection-auth-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 15px 20px;
  border-top: 1px solid #d8e5f4;
  background: #f4f8fd;
}
.connection-auth-form label {
  display: grid;
  gap: 5px;
  color: #596777;
  font-size: 11px;
}
.connection-auth-form > div {
  display: flex;
  gap: 8px;
}
.connection-auth-form .field-error {
  grid-column: 1/-1;
  margin: 0;
}
.player-row-actions {
  margin-top: 8px;
}
.player-row-actions button {
  min-height: 30px !important;
  padding: 5px 9px;
  font-size: 10px;
}
.public-page-cell {
  display: grid;
  gap: 8px;
}
.public-page-cell > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}
.public-page-url {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #245d9c;
  font:
    600 10px/1.45 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.public-page-cell button {
  min-height: 30px !important;
  width: fit-content;
  padding: 5px 9px;
  font-size: 10px;
}
.public-page-state {
  color: #687482;
  font-size: 11px;
}
@media (max-width: 620px) {
  .public-page-cell > div {
    grid-template-columns: 1fr;
  }
  .public-page-cell button {
    width: 100%;
  }
}
.group-dialog {
  width: min(720px, calc(100vw - 28px));
}
.group-dialog-body {
  padding: 22px 24px 28px;
}
.group-dialog .list {
  max-height: min(56vh, 520px);
  overflow: auto;
}
.group-choice:disabled {
  opacity: 0.62;
}

@media (max-width: 1100px) {
  .management-hero,
  .management-grid {
    grid-template-columns: 1fr;
  }
  .robot-operations {
    align-items: stretch;
  }
  .robot-lower-row { align-items:stretch; flex-direction:column; }
  .robot-operations .card-actions {
    justify-content: flex-start;
  }
}
@media (max-width: 900px) {
  #shell > main {
    max-width: 100vw;
  }
}
@media (max-width: 700px) {
  .management-hero {
    padding: 21px;
  }
  .pool-metrics {
    grid-template-columns: 1fr;
  }
  .management-identity {
    grid-template-columns: 38px minmax(0, 1fr);
  }
  .management-balance {
    grid-column: 2;
  }
  .robot-config-strip {
    grid-template-columns: 1fr 1fr;
  }
  .robot-config-strip span:nth-child(2) {
    border-right: 0;
  }
  .robot-config-strip span:nth-child(-n + 2) {
    border-bottom: 1px solid #e8edf2;
  }
  .robot-transfer,
  .robot-adjust,
  .robot-auto-adjust {
    grid-template-columns: 1fr 1fr;
  }
  .robot-transfer label,
  .robot-adjust label {
    grid-column: 1/-1;
  }
  .robot-auto-adjust .auto-adjust-switch { grid-column:1/-1; }
  .connection-auth-form {
    grid-template-columns: 1fr;
  }
  .connection-auth-form .field-error {
    grid-column: 1;
  }
  .compact-ledger table {
    min-width: 0;
  }
  .management-identity > div {
    min-width: 0;
  }
  .management-identity > div > small {
    display: block;
    overflow-wrap: anywhere;
  }
  .management-financials {
    grid-template-columns: 1fr;
  }
  .management-financials > span {
    border-right: 0;
    border-bottom: 1px solid #e8edf2;
  }
  .management-financials > span:last-child {
    border-bottom: 0;
  }
}
@media (max-width: 460px) {
  .uniform-amounts,
  .play-amount-row {
    grid-template-columns: 1fr;
  }
  .robot-transfer,
  .robot-adjust,
  .robot-auto-adjust {
    grid-template-columns: 1fr;
  }
  .robot-transfer label,
  .robot-adjust label {
    grid-column: 1;
  }
  .robot-auto-adjust .auto-adjust-switch { grid-column:1; }
  .robot-command-row { grid-template-columns:1fr; }
  .robot-operations .card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .robot-operations .card-actions button {
    width: 100%;
  }
}

/* Overview capital intelligence */
.capital-analytics {
  display: grid;
  gap: 14px;
  margin: 24px 0 18px;
}
.analytics-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 2px 0;
}
.analytics-title h3 {
  margin: 0 0 5px;
  color: #17212b;
  font-size: 20px;
  letter-spacing: -0.025em;
}
.analytics-title p {
  margin: 0;
  color: #738092;
  font-size: 12px;
}
.analytics-title > span {
  color: #7d8895;
  font:
    600 10px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  white-space: nowrap;
}
.analytics-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.analytics-summary article {
  position: relative;
  min-width: 0;
  padding: 17px 18px;
  overflow: hidden;
  border: 1px solid #dce5ee;
  border-radius: 13px;
  background: linear-gradient(145deg, #fff, #f8fafc);
  box-shadow: 0 7px 24px rgba(23, 33, 43, 0.04);
}
.analytics-summary article::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: #1769e0;
}
.analytics-summary article:nth-child(2)::before {
  background: #11a58a;
}
.analytics-summary article:nth-child(3)::before {
  background: #7c5ce0;
}
.analytics-summary article:nth-child(4)::before {
  background: #d98218;
}
.analytics-summary article:nth-child(5)::before {
  background: #8c5bd8;
}
.analytics-summary span,
.analytics-summary > article > small {
  display: block;
  color: #788493;
  font-size: 10px;
}
.analytics-summary strong {
  display: block;
  margin: 8px 0 4px;
  color: #17212b;
  font:
    760 19px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  overflow-wrap: anywhere;
}
.analytics-summary strong small {
  color: #7a8795;
  font:
    700 10px ui-sans-serif,
    system-ui,
    sans-serif;
}
.player-business-summary {
  min-width: 0;
}
.player-business-loading {
  display: grid;
  min-height: 142px;
  place-items: center;
  border: 1px solid #dce5ee;
  border-radius: 13px;
  background: #fff;
  color: #788493;
  font-size: 12px;
}
.player-business-table-wrap {
  position: relative;
  min-width: 0;
  overflow: visible;
  border: 1px solid #dce5ee;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 7px 24px rgba(23, 33, 43, 0.04);
}
.player-business-table-scroll,
.player-bet-scroll {
  max-width: 100%;
  overflow-x: auto;
}
.player-business-table,
.player-bet-scroll table {
  width: 100%;
  border-collapse: collapse;
  color: #354252;
  font-size: 12px;
}
.player-business-table {
  min-width: 1220px;
}
.player-business-table th,
.player-business-table td,
.player-bet-scroll th,
.player-bet-scroll td {
  padding: 13px 16px;
  border-bottom: 1px solid #e8edf2;
  text-align: right;
  white-space: nowrap;
}
.player-business-table thead th,
.player-bet-scroll thead th {
  background: #f7f9fb;
  color: #687687;
  font-size: 11px;
  font-weight: 750;
}
.player-business-table tfoot th,
.player-business-table tfoot td {
  border-top: 2px solid #d9e3ed;
  border-bottom: 0;
  background: #f3f7fb;
  color: #273545;
  font-weight: 800;
}
.player-business-table th:first-child,
.player-business-table td:first-child,
.player-bet-scroll th:first-child,
.player-bet-scroll td:first-child {
  text-align: left;
}
.player-business-table tbody tr:last-child > * {
  border-bottom: 0;
}
.player-business-table td small,
.player-bet-scroll td small {
  color: #8190a0;
  font-size: 10px;
}
.player-filter-toggle,
.player-expand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 4px 7px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 750;
  box-shadow: none;
}
.player-name-static {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 7px;
  color: #687687;
}
.player-name-static > small {
  color: #9a6770;
  font-size: 9px;
  font-weight: 700;
}
.player-name-static > span small {
  padding: 2px 5px;
  border-radius: 5px;
  background: #eef1f4;
  color: #7a8795;
  font-size: 9px;
}
.player-filter-toggle:hover,
.player-expand:hover {
  background: #edf5ff;
  color: #1769e0;
  transform: none;
}
.player-filter-toggle:focus-visible,
.player-expand:focus-visible {
  outline: 2px solid #1769e0;
  outline-offset: 1px;
}
.player-filter-toggle span {
  color: #1769e0;
  font-size: 10px;
}
.player-filter-toggle i {
  font-style: normal;
  transition: transform 0.16s ease;
}
.player-filter-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}
.player-filter-panel {
  position: absolute;
  z-index: 25;
  top: 43px;
  left: 12px;
  width: min(290px, calc(100% - 24px));
  padding: 12px;
  border: 1px solid #cfdbe8;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(23, 33, 43, 0.18);
}
.player-filter-actions {
  display: flex;
  gap: 8px;
  padding-bottom: 9px;
  border-bottom: 1px solid #edf0f3;
}
.player-filter-search {
  display: grid;
  gap: 5px;
  margin-bottom: 9px;
  color: #566577;
  font-size: 10px;
  font-weight: 750;
}
.player-filter-search input {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #cfdbe8;
  border-radius: 8px;
  background: #fff;
  color: #354252;
  font: inherit;
  font-size: 12px;
}
.player-filter-search input:focus {
  border-color: #1769e0;
  outline: 2px solid rgba(23,105,224,.15);
}
.player-filter-status {
  margin: 8px 7px 0;
  color: #7a8795;
  font-size: 10px;
}
.player-filter-options {
  display: grid;
  gap: 2px;
  max-height: 260px;
  margin-top: 8px;
  overflow-y: auto;
}
.player-filter-options label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 5px 7px;
  border-radius: 7px;
  color: #3f4d5c;
  cursor: pointer;
}
.player-filter-options label:hover {
  background: #f1f6fc;
}
.player-filter-options input {
  width: 17px;
  height: 17px;
}
.player-expand-icon {
  color: #1769e0;
  font-size: 19px;
  line-height: 1;
  transition: transform 0.16s ease;
}
.player-expand[aria-expanded="true"] .player-expand-icon {
  transform: rotate(90deg);
}
.player-expand small {
  padding: 2px 5px;
  border-radius: 5px;
  background: #eef1f4;
  color: #7a8795;
  font-size: 9px;
}
.business-net.positive,
.bet-outcome.win {
  color: #17875f;
}
.business-net.negative,
.bet-outcome.loss {
  color: #b33a34;
}
.bet-outcome.tie {
  color: #667586;
}
.player-detail-row > td {
  padding: 0;
  background: #f8fbfe;
  white-space: normal;
}
.player-bet-scroll table {
  min-width: 780px;
  background: #fbfdff;
}
.player-bet-scroll th,
.player-bet-scroll td {
  padding-block: 10px;
}
.player-detail-status,
.player-detail-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px 16px;
  color: #738092;
  font-size: 11px;
  text-align: center;
}
.player-detail-coverage {
  padding: 9px 16px;
  border-bottom: 1px solid #dbe7f2;
  background: #eef6ff;
  color: #526f90;
  font-size: 10px;
  text-align: left;
}
.player-detail-footer {
  justify-content: flex-end;
  border-top: 1px solid #e8edf2;
}
.player-business-empty td {
  height: 112px;
  color: #7f8b98;
  text-align: center !important;
}
.player-business-note {
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid #edf0f3;
  color: #7a8795;
  font-size: 10px;
}
.analytics-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce4ec;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 10px 34px rgba(23, 33, 43, 0.05);
}
.analytics-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 19px 21px 15px;
  border-bottom: 1px solid #edf1f4;
}
.analytics-card-head h4 {
  margin: 0 0 5px;
  color: #17212b;
  font-size: 16px;
  letter-spacing: -0.015em;
}
.analytics-card-head p {
  margin: 0;
  color: #788594;
  font-size: 11px;
  line-height: 1.5;
}
.analytics-legend,
.analytics-ranges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.analytics-legend button,
.analytics-ranges button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #dce3eb;
  border-radius: 999px;
  background: #fff;
  color: #667382;
  font-size: 10px;
  box-shadow: none;
}
.analytics-legend button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.analytics-legend button::before {
  width: 18px;
  border-top: 3px solid #1769e0;
  content: "";
}
.analytics-legend .players::before {
  border-top-color: #11a58a;
  border-top-style: dashed;
}
.analytics-legend .operator-investment::before {
  border-top-color: #d98218;
  border-top-style: dashed;
}
.analytics-legend .player-investment::before {
  border-top-color: #8c5bd8;
  border-top-style: dotted;
}
.analytics-legend .stake::before {
  border-top-color: #35a6e8;
  border-top-width: 7px;
}
.analytics-legend .net::before {
  border-top-color: #e29338;
  border-top-width: 7px;
}
.analytics-legend .poolbar::before {
  border-top-color: #7258d6;
  border-top-width: 7px;
}
.analytics-legend button.active,
.analytics-ranges button.active {
  border-color: #9bbce9;
  background: #edf5ff;
  color: #145fca;
}
.analytics-legend button:not(.active) {
  opacity: 0.48;
  text-decoration: line-through;
}
.analytics-card > .analytics-legend.daily {
  padding: 12px 21px 0;
}
.analytics-plot {
  min-height: 250px;
  padding: 0;
}
.analytics-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}
.analytics-svg {
  display: block;
  width: auto;
  max-width: none;
  height: auto;
  background: linear-gradient(180deg, #fff, #fbfcfe);
}
.analytics-grid line {
  stroke: #e8edf2;
  stroke-width: 1;
}
.analytics-grid .zero-line {
  stroke: #aeb9c5;
  stroke-width: 1.3;
}
.analytics-grid text,
.date-label {
  fill: #7c8997;
  font:
    10px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.analytics-grid .axis-title {
  fill: #4c5b6a;
  font-weight: 700;
}
.analytics-area {
  fill: url(#capitalPoolArea);
}
.analytics-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.analytics-line.pool {
  stroke: #1769e0;
}
.analytics-line.players {
  stroke: #11a58a;
  stroke-dasharray: 8 7;
}
.analytics-line.operator-investment {
  stroke: #d98218;
  stroke-width: 2.5;
  stroke-dasharray: 12 5 2 5;
}
.analytics-line.player-investment {
  stroke: #8c5bd8;
  stroke-width: 2.5;
  stroke-dasharray: 3 6;
}
.analytics-point {
  fill: #fff;
  stroke-width: 3;
  cursor: help;
}
.analytics-point.pool {
  stroke: #1769e0;
}
.analytics-point.players {
  stroke: #11a58a;
}
.analytics-point.operator-investment {
  stroke: #d98218;
}
.analytics-point.player-investment {
  stroke: #8c5bd8;
}
.analytics-bar {
  cursor: help;
}
.analytics-bar.stake {
  fill: #35a6e8;
}
.analytics-bar.net {
  fill: #e29338;
}
.analytics-bar.poolbar {
  fill: #7258d6;
}
.analytics-svg :is(.analytics-point, .analytics-bar, .unavailable-mark):focus {
  outline: none;
  filter: drop-shadow(0 0 4px rgba(23, 105, 224, 0.55));
  stroke: #101820;
  stroke-width: 2;
}
.analytics-svg .is-hidden {
  display: none;
}
.unavailable-mark line {
  stroke: #9ca8b5;
  stroke-width: 3;
  stroke-dasharray: 3 3;
}
.analytics-tooltip {
  margin: -4px 20px 14px;
  padding: 10px 12px;
  border: 1px solid #cddcf0;
  border-radius: 9px;
  background: #f4f8fd;
  color: #33465a;
  font-size: 11px;
  line-height: 1.5;
}
.analytics-note {
  margin: 0;
  padding: 13px 21px;
  border-top: 1px solid #edf0f3;
  background: #fff9ed;
  color: #765a25;
  font-size: 11px;
  line-height: 1.65;
}
.analytics-note::before {
  content: "口径说明 · ";
  font-weight: 800;
}
.analytics-empty {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 250px;
  padding: 30px;
  color: #7f8b98;
  text-align: center;
}
.capital-analytics.is-loading .analytics-card {
  opacity: 0.72;
}
.analytics-data {
  border-top: 1px solid #edf0f3;
}
.analytics-data summary {
  padding: 12px 21px;
  color: #687687;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.analytics-data > div {
  max-height: 280px;
  overflow: auto;
  border-top: 1px solid #edf0f3;
}
.analytics-data table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  color: #3f4d5c;
  font-size: 10px;
}
.analytics-data th,
.analytics-data td {
  padding: 9px 12px;
  border-bottom: 1px solid #edf0f3;
  text-align: right;
  white-space: nowrap;
}
.analytics-data th:first-child,
.analytics-data td:first-child {
  text-align: left;
}
.analytics-data th {
  position: sticky;
  top: 0;
  background: #f7f9fb;
  color: #687687;
}

@media (max-width: 760px) {
  .analytics-title,
  .analytics-card-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
  }
  .analytics-title > span {
    white-space: normal;
  }
  .analytics-summary {
    grid-template-columns: 1fr;
  }
  .analytics-legend,
  .analytics-ranges {
    justify-content: flex-start;
  }
  .analytics-card-head,
  .analytics-card > .analytics-legend.daily {
    padding-inline: 16px;
  }
  .analytics-tooltip {
    margin-inline: 15px;
  }
  .analytics-note {
    padding-inline: 16px;
  }
}
@media (min-width: 761px) and (max-width: 1250px) {
  .analytics-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Stable chart chrome and compact interaction polish. */
.chart-frame {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
  background: linear-gradient(180deg, #fff, #f8fbff);
}
.chart-frame.dual-axis {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.chart-fixed-axis {
  position: relative;
  z-index: 2;
  display: block;
  flex: none;
  background: linear-gradient(180deg, #fff, #f8fbff);
}
.point-chart-scroll,
.analytics-scroll {
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
.analytics-hit,
.chart-data-hit {
  fill: transparent;
  stroke: transparent;
  cursor: help;
}
.chart-data-point {
  fill: #fff;
  stroke: #2979e7;
  stroke-width: 2;
  pointer-events: none;
}
.analytics-tooltip,
.point-chart-tooltip {
  min-height: 40px;
  margin: 10px 18px 14px;
  padding: 10px 12px;
  border: 1px solid #cddcf0;
  border-radius: 9px;
  background: #f4f8fd;
  color: #33465a;
  font-size: 11px;
  line-height: 1.5;
}
.panel,
.management-card,
.analytics-card,
.template-card,
.config-section {
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}
.panel:hover,
.analytics-card:hover {
  border-color: #c8d9ed;
  box-shadow: 0 12px 32px rgba(31, 70, 112, 0.07);
}
main > section:not(#overview):not([hidden]) {
  border-radius: 0;
  background: transparent;
}
input,
select,
textarea {
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}

/* R73 interaction polish */
.hero-actions {
  display: flex;
  align-items: stretch;
  gap: 14px;
}
.game-open-actions,
.game-stop-actions {
  display: grid;
  grid-template-columns: auto auto;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  background: rgba(255,255,255,.07);
}
.game-open-actions,
.game-stop-actions { min-height: 196px; grid-template-rows: 1fr 1fr; }
.game-open-actions { grid-template-columns:minmax(150px,1fr) minmax(150px,1fr); }
.game-open-actions #startGame { grid-column:1 / -1; }
.display-unit-control { display:block; margin:0; }
.display-unit-control select { min-width:150px; height:100%; min-height:42px; background:rgba(255,255,255,.12); border-color:rgba(255,255,255,.38); color:#fff; }
.rebate-result-control { grid-column:1 / -1; display:flex; align-items:center; gap:9px; margin:0; padding:9px 11px; border:1px solid rgba(255,255,255,.28); border-radius:9px; background:rgba(255,255,255,.1); color:#fff; cursor:pointer; }
.rebate-result-control input { width:auto; margin:0; accent-color:#2b72df; }
.rebate-result-control span { display:grid; gap:2px; font-size:13px; font-weight:750; }
.rebate-result-control small { color:rgba(255,255,255,.7); font-size:10px; font-weight:500; }
.game-open-actions > span,
.game-stop-actions > span {
  grid-column: 1 / -1;
  color: rgba(255,255,255,.78);
  font-size: 11px;
  font-weight: 700;
}
.game-stop-actions { grid-template-columns: auto; }
.game-stop-actions #stopGame { align-self:stretch; }
.connection-state {
  border: 1px solid currentColor;
  font-weight: 800;
}
.connection-state.online {
  background: #d8f7e9 !important;
  color: #075d3d !important;
  border-color: #16835c;
}
.connection-state.offline {
  background: #f3f4f6 !important;
  color: #3f4b57 !important;
  border-color: #7b8791;
}
.connection-state.reconnect-required {
  background: #fff2dc !important;
  color: #884500 !important;
  border-color: #c96a00;
}
.template-card textarea,
textarea {
  min-height: 132px;
  padding: 13px 14px;
  border: 1px solid #aebbc7;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}
.template-silent {
  display:inline-flex;
  align-items:center;
  gap:7px;
  white-space:nowrap;
  color:#536273;
  font-size:13px;
  font-weight:700;
}
.template-silent input { width:auto; min-height:auto; margin:0; }
.template-card header { display:block; }
.template-title-line {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
}
.template-title-line h3,
.template-title-line strong { margin:0; }
.rejection-template { display:grid; gap:8px; margin-top:14px; }
.rejection-template textarea { margin:0; }
.template-card textarea:focus,
textarea:focus {
  outline: 0;
  border-color: #1769e0;
  box-shadow: 0 0 0 3px rgba(23,105,224,.18);
}
.pin-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.pin-dialog-heading > div > span {
  display: block;
  margin-bottom: 4px;
  color: #1769e0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
}
.pin-dialog-heading h3 { margin: 0; }
.public-password-dialog {
  width: min(500px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
  border-color: #d7e0ea;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(19, 37, 58, .25);
}
.public-password-dialog > div {
  padding: 28px;
}
.public-password-dialog #publicPinDescription {
  margin: 18px 0 14px;
  color: #687482;
}
.password-display {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid #d8e5f4;
  border-radius: 14px;
  background: linear-gradient(135deg, #f7faff, #eef5ff);
}
.password-display dt {
  color: #667382;
  font-size: 11px;
  font-weight: 750;
}
.password-display dd {
  margin: 7px 0 0;
}
.public-password-dialog .dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  margin-top: 18px;
}
.public-password-dialog .dialog-actions button {
  min-height: 46px;
}

.rebate-dialog { width: min(520px, calc(100vw - 32px)); }
.rebate-dialog form { display: grid; gap: 18px; }
.rebate-dialog label { display: grid; gap: 8px; font-weight: 700; }
.rebate-dialog label small { color: var(--muted, #64748b); font-weight: 500; }
.percent-input { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.percent-input b { font-size: 1.2rem; }
.operator-rebate { display: grid; grid-template-columns: minmax(84px, 1fr) auto; gap: 6px; min-width: 190px; }
.operator-rebate .field-error { grid-column: 1 / -1; margin: 0; }
.date-range { display:flex; align-items:end; gap:10px; flex-wrap:wrap; margin:14px 0; }
.date-range label { display:grid; gap:5px; color:#687482; font-size:11px; }
.date-range input { min-height:40px; min-width:210px; }
#settleRangeRebates { margin-left:auto; }
.player-business-chart text { fill:#718096; font-size:11px; }
.player-business-chart .zero { stroke:#9aa9b8; stroke-width:1.5; }
.business-returned { fill:#2f9fdb; }
.business-unreturned { fill:#e86b63; }
.business-profit { fill:#2eb67d; }
.business-unreturned-key::before,.business-principal-key::before,.business-profit-key::before { content:""; display:inline-block; width:12px; height:12px; margin-right:6px; border-radius:3px; vertical-align:-1px; }
.business-unreturned-key::before { background:#e86b63; }
.business-principal-key::before { background:#2f9fdb; }
.business-profit-key::before { background:#2eb67d; }
.player-business-chart .business-total { fill:#334155; font-weight:800; }
.player-business-chart .business-net-label { fill:#64748b; font-weight:800; }
.player-business-chart .business-net-label.negative { fill:#b33a34; }
.player-business-chart .business-net-label.positive { fill:#17875f; }
.player-business-chart .business-date { fill:#718096; }
.player-business-chart .bar-caption { fill:#718096; font-size:10px; }
@media(max-width:760px) {
  .date-range label { width:100%; }
  .date-range input { min-width:0; }
  #settleRangeRebates { width:100%; margin-left:0; }
}
.business-unavailable { fill:#8a96a3; font-size:9px; }
.adjustment-chart svg { width:100%; max-height:190px; }
.adjustment-chart line { stroke:#9aa9b8; }
.adjustment-chart text { fill:#465668; font-size:14px; }
.adjust-topup { fill:#1e9b78; }
.adjust-withdrawal { fill:#e05252; }
.template-image-toggle { display:flex; align-items:center; gap:12px; margin-bottom:16px; padding:16px; border:1px solid #d8e5f4; border-radius:12px; background:#f7faff; font-weight:750; }
.template-image-toggle input { width:20px; height:20px; }
.template-image-toggle span { display:grid; gap:3px; }
.template-image-toggle small { color:#687482; font-weight:500; }
@media (min-width: 621px) {
  .operator-rebate { min-width:0; width:200px; }
  #players .ledger-table { overflow-x:auto; }
  #players .ledger-table table { min-width:1500px; table-layout:fixed; }
  #players .ledger-table th { white-space:nowrap; word-break:keep-all; writing-mode:horizontal-tb; }
  #players .ledger-account-column { width:180px; }
  #players .ledger-current-column { width:105px; }
  #players .ledger-money-column { width:105px; }
  #players .ledger-public-page-column { width:220px; }
  #players .ledger-table th:nth-last-child(2),#players .ledger-table td:nth-last-child(2){width:100px;}
  #players .ledger-table th:last-child,#players .ledger-table td:last-child{width:230px;}
}
@media (max-width: 620px) {
  #players .rebate-settings { white-space:nowrap; word-break:keep-all; }
  #players .operator-rebate { width:100%; grid-template-columns:minmax(0,1fr) auto; }
  #players .operator-rebate button { white-space:nowrap; }
}
#players .operator-rebate input { min-width:0; }
.player-card-list { display:grid; gap:16px; }
.player-card { overflow:hidden; border:1px solid #d8e2ed; border-radius:16px; background:#fff; box-shadow:0 8px 28px rgba(28,45,66,.055); }
.player-card button { white-space:nowrap; }
.player-card.is-disabled { background:#f7f8fa; }
.player-card-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 20px; }
.player-card-header .ledger-account { min-width:0; }
.player-card-header .connection-state { flex:0 0 auto; }
.player-card-overview { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); border-block:1px solid #e7edf3; background:linear-gradient(90deg,#fbfcfe,#f6faff); }
.player-card-metric { min-width:0; padding:14px 20px; border-right:1px solid #e7edf3; }
.player-card-metric:last-child { border-right:0; }
.player-card-metric > span,.player-card-metric em { display:block; color:#7a8796; font-size:10px; font-style:normal; }
.player-card-metric strong { display:block; margin:6px 0 3px; color:#17212b; font:750 17px ui-monospace,SFMono-Regular,Consolas,monospace; overflow-wrap:anywhere; }
.player-card-metric strong small { color:#7d8896; font:650 10px ui-sans-serif,system-ui,sans-serif; }
.player-card-metric.profit strong { color:#126c52; }
.player-card-metric.investment strong { color:#9a5a08; }
.player-card-section { display:grid; grid-template-columns:210px minmax(0,1fr); align-items:center; gap:24px; padding:18px 32px; border-top:1px solid #edf1f5; }
.player-card-section-title { align-self:start; min-width:0; }
.player-card-section-title strong,.player-card-section-title small { display:block; }
.player-card-section-title strong { color:#263545; font-size:12px; }
.player-card-section-title small { margin-top:4px; color:#84909d; font-size:10px; line-height:1.45; }
.player-adjustment-grid { display:grid; grid-template-columns:repeat(2,120px) 112px; align-items:end; justify-content:start; gap:10px; min-width:0; }
.player-adjustment-grid > label,.player-adjustment-grid .operator-rebate label,.player-adjustment-grid .unfreeze-points label { display:grid; gap:5px; min-width:0; color:#697687; font-size:10px; font-weight:700; }
.player-adjustment-grid .ledger-money-input { width:100%; min-width:0; min-height:42px; padding:9px 10px; }
.player-adjustment-grid > button { width:100%; min-width:0; min-height:42px; }
.player-adjustment-grid .unfreeze-points { display:grid; grid-template-columns:minmax(144px,1fr) 88px; grid-column:1/3; grid-row:2; align-items:end; gap:8px; width:100%; min-width:0; }
.player-adjustment-grid .unfreeze-points button { width:88px; min-width:88px; min-height:42px; }
.player-adjustment-grid .unfreeze-points .field-error { grid-column:1/-1; }
.player-adjustment-grid .unfreeze-points .field-error:empty { display:none; }
.player-adjustment-grid .rebate-settings { grid-column:3; grid-row:3; }
.player-adjustment-grid .operator-rebate { display:grid; grid-template-columns:minmax(144px,1fr) 88px; grid-column:1/3; grid-row:3; align-items:end; gap:8px; width:100%; min-width:0; }
.player-adjustment-grid .operator-rebate button { width:88px; min-width:88px; min-height:42px; }
.player-adjustment-grid .operator-rebate .field-error { grid-column:1/-1; }
.player-adjustment-grid .operator-rebate .field-error:empty { display:none; }
.player-adjustment-grid .ledger-row-error { grid-column:1/-1; min-height:0; margin:0; }
.player-card-access { grid-template-columns:210px minmax(360px,720px) auto; justify-content:start; }
.player-card-access .player-public-page { min-width:0; }
.player-card-access .public-page-cell { display:grid; grid-template-columns:88px minmax(0,1fr) 88px; align-items:center; gap:8px; min-width:0; }
.player-card-access .public-page-cell > div { display:contents; }
.player-card-access .public-page-url { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.player-card-access .public-page-url,.player-card-access .public-page-state { grid-column:1/-1; grid-row:1; }
.player-card-access .manage-public-pin { grid-column:1; grid-row:2; }
.player-card-access .copy-public-url { grid-column:3; grid-row:2; }
.player-card-access button { width:88px; min-width:88px; min-height:42px; }
.player-card-actions { display:grid; grid-template-columns:88px 88px; gap:8px; }
.player-card-help { margin:10px 2px 0; }
.period-actions { display:flex; gap:8px; margin-left:auto; }
.period-actions .danger { color:#9b2c2c; border-color:#efb5b5; background:#fff5f5; }
#periods .row { grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) auto; align-items:center; }
.settlement-operation-dialog fieldset { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:16px 0; padding:14px; border:1px solid #d8e2ed; border-radius:12px; }
.settlement-operation-dialog fieldset label { display:grid; gap:6px; }
.settlement-operation-dialog select { min-height:44px; }
.settlement-operation-dialog textarea { width:100%; min-height:84px; margin-top:7px; }
.settlement-operation-dialog #reversalPreview { margin:14px 0; padding:12px; border-radius:10px; background:#f5f8fb; white-space:pre-line; }
.draw-classification-value { font-weight:750; }
.draw-classification-red { color:#d92323; }
.draw-classification-blue { color:#1675b9; }
.draw-classification-green { color:#12823a; }
.draw-classification-purple { color:#7e35b4; }
.draw-classification-gray { color:#6b7280; }
@media (max-width:1100px) {
  .player-card-section { grid-template-columns:150px minmax(0,1fr); }
  .player-adjustment-grid { grid-template-columns:repeat(2,minmax(112px,1fr)) 112px; }
  .player-adjustment-grid .operator-rebate,.player-adjustment-grid .unfreeze-points { grid-column:1/3; max-width:none; }
  .player-card-access { grid-template-columns:150px minmax(0,1fr); }
  .player-card-actions { grid-column:2; justify-content:start; }
}
@media (max-width:620px) {
  .player-card-header { align-items:flex-start; padding:16px; }
  .player-card-overview { grid-template-columns:1fr; }
  .player-card-metric { border-right:0; border-bottom:1px solid #e7edf3; }
  .player-card-metric:last-child { border-bottom:0; }
  .player-card-section,.player-card-access { grid-template-columns:1fr; gap:13px; padding:16px; }
  .player-adjustment-grid { grid-template-columns:1fr 1fr; }
  .player-adjustment-grid > button { width:100%; min-width:0; }
  .player-adjustment-grid .operator-rebate,.player-adjustment-grid .unfreeze-points { grid-column:1/-1; max-width:none; }
  .player-adjustment-grid .rebate-settings { grid-column:1/-1; grid-row:4; }
  .player-card-access .public-page-cell { grid-template-columns:88px minmax(0,1fr) 88px; }
  .player-card-actions { grid-column:1; grid-template-columns:1fr 1fr; }
  .player-card-actions button { width:100%; min-width:0; }
  #periods .row { grid-template-columns:1fr 1fr 1fr; }
  #periods .period-actions { grid-column:1/-1; justify-content:flex-end; }
}

#publicPin {
  min-height: 30px;
  overflow-wrap: anywhere;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .08em;
}
.operator-reconnect-control {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-top: 9px;
}
.operator-auth-form {
  display: grid;
  width: min(260px, 100%);
  gap: 7px;
  padding: 11px;
  border: 1px solid #d8e5f4;
  border-radius: 10px;
  background: #f5f9ff;
}
.operator-auth-form label {
  display: grid;
  gap: 5px;
  color: #596777;
  font-size: 10px;
  font-weight: 700;
}
.operator-auth-form input {
  min-width: 0;
  padding: 8px 9px;
}
.operator-auth-form > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.operator-auth-form .field-error {
  width: auto;
  margin: 0;
  overflow-wrap: anywhere;
}
.operator-auth-form .field-error:empty { display: none; }
.point-range label {
  display: block;
  color: #687482;
  font-size: 11px;
}
.point-range {
  grid-column: 1 / -1;
}
.point-range > span {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) minmax(145px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.point-range input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
}
.point-range .field-error { display: block; }
#players .ledger-table td {
  vertical-align: middle;
}
#players .ledger-table tbody tr {
  height: 146px;
}
#players .ledger-account,
#players .ledger-financial,
#players .public-page-cell {
  align-content: center;
}
#players .public-page-url { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
#players .ledger-financial em {
  min-height: 18px;
}
#pageDescription {
  color: #5f6b79;
}
#players .ledger-table button,
#players .ledger-table input {
  min-height: 42px;
}
#players .ledger-table button { white-space:nowrap; word-break:keep-all; }
#players .point-details { min-width:74px; white-space:nowrap; word-break:keep-all; }
#players .ledger-adjust-column,
#players .ledger-trend-column { width: 85px; }
#players .ledger-adjust-column { width: 80px; }
#players .player-operation-row {
  --player-action-width:88px;
  --player-input-width:112px;
}
#players .player-operation-row button {
  width:var(--player-action-width);
  min-width:var(--player-action-width);
  height:42px;
  min-height:42px !important;
  padding:7px 8px;
  font-size:11px;
}
#players .player-operation-row .ledger-money-input {
  width:var(--player-input-width);
  min-width:var(--player-input-width);
  max-width:var(--player-input-width);
  height:42px;
}
#players .player-row-actions { margin:0; }

@media (min-width: 761px) {
  #players .ledger-table { overflow: visible; }
  #players .ledger-table thead { display:none; }
  #players .ledger-table table,
  #players .ledger-table tbody { display:block; min-width:0; width:100%; }
  #players .ledger-table tr.player-operation-row {
    display:grid;
    grid-template-columns:minmax(110px,1.35fr) minmax(var(--player-action-width),1fr) repeat(2,minmax(35px,1fr)) repeat(2,var(--player-input-width)) var(--player-action-width);
    grid-template-rows:auto auto auto;
    gap:10px 8px;
    height:auto;
    padding:18px;
    align-items:center;
  }
  #players .player-operation-row > td { display:block; width:auto !important; padding:0; border:0; }
  #players .player-operation-row > td:nth-child(1) { grid-column:1; grid-row:1 / 4; }
  #players .player-operation-row > td:nth-child(2) { grid-column:2; grid-row:1; }
  #players .player-operation-row > td:nth-child(3) { grid-column:3; grid-row:1; }
  #players .player-operation-row > td:nth-child(4) { grid-column:4; grid-row:1; }
  #players .player-operation-row > td:nth-child(5) { grid-column:5; grid-row:1; }
  #players .player-operation-row > td:nth-child(6) { grid-column:6; grid-row:1; }
  #players .player-operation-row > .player-adjust { grid-column:7; grid-row:1; justify-self:end; transform:translateX(0); }
  #players .player-operation-row > .player-rebate-settings { grid-column:2 / 3; grid-row:2; }
  #players .player-operation-row > .player-operator-rebate { grid-column:3 / 7; grid-row:2; }
  #players .player-operation-row > .player-public-page { grid-column:2 / 6; grid-row:3; }
  #players .player-operation-row > .player-trend { grid-column:6; grid-row:3; }
  #players .player-operation-row > .player-lifecycle { grid-column:7; grid-row:3; }
  #players .player-rebate-settings,
  #players .player-operator-rebate,
  #players .player-public-page,
  #players .player-trend,
  #players .player-lifecycle { align-self:start; }
  #players .player-operation-row .operator-rebate { display:grid; grid-template-columns:var(--player-input-width) var(--player-action-width); gap:8px; align-items:center; justify-content:start; }
  #players .player-operation-row .operator-rebate .field-error { grid-column:1 / -1; }
  #players .player-operation-row .public-page-cell { display:grid; grid-template-columns:minmax(0,1fr) var(--player-action-width); align-items:center; gap:8px; }
  #players .player-operation-row .public-page-cell > div { display:grid; grid-template-columns:minmax(0,1fr) var(--player-action-width); align-items:center; gap:8px; }
}

@media (max-width: 760px) {
  .hero-actions { align-items: stretch; flex-direction: column; }
  .game-open-actions { grid-template-columns: 1fr 1fr; }
  .game-stop-actions { grid-template-columns: 1fr; }
  .game-open-actions button,
  .game-stop-actions button { width: 100%; }
  #players .ledger-table { overflow:visible; }
  #players .ledger-table thead {
    position:absolute;
    width:1px;
    height:1px;
    overflow:hidden;
    clip:rect(0 0 0 0);
  }
  #players .ledger-table table,
  #players .ledger-table tbody,
  #players .ledger-table tr.player-operation-row,
  #players .ledger-table tr.player-operation-row > td {
    display:block;
    width:100%;
    min-width:0;
  }
  #players .ledger-table table { table-layout:auto; }
  #players .ledger-table tr.player-operation-row {
    height:auto;
    margin-bottom:12px;
    padding:16px;
    border:1px solid var(--line);
    border-radius:12px;
    background:#fff;
    box-shadow:0 3px 12px rgba(23,33,43,.035);
  }
  #players .ledger-table tr.player-operation-row > td {
    display:grid;
    grid-template-columns:100px minmax(0,1fr);
    align-items:center;
    gap:10px;
    padding:7px 0;
    border:0;
  }
  #players .ledger-table tr.player-operation-row > td::before {
    content:attr(data-label);
    color:var(--muted);
    font-size:11px;
  }
  #players .player-operation-row .ledger-account,
  #players .player-operation-row .operator-rebate,
  #players .player-operation-row .public-page-cell { min-width:0; }
  .public-password-dialog > div { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
