:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.remote-page .terminal-health b {
  color: #dce7ed;
  font-weight: 650;
}

.remote-page .terminal-health .remote-user-name {
  max-width: 140px;
  overflow: hidden;
  color: #6ed5e3;
  text-overflow: ellipsis;
}

.remote-page .remote-logout {
  min-height: 27px;
  padding: 0 10px;
  border: 1px solid var(--terminal-line);
  border-radius: 1px;
  color: #c7d1d8;
  background: var(--terminal-panel);
  font-size: 11px;
}

.remote-page .remote-logout:hover {
  border-color: #54616c;
  color: #fff;
}

.remote-page .remote-session-monitor {
  border-left-color: #43b5c5;
}

.remote-page .remote-session-monitor.is-online {
  border-color: #2d806b;
  border-left-color: #42b987;
  background: #0e211c;
}

.remote-page .remote-session-monitor.is-online .segment-entry-alert-actions b {
  color: #5fe0ae;
}

.remote-page .terminal-form-body .road-panel-import {
  display: grid;
}

.remote-page .road-panel-import-confirm p {
  color: #72c9d5;
  font: 10px/1.45 Consolas, monospace;
}

.remote-page #captureStatus.success,
.remote-page #bulkStatus.success,
.remote-page #saveStatus.success {
  color: var(--terminal-green);
}

.remote-page #captureStatus.error,
.remote-page #bulkStatus.error,
.remote-page #saveStatus.error {
  color: #ef7181;
}

.remote-page .bulk-replay-result {
  display: block;
}

.remote-page .live-bet-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #2b6556;
  background: #0e251e;
}

.remote-page .live-bet-session > div {
  display: grid;
  gap: 4px;
}

.remote-page .live-bet-session span {
  color: #8da49b;
  font-size: 10px;
}

.remote-page .live-bet-session strong {
  color: #51ddb0;
  font: 700 13px/1.2 Consolas, monospace;
}

.remote-page .live-bet-toggle {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #397565;
  border-radius: 1px;
  color: #d9eee7;
  background: #194739;
  font-size: 11px;
  font-weight: 700;
}

.remote-page .live-bet-toggle:hover {
  filter: brightness(1.12);
}

.remote-page .roadmap .bead {
  display: grid;
  place-items: center;
}

.remote-page .remote-diagnostic-body,
.remote-page .remote-shoe-list,
.remote-page .reference-box {
  padding: 16px 18px 18px;
  color: #9caab3;
  font-size: 11px;
  line-height: 1.65;
}

.remote-page .remote-diagnostic-body strong {
  color: #e8f0f4;
}

.remote-page .remote-shoe-list {
  display: grid;
  gap: 1px;
  padding: 1px;
  background: #2a3540;
}

.remote-page .remote-shoe-list p {
  margin: 0;
  padding: 16px;
  color: #84949f;
  background: #111820;
}

.remote-page .remote-shoe-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 14px;
  padding: 11px 14px;
  background: #111820;
}

.remote-page .remote-shoe-row strong {
  overflow: hidden;
  color: #e8f0f4;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remote-page .remote-shoe-row span,
.remote-page .remote-shoe-row time {
  color: #83929c;
  font: 10px/1.3 Consolas, monospace;
}

.remote-page .remote-shoe-row time {
  grid-column: 1 / -1;
}

.remote-page .history-result-chart {
  display: grid;
  gap: 8px;
}

.remote-page .remote-history-empty {
  margin: 0;
  padding: 28px 12px;
  border: 1px solid var(--terminal-line);
  color: #84949f;
  font-size: 11px;
  text-align: center;
}

.remote-page .remote-history-day {
  border: 1px solid var(--terminal-line);
  background: #0d1319;
}

.remote-page .remote-history-day > summary {
  display: grid;
  grid-template-columns: minmax(120px, .75fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  cursor: pointer;
  list-style: none;
}

.remote-page .remote-history-day > summary::-webkit-details-marker {
  display: none;
}

.remote-page .remote-history-day > summary strong {
  color: #eaf1f5;
  font: 700 12px/1.2 Consolas, monospace;
}

.remote-page .remote-history-day > summary span {
  color: #8998a3;
  font-size: 11px;
}

.remote-page .remote-history-day > summary b {
  color: #59d6e7;
  font: 700 12px/1 Consolas, monospace;
}

.remote-page .remote-history-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  min-height: 86px;
  padding: 12px;
  overflow-x: auto;
  border-top: 1px solid var(--terminal-line);
}

.remote-page .remote-history-bar {
  width: 9px;
  min-width: 9px;
  border-radius: 1px 1px 0 0;
}

.remote-page .remote-history-bar.win {
  height: 54px;
  background: #42b987;
}

.remote-page .remote-history-bar.loss {
  height: 25px;
  background: #c34b58;
}

.remote-page .toast {
  position: fixed;
  z-index: 1000;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 15px;
  border: 1px solid #2d8e77;
  border-radius: 3px;
  color: #eafff8;
  background: #12382e;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .38);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .16s ease, transform .16s ease;
}

.remote-page .toast.show {
  opacity: 1;
  transform: translateY(0);
}

.remote-page .toast.error {
  border-color: #a94857;
  background: #471a22;
}

.remote-page button:focus-visible,
.remote-page input:focus-visible,
.remote-page summary:focus-visible {
  outline: 2px solid #59d6e7;
  outline-offset: 2px;
}

/* Login keeps the same restrained terminal identity without loading the main stylesheet. */
.login-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: #edf2f5;
  background: #090b0e;
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
}

.login-shell {
  width: min(100%, 420px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
}

.brand-index {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #43b5c5;
  color: #43b5c5;
  font: 700 12px/1 Consolas, monospace;
}

.brand-block h1,
.brand-block p {
  margin: 0;
}

.brand-block h1 {
  font-size: 16px;
}

.brand-block p,
.section-kicker {
  margin-top: 4px;
  color: #81909b;
  font: 10px/1.2 Consolas, monospace;
}

.login-panel {
  padding: 24px;
  border: 1px solid #2b333c;
  border-left: 3px solid #43b5c5;
  background: #101419;
}

.login-panel h2 {
  margin: 8px 0 22px;
  font-size: 24px;
}

.login-panel form {
  display: grid;
  gap: 9px;
}

.login-panel label {
  color: #8d98a3;
  font-size: 11px;
}

.login-panel input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #2b333c;
  border-radius: 1px;
  outline: 0;
  color: #edf2f5;
  background: #090b0e;
}

.login-panel input:focus {
  border-color: #43b5c5;
}

.form-error {
  min-height: 18px;
  margin: 3px 0;
  color: #ef7181;
  font-size: 11px;
}

.primary-command {
  min-height: 44px;
  border: 1px solid #389eb0;
  border-radius: 1px;
  color: #f2feff;
  background: #146278;
  font-weight: 750;
}

@media (max-width: 760px) {
  .remote-page .remote-user-name {
    display: none;
  }

  .remote-page .terminal-health {
    align-items: center;
  }

  .remote-page .terminal-health .remote-logout {
    flex: 0 0 auto;
  }

  .remote-page .online-ai-reference {
    min-height: 170px;
  }

  .remote-page .remote-history-day > summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .remote-page .remote-history-day > summary span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  .remote-page .terminal-health span:nth-child(2) {
    display: none;
  }

  .remote-page .terminal-reference-signal,
  .remote-page .terminal-evidence {
    padding: 20px 18px;
  }

  .remote-page .public-result-grid > div {
    min-height: 118px;
    padding: 18px 14px;
  }

  .remote-page .public-result-grid strong {
    font-size: 18px;
  }

  .remote-page .online-ai-reference > div {
    padding: 13px;
  }

  .remote-page .online-ai-signal strong,
  .remote-page .online-ai-room-score strong,
  .remote-page .online-ai-room-observation-score strong,
  .remote-page .online-ai-score strong {
    font-size: 17px;
  }

  .remote-page .road-panel-import-actions,
  .remote-page .road-panel-import-confirm-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}
