:root {
  font-family:Inter,-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  color:#263631;
  background:#f5f6f3;
  font-synthesis:none;
  --green:#194f42;
  --muted:#7a8881;
  --line:#e3e8e1;
  --red:#c85c5b;
  --blue:#497bc2
}
* {
  box-sizing:border-box
}
body {
  margin:0
}
button,input,select {
  font:inherit
}
button,a,input {
  -webkit-tap-highlight-color:transparent
}
button {
  cursor:pointer
}
button:disabled {
  opacity:.5;
  cursor:not-allowed
}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible {
  outline:3px solid #95bd8f;
  outline-offset:3px
}
[hidden] {
  display:none!important
}
a {
  color:inherit;
  text-decoration:none
}
.sidebar {
  width:224px;
  background:#163b33;
  color:#fff;
  position:fixed;
  inset:0 auto 0 0;
  display:flex;
  flex-direction:column;
  padding:34px 22px;
  z-index:40;
  overflow-y:auto
}
.menu-toggle,.sidebar-close { display:none; border:0; background:none; align-items:center; justify-content:center; min-width:44px; min-height:44px; border-radius:7px; font-size:24px }
.menu-toggle { color:var(--green); flex-shrink:0 }
.sidebar-close { color:#fff; position:absolute; right:14px; top:18px; font-size:30px }
.menu-toggle:hover { background:#eaf0e5 }
.sidebar-close:hover { background:#214c40 }
.nav-backdrop { position:fixed; inset:0; z-index:30; border:0; padding:0; background:#0e241b66 }
.brand {
  display:flex;
  align-items:center;
  gap:12px;
  font-size:27px;
  font-weight:650;
  letter-spacing:-1px
}
.brand-icon {
  font-size:40px;
  color:#d8eabe;
  font-weight:600;
  line-height:48px
}

.workspace-label {
  margin:36px 10px 16px;
  display:flex;
  justify-content:space-between;
  color:#8dab9c;
  font-size:10px;
  letter-spacing:1.5px
}

nav {
  display:grid;
  gap:8px
}
.nav-item {
  background:none;
  border:0;
  color:#a7bcb2;
  text-align:left;
  display:flex;
  align-items:center;
  gap:13px;
  padding:14px 15px;
  border-radius:7px;
  font-size:13px
}
.nav-item:hover {
  background:#214c40
}
.nav-item.active {
  background:#d1e8ba;
  color:#234733;
  font-weight:600
}
.nav-icon {
  font-size:22px;
  line-height:20px
}
.nav-dot {
  background:#385f43;
  width:5px;
  height:5px;
  border-radius:50%;
  margin-left:auto
}
.source-block {
  border-top:1px solid #315046;
  margin-top:33px;
  padding:25px 9px
}
.small-label {
  font-size:10px;
  color:#85a094;
  letter-spacing:1px
}
.source-name {
  display:flex;
  align-items:center;
  gap:10px;
  font-size:13px;
  margin-top:20px
}
.source-logo {
  font:600 13px Georgia,serif;
  background:#254e42;
  border:1px solid #436556;
  color:#d9d6a9;
  border-radius:7px;
  padding:11px 8px
}
.source-name small {
  display:block;
  font-size:8px;
  letter-spacing:1px;
  color:#91a99e;
  margin-top:7px
}

.sidebar-bottom {
  margin-top:auto;
  padding:20px 9px 0
}
.local-badge {
  font-size:11px;
  display:flex;
  align-items:center;
  gap:7px;
  color:#b0c7bb
}
.dot {
  display:inline-block;
  width:6px;
  height:6px;
  border-radius:50%;
  background:#a4afa8;
  flex-shrink:0
}
.local-badge .dot {
  background:#bfdc9f
}

.main-shell {
  margin-left:224px;
  min-width:0
}
.topbar-start { display:flex; align-items:center; gap:12px; min-width:0 }
.topbar {
  height:73px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 40px;
  border-bottom:1px solid var(--line);
  background:#fafbf8
}
.breadcrumb {
  font-size:11px;
  color:#98a298;
  display:flex;
  align-items:center;
  gap:14px
}
.breadcrumb strong {
  color:#485b4f;
  font-weight:500
}
.topbar-right {
  display:flex;
  align-items:center;
  gap:19px
}
.topbar-divider {
  height:18px;
  width:1px;
  background:var(--line)
}
#clock {
  font-size:11px;
  letter-spacing:1px;
  font-variant-numeric:tabular-nums;
  color:#869287
}
.connection-pill {
  font-size:11px;
  display:flex;
  align-items:center;
  gap:7px;
  color:#78877c
}
.connection-pill.live {
  color:#277350
}
.connection-pill.live .dot {
  background:#61a970;
  box-shadow:0 0 0 4px #61a97012
}
.connection-pill.error {
  color:#b75f44
}
.connection-pill.error .dot {
  background:#c87952
}
#mode-badge {
  font-size:10px;
  color:#ab5d14;
  background:#ffedc6;
  padding:5px 8px;
  border-radius:4px
}
main {
  max-width:1660px;
  padding:37px 40px 20px;
  margin:auto
}
.page-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:30px;
  gap:20px
}

h1 {
  font-size:29px;
  letter-spacing:-.6px;
  font-weight:600;
  margin:11px 0 10px;
  line-height:1.3
}

.account-actions {
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end
}
.account-actions>span {
  font-size:11px;
  color:#8b978e
}
.button {
  border-radius:6px;
  padding:10px 15px;
  border:1px solid var(--line);
  font-size:11px;
  font-weight:500;
  background:white;
  color:#4e6153;
  display:inline-flex;
  gap:15px;
  justify-content:center;
  align-items:center
}
.button:hover {
  filter:brightness(.97)
}
.button.dark {
  background:var(--green);
  color:white;
  border-color:var(--green)
}
.button.subtle {
  background:#ffffff85
}
.metrics {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  border:1px solid var(--line);
  border-radius:9px;
  background:#fff;
  margin-bottom:27px;
  overflow:hidden
}
.metric {
  padding:20px 23px 17px
}
.metric+.metric {
  border-left:1px solid var(--line)
}
.metric-label {
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:11px;
  color:#6c7b70
}
.metric-label>span {
  font-size:15px;
  color:#83997c
}
.metric-label>.tiny-wave {
  font-size:11px;
  letter-spacing:1px
}
.metric-number {
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:31px;
  letter-spacing:-1px;
  line-height:1;
  margin:17px 0 14px;
  color:#2f4c3b
}

.section-index {
  font:9px ui-monospace,monospace;
  letter-spacing:1.6px;
  color:#819476
}

#collector-error {
  font-size:11px;
  line-height:1.7;
  color:#b04e38;
  margin:10px 0 0
}
.section-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:20px
}
.section-heading h2 {
  font-size:16px;
  font-weight:600;
  margin:0;
  display:flex;
  gap:9px;
  align-items:center
}
.section-heading h2 span {
  font:10px ui-monospace,monospace;
  background:#e8ede3;
  padding:3px 6px;
  border-radius:4px;
  color:#708469;
  min-width:22px;
  text-align:center
}
.update-note {
  font-size:10px;
  color:#98a18f;
  display:flex;
  align-items:center;
  gap:6px
}
.table-toolbar {
  display:flex;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px
}
.filters {
  display:flex;
  gap:3px;
  flex-wrap:wrap
}
.filters button {
  font-size:11px;
  padding:9px 12px;
  border:1px solid transparent;
  background:transparent;
  color:#809078;
  border-radius:5px
}
.filters button:hover {
  background:#e9ede5
}
.filters .selected {
  background:#fff;
  border:1px solid #dbe3d4;
  color:#395f3d;
  box-shadow:0 1px 3px #30493306
}
.search-wrap {
  position:relative;
  min-width:174px
}
.search-wrap span {
  position:absolute;
  left:11px;
  top:6px;
  font-size:21px;
  color:#97a48d
}
.search-wrap input {
  width:100%;
  height:34px;
  border:1px solid #e1e7db;
  border-radius:5px;
  background:#fff;
  padding:0 10px 0 31px;
  font-size:10px;
  color:#536c4c
}
.search-wrap input::placeholder {
  color:#a5af9c
}
.empty-state {
  border:1px dashed #dbe3d2;
  background:#f9faf7;
  border-radius:8px;
  min-height:197px;
  padding:28px;
  text-align:center
}
.empty-symbol {
  font-size:27px;
  color:#b3c2a7;
  line-height:30px
}
.empty-state h3 {
  font-size:13px;
  font-weight:500;
  color:#8a9b7f;
  margin:10px 0
}
.empty-state p {
  font-size:10px;
  color:#a3af9a;
  margin:10px 0
}
.empty-legend {
  display:flex;
  justify-content:center;
  gap:17px;
  margin-top:17px;
  color:#a0aa98;
  font-size:9px
}
.empty-legend span {
  display:flex;
  gap:5px;
  align-items:center
}
.empty-legend i {
  width:5px;
  height:5px;
  border-radius:50%;
  opacity:.55
}
.legend-banker {
  background:var(--red)
}
.legend-player {
  background:var(--blue)
}
.legend-tie {
  background:#62a375
}
.table-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px
}
.table-card {
  padding:17px 18px 13px;
  background:#fff;
  border:1px solid #e0e6da;
  border-radius:8px;
  box-shadow:0 2px 3px #29442402;
  transition:border-color .15s,box-shadow .15s
}
.table-card:hover {
  border-color:#aabd9d;
  box-shadow:0 3px 9px #29442408
}
.table-card.stale {
  background:#f9faf8
}
.card-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px
}
.table-link {
  padding:0;
  border:0;
  background:none;
  font-size:15px;
  font-weight:650;
  color:#304d38;
  display:flex;
  gap:8px;
  align-items:center
}
.table-link small {
  font-size:8px;
  letter-spacing:1px;
  color:#9eac96;
  font-weight:400
}
.state-tag {
  font-size:8px;
  color:#829277;
  background:#f2f5ee;
  border:1px solid #e7ecdf;
  padding:4px 6px;
  border-radius:4px;
  white-space:nowrap
}
.state-tag.shuffling {
  background:#fbefd8;
  color:#8b681f
}
.state-tag.betting {
  font-variant-numeric:tabular-nums;
  background:#eaf4e8;
  color:#5b8953;
  border-color:#dcebd7
}
.state-tag.payout {
  background:#faf1e4;
  color:#b1864d;
  border-color:#f0e3ca
}
.state-tag.betting.urgent {
  background:#fff0e6;
  border-color:#f3d2bf;
  color:#b2532a
}
.recording-panel {
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:16px 20px;
  margin:0 0 24px;
  border:1px solid #dcebd7;
  border-radius:8px;
  background:#eff5ee;
  color:#54705b;
  font-size:12px
}
.recording-panel p { margin:6px 0;line-height:1.6 }

.round-line {
  font:8px ui-monospace,monospace;
  color:#9daa95;
  letter-spacing:.4px;
  margin-top:9px
}
.hands {
  display:grid;
  grid-template-columns:1fr 1px 1fr;
  gap:13px;
  margin:17px 0 13px
}
.hand-divider {
  background:#edf0e8
}
.hand-heading {
  font-size:10px;
  color:var(--red);
  display:flex;
  justify-content:space-between;
  align-items:center
}
.hand.player .hand-heading {
  color:var(--blue)
}
.hand-heading strong {
  font:500 18px ui-monospace,monospace
}
.hand-heading strong small {
  font-size:8px;
  margin-left:2px;
  color:#9eab97
}
.playing-cards {
  display:flex;
  gap:5px;
  margin-top:7px;
  min-height:43px
}
.playing-card {
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid #dfe5d8;
  background:linear-gradient(#fff,#fbfcf9);
  border-radius:4px;
  height:42px;
  width:31px;
  font:19px Georgia,serif;
  color:#425839;
  position:relative;
  box-shadow:0 1px 2px #34452705
}
.playing-card.hidden {
  color:#94a589;
  font-size:15px;
  background:repeating-linear-gradient(45deg,#ecf0e7,#ecf0e7 2px,#f3f6ed 2px,#f3f6ed 5px)
}
.playing-card.absent {
  color:#c4cebc;
  border-style:dashed;
  background:#fafcf7;
  box-shadow:none;
  font-size:13px
}

.result-bar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  font-size:10px;
  background:#f7f9f3;
  border-radius:4px;
  padding:8px 9px;
  color:#9ca990;
  min-height:31px
}
.result-bar strong {
  font-weight:500
}
.result-bar.banker strong {
  color:var(--red)
}
.result-bar.player strong {
  color:var(--blue)
}
.result-bar.tie strong {
  color:#63a071
}

.road {
  display:flex;
  gap:3px;
  margin-top:12px;
  align-items:center;
  min-height:12px;
  overflow:hidden
}
.road-label {
  font-size:8px;
  color:#a0ac96;
  margin-right:5px;
  white-space:nowrap
}
.road-dot {
  display:block;
  flex-shrink:0;
  width:7px;
  height:7px;
  border:1.5px solid var(--red);
  border-radius:50%
}
.road-dot.player {
  border-color:var(--blue)
}
.road-dot.tie {
  border-color:#6da273
}
.road-placeholder {
  font-size:9px;
  color:#b0baa7
}
.card-footer {
  display:flex;
  justify-content:space-between;
  margin-top:14px;
  padding-top:10px;
  border-top:1px solid #eff2e9;
  align-items:center;
  font-size:8px;
  color:#abb69f
}
.card-footer button {
  border:0;
  background:none;
  color:#7c926e;
  font-size:9px;
  padding:1px
}
.coverage-banner {
  display:flex;
  gap:9px;
  align-items:center;
  background:#f7f0df;
  border:1px solid #eee2c5;
  color:#aa8650;
  border-radius:6px;
  padding:11px 13px;
  margin-bottom:23px
}
.coverage-banner p {
  margin:0;
  font-size:10px;
  line-height:1.8;
  flex:1
}
.notice-icon {
  border:1px solid #baa070;
  border-radius:50%;
  height:14px;
  width:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:10px;
  flex-shrink:0
}
.coverage-banner button {
  background:none;
  border:0;
  font-size:9px;
  white-space:nowrap;
  color:#9a7845
}

dialog {
  border:1px solid var(--line);
  border-radius:12px;
  padding:27px;
  color:#304632;
  background:#fafbf8;
  max-height:88vh;
  box-shadow:0 20px 90px #152d3a30
}
dialog::backdrop {
  background:#102b27a3;
  backdrop-filter:blur(3px)
}
.table-dialog {
  width:830px;
  max-width:calc(100vw - 30px)
}
.status-dialog {
  width:540px;
  max-width:calc(100vw - 30px)
}
.dialog-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:21px
}
.dialog-header h2 {
  font-size:22px;
  font-weight:550;
  margin:9px 0 0
}
.icon-button {
  border:1px solid var(--line);
  background:#fff;
  color:#87977c;
  border-radius:50%;
  width:30px;
  height:30px;
  font-size:20px;
  line-height:20px
}
.history-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:25px;
  font-size:11px;
  color:#8b9a7f
}
.history-heading h3 {
  font-size:14px;
  font-weight:550;
  color:#506647
}
.history-note {
  font-size:10px;
  color:#a0ae94;
  margin:0 0 13px
}
.history-scroll {
  max-height:350px;
  overflow:auto
}
table {
  width:100%;
  border-collapse:collapse;
  text-align:left;
  white-space:nowrap
}
th {
  font-size:10px;
  color:#8e9e83;
  font-weight:500;
  padding:12px 8px;
  background:#eef3e9;
  position:sticky;
  top:0
}
td {
  padding:12px 8px;
  font:11px ui-monospace,monospace;
  border-bottom:1px solid #e6ecdf;
  color:#617654
}
td small {
  display:block;
  font-size:8px;
  color:#a4b094;
  margin-top:4px
}
.text-banker {
  color:var(--red)
}
.text-player {
  color:var(--blue)
}
.text-tie {
  color:#64a473
}
.pagination {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:16px;
  font-size:10px;
  color:#98a78b
}
.detail-table {
  max-width:430px;
  margin:auto
}
dl {
  margin:0;
  display:grid;
  grid-template-columns:125px 1fr;
  font-size:11px;
  line-height:2.5
}
dt {
  color:#8a9b7f
}
dd {
  margin:0;
  overflow-wrap:anywhere;
  color:#47633d
}
.status-note {
  border-top:1px solid var(--line);
  margin-top:20px;
  padding-top:15px;
  font-size:11px;
  color:#93a086;
  line-height:1.9
}
@media(min-width:1650px) {
  .table-grid {
    grid-template-columns:repeat(4,minmax(0,1fr))
  }
}
@media(max-width:1200px) {
  body.nav-open { overflow:hidden }
  .sidebar {
    width:min(280px,calc(100vw - 48px));
    padding:30px 22px;
    transform:translateX(-100%);
    visibility:hidden;
    transition:transform .18s ease
  }
  .nav-open .sidebar { transform:translateX(0); visibility:visible }
  .menu-toggle,.sidebar-close { display:flex }
  .main-shell {
    margin-left:0
  }
  .topbar {
    position:sticky;
    top:0;
    z-index:20;
    padding:0 24px;
    gap:16px
  }
  .topbar-right { gap:12px }
  main {
    padding:28px 24px
  }
  .table-grid {
    grid-template-columns:repeat(2,minmax(0,1fr))
  }

}
@media(max-width:860px) {
  .topbar {
    height:61px;
    padding:0 18px
  }
  .topbar-start { gap:6px }
  .breadcrumb { font-size:10px; gap:8px }
  .topbar-divider,#clock { display:none }
  main {
    padding:28px 22px
  }
  .page-heading {
    align-items:flex-start
  }
  .account-actions {
    max-width:140px
  }

  .metric {
    padding:18px 16px
  }

  .table-toolbar {
    flex-direction:column
  }
  .search-wrap {
    max-width:230px
  }
}
@media(max-width:600px) {
  .topbar {
    height:56px;
    padding:0 12px;
    gap:8px
  }
  .breadcrumb { display:none }
  .topbar-right {
    gap:11px
  }
  #clock,.topbar-divider {
    display:none
  }
  main {
    padding:24px 16px
  }
  h1 {
    font-size:24px
  }
  .page-heading {
    gap:10px;
    margin-bottom:22px
  }

  .account-actions>span {
    display:none
  }
  .account-actions {
    max-width:100px
  }
  .account-actions .button {
    font-size:10px;
    padding:8px 10px
  }
  .metrics {
    grid-template-columns:repeat(2,1fr);
    margin-bottom:22px
  }
  .metric:nth-child(3) {
    border-left:0;
    border-top:1px solid var(--line)
  }
  .metric:nth-child(4) {
    border-top:1px solid var(--line)
  }
  .metric {
    padding:16px
  }
  .metric-number {
    font-size:28px;
    margin:14px 0 11px
  }

  .table-grid {
    grid-template-columns:1fr
  }
  .table-toolbar {
    gap:12px
  }
  .filters button {
    font-size:10px;
    padding:8px 11px
  }
  .search-wrap {
    max-width:none
  }
  .section-heading h2 {
    font-size:15px
  }
  .update-note {
    font-size:9px
  }
  .coverage-banner {
    flex-wrap:wrap
  }
  .coverage-banner p {
    min-width:210px
  }
  .coverage-banner button {
    margin-left:auto
  }
  .empty-state {
    padding:24px 14px
  }
  .empty-state p {
    line-height:1.9
  }
  .playing-card {
    width:37px;
    height:48px
  }

  dialog {
    padding:20px
  }
  .table-dialog {
    max-width:calc(100vw - 20px)
  }
  .dialog-header h2 {
    font-size:19px
  }
  dl {
    grid-template-columns:105px 1fr
  }
}
@media(prefers-reduced-motion:reduce) { .sidebar { transition:none } }

.account-actions { flex-wrap:wrap; justify-content:flex-end }

.database-view { background:#fff; border:1px solid var(--line); border-radius:12px; padding:24px }
.database-filters { display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; margin:24px 0 }
.database-filters label { display:grid; gap:8px; font-size:12px; color:#68776e; flex:1 1 140px }
.database-filters select,.database-filters input { width:100%; min-height:40px; border:1px solid var(--line); border-radius:6px; padding:8px 10px; background:#fff; color:#263631; font:inherit }
.database-filters select:focus-visible { outline:3px solid #95bd8f }
.database-scroll { max-height:65vh; border:1px solid var(--line); border-radius:6px }
.database-scroll table { min-width:1050px; width:100% }
.database-scroll th { position:sticky; top:0; background:#f7f9f5; z-index:1 }
#database-error { color:var(--red); font-size:13px }
@media(max-width:760px) { .database-view { padding:16px } .database-filters label { flex-basis:42% } }

.database-scroll .shoe-heading th { position:static; background:#eaf1e5; color:var(--green); text-align:left }
#database-shoe-summary { color:var(--green); line-height:1.8 }

.page-help { margin-top:16px; color:var(--muted); font-size:12px; line-height:1.7 }
.page-help summary { cursor:pointer; width:fit-content }
.page-help p { margin:8px 0 }

.system-user{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
@media(max-width:600px){.system-user{max-width:70px}.topbar #clock{display:none}.topbar-right{gap:8px}#system-logout{padding:7px 9px}}
