* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #0b0f17;
  color: #e8edf5;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 28px 40px;

  border-bottom: 1px solid #202938;
  background: #101621;
}

header h1 {
  margin: 0;
  font-size: 28px;
}

header p {
  margin: 5px 0 0;
  color: #8995a7;
}

#last-updated {
  color: #8995a7;
  font-size: 14px;
}

main {
  padding: 40px;
}

.bot-grid {
  display: grid;

  grid-template-columns:
    repeat(auto-fit, minmax(300px, 1fr));

  gap: 24px;
}

.bot-card {
  background: #121a27;

  border: 1px solid #263244;
  border-radius: 14px;

  padding: 24px;
}

.bot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-bottom: 24px;
}

.bot-header h2 {
  margin: 0;
}

.status {
  padding: 5px 10px;
  border-radius: 999px;

  font-size: 12px;
  font-weight: 700;
}

.online {
  background: #163d2c;
  color: #5ce59a;
}

.offline {
  background: #472126;
  color: #ff7885;
}

.stat {
  display: flex;
  justify-content: space-between;

  padding: 11px 0;

  border-bottom: 1px solid #202938;
}

.stat:last-child {
  border-bottom: none;
}

.label {
  color: #8995a7;
}

.value {
  font-weight: 600;
}

.error {
  color: #ff7885;
}
.username {
  margin-top: 4px;
  color: #8995a7;
  font-size: 13px;
}

.health-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;

  margin-top: 22px;
  padding-top: 18px;

  border-top: 1px solid #202938;

  font-size: 13px;
  font-weight: 600;
}

.health-good {
  color: #5ce59a;
}

.health-bad {
  color: #ff7885;
}

.controls {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 10px;

  margin-top: 22px;
}

.control-button {
  padding: 10px 14px;

  border: 1px solid #344258;
  border-radius: 8px;

  background: #192332;
  color: #e8edf5;

  font-weight: 600;
  cursor: pointer;
}

.control-button:hover {
  background: #223047;
}

.control-button.primary {
  background: #1b4937;
  border-color: #276348;
}

.control-button.primary:hover {
  background: #235b45;
}

.command-message {
  min-height: 20px;

  margin-top: 12px;

  font-size: 13px;
}

.command-working {
  color: #8995a7;
}

.command-success {
  color: #5ce59a;
}

.command-error {
  color: #ff7885;
}
.clickable {
  cursor: pointer;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease;
}

.clickable:hover {
  transform: translateY(-2px);
  border-color: #3a4b64;
}

.card-hint {
  margin-top: 18px;
  color: #65748a;
  font-size: 12px;
  text-align: right;
}

.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;

  display: flex;
  justify-content: center;
  align-items: flex-start;

  padding: 40px;

  background: rgba(4, 8, 14, 0.82);

  overflow-y: auto;
}

.detail-panel {
  width: min(1100px, 100%);

  background: #101824;

  border: 1px solid #2a374a;
  border-radius: 16px;

  padding: 28px;

  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.45);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  margin-bottom: 24px;
}

.detail-header h2 {
  margin: 0;
  font-size: 28px;
}

.detail-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.close-button {
  width: 38px;
  height: 38px;

  border: 1px solid #344258;
  border-radius: 8px;

  background: #192332;
  color: #e8edf5;

  font-size: 24px;
  line-height: 1;

  cursor: pointer;
}

.close-button:hover {
  background: #26354c;
}

.detail-health {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;

  padding: 16px 18px;
  margin-bottom: 24px;

  background: #0d141f;

  border: 1px solid #202d3e;
  border-radius: 10px;

  font-size: 14px;
  font-weight: 600;
}

.detail-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 18px;
}

.detail-section {
  padding: 20px;

  background: #121c29;

  border: 1px solid #243246;
  border-radius: 12px;
}

.detail-section h3 {
  margin: 0 0 14px;

  font-size: 15px;
  color: #c8d4e5;
}

.detail-controls {
  margin-top: 20px;
  padding: 20px;

  background: #121c29;

  border: 1px solid #243246;
  border-radius: 12px;
}

.detail-controls h3 {
  margin: 0 0 14px;
}

.control-button.danger {
  background: #412229;
  border-color: #66313c;
  color: #ff9ca6;
}

.control-button.danger:hover {
  background: #542a34;
}

.detail-offline {
  padding: 30px;

  background: #171219;

  border: 1px solid #472630;
  border-radius: 12px;
}

@media (max-width: 750px) {
  header {
    padding: 20px;
  }

  main {
    padding: 20px;
  }

  .detail-overlay {
    padding: 12px;
  }

  .detail-panel {
    padding: 20px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .controls {
    grid-template-columns: 1fr;
  }
}

.command-input-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.command-input {
  flex: 1;
  min-width: 0;

  padding: 11px 13px;

  background: #0d141f;
  color: #e8edf5;

  border: 1px solid #344258;
  border-radius: 8px;

  font: inherit;
  outline: none;
}

.command-input:focus {
  border-color: #607da5;
}

.command-input::placeholder {
  color: #65748a;
}

.pay-description {
  margin-bottom: 12px;
  color: #8d9bae;
  font-size: 13px;
}

@media (max-width: 600px) {
  .command-input-row {
    flex-direction: column;
  }
}
/* Account settings dialogs: match the dashboard's dark UI (including mobile). */
.account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
#add-account-button,
#edit-account-button {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}
#add-account-button {
  background: #38bdf8;
  border: 1px solid #67d3ff;
  color: #08263b;
}
#add-account-button:hover { background: #7dd3fc; transform: translateY(-1px); }
#edit-account-button {
  background: #1b293c;
  border: 1px solid #415370;
  color: #e8edf5;
}
#edit-account-button:hover { background: #273a52; transform: translateY(-1px); }

.account-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 7, 14, .82);
  backdrop-filter: blur(7px);
}
.account-dialog {
  width: min(100%, 620px);
  max-height: min(90dvh, 940px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 16px;
  padding: 28px;
  color: #e8edf5;
  background: linear-gradient(155deg, #19263a 0%, #111b2a 75%);
  border: 1px solid #34465e;
  border-radius: 20px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, .62);
  scrollbar-color: #415675 transparent;
}
.account-dialog h2 {
  margin: 0;
  color: #f5f8ff;
  font-size: clamp(21px, 4vw, 26px);
  letter-spacing: -.03em;
}
.account-dialog .account-subtitle {
  margin: -8px 0 2px;
  line-height: 1.5;
  font-size: 13px;
  color: #9fb0c8;
}
.account-dialog label {
  display: grid;
  gap: 7px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: #cad7e8;
}
.account-dialog input:not([type="checkbox"]),
.account-dialog select {
  display: block;
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 10px 13px;
  border: 1px solid #384b64;
  border-radius: 10px;
  outline: none;
  background: #0d1726;
  color: #f1f5fb;
  font-weight: 500;
  line-height: 1.4;
  font-family: inherit;
  font-size: 14px;
  color-scheme: dark;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.account-dialog input::placeholder { color: #75869d; opacity: 1; }
.account-dialog input:not([type="checkbox"]):focus,
.account-dialog select:focus {
  border-color: #64baff;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .14);
}
.account-dialog input:disabled,
.account-dialog select:disabled { opacity: .56; cursor: not-allowed; }
.account-dialog select { cursor: pointer; }
.account-dialog input[type="checkbox"] {
  appearance: auto;
  width: 18px;
  height: 18px;
  accent-color: #38bdf8;
  margin: 0;
  flex: 0 0 auto;
  cursor: pointer;
}
.account-dialog label:has(> span > input[type="checkbox"]) {
  display: block;
}
.account-dialog label > span:has(> input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #344861;
  border-radius: 10px;
  background: #16263a;
}
.account-dialog fieldset {
  min-width: 0;
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 18px;
  border: 1px solid #33445b;
  border-radius: 14px;
  background: rgba(8, 16, 27, .34);
}
.account-dialog fieldset[hidden] { display: none; }
.account-dialog legend {
  padding: 0 8px;
  color: #7dd3fc;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .02em;
}
.account-dialog .account-coordinate-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.account-dialog .account-coordinate-row input { width: 100%; }
.account-dialog .account-tip {
  margin: -4px 0 0;
  padding: 11px 13px;
  border-radius: 9px;
  background: rgba(56, 189, 248, .08);
  border: 1px solid rgba(56, 189, 248, .18);
  color: #a5bfd5;
  font-size: 12px;
  line-height: 1.5;
}
.account-dialog .account-buttons {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid #2e3f56;
}
.account-dialog button {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid #3e526d;
  border-radius: 10px;
  background: #233249;
  color: #e8edf5;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease;
}
.account-dialog button:hover:not(:disabled) { background: #2f4360; }
.account-dialog button[type="submit"],
.account-dialog #load-location {
  background: #116b8d;
  border-color: #1686b2;
  color: #f5fcff;
}
.account-dialog button[type="submit"]:hover:not(:disabled),
.account-dialog #load-location:hover:not(:disabled) { background: #1585ad; }
.account-dialog button:disabled { opacity: .46; cursor: not-allowed; }
.account-dialog [role="status"] {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #a9bdd6;
}
#account-logs {
  margin: 0;
  max-height: 250px;
  overflow: auto;
  padding: 12px;
  background: #080e18;
  border: 1px solid #344258;
  border-radius: 10px;
  color: #aadae6;
  font: 12px/1.6 ui-monospace, monospace;
  white-space: pre-wrap;
}
@media (max-width: 650px) {
  .account-overlay { padding: 10px; align-items: center; }
  .account-dialog { max-height: 95dvh; padding: 20px 16px; gap: 14px; border-radius: 16px; }
  .account-dialog fieldset { padding: 14px 12px; }
  .account-dialog .account-coordinate-row { gap: 8px; }
  .account-dialog .account-coordinate-row input { padding: 9px 8px; }
  .account-dialog .account-buttons button { flex: 1; }
}

.account-dialog details { display: grid; gap: 14px; min-width: 0; }
.account-dialog details > fieldset { margin-top: 14px; }
.account-dialog summary { color: #7dd3fc; cursor: pointer; padding: 8px 0; font-weight: 650; }


/* Restored account and authentication UI */
.dashboard-header {display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:16px;padding:22px 28px;}
.header-left{justify-self:start;}
.header-center{text-align:center;}
.header-right{justify-self:end;display:flex;align-items:center;gap:14px;flex-wrap:wrap;justify-content:flex-end;}
#admin-login-button{min-height:42px;padding:10px 16px;border-radius:10px;background:#1b293c;border:1px solid #415370;color:#e8edf5;font:700 13px inherit;cursor:pointer;white-space:nowrap;}
#admin-login-button:hover{background:#273a52;}
.admin-login-form{display:grid;gap:15px;margin-top:20px;}
.admin-login-form label{display:grid;gap:7px;color:#b8c7db;font-weight:600;font-size:14px;}
.admin-login-form input{width:100%;min-height:44px;border-radius:9px;padding:10px 12px;background:#0d1726;color:#e8edf5;border:1px solid #415370;font:inherit;}
.admin-login-form button{padding:12px 16px;background:#38bdf8;border:0;border-radius:9px;font-weight:700;color:#08263b;cursor:pointer;}
.admin-login-error{min-height:22px;color:#ff9c9c;margin:0;}
@media(max-width:800px){.dashboard-header{grid-template-columns:1fr auto;gap:14px;padding:18px 16px;}.header-center{grid-column:1/-1;grid-row:1;text-align:center;}.header-left{grid-column:1;grid-row:2;}.header-right{grid-column:2;grid-row:2;}#last-updated{display:none;}}
@media(max-width:500px){.header-left{gap:7px;}.header-left button{padding:8px 9px;font-size:11px;min-height:38px;}.header-right button{padding:8px 10px;min-height:38px;}.dashboard-header{gap:10px;}}

/* Match the Add Account / Edit Account dialog exactly during login. */
.admin-dialog{width:min(100%,620px);height:auto;max-height:min(90dvh,940px);grid-template-rows:none;overflow-y:auto;}
.admin-dialog-expanded{width:min(100%,900px);height:min(90dvh,900px);grid-template-rows:auto minmax(0,1fr);overflow:hidden;}
.admin-login-form{display:grid;gap:16px;margin-top:0;}
.admin-login-form label{font-size:13px;color:#cad7e8;}
.admin-login-form input{height:44px;border:1px solid #384b64;border-radius:10px;padding:10px 13px;background:#0d1726;color:#f1f5fb;font:inherit;}
.admin-login-form .account-buttons{margin-top:4px;}
.admin-login-form .account-buttons button{min-height:42px;padding:10px 16px;font-size:13px;}
.admin-login-error{min-height:0;color:#ff9c9c;margin:0;}
.admin-login-error:empty{display:none;}
@media(max-width:650px){.admin-dialog{height:auto;max-height:95dvh;}.admin-dialog-expanded{height:94dvh;}}

/* Login uses the same account-dialog styles as Add/Edit Account. */
body.auth-pending > header, body.auth-pending > main { visibility:hidden; pointer-events:none; }
.auth-overlay { z-index:10000; }
.auth-overlay .admin-dialog { width:min(100%,620px); }
.remember-option { display:flex !important; flex-direction:row; align-items:center; gap:10px; cursor:pointer; }
.remember-option input { width:17px !important; height:17px !important; min-height:0 !important; accent-color:#38bdf8; }
#logout-button, #admin-panel-button { min-height:42px; padding:10px 16px; border-radius:10px; background:#1b293c; border:1px solid #415370; color:#e8edf5; font:700 13px Arial,sans-serif; cursor:pointer; white-space:nowrap; }
#logout-button:hover, #admin-panel-button:hover { background:#273a52; }
[hidden] { display:none !important; }


#my-account-button { min-height:42px; padding:10px 16px; border-radius:10px; background:#1b293c; border:1px solid #415370; color:#e8edf5; font:700 13px Arial,sans-serif; cursor:pointer; white-space:nowrap; }
#my-account-button:hover { background:#273a52; }
.my-bot-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid #415370; }
.my-bot-row button { padding:7px 12px; border-radius:8px; cursor:pointer; }

/* Consistent three-action Docker container controls */
.container-controls { display: flex; flex-wrap: wrap; gap: 10px; }
.container-controls .control-button { flex: 1 1 100px; }

/* DATSUN ADMIN IFRAME LAYOUT FIX v1 */
.account-dialog.admin-dialog-expanded {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  width: min(900px, 100%);
  height: min(90dvh, 900px);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.admin-dialog-expanded .admin-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.admin-dialog-expanded .admin-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
}
@media (max-width: 650px) {
  .account-dialog.admin-dialog-expanded {
    width: 100%;
    height: 94dvh;
  }
}

/* Server reboot state shown on cards and bot detail pages */
.bot-restarting { display: inline-flex; align-items: center; justify-content: flex-end; gap: 7px; color: #fbbf24; font-weight: 700; }
.bot-restarting-icon { display: inline-block; font-size: 19px; line-height: 1; animation: bot-restarting-spin 1.5s linear infinite; }
@keyframes bot-restarting-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bot-restarting-icon { animation: none; } }

/* Restored Docker power status and three equal-width controls */
.container-status { display:inline-flex; align-items:center; gap:8px; margin:6px 0 12px; font-size:14px; font-weight:650; }
.container-status .status-icon { width:19px; height:19px; flex-shrink:0; }
.container-status.running { color:#22c55e; }
.container-status.running .status-icon { animation:datsun-breathe 2.4s ease-in-out infinite; }
.container-status.starting,.container-status.restarting { color:#f59e0b; }
.container-status.starting .status-icon,.container-status.restarting .status-icon { animation:datsun-spin 1s linear infinite; }
.container-status.stopped { color:#ef4444; }
.container-status.stopped .status-icon { animation:datsun-offline-glow 2.6s ease-in-out infinite; }
.container-status.error { color:#ef4444; }
.container-status.error .status-icon { animation:datsun-alert 1.15s ease-in-out infinite; }
@keyframes datsun-spin { to { transform:rotate(360deg); } }
@keyframes datsun-breathe { 0%,100% { opacity:.7;filter:drop-shadow(0 0 1px #22c55e); } 50% { opacity:1;filter:drop-shadow(0 0 7px #22c55e); } }
@keyframes datsun-offline-glow { 0%,100% { opacity:.65; filter:drop-shadow(0 0 1px #ef4444); } 50% { opacity:1; filter:drop-shadow(0 0 7px #ef4444); } }
@keyframes datsun-alert { 0%,100% { opacity:1;transform:scale(1); } 50% { opacity:.5;transform:scale(1.15); } }
@media (prefers-reduced-motion:reduce) { .container-status .status-icon { animation:none !important; } }


.detail-controls .container-controls, .detail-offline .container-controls { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px; }
@media(max-width:650px){.detail-controls .container-controls,.detail-offline .container-controls{grid-template-columns:1fr;}}

/* State display restoration: separate Docker and Minecraft states */
.bot-starting, .safety-pause-state { display:inline-flex; align-items:center; justify-content:flex-end; gap:7px; font-weight:700; }
.bot-starting { color:#fbbf24; }
.bot-starting-icon { display:inline-block; font-size:21px; line-height:1; animation:bot-starting-spin 1.5s linear infinite; }
@keyframes bot-starting-spin { to { transform:rotate(360deg); } }
.safety-pause-state { color:#fb4d65; }
.safety-pause-icon { display:inline-block; color:#fb4d65; font-size:19px; line-height:1; animation:safety-pulse 1.2s ease-in-out infinite; }
@keyframes safety-pulse { 0%,100% {opacity:1; transform:scale(1)} 50% {opacity:.55; transform:scale(1.12)} }
.safety-pause-notice { margin:12px 0; padding:12px; border:1px solid rgba(251,77,101,.5); border-radius:10px; background:rgba(251,77,101,.08); color:#ffc2cc; font-size:13px; overflow-wrap:anywhere; }
.safety-pause-notice p { margin:6px 0; }
.safety-pause-heading { font-weight:700; display:flex; align-items:center; gap:7px; }
@media(prefers-reduced-motion:reduce) { .bot-starting-icon,.safety-pause-icon {animation:none} }

/* High-specificity bot-state indicators: keep these separate from Docker status. */
.bot-card .stat .value .bot-starting, .bot-details .stat .value .bot-starting, .bot-starting { color:#fbbf24; }
.bot-card .stat .value .safety-pause-state, .bot-details .stat .value .safety-pause-state, .safety-pause-state { color:#ff526e; }
.bot-starting-icon { display:inline-block; width:20px; height:20px; flex:none; transform-origin:center; animation:bot-starting-spin .95s linear infinite; }
.safety-pause-icon { display:inline-block; width:21px; height:21px; flex:none; transform-origin:center; animation:safety-pulse 1.1s ease-in-out infinite; }
@media(prefers-reduced-motion:reduce){.bot-starting-icon,.safety-pause-icon{animation:none}}

/* Keep bot cards at independent heights */
.bot-grid {
  align-items: start !important;
}

.bot-grid > * {
  align-self: start !important;
  height: auto !important;
  min-height: 0 !important;
}


/* Bot API connection failure: separate from real Docker status. */
.bot-connection-error {
  margin: 12px 0 0; padding: 12px 14px;
  border: 1px solid rgba(251,77,101,.5); border-radius: 10px;
  background: rgba(251,77,101,.08); color: #ffc2cc;
  overflow-wrap: anywhere; font-size: 13px;
}
.bot-connection-error-heading {
  display: flex; align-items: center; gap: 8px;
  font-weight: 750; color: #ff526e;
}
.bot-connection-error-icon {
  flex: none; color: #ff526e; transform-origin: center;
  animation: datsun-connection-pulse 1.15s ease-in-out infinite;
}
.bot-connection-error p { margin: 7px 0 0; }
.bot-connection-error-hint { color: #aebbcf; }
@keyframes datsun-connection-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .bot-connection-error-icon { animation: none; }
}

/* Fixed four-column desktop bot grid, independent card heights. */
.bot-grid { display:grid !important; grid-template-columns:repeat(4,minmax(0,1fr)) !important; align-items:start !important; gap:24px; }
.bot-grid > * { min-width:0; align-self:start !important; height:auto !important; }
@media (max-width:1100px) { .bot-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; } }
@media (max-width:650px) { .bot-grid { grid-template-columns:minmax(0,1fr) !important; } }
.danger-delete { background:#7f1d1d !important; color:#fff !important; border:1px solid #ef4444 !important; }
.danger-delete:disabled { opacity:.45; cursor:not-allowed; }

/* Collapsible, per-bot Docker log viewer below Power Controls */
.bot-log-section { margin-top: 20px; min-width: 0; }
.bot-log-details { border: 1px solid #33445d; border-radius: 10px; background: #0c1524; overflow: hidden; }
.bot-log-details summary { cursor: pointer; padding: 14px 16px; font-weight: 700; color: #e5efff; }
.bot-log-details summary:hover { background: #172438; }
.bot-log-hint { font-size: 12px; font-weight: 400; color: #92a7c5; margin-left: 10px; }
.bot-log-toolbar { display: flex; justify-content: flex-end; padding: 8px 12px; }
.bot-log-output { box-sizing: border-box; width: 100%; height: 250px; overflow: auto; padding: 12px; margin: 0; border-top: 1px solid #33445d; background: #070d17; color: #c9d8ec; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
@media (max-width: 650px) { .bot-log-hint { display: block; margin: 4px 0 0 16px; } }

/* Per-bot Microsoft device login prompt, anchored over its own card. */
.bot-card[data-bot-id] { position: relative; }
.device-login-popup { position:absolute; z-index:20; top:12px; left:10px; right:10px; padding:16px; background:#101e32; color:#eef5ff; border:2px solid #60a5fa; border-radius:12px; box-shadow:0 12px 32px rgba(0,0,0,.75); overflow-wrap:anywhere; cursor:default; }
.device-login-popup strong { display:block; font-size:16px; }
.device-login-popup p { margin:9px 0; font-size:13px; }
.device-login-popup a { color:#93c5fd; text-decoration:underline; font-size:13px; }
.device-login-code { margin:12px 0; font:700 23px/1.4 ui-monospace,monospace; letter-spacing:2px; text-align:center; background:#070e1c; border-radius:7px; padding:8px; user-select:all; }
.device-login-actions { display:flex; gap:8px; }
.device-login-actions button { flex:1; padding:9px; border:1px solid #526b8e; border-radius:7px; background:#203653; color:white; cursor:pointer; }

/* DatsunServers 2026 visual refresh: presentation only, existing bot controls retained. */
:root{color-scheme:dark;--ds-bg:#0b111c;--ds-surface:#131e2d;--ds-border:#28394d;--ds-muted:#9cacc2;--ds-green:#28d98b}
body{background:var(--ds-bg);color:#edf4ff}
.site-shell{display:flex;min-height:100dvh}
.site-sidebar{position:sticky;top:0;height:100dvh;flex:0 0 252px;background:#101a28;border-right:1px solid #25364a;display:flex;flex-direction:column;padding:24px 14px 18px;z-index:5}
.sidebar-brand{display:flex;align-items:center;gap:12px;padding:6px 11px 34px;color:#f1f7ff}.brand-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:#1c403b;color:#46e3a2;font-size:25px}.sidebar-brand strong{font-size:13px;letter-spacing:.09em;white-space:nowrap}.sidebar-brand small{display:block;color:#8fa3b9;margin-top:4px;font-size:11px}.sidebar-section-label{color:#70849d;font-size:10px;letter-spacing:.14em;font-weight:800;margin:0 13px 12px}
.sidebar-nav{display:grid;gap:6px}.side-nav-item{appearance:none;display:flex;align-items:center;gap:13px;width:100%;text-align:left;background:transparent;border:1px solid transparent;border-radius:10px;padding:13px 14px;color:#b4c2d4;font:600 13px/1.2 inherit;font-family:inherit;cursor:pointer;text-decoration:none}.side-nav-item span{font-size:19px;min-width:20px;text-align:center}.side-nav-item:hover{background:#1c2a3c;color:white}.side-nav-item.active{background:#16392f;border-color:#245f4d;color:#65eab0}.sidebar-bottom{margin-top:auto;display:grid;gap:9px}.admin-link{color:#e0c5ff}.profile-button{width:100%;display:flex;align-items:center;gap:9px;text-align:left;border:1px solid #2c4055;background:#182638;color:#eaf2ff;border-radius:12px;padding:11px 9px;cursor:pointer}.profile-avatar{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#264b52;color:#8cead4}.profile-copy{flex:1;min-width:0}.profile-copy strong{display:block;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.profile-copy small{color:#94a8bd;font-size:10px}.profile-cog{font-size:20px;color:#b3c8dc}.side-logout{border:0;background:transparent;color:#8d9fb4;padding:9px;cursor:pointer;text-align:left}
.site-content{min-width:0;flex:1}.site-content .dashboard-header{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:16px;padding:29px 32px!important;background:#0e1724;border-bottom:1px solid #26354a}.site-content .header-center{grid-column:auto!important;grid-row:auto!important;text-align:left!important}.site-content .header-center h1{font-size:29px;font-weight:800;letter-spacing:-.04em}.site-content .header-center p{font-size:13px}.site-content .header-left,.site-content .header-right>button{display:none!important}.site-content .header-right{display:flex;align-items:center;justify-content:flex-end}.site-content main{padding:29px 32px 60px}.dashboard-topline{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:22px}.dashboard-topline h2{margin:0 0 6px;font-size:19px}.dashboard-topline p{margin:0;color:#8ea2b9;font-size:12px}.live-indicator{font-size:11px;letter-spacing:.08em;color:#58dfa5;font-weight:800;white-space:nowrap}
.site-content .bot-grid{grid-template-columns:repeat(auto-fit,minmax(260px,1fr))!important;gap:16px!important}.site-content .bot-card{background:linear-gradient(155deg,#182638,#111c2b);border:1px solid #30435a;border-radius:15px;padding:19px;box-shadow:0 8px 26px #0208142e;transition:border-color .18s,transform .18s,box-shadow .18s;overflow-wrap:anywhere}.site-content .bot-card:hover{border-color:#4b7792;transform:translateY(-2px);box-shadow:0 12px 34px #0208145c}.site-content .bot-header{margin-bottom:14px;gap:8px}.site-content .bot-header h2{font-size:18px;letter-spacing:-.02em}.site-content .stat{padding:9px 0;font-size:12px;gap:8px}.site-content .stat .value{text-align:right;max-width:65%;overflow-wrap:anywhere}.site-content .health-row{margin-top:13px;padding-top:13px;gap:10px;font-size:11px}.site-content .bot-card .container-status{font-size:11px}.site-content .bot-card .safety-pause-notice,.site-content .bot-card .bot-connection-error{border-radius:10px}
body.auth-pending .site-shell{filter:blur(5px);pointer-events:none}
[hidden]{display:none!important}
@media(min-width:1500px){.site-content .bot-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}}
@media(max-width:1100px){.site-sidebar{flex-basis:210px}.site-content .bot-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:760px){.site-shell{display:block}.site-sidebar{position:relative;width:100%;height:auto;padding:11px 14px;display:block;border-right:0;border-bottom:1px solid #26384b}.sidebar-brand{padding:4px 0 12px}.sidebar-section-label{display:none}.sidebar-nav{display:flex;gap:7px;overflow-x:auto;padding-bottom:5px}.side-nav-item{width:auto;white-space:nowrap;padding:10px 12px;font-size:12px}.sidebar-bottom{margin-top:9px;display:flex;align-items:center;gap:8px}.sidebar-bottom .admin-link{width:auto}.profile-button{max-width:230px;margin-left:auto}.side-logout{font-size:12px;white-space:nowrap}.site-content .dashboard-header{padding:20px 17px!important}.site-content main{padding:22px 15px 48px}.site-content .bot-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.header-subtitle{display:none}}
@media(max-width:560px){.site-content .bot-grid{grid-template-columns:1fr!important}.site-content .header-center h1{font-size:24px}.site-content .header-right{display:none}.live-indicator{font-size:9px}.dashboard-topline p{font-size:11px}.profile-button{max-width:210px}.side-logout{font-size:11px}}
@media(prefers-reduced-motion:reduce){.site-content .bot-card{transition:none}.site-content .bot-card:hover{transform:none}}

/* Reference-inspired dark dashboard and optional collapsible navigation. */
:root{--ds-bg:#03111d;--ds-surface:#071a2b;--ds-border:#19334b;--ds-green:#00d58d}
body{background:#03111d}
.site-sidebar{background:#041422;flex-basis:192px;padding:16px 10px;border-right-color:#123047;transition:flex-basis .2s ease,transform .2s ease}
.sidebar-brand{padding:0 6px 26px;gap:9px}.sidebar-brand strong{font-size:13px;letter-spacing:0}.sidebar-brand small{font-size:10px}.brand-icon{background:#10294d;color:#54a6ff;border-radius:8px}
.side-nav-item{border-radius:7px;padding:12px 10px;color:#c7d6e7}.side-nav-item.active{background:#102b40;border-color:#154764;color:#20c9ff;border-left:3px solid #11c9f5}.side-nav-item:hover{background:#112b40}.admin-link{color:#ffcc4d}
.sidebar-close{position:absolute;top:64px;right:9px;background:#0c2539;border:1px solid #1c435d;border-radius:7px;color:#b9d6e9;padding:3px 9px;cursor:pointer;font-size:20px}.sidebar-close:hover,.sidebar-toggle:hover{background:#173a54}
.site-content .dashboard-header{background:#031421!important;border-bottom:1px solid #12334b;padding:18px 22px!important}.site-content .header-center h1{font-size:25px}.site-content .header-center p{color:#94aec8}.ds-title-line{display:flex;align-items:center;gap:13px}.sidebar-toggle{flex:none;border:1px solid #1a405a;border-radius:8px;background:#0b2639;color:#d2efff;padding:9px 12px;cursor:pointer;font-size:18px}
.site-content main{padding:22px 22px 60px}.dashboard-topline{margin-bottom:15px}.dashboard-topline h2{font-size:17px}.live-indicator{color:#04d99a}
/* The reference uses a single vertical list of concise account summaries. */
.site-content .bot-grid,.site-content .bot-grid:not(#unused){display:grid!important;grid-template-columns:minmax(0,1fr)!important;max-width:920px;gap:10px!important}
.site-content .bot-card{border-radius:9px;padding:13px 17px;border:1px solid #17364b;border-left:6px solid #00d58d;background:#061725;box-shadow:none;display:flex;flex-wrap:wrap;align-items:center;column-gap:20px;row-gap:5px;min-height:92px}
.site-content .bot-card:hover{transform:translateY(-1px);border-color:#27749a;background:#0b2234}
.site-content .bot-card .bot-header{margin:0;flex:1 1 185px;min-width:165px}.site-content .bot-card .bot-header h2{font-size:16px}.site-content .bot-card .username{font-size:11px;color:#9db7d0}
.site-content .bot-card .stat{flex:1 1 115px;min-width:90px;max-width:180px;display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:3px 0;font-size:11px}.site-content .bot-card .stat .value{text-align:left;max-width:100%;font-weight:700}
.site-content .bot-card .health-row{flex:1 1 100%;margin:0;padding:3px 0 0;border-top-color:#143247}.site-content .bot-card .bot-connection-error{flex:1 1 220px;margin:0}.site-content .bot-card:has(.bot-connection-error){border-left-color:#ff365d}.site-content .bot-card:has(.safety-pause-notice){border-left-color:#ffc021}
.site-content .bot-card:has(.bot-starting-icon){border-left-color:#b243ff}.site-content .bot-card:has(.bot-restarting-icon){border-left-color:#168fff}
body.ds-sidebar-collapsed .site-sidebar{flex-basis:0;width:0;min-width:0;overflow:hidden;padding:0;border:0}body.ds-sidebar-collapsed .site-content{width:100%}
.sidebar-backdrop{display:none}
@media(min-width:1500px){.site-content .bot-grid{grid-template-columns:minmax(0,1fr)!important}}
@media(max-width:1100px){.site-sidebar{flex-basis:192px}.site-content .bot-grid{grid-template-columns:minmax(0,1fr)!important}}
@media(max-width:760px){
.site-shell{display:flex}.site-sidebar{position:fixed;inset:0 auto 0 0;width:min(285px,85vw);height:100dvh;z-index:101;display:flex;flex-direction:column;padding:18px 12px;transform:translateX(-110%);box-shadow:10px 0 30px #0008}.sidebar-brand{padding:4px 6px 28px}.sidebar-close{top:18px;right:10px}.sidebar-nav{display:grid;overflow:visible;padding:0}.sidebar-section-label{display:none}.side-nav-item{width:100%}.sidebar-bottom{display:grid;margin-top:auto}.profile-button{max-width:none;margin:0}.side-logout{font-size:13px}
body.ds-mobile-menu-open .site-sidebar{transform:translateX(0)}body.ds-sidebar-collapsed .site-sidebar{width:min(285px,85vw);padding:18px 12px;border-right:1px solid #123047}
.sidebar-backdrop:not([hidden]){display:block;position:fixed;inset:0;z-index:100;background:#000a;border:0;width:100%;height:100%;cursor:pointer}
.site-content{width:100%}.site-content .dashboard-header{padding:16px!important}.site-content main{padding:16px!important}.site-content .bot-grid{grid-template-columns:minmax(0,1fr)!important}.site-content .bot-card{padding:12px;column-gap:12px}.site-content .bot-card .stat{flex-basis:90px}.site-content .header-center h1{font-size:21px}
}
@media(max-width:560px){.site-content .bot-grid{grid-template-columns:minmax(0,1fr)!important}.site-content .bot-card .bot-header{flex-basis:100%}.site-content .bot-card .stat{flex:1 1 80px}.dashboard-topline{align-items:flex-start}.live-indicator{font-size:9px}}
@media(prefers-reduced-motion:reduce){.site-sidebar{transition:none}}

/* Screenshot-faithful production UI refinement; existing action handlers remain intact. */
:root { --ds-cyan:#0dcaff; --ds-blue:#138fff; --ds-panel:#061b2d; }
.site-sidebar { background:#021321; }
.sidebar-brand .brand-icon { background:linear-gradient(145deg,#1577ff,#063c86); color:#e2f4ff; }
.site-content .dashboard-header { background:#021320!important; }
.site-content .bot-grid { max-width:1050px; }
.site-content .bot-card { background:linear-gradient(115deg,#071d2e,#031522); border-color:#12384e; border-left-color:#00dd91; border-radius:10px; min-height:110px; padding:16px 19px; }
.site-content .bot-card .bot-header { flex:1 1 205px; }
.site-content .bot-card .stat { flex:1 1 125px; }
.site-content .bot-card .health-row { color:#02d9a0; }
.site-content .bot-card:has(.safety-pause-notice) { background:linear-gradient(115deg,#221e0a,#081725); border-color:#9b7300; border-left-color:#ffbd00; }
.site-content .bot-card:has(.bot-connection-error) { border-left-color:#ff254d; }
/* Bot management becomes a wide workspace rather than a centered pop-up. */
.detail-overlay { background:rgba(0,7,15,.78); padding:24px; align-items:flex-start; backdrop-filter:blur(5px); }
.detail-panel { width:min(1280px,100%); margin:0 auto; background:#041523; border:1px solid #1a415a; border-radius:12px; box-shadow:0 22px 80px #0009; padding:24px; }
.ds-back-dashboard { display:inline-flex; align-items:center; margin:0 0 16px; padding:6px 0; border:0; background:none; color:#13caff; cursor:pointer; font-size:13px; font-weight:700; }
.detail-header { padding:15px 18px; background:#071d30; border:1px solid #1c3b54; border-radius:11px; margin-bottom:12px; }
.detail-header h2 { color:#f2f8ff; }
.ds-detail-tabs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:0 0 16px; }
.ds-detail-tabs button { padding:13px 8px; background:#0a2136; border:1px solid #18364c; border-radius:8px; color:#d7e7f7; cursor:pointer; font:600 13px inherit; }
.ds-detail-tabs button.active { color:#4fdaff; border-bottom:3px solid #03c9ff; background:#102d45; }
.detail-section,.detail-controls,.detail-health,.detail-offline,.bot-log-section { scroll-margin-top:20px; }
.detail-section,.detail-controls { background:#071b2c; border-color:#1a3b53; border-radius:10px; }
/* Slide-out edit account settings, with real existing form and save behavior. */
.account-overlay.ds-settings-drawer { padding:0; justify-content:flex-end; align-items:stretch; background:rgba(0,8,16,.54); backdrop-filter:blur(2px); }
.ds-settings-drawer .account-dialog { width:min(440px,100vw); max-height:100dvh; height:100dvh; border-radius:0; border:0; border-left:1px solid #24516d; background:linear-gradient(170deg,#041b2d,#02111e); padding:23px 20px 26px; gap:15px; box-shadow:-20px 0 60px #0008; animation:ds-drawer-in .22s ease-out; }
.ds-drawer-heading { display:flex; align-items:start; justify-content:space-between; gap:12px; padding-bottom:14px; border-bottom:1px solid #1a3a52; }
.ds-drawer-heading h2 { font-size:19px; }
.ds-drawer-heading .account-subtitle { margin:7px 0 0; }
.ds-drawer-x { font-size:25px!important; line-height:1!important; border:0!important; background:transparent!important; color:#c9e2f4!important; padding:0 5px!important; }
.ds-settings-drawer .account-dialog fieldset { background:#071e30; border:1px solid #1b405a; border-radius:9px; padding:13px; }
.ds-settings-drawer .account-dialog legend { color:#e9f4ff; font-weight:700; }
.ds-settings-drawer .account-dialog input:not([type=checkbox]),.ds-settings-drawer .account-dialog select { background:#0a253a; border:1px solid #224962; color:#eaf7ff; }
.ds-settings-drawer .account-dialog #save-edit { background:#075eff; }
@keyframes ds-drawer-in { from { transform:translateX(35px); opacity:.65; } to { transform:translateX(0); opacity:1; } }
@media(max-width:760px) { .detail-overlay{padding:0}.detail-panel{min-height:100dvh;border-radius:0;padding:14px}.ds-detail-tabs{gap:4px}.ds-detail-tabs button{padding:11px 3px;font-size:11px}.ds-settings-drawer .account-dialog{width:min(440px,100vw)} }
@media(prefers-reduced-motion:reduce) { .ds-settings-drawer .account-dialog{animation:none} }


/* DatsunServers reference-layout rebuild: structural card and workspace styling */
:root{color-scheme:dark}
body,.site-shell,.site-content{background:#02121f!important;color:#f0f7ff}
.site-sidebar{background:linear-gradient(180deg,#031626,#04111e)!important;border-right:1px solid #18364b!important;flex-basis:204px!important}
.sidebar-brand{min-height:74px}.brand-icon{background:linear-gradient(145deg,#167cff,#0a326d)!important;color:#d4f7ff!important;border-radius:9px!important;font-size:25px!important}
.sidebar-nav{margin-top:12px!important}.side-nav-item{min-height:47px!important;border-radius:8px!important}.side-nav-item.active{background:#0d2b43!important;border-left:3px solid #04d6ff!important;color:#32d8ff!important}
.site-content .dashboard-header{min-height:86px!important;background:#031421!important;padding:16px 23px!important;border-bottom:1px solid #16364b!important}
.site-content .header-center h1{font-size:26px!important;letter-spacing:-.6px}.site-content .header-center p{font-size:13px}
.site-content main{padding:24px 24px 70px!important}.dashboard-topline{max-width:1050px!important}.dashboard-topline h2{font-size:19px!important}
.site-content .bot-grid{max-width:1050px!important;display:flex!important;flex-direction:column!important;gap:11px!important}
.site-content .bot-grid .ds-account-card{box-sizing:border-box;display:grid!important;grid-template-columns:minmax(185px,1.2fr) minmax(0,2.6fr) minmax(95px,.6fr)!important;gap:18px!important;align-items:center!important;min-height:110px!important;padding:14px 16px!important;border:1px solid #163c53!important;border-left:7px solid var(--accent)!important;border-radius:10px!important;background:linear-gradient(115deg,#071d2e,#031522)!important;cursor:pointer;transition:background .18s,border-color .18s,transform .18s}
.ds-tone-online{--accent:#00db91;--accent-soft:#0b9e73}.ds-tone-paused{--accent:#ffc11e;--accent-soft:#b38a19}.ds-tone-offline{--accent:#ff2852;--accent-soft:#b72545}.ds-tone-rebooting{--accent:#168dff;--accent-soft:#1760a8}.ds-tone-starting{--accent:#a737ff;--accent-soft:#8534b7}
.site-content .bot-grid .ds-account-card:hover,.site-content .bot-grid .ds-account-card:focus-visible{transform:translateX(2px);border-color:var(--accent)!important;outline:none;background:#0b273b!important}
.ds-account-identity{display:flex;gap:12px;align-items:center;min-width:0}.ds-avatar{position:relative;display:inline-flex;flex:0 0 51px;width:51px;height:51px;border:2px solid var(--accent,#19a5ff);border-radius:12px;align-items:center;justify-content:center;background:#0d2c40;overflow:hidden}.ds-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:1;image-rendering:pixelated}.ds-avatar-fallback{font-size:24px;color:#4edcff}.ds-account-name{display:flex;flex-direction:column;gap:4px;min-width:0}.ds-account-name strong{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ds-account-name small{font-size:11px;color:#94b0c7}.ds-state-pill{font-size:11px;color:var(--accent);font-weight:700;display:flex;align-items:center;gap:6px}.ds-state-pill i{display:block;width:9px;height:9px;background:var(--accent);border-radius:50%}
.ds-account-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;min-width:0}.ds-account-metrics>div{display:flex;flex-direction:column;gap:7px;min-width:0}.ds-account-metrics small{color:#7f9db5;font-size:10px}.ds-account-metrics strong{font-size:12px;color:#eff8ff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ds-account-metrics .ds-state-text{color:var(--accent)}.ds-card-end{display:flex;align-items:center;justify-content:flex-end;gap:12px}.ds-card-status{border:1px solid #16445a;border-radius:8px;padding:10px;color:var(--accent);font-size:11px;text-transform:uppercase;font-weight:800}.ds-chevron{font-size:28px;color:#9cc5dd}
.detail-overlay{position:fixed!important;inset:0!important;background:rgba(0,9,18,.9)!important;padding:20px!important;z-index:200!important;overflow:auto!important;align-items:flex-start!important}.detail-panel.ds-workspace{box-sizing:border-box;max-width:1150px!important;width:100%!important;margin:0 auto!important;min-height:min(760px,94vh);background:#031725!important;border:1px solid #1b3c51!important;padding:20px!important;border-radius:13px!important}.ds-workspace-back button{border:0;background:none;color:#14d0ff;padding:5px 0 14px;cursor:pointer;font-weight:700}.detail-panel.ds-workspace .ds-workspace-header{border-left:6px solid var(--accent)!important;background:#081e30!important;display:flex;align-items:center;gap:12px;padding:16px!important}.ds-workspace-header>div:first-child{display:flex;align-items:center;gap:13px;flex:1}.ds-workspace-header>div:first-child>div{min-width:0}.ds-workspace-header h2{font-size:23px}.ds-workspace-state{color:var(--accent);font-size:12px;font-weight:800;text-transform:uppercase;border:1px solid var(--accent);border-radius:8px;padding:9px}.detail-panel.ds-workspace .ds-detail-tabs{grid-template-columns:repeat(5,minmax(0,1fr));margin:14px 0!important}.ds-detail-tabs button{background:#0a2237!important;border:1px solid #1b3c54!important;color:#d8eafa!important;border-radius:7px!important;cursor:pointer;padding:13px 6px!important}.ds-detail-tabs button.active{color:#39d9ff!important;border-bottom:3px solid #02ccff!important;background:#103049!important}
.ds-workspace [data-ds-group][hidden]{display:none!important}.ds-workspace .detail-section,.ds-workspace .detail-controls,.ds-workspace .detail-offline,.ds-workspace .ds-mode-panel{background:#071d30!important;border:1px solid #1b4057!important;border-radius:10px!important;padding:18px!important;margin-bottom:12px!important}.ds-workspace .detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.ds-workspace .detail-grid:has(> :not([hidden]):only-child){grid-template-columns:1fr}.ds-workspace .detail-health{border:1px solid #1b4057;background:#071d30;border-radius:9px;padding:14px;margin-bottom:12px}.ds-mode-panel>p{color:#9ab7cc;margin:7px 0 15px}.ds-mode-options{display:grid;grid-template-columns:1fr 1fr;gap:12px}.ds-mode-options>div{border:1px solid #1b76bf;border-radius:9px;padding:18px;background:#07233a;display:flex;flex-direction:column;gap:10px}.ds-mode-options>div.selected{border:2px solid #00d48a;background:#083d32}.ds-mode-options strong{font-size:16px}.ds-mode-options small{color:#b0d0e2}.ds-mode-info{margin:15px 0;padding:15px;border:1px solid #164e6c;background:#09273b;border-radius:8px}.ds-mode-info p{color:#a9c9de;font-size:13px;margin-top:10px}.ds-edit-from-mode{border:1px solid #237db2;border-radius:7px;background:#0a3551;color:#e3f8ff;padding:12px;cursor:pointer}
.ds-settings-drawer{z-index:400!important}.ds-settings-drawer .account-dialog{width:min(460px,100vw)!important}
@media(max-width:1100px){.site-content .bot-grid .ds-account-card{grid-template-columns:minmax(160px,1fr) minmax(0,2fr)!important}.ds-card-end{display:none}.ds-account-metrics{gap:8px}}
@media(max-width:760px){.site-sidebar{flex-basis:auto!important}.site-content main{padding:16px!important}.site-content .bot-grid .ds-account-card{grid-template-columns:1fr!important;gap:12px!important;padding:13px!important}.ds-account-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.ds-account-identity{gap:10px}.detail-overlay{padding:0!important}.detail-panel.ds-workspace{border-radius:0!important;min-height:100dvh;padding:13px!important}.ds-workspace .detail-grid{grid-template-columns:1fr}.ds-detail-tabs{gap:4px!important}.ds-detail-tabs button{font-size:10px!important;padding:10px 2px!important}.ds-workspace-state{font-size:10px}.ds-mode-options{gap:7px}}

/* Safety pause details beside account cards; mobile badge expands in place. */
.site-content .bot-grid .ds-account-row{display:grid;grid-template-columns:minmax(0,1050px) minmax(0,1fr);gap:14px;align-items:center;max-width:none;width:100%}
.site-content .bot-grid .ds-account-row .ds-account-card{width:100%;min-width:0}
.ds-safety-desktop{display:flex;align-items:center;flex-wrap:wrap;gap:5px 9px;min-width:0;color:#f4d68a;font-size:11px;line-height:1.6;padding:10px 12px;border:1px solid #68521e;border-radius:8px;background:#201c10;overflow-wrap:anywhere}
.ds-safety-desktop b{color:#ffc02b;font-weight:700}
.ds-safety-desktop .ds-separator{color:#a38b51}
.ds-safety-mobile{display:none}
@media(max-width:1350px){.site-content .bot-grid .ds-account-row{grid-template-columns:minmax(0,1fr)}.ds-safety-desktop{margin-top:-6px}}
@media(max-width:760px){.site-content .bot-grid .ds-account-row{display:block}.ds-safety-desktop{display:none}.ds-safety-mobile{display:block;margin-top:6px}.ds-safety-toggle{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;text-align:left;background:#27200d;border:1px solid #a77c18;border-radius:8px;color:#ffc02b;padding:11px 13px;font:700 12px inherit;cursor:pointer}.ds-safety-toggle-label{font-size:11px;color:#e8c878}.ds-safety-mobile-details{padding:12px 13px;background:#111f2c;border:1px solid #6c551c;border-top:0;border-radius:0 0 8px 8px;color:#e6f0fb;font-size:12px;line-height:1.65}.ds-safety-mobile-details[hidden]{display:none!important}.ds-safety-mobile-details b{color:#ffc02b}.ds-safety-mobile-details>div+div{margin-top:7px}}

/* FIX: stronger than earlier !important sidebar width/flex-basis rules. */
@media (min-width:761px) {
  body.ds-sidebar-collapsed .site-shell > .site-sidebar {
    flex:0 0 0px !important;width:0 !important;min-width:0 !important;max-width:0 !important;
    padding:0 !important;margin:0 !important;border:0 !important;overflow:hidden !important;visibility:hidden !important;
  }
  body.ds-sidebar-collapsed .site-shell > .site-content {flex:1 1 100% !important;min-width:0 !important;width:100% !important;}
}
/* Let safety details use remaining dashboard width instead of constraining the row to card width. */
.site-content .bot-grid {max-width:none !important;}
.site-content .bot-grid .ds-account-row {grid-template-columns:minmax(0, min(65%, 1050px)) minmax(0,1fr) !important;}
.site-content .bot-grid .ds-account-row:not(.ds-has-safety) {grid-template-columns:minmax(0,1050px) !important;}
.ds-safety-desktop {white-space:normal;}
@media(max-width:1350px) {
 .site-content .bot-grid .ds-account-row {grid-template-columns:minmax(0,1fr) !important;}
}
@media(max-width:760px) {
 .site-content .bot-grid .ds-account-row {display:block !important;}
 .ds-safety-desktop {display:none !important;}
 .ds-safety-mobile {display:block !important;}
}

/* Layout C: account cards and live monitoring, scoped to dashboard. */
.site-content main .ds-layout-c{display:grid;grid-template-columns:minmax(0, 1050px) minmax(280px, 1fr);gap:22px;align-items:start;width:100%;max-width:none}
.site-content main .ds-accounts-column,.site-content main .ds-monitor-column{min-width:0}
.site-content main .ds-layout-c .bot-grid{max-width:none!important;width:100%!important}
.site-content main .ds-layout-c .bot-grid .ds-account-row,.site-content main .ds-layout-c .bot-grid .ds-account-row:not(.ds-has-safety){grid-template-columns:minmax(0,1fr)!important;max-width:none!important}
.site-content main .ds-layout-c .ds-safety-desktop{display:none!important}
.ds-monitor-panel{border:1px solid #16425a;background:linear-gradient(140deg,#071d2d,#031421);border-radius:12px;padding:16px;color:#e6f4ff;box-shadow:0 8px 30px #0002}
.ds-monitor-heading{display:flex;justify-content:space-between;align-items:center;width:100%;padding:0 0 15px;border:0;background:transparent;color:#f0f7ff;text-align:left;font:800 17px inherit;cursor:pointer}
.ds-monitor-chevron{font-size:18px;color:#77a9c2}
.ds-monitor-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.ds-monitor-stat{display:flex;align-items:center;gap:12px;min-width:0;padding:13px 11px;border:1px solid #1b3b50;border-radius:9px;background:#0a2639}
.ds-monitor-stat-icon{font-size:23px;color:#73b9df}.ds-monitor-stat.green .ds-monitor-stat-icon{color:#00d69a}.ds-monitor-stat.amber .ds-monitor-stat-icon{color:#ffc34a}.ds-monitor-stat.red .ds-monitor-stat-icon{color:#ff5c68}
.ds-monitor-stat small,.ds-monitor-stat strong{display:block}.ds-monitor-stat small{color:#91aec2;font-size:11px}.ds-monitor-stat strong{font-size:20px;margin-top:3px}
.ds-activity-heading{display:flex;justify-content:space-between;gap:8px;align-items:baseline;font-size:14px;font-weight:800;margin:20px 0 8px;padding-top:15px;border-top:1px solid #1c3b50}.ds-activity-heading span{font-size:10px;font-weight:400;color:#829bb0}
.ds-monitor-event{display:flex;gap:10px;align-items:flex-start;padding:10px 3px;border-bottom:1px solid #17364a}.ds-monitor-event:last-child{border:0}.ds-event-dot{color:#00d69a}.ds-monitor-event strong{display:block;font-size:12px;font-weight:600;overflow-wrap:anywhere}.ds-monitor-event small{display:block;color:#829db1;margin-top:3px;font-size:10px}.ds-activity-empty{color:#91a8b8;font-size:12px;line-height:1.5;margin:8px 0}
.ds-monitor-alert-heading{display:flex;justify-content:space-between;gap:10px;color:#ffbd5c;font-weight:800;font-size:14px;padding:12px;background:#321a20;border:1px solid #a64740;border-radius:8px 8px 0 0}.ds-monitor-alert-heading span{font-size:11px;font-weight:500}.ds-monitor-alert{padding:12px;background:#221922;border:1px solid #a64740;border-top:0;color:#f7d5c6;font-size:12px;line-height:1.6;overflow-wrap:anywhere}.ds-monitor-alert:last-child{border-radius:0 0 8px 8px}.ds-monitor-alert strong{display:block;color:#fff;font-size:13px}.ds-monitor-alert b{color:#ffbb79}#ds-safety-alerts:not(:empty){margin-bottom:17px}
@media(max-width:1450px){.site-content main .ds-layout-c{grid-template-columns:minmax(0,1fr) minmax(290px, .8fr)}.site-content main .ds-layout-c .ds-account-card{grid-template-columns:minmax(130px,1fr) minmax(0,2fr)!important}.site-content main .ds-layout-c .ds-card-end{display:none!important}}
@media(max-width:1120px){.site-content main .ds-layout-c{grid-template-columns:minmax(0,1fr)}.ds-monitor-column{max-width:1050px}.site-content main .ds-layout-c .ds-account-card{grid-template-columns:minmax(160px,1fr) minmax(0,2fr) minmax(80px,.5fr)!important}.site-content main .ds-layout-c .ds-card-end{display:flex!important}}
@media(max-width:760px){.site-content main .ds-layout-c{gap:16px}.site-content main .ds-layout-c .ds-account-card{grid-template-columns:1fr!important}.site-content main .ds-layout-c .ds-card-end{display:none!important}.ds-monitor-panel{padding:13px}.ds-monitor-heading{padding-bottom:0}.ds-monitor-body{margin-top:14px}.ds-monitor-collapsed .ds-monitor-body{display:none}.ds-monitor-collapsed .ds-monitor-chevron{transform:rotate(-90deg)}}
@media(max-width:420px){.ds-monitor-stats{gap:7px}.ds-monitor-stat{padding:10px 7px;gap:7px}.ds-monitor-stat-icon{font-size:17px}.ds-monitor-stat strong{font-size:17px}.ds-monitor-stat small{font-size:10px}}

/* Keep the newest 100 persistent activity entries accessible by scrolling. */
#ds-monitor-activity { max-height: 430px; overflow-y: auto; overscroll-behavior: contain; }
.ds-account-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media(max-width: 800px) { .ds-account-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Total Collected stays visible beneath Balance on desktop and mobile. */
.ds-account-metrics .ds-balance-collected{display:flex;flex-direction:column;gap:9px;min-width:0}
.ds-account-metrics .ds-balance-collected>div{display:flex;flex-direction:column;gap:5px;min-width:0}
.ds-account-metrics .ds-collected-total{padding-top:7px;border-top:1px solid #174054}
.ds-account-metrics .ds-collected-total strong{color:#00dca0;white-space:normal;overflow-wrap:anywhere;overflow:visible;text-overflow:clip}
@media(max-width:760px){.ds-account-metrics .ds-balance-collected{gap:7px}.ds-account-metrics .ds-collected-total{padding-top:6px}}

/* Layout C correction: keep full coordinates and collected total readable. */
.site-content main .ds-layout-c .ds-account-metrics { grid-template-columns: minmax(66px,.7fr) minmax(115px,1.2fr) minmax(90px,1fr) minmax(170px,1.7fr) !important; gap:12px; }
.site-content main .ds-layout-c .ds-account-metrics > div { min-width:0; }
.site-content main .ds-layout-c .ds-account-metrics > div:last-child strong { white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; line-height:1.45; }
.site-content main .ds-layout-c .ds-account-metrics .ds-collected-total { display:flex !important; visibility:visible !important; }
@media(max-width:1450px) and (min-width:761px) {
 .site-content main .ds-layout-c .ds-account-metrics { grid-template-columns:repeat(2,minmax(0,1fr)) !important; row-gap:13px; }
 .site-content main .ds-layout-c .ds-account-metrics > div:last-child { grid-column:2; }
}
@media(max-width:760px) {
 .site-content main .ds-layout-c .ds-account-card { grid-template-columns:minmax(0,1fr) !important; }
 .site-content main .ds-layout-c .ds-account-metrics { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:14px 12px !important; width:100%; }
 .site-content main .ds-layout-c .ds-account-metrics .ds-balance-collected { display:flex !important; flex-direction:column !important; }
 .site-content main .ds-layout-c .ds-account-metrics > div:last-child { grid-column:auto; }
 .site-content main .ds-layout-c .ds-account-metrics strong { white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; }
}

/* Mobile card typography: labels and values occupy separate rows, never run together. */
@media (max-width:760px) {
  .site-content main .ds-layout-c .ds-account-metrics {
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    align-items:start !important;
    gap:18px 18px !important;
  }
  .site-content main .ds-layout-c .ds-account-metrics > div,
  .site-content main .ds-layout-c .ds-account-metrics .ds-balance-collected > div {
    display:flex !important;
    flex-direction:column !important;
    align-items:flex-start !important;
    justify-content:flex-start !important;
    gap:7px !important;
    min-width:0 !important;
    text-align:left !important;
  }
  .site-content main .ds-layout-c .ds-account-metrics small,
  .site-content main .ds-layout-c .ds-account-metrics strong {
    display:block !important;
    position:static !important;
    width:100% !important;
    margin:0 !important;
    padding:0 !important;
    line-height:1.4 !important;
    text-align:left !important;
    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
    overflow-wrap:normal !important;
    word-break:normal !important;
  }
  .site-content main .ds-layout-c .ds-account-metrics small {font-size:12px !important;color:#8caac0 !important;}
  .site-content main .ds-layout-c .ds-account-metrics strong {font-size:14px !important;}
  .site-content main .ds-layout-c .ds-account-metrics .ds-balance-collected {gap:15px !important;}
  .site-content main .ds-layout-c .ds-account-metrics .ds-collected-total {
    display:flex !important;
    border-top:1px solid #174054 !important;
    padding-top:12px !important;
  }
  .site-content main .ds-layout-c .ds-account-metrics .ds-collected-total strong {color:#00dca0 !important;overflow-wrap:anywhere !important;}
  .site-content main .ds-layout-c .ds-account-metrics > div:last-child strong {overflow-wrap:anywhere !important;}
}

/* 2026-10-27: Flat metric cells eliminate nested label/value collisions on mobile. */
.site-content main .ds-layout-c .ds-account-metrics {
  display:grid !important;
  grid-template-columns: minmax(65px,.7fr) minmax(90px,1fr) minmax(120px,1.35fr) minmax(70px,.8fr) minmax(155px,1.5fr) !important;
  gap:12px !important;
}
.site-content main .ds-layout-c .ds-account-metrics > div {
  display:flex !important; flex-direction:column !important; align-items:flex-start !important;
  justify-content:flex-start !important; gap:7px !important; min-width:0 !important;
}
.site-content main .ds-layout-c .ds-account-metrics > div > small,
.site-content main .ds-layout-c .ds-account-metrics > div > strong {
  display:block !important; width:auto !important; max-width:100% !important;
  margin:0 !important; padding:0 !important; position:static !important;
  text-align:left !important; line-height:1.45 !important;
}
.site-content main .ds-layout-c .ds-account-metrics > div > strong {
  white-space:normal !important; overflow:visible !important; text-overflow:clip !important;
  overflow-wrap:anywhere !important;
}
.site-content main .ds-layout-c .ds-account-metrics .ds-metric-collected strong {color:#00dca0 !important;}
@media(max-width:1450px) and (min-width:761px) {
 .site-content main .ds-layout-c .ds-account-metrics {grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
 .site-content main .ds-layout-c .ds-account-metrics > div:last-child {grid-column:auto !important;}
}
@media(max-width:760px) {
 .site-content main .ds-layout-c .ds-account-metrics {
   grid-template-columns:repeat(2,minmax(0,1fr)) !important;
   column-gap:18px !important; row-gap:19px !important; align-items:start !important;
 }
 .site-content main .ds-layout-c .ds-account-metrics .ds-metric-collected {
   grid-column:2; grid-row:2;
 }
 .site-content main .ds-layout-c .ds-account-metrics .ds-metric-mode {grid-column:1;grid-row:2;}
 .site-content main .ds-layout-c .ds-account-metrics > div:last-child {grid-column:1 / -1 !important;grid-row:3;}
 .site-content main .ds-layout-c .ds-account-metrics > div > small {font-size:12px !important;color:#8caac0 !important;}
 .site-content main .ds-layout-c .ds-account-metrics > div > strong {font-size:14px !important;}
}

/* Linking state and no-stat starting cards. */
.site-content main .ds-layout-c .ds-account-card:has(.ds-starting-message) {
 grid-template-columns:minmax(170px,1fr) minmax(0,1.5fr) minmax(90px,.5fr)!important;
}
.ds-starting-message {color:#c5b4ff;font-size:13px;line-height:1.5;}
.site-content main .ds-layout-c .ds-account-row > .device-login-popup,
.site-content main .ds-layout-c .ds-account-row > .ds-login-waiting {
 grid-column:1 / -1!important;position:static!important;margin:10px 0 0!important;
 width:100%!important;box-sizing:border-box!important;
}
.ds-login-waiting {padding:12px 15px;border:1px solid #7b45bc;border-radius:10px;background:#17172d;color:#cbbaf2;font-size:13px;}
@media(max-width:760px){
 .site-content main .ds-layout-c .ds-account-card:has(.ds-starting-message) {grid-template-columns:1fr!important;}
 .ds-starting-message{padding:6px 0;}
}

/* Inline Microsoft linking within the SAME starting account card. */
.site-content main .ds-layout-c .ds-account-card.ds-is-starting {
  grid-template-columns:minmax(165px,1fr) minmax(0,1.4fr) minmax(85px,.5fr)!important;
  align-items:center!important;
}
.site-content main .ds-layout-c .ds-account-card.ds-is-starting .ds-account-metrics {display:none!important;}
.site-content main .ds-layout-c .ds-account-card .ds-login-slot {
  grid-column:1 / -1!important;min-width:0;width:100%;
}
.site-content main .ds-layout-c .ds-account-card .ds-login-slot:empty {display:none!important;}
.site-content main .ds-layout-c .ds-account-card .ds-login-slot .device-login-popup,
.site-content main .ds-layout-c .ds-account-card .ds-login-slot .ds-login-waiting {
  display:block!important;position:static!important;inset:auto!important;
  width:100%!important;max-width:100%!important;margin:0!important;
  padding:14px!important;box-sizing:border-box!important;box-shadow:none!important;
  border-radius:9px!important;transform:none!important;
}
.site-content main .ds-layout-c .ds-account-card .ds-login-slot .device-login-actions {
 display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;
}
.site-content main .ds-layout-c .ds-account-card .ds-login-slot .device-login-actions button {flex:1 1 130px;}
.site-content main .ds-layout-c .ds-account-card .ds-login-slot a {overflow-wrap:anywhere;}
@media(max-width:760px){
 .site-content main .ds-layout-c .ds-account-card.ds-is-starting {grid-template-columns:1fr!important;}
 .site-content main .ds-layout-c .ds-account-card .ds-login-slot {grid-column:1!important;}
}

/* Compact linking code in the existing starting card row. */
.site-content main .ds-layout-c .ds-account-card.ds-is-starting {
  grid-template-columns:minmax(145px,1fr) minmax(0,1.65fr) minmax(85px,.5fr)!important;
  align-items:center!important;
}
.site-content main .ds-layout-c .ds-account-card.ds-is-starting .ds-starting-message {
  min-width:0;padding:0!important;margin:0!important;
}
.site-content main .ds-layout-c .ds-account-card.ds-is-starting .ds-login-slot {
  display:flex!important;align-items:center;gap:10px;flex-wrap:wrap;
  grid-column:auto!important;width:100%;min-width:0;
  color:#c9b6ed;font-size:12px;line-height:1.4;
}
.ds-linking-label {font-size:12px;color:#c9b6ed;white-space:nowrap;}
.site-content main .ds-layout-c .ds-account-card .ds-linking-code {
  background:#091423;border:1px solid #8e53d8;border-radius:6px;
  padding:7px 10px;color:#fff;font-weight:800;font-size:14px;letter-spacing:1px;
  cursor:pointer;white-space:nowrap;
}
.site-content main .ds-layout-c .ds-account-card .ds-linking-url {
  color:#80bfff;font-size:12px;text-decoration:underline;white-space:nowrap;
}
@media(max-width:760px) {
 .site-content main .ds-layout-c .ds-account-card.ds-is-starting {grid-template-columns:minmax(0,1fr) auto!important;}
 .site-content main .ds-layout-c .ds-account-card.ds-is-starting .ds-starting-message {grid-column:1 / -1!important;}
 .site-content main .ds-layout-c .ds-account-card.ds-is-starting .ds-login-slot {gap:8px;}
}

/* Restore the existing spinning start indicator without expanding the card. */
.site-content main .ds-layout-c .ds-account-card.ds-is-starting .ds-starting-message {
 display:flex!important;align-items:center!important;gap:12px!important;flex-wrap:wrap!important;
}
.ds-original-starting {display:inline-flex;align-items:center;gap:7px;color:#fbbf24;font-size:12px;font-weight:800;white-space:nowrap;}
.ds-original-starting .bot-starting-icon {display:inline-block;color:#fbbf24;font-size:23px;line-height:1;animation:bot-starting-spin .95s linear infinite;}
.ds-linking-expired {font-size:11px;color:#fbbf24;}
@media(max-width:760px) { .site-content main .ds-layout-c .ds-account-card.ds-is-starting .ds-starting-message {gap:9px!important;} }

/* Compact device-link information visible in both desktop and mobile cards. */
.site-content main .ds-layout-c .ds-account-card.ds-is-starting .ds-starting-message {
 display:flex!important;align-items:center!important;gap:12px!important;flex-wrap:wrap!important;min-width:0!important;
}
.site-content main .ds-layout-c .ds-account-card.ds-is-starting .ds-login-slot {
 display:flex!important;align-items:center!important;flex-wrap:wrap!important;gap:8px!important;
 min-width:0!important;max-width:100%!important;grid-column:auto!important;
 font-size:12px!important;line-height:1.5!important;
}
.site-content main .ds-layout-c .ds-account-card.ds-is-starting .ds-login-slot .ds-linking-code {
 display:inline-block!important;white-space:nowrap!important;font-weight:800!important;
}
.site-content main .ds-layout-c .ds-account-card.ds-is-starting .ds-login-slot .ds-linking-url {
 display:inline-block!important;white-space:normal!important;overflow-wrap:anywhere!important;
}
@media(max-width:760px){
 .site-content main .ds-layout-c .ds-account-card.ds-is-starting {grid-template-columns:minmax(0,1fr)!important;}
 .site-content main .ds-layout-c .ds-account-card.ds-is-starting .ds-starting-message {grid-column:1/-1!important;grid-row:auto!important;}
 .site-content main .ds-layout-c .ds-account-card.ds-is-starting .ds-login-slot {grid-column:auto!important;width:100%!important;}
}

/* Expandable collected-payment breakdown; outside the compact bot card. */
.site-content main .ds-layout-c .ds-account-row .ds-recipient-panel{grid-column:1/-1;min-width:0;background:#102639;border:1px solid #27516a;border-radius:10px;padding:13px 16px;color:#eaf6ff}
.ds-recipient-panel[hidden]{display:none!important}
.ds-recipient-title{font-size:12px;font-weight:800;margin-bottom:10px;color:#9bc9df}
.ds-recipient-line{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-top:1px solid #234458;font-size:12px;overflow-wrap:anywhere}
.ds-recipient-line strong{color:#23dfab;white-space:nowrap}
.ds-recipient-unassigned{opacity:.7}
.ds-recipient-empty{font-size:12px;color:#9eb2c5}
.ds-metric-collected .ds-collected-toggle{display:flex;flex-direction:column;align-items:flex-start;gap:7px;width:100%;min-width:0;border:0;background:transparent;padding:0;text-align:left;cursor:pointer;font:inherit}
.ds-metric-collected .ds-collected-toggle small{color:#9ac6db}
.ds-metric-collected .ds-collected-toggle strong{color:#eff8ff;font-size:12px;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.ds-metric-collected .ds-collected-toggle:hover small{text-decoration:underline}

/* Make the currently managed account unmistakable in every detail tab. */
.detail-panel.ds-workspace .ds-workspace-account-identity{margin-left:auto;min-width:0;max-width:42%;text-align:right;color:#d8eafa;font-size:14px;line-height:1.4;overflow-wrap:anywhere}
.detail-panel.ds-workspace .ds-workspace-account-identity strong{color:#fff;font-weight:800}
.detail-panel.ds-workspace .ds-workspace-header>.ds-workspace-account-identity{flex:0 1 auto}
@media(max-width:650px){.detail-panel.ds-workspace .ds-workspace-header{flex-wrap:wrap}.detail-panel.ds-workspace .ds-workspace-account-identity{order:3;max-width:100%;flex:1 1 100%;text-align:left;margin-left:0;padding-top:6px;border-top:1px solid #23435a}}

.ds-received-section { margin-top: 20px; padding-top: 17px; border-top: 2px solid rgba(109,171,205,.35); }
.ds-received-total { margin-top: 8px; font-weight: 700; }

/* Management menu: keep the selected username and nickname clearly on the right. */
.detail-panel.ds-workspace .detail-header.ds-workspace-header {
  display:flex !important;
  align-items:center;
  flex-wrap:wrap;
  gap:12px;
}
.detail-panel.ds-workspace .ds-workspace-account-identity {
  display:block !important;
  margin-left:auto !important;
  text-align:right !important;
  max-width:none;
  flex:0 1 auto;
  padding:7px 12px;
  border:1px solid rgba(97,166,199,.4);
  border-radius:8px;
  background:rgba(9,35,54,.8);
}
@media(max-width:650px){
  .detail-panel.ds-workspace .ds-workspace-account-identity {
    order:10;
    flex:1 1 100%;
    width:100%;
    text-align:right !important;
    margin-left:0 !important;
    border:1px solid rgba(97,166,199,.4);
    padding:8px 10px;
  }
}

/* Management tabs + unmistakable selected account identifier. */
.ds-management-tab-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0}
.ds-management-tab-row .ds-detail-tabs{flex:1 1 560px;min-width:0;margin:0}
.ds-management-account-label{margin-left:auto;padding:10px 12px;background:#102b40;border:1px solid #376a88;border-radius:8px;color:#d6eaf7;text-align:right;overflow-wrap:anywhere}
.ds-management-account-label strong{color:white}
.ds-mode-options>div{cursor:pointer}
.ds-mode-options>div:focus-visible{outline:2px solid #1bd4e8;outline-offset:3px}
@media(max-width:800px){.ds-management-tab-row .ds-detail-tabs{flex-basis:100%}.ds-management-account-label{width:100%;margin-left:0}}

/* Selected bot identity belongs in the expanded payment breakdown itself. */
.ds-recipient-account-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;padding:0 0 12px;margin-bottom:13px;border-bottom:1px solid #315a72}
.ds-recipient-account-caption{font-size:12px;color:#9bc9df;font-weight:700}
.ds-recipient-account-identity{margin-left:auto;text-align:right;color:#f1faff;font-size:13px;font-weight:750;overflow-wrap:anywhere}
.ds-recipient-account-identity span{color:#69b7db;padding:0 3px}
@media(max-width:600px){.ds-recipient-account-heading{align-items:flex-start}.ds-recipient-account-identity{max-width:100%;font-size:12px}}

/* Modern ring spinner for first startup and reconnection, desktop and mobile. */
.site-content main .ds-layout-c .bot-starting-icon,
.site-content main .ds-layout-c .ds-original-starting .bot-starting-icon {
  box-sizing:border-box;display:inline-block;width:17px;height:17px;
  border:2.5px solid rgba(251,191,36,.22);border-top-color:#fbbf24;
  border-right-color:#fbbf24;border-radius:50%;font-size:0;
  flex-shrink:0;animation:bot-starting-spin .85s linear infinite;
}
.site-content main .ds-layout-c .ds-inline-loading {display:inline-flex;align-items:center;gap:8px;color:#fbbf24;font-weight:700;white-space:nowrap;}
@media(prefers-reduced-motion:reduce){.site-content main .ds-layout-c .bot-starting-icon{animation:none}}
