/* sd.czrkt.xyz — 绫波丽超自然 Ultra-Clear Liquid Glass Theme + Chonggu 4-Squad Extensions */
:root {
  --bg: #0b1120;
  --glass: rgba(10, 16, 30, 0.16);
  --glass-work: rgba(10, 16, 30, 0.22);
  --glass-soft: rgba(8, 13, 25, 0.20);
  --line: rgba(255, 255, 255, 0.22);
  --line-soft: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --text-soft: #f1f5f9;
  --muted: rgba(226, 232, 240, 0.84);
  --dim: rgba(203, 213, 225, 0.62);
  --ice: #93c5fd;
  --ice-bright: #e0f2fe;
  --ok: #86efac;
  --amber: #fcd34d;
  --red-20: #fb923c;
  --red-50: #f43f5e;
  --red-100: #fbbf24;
  --danger: #fda4af;
  --danger-soft: rgba(244, 63, 94, 0.18);
  --mono: "CzrktPingFang", "PingFang SC", -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
}

#pointer-orbit, #pointer-dot, .pointer-orbit, .pointer-dot,
.czrktxyz-backdrop, .czrktxyz-scene, .czrktxyz-shade { display: none !important; }
html, body, .czrktxyz-app, .czrktxyz-app * { cursor: auto !important; }
a, a *, button, button *, [role="button"], select, label[for] { cursor: pointer !important; }
input[type="text"], input[type="password"], input[type="number"], input:not([type]) { cursor: text !important; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed !important; }

html {
  min-height: 100%;
  background: #0b1120 !important;
}
body {
  min-height: 100%;
  position: relative;
  isolation: isolate;
  background: transparent !important;
  color: var(--text);
  font: 14px/1.55 "CzrktPingFang", "PingFang SC", -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.92), 0 0 3px rgba(0, 0, 0, 0.72) !important;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: #0b1120 url('assets/rei/rei-bg.jpg?v=1') center 22% / cover no-repeat;
  transform: translateZ(0);
}
.shell { position: relative; z-index: 2; width: min(1560px, calc(100% - 36px)); }

* { scrollbar-width: thin; scrollbar-color: rgba(186, 220, 255, 0.30) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(186, 220, 255, 0.30); border-radius: 999px; }

.rei-brand-icon {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.45); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); flex-shrink: 0;
}

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  margin-top: 12px; min-height: 52px; height: auto; padding: 9px 18px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.015) !important;
  backdrop-filter: blur(1.2px) saturate(112%) !important;
  -webkit-backdrop-filter: blur(1.2px) saturate(112%) !important;
  border: 1px solid rgba(255, 255, 255, 0.11) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: #ffffff; }
.brand span, .brand strong { color: #ffffff !important; font-size: 16px; font-weight: 700; white-space: nowrap; }
.top-right { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px 10px; min-width: 0; font-size: 12px; color: var(--text-soft); }
.conn-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.012); border: 1px solid rgba(255, 255, 255, 0.09); }
.top-right time { font-family: var(--mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.top-right .back {
  padding: 5px 13px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03); color: #ffffff; font-size: 12.5px; font-weight: 500;
}
.top-right .back:hover { background: rgba(255, 255, 255, 0.13); border-color: rgba(255, 255, 255, 0.40); }
.live-dot { height: 6px; width: 6px; border-radius: 50%; background: rgba(203, 213, 225, 0.5); }
.live-dot.online { background: var(--ok); box-shadow: 0 0 8px rgba(134, 239, 172, 0.7); }
.live-dot.offline { background: var(--danger); }

.panel, .license-bar, .is-login-view .auth-panel {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.015) !important;
  backdrop-filter: blur(1.2px) saturate(112%) !important;
  -webkit-backdrop-filter: blur(1.2px) saturate(112%) !important;
  border: 1px solid rgba(255, 255, 255, 0.11) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
}

.is-login-view .auth-panel {
  width: min(410px, calc(100vw - 32px)); height: auto; margin: clamp(72px, 18dvh, 240px) auto 32px;
  padding: 26px 26px 24px; border-radius: 22px; align-items: stretch;
}
.is-login-view .auth-panel h2 { font-size: 20px; font-weight: 650; text-align: left; margin: 0 0 14px; color: #ffffff; }

/* 3-Map Selector (Four-Squad Maps) */
.map-picker-field { margin: 0 0 12px; }
.map-picker-label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-soft); margin-bottom: 6px; }
.map-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.map-option {
  width: 100%; margin: 0; padding: 9px 6px 8px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  background: rgba(255, 255, 255, 0.024); border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff; text-align: center;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.map-option:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09); border-color: rgba(186, 224, 255, 0.44);
}
.map-option.is-selected {
  background: rgba(147, 197, 253, 0.18); border-color: rgba(186, 224, 255, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 0 14px -6px rgba(147, 197, 253, 0.60);
}
.map-option.is-disabled, .map-option:disabled {
  opacity: 0.48; background: rgba(255, 255, 255, 0.012); border-color: rgba(255, 255, 255, 0.08);
  cursor: not-allowed !important;
}
.map-option-name { font-size: 12.5px; font-weight: 600; color: #ffffff; line-height: 1.25; white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }
.map-option-badge {
  font-style: normal; font-size: 10px; font-weight: 600; padding: 1px 7px;
  border-radius: 999px; line-height: 1.4; white-space: nowrap;
}
.map-option-badge.is-open {
  background: rgba(134, 239, 172, 0.18); color: #bbf7d0; border: 1px solid rgba(134, 239, 172, 0.42);
}
.map-option-badge.is-locked {
  background: rgba(255, 255, 255, 0.06); color: var(--dim); border: 1px solid rgba(255, 255, 255, 0.12);
}

.license-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 10px 18px; margin: 14px 0; border-radius: 16px; }
.license-bar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.license-bar-left b { font-size: 13.5px; font-weight: 600; color: #ffffff; }
.license-bar small {
  display: inline-block; margin: 0; font-family: var(--mono); font-size: 11.5px;
  color: var(--ice-bright); background: rgba(96, 165, 250, 0.14);
  border: 1px solid rgba(147, 197, 253, 0.30); padding: 2px 9px; border-radius: 999px;
}
.online-dot { width: 7px; height: 7px; margin: 0; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px rgba(134, 239, 172, 0.7); flex-shrink: 0; }
.btn-switch-card { width: auto; margin: 0; flex-shrink: 0; white-space: nowrap; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 999px; padding: 5px 14px; font-size: 12px; color: #ffffff; background: rgba(255, 255, 255, 0.03); }
.btn-switch-card:hover { background: rgba(255, 255, 255, 0.13); border-color: rgba(255, 255, 255, 0.40); }

.mj-workspace { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; margin-bottom: 36px; align-items: start; }
.controls { position: sticky; top: 14px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mj-dashboard { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mj-workspace .panel { min-width: 0; padding: 18px 20px; }
.mj-workspace .panel h2 { font-size: 15.5px; font-weight: 650; color: #ffffff; margin: 0; min-width: 0; }
.section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; margin-bottom: 12px; background: transparent !important; border: 0 !important; padding: 0 !important; }

.pill-count {
  font-size: 11.5px; font-weight: 600; color: var(--ice-bright);
  background: rgba(96, 165, 250, 0.16); border: 1px solid rgba(147, 197, 253, 0.30);
  padding: 2px 10px; border-radius: 999px; white-space: nowrap;
}

.entitlement > span { display: block; font-size: 12px; color: var(--muted); }
.entitlement strong { display: block; font-family: var(--mono); font-size: 20px; font-weight: 700; margin: 6px 0 10px; color: #ffffff; font-variant-numeric: tabular-nums; }
.quota-bar { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); overflow: hidden; margin-bottom: 8px; }
.quota-bar-fill { height: 100%; width: 0%; border-radius: inherit; background: linear-gradient(90deg, #60a5fa, #dbeafe); transition: width .35s ease; }
.entitlement p { font-size: 12px; color: var(--muted); margin: 0; }
.field-hint { display: block; margin-top: 10px; font-size: 11.5px; line-height: 1.5; color: var(--dim); }

.controls label, .is-login-view .auth-panel label { display: block; margin: 12px 0 0; font-size: 12.5px; font-weight: 500; color: var(--text-soft); }
.controls label:first-child { margin-top: 0; }
input:where(:not([type="checkbox"]):not([type="radio"]):not([type="hidden"])), select {
  display: block; width: 100%; margin-top: 6px; border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 12px; padding: 10px 13px; background: rgba(255, 255, 255, 0.018) !important;
  color: #ffffff !important; font: inherit; font-size: 13.5px;
}
input:focus, select:focus { border-color: rgba(255, 255, 255, 0.38) !important; background: rgba(255, 255, 255, 0.05) !important; outline: none; }
select {
  color-scheme: dark; height: 36px; padding: 0 32px 0 12px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 11px center !important;
}
select option { background: #0e1628; color: #f8fafc; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled { opacity: 0.5; }
.password-wrap {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 6px;
}
.password-wrap input {
  margin-top: 0;
  padding-right: 60px;
}
.password-wrap .password-toggle {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: auto; padding: 4px 10px; margin: 0; font-size: 11.5px; line-height: 1.35;
  color: var(--text-soft) !important;
  background: rgba(255, 255, 255, 0.10) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 8px;
}
.password-wrap .password-toggle:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.20) !important;
  border-color: rgba(147, 197, 253, 0.55) !important;
  color: #ffffff !important;
}

/* Auto-Sell Threshold Picker (Launch Form & Live Inline Bar) */
.sell-threshold-field { margin-top: 12px; }
.controls .sell-threshold-label { margin: 0 0 6px; font-size: 12.5px; font-weight: 500; color: var(--text-soft); }
.sell-presets { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.sell-presets .sell-preset-btn {
  width: auto; margin: 0; padding: 4px 8.5px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.45; white-space: nowrap;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.14); color: var(--muted);
  transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
.sell-presets .sell-preset-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.10); border-color: rgba(186, 224, 255, 0.44); color: #ffffff;
}
.sell-presets .sell-preset-btn.is-active {
  background: rgba(147, 197, 253, 0.20); border-color: rgba(186, 224, 255, 0.68); color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 0 12px -6px rgba(147, 197, 253, 0.60);
}
.sell-presets .sell-preset-btn:disabled { opacity: 0.45; }
.sell-threshold-field input[type="number"] { margin-top: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sell-threshold-hint { display: block; margin-top: 5px; font-size: 11px; line-height: 1.45; color: var(--dim); }

button.primary {
  width: 100%; margin-top: 16px; padding: 10px 20px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.07) !important; color: #ffffff !important; font-size: 14px; font-weight: 600 !important;
  border: 1px solid rgba(255, 255, 255, 0.24) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24) !important;
}
button.primary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16) !important; border-color: rgba(255, 255, 255, 0.48) !important; }
button.primary:disabled { opacity: 0.45; }
.ghost { background: rgba(255, 255, 255, 0.03) !important; border: 1px solid rgba(255, 255, 255, 0.14) !important; color: #ffffff !important; border-radius: 999px; padding: 5px 12px; font-size: 12px; width: auto; margin: 0; }
.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.13) !important; border-color: rgba(255, 255, 255, 0.40) !important; }

/* Stats & Full Income/Expense Ledger */
.stats { padding: 14px 18px !important; }
.sd-counters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; }
.sd-counters .stat-card {
  padding: 13px 15px; border-radius: 14px; background: rgba(255, 255, 255, 0.012);
  border: 1px solid rgba(255, 255, 255, 0.09); min-width: 0;
}
.sd-counters span { display: block; font-size: 12px; color: var(--muted); }
.sd-counters strong { display: block; margin-top: 4px; font-family: var(--mono); font-size: 22px; font-weight: 700; color: #ffffff; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sd-counters strong.win-rate-value, .sd-counters strong.is-pos { color: var(--ok); }
.sd-counters strong.is-neg { color: var(--danger); }
.sd-counters strong.big-red-value { color: #fde68a; }
.sd-counters small { display: block; margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }

.ledger-strip {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.ledger-cell {
  padding: 8px 11px; border-radius: 11px; background: rgba(255, 255, 255, 0.014);
  border: 1px solid rgba(255, 255, 255, 0.09); min-width: 0;
}
.ledger-cell span { display: block; font-size: 11px; color: var(--muted); }
.ledger-cell strong { display: block; margin-top: 2px; font-family: var(--mono); font-size: 13.5px; font-weight: 700; color: #ffffff; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; word-break: break-word; }
.ledger-cell.is-expense strong, .ledger-cell.is-loss strong { color: #fecdd3; }
.ledger-cell.is-cash strong { color: #fde68a; }
.ledger-cell.is-warehouse strong { color: #bfdbfe; }
.ledger-cell.is-net strong { color: var(--ok); }

/* 6-Stage Chonggu Progress */
.sd-stage-progress { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.sd-stage-progress span {
  display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 11px;
  background: rgba(255, 255, 255, 0.012); border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sd-stage-progress span i {
  display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; border-radius: 50%;
  font-style: normal; font-family: var(--mono); font-size: 10.5px; background: rgba(255, 255, 255, 0.12); color: var(--muted); flex-shrink: 0;
}
.sd-stage-progress span.done { color: #ffffff; border-color: rgba(147, 197, 253, 0.40); background: rgba(59, 130, 246, 0.16); }
.sd-stage-progress span.done i { background: rgba(147, 197, 253, 0.40); color: #ffffff; font-weight: 700; }
.sd-stage-progress span.active { color: #ffffff; border-color: rgba(147, 197, 253, 0.78); background: rgba(96, 165, 250, 0.24); }
.sd-stage-progress span.active i { background: #dbeafe; color: #09111f; font-weight: 700; text-shadow: none; }

.sd-current-info { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.info-tile { padding: 10px 13px; border-radius: 12px; background: rgba(255, 255, 255, 0.012); border: 1px solid rgba(255, 255, 255, 0.09); min-width: 0; }
.info-tile span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.info-tile strong { display: block; font-size: 13px; font-weight: 600; color: #ffffff; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.info-tile .live-timer { font-family: var(--mono); color: var(--ice-bright); }
.mission-banner { margin-top: 10px; padding: 9px 13px; border-radius: 12px; background: rgba(255, 255, 255, 0.012); border: 1px solid rgba(255, 255, 255, 0.09); font-size: 12.5px; color: var(--text-soft); }
.mission-banner.is-warn { border-color: rgba(252, 211, 77, 0.42); background: rgba(251, 191, 36, 0.08); color: #fef3c7; }
.current-actions { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.cancel-match-button {
  border-color: rgba(252, 211, 77, 0.36) !important;
  background: rgba(251, 191, 36, 0.10) !important;
  color: #fef3c7 !important;
}
.cancel-match-button:hover:not(:disabled) {
  background: rgba(251, 191, 36, 0.24) !important;
  border-color: rgba(252, 211, 77, 0.70) !important;
}
.cancel-match-button:disabled {
  opacity: 0.45;
  border-color: rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.02) !important;
  color: var(--dim) !important;
}
.stop-button:hover:not(:disabled) { background: rgba(244, 63, 94, 0.26) !important; border-color: rgba(253, 164, 175, 0.60) !important; }

.live-sell-bar {
  margin-top: 10px; padding: 9px 13px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.014); border: 1px solid rgba(255, 255, 255, 0.09);
  display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap;
}
.live-sell-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.live-sell-label {
  font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap;
  padding: 1px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12);
}
.live-sell-status strong {
  font-size: 12.5px; font-weight: 600; color: var(--text-soft);
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.live-sell-status strong.is-enabled { color: #fde68a; }
.live-sell-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sell-presets-compact { margin-bottom: 0; gap: 5px; }
.sell-presets-compact .sell-preset-btn { padding: 3px 8px; font-size: 11px; }
.live-sell-editor { display: inline-flex; align-items: center; gap: 6px; }
.live-sell-bar .live-sell-input {
  width: 114px; height: 30px; margin-top: 0; padding: 4px 9px; border-radius: 9px;
  font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums;
}
.live-sell-save {
  height: 30px; padding: 4px 12px; font-size: 11.5px; font-weight: 600;
  border-radius: 9px; white-space: nowrap;
}
.live-sell-save.is-dirty {
  background: rgba(96, 165, 250, 0.24) !important;
  border-color: rgba(147, 197, 253, 0.72) !important;
  color: #ffffff !important;
}

/* Account Jobs */
.account-jobs { display: grid; gap: 8px; max-height: 360px; overflow-y: auto; }
.account-job {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 14px; background: rgba(255, 255, 255, 0.012);
}
.account-job-main { flex: 1 1 auto; min-width: 0; }
.account-job.selected { background: rgba(147, 197, 253, 0.07); border-color: rgba(186, 224, 255, 0.36); box-shadow: inset 3px 0 0 #93c5fd; }
.account-job-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.account-job-title strong { overflow-wrap: anywhere; }
.job-state-badge { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: rgba(255, 255, 255, 0.10); border: 1px solid rgba(255, 255, 255, 0.16); }
.job-state-badge.is-running { background: rgba(134, 239, 172, 0.18); color: #bbf7d0; border-color: rgba(134, 239, 172, 0.42); }
.job-state-badge.is-queued { background: rgba(147, 197, 253, 0.18); color: #dbeafe; border-color: rgba(147, 197, 253, 0.40); }
.job-state-badge.is-paused { background: rgba(251, 191, 36, 0.16); color: #fde68a; border-color: rgba(252, 211, 77, 0.40); }
.job-state-badge.is-failed { background: var(--danger-soft); color: #fecdd3; border-color: rgba(253, 164, 175, 0.38); }
.job-progress-chip { font-family: var(--mono); font-size: 11.5px; color: var(--ice-bright); }
.account-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.account-error { display: block; margin-top: 6px; padding: 5px 9px; border-radius: 8px; background: var(--danger-soft); color: #fecdd3; font-size: 11.5px; overflow-wrap: anywhere; word-break: break-word; }
.account-actions { display: flex; flex-wrap: wrap; gap: 6px; flex-shrink: 0; }
.account-actions button { width: auto; margin: 0; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.03); color: #ffffff; border-radius: 999px; padding: 5px 12px; font-size: 12px; }
.account-actions button:hover:not(:disabled) { border-color: rgba(147, 197, 253, 0.72); background: rgba(96, 165, 250, 0.22); }
.account-actions button[data-action="resume"],
.account-actions button[data-action="retry"] {
  background: rgba(147, 197, 253, 0.20); border-color: rgba(186, 224, 255, 0.55); color: #e0f2fe; font-weight: 600;
}
.account-actions button[data-action="resume"]:hover:not(:disabled),
.account-actions button[data-action="retry"]:hover:not(:disabled) {
  background: rgba(147, 197, 253, 0.32); border-color: rgba(219, 234, 254, 0.85); color: #ffffff;
}
.account-actions button[data-action="cancel_match"] { color: #fef3c7; border-color: rgba(252, 211, 77, 0.38); background: rgba(251, 191, 36, 0.10); }
.account-actions button[data-action="cancel_match"]:hover:not(:disabled) { border-color: rgba(252, 211, 77, 0.72); background: rgba(251, 191, 36, 0.24); }
.account-actions button[data-action="delete"] { color: #fecdd3; border-color: rgba(253, 164, 175, 0.34); background: rgba(244, 63, 94, 0.10); }
.account-actions button[data-action="delete"]:hover:not(:disabled) { border-color: rgba(253, 164, 175, 0.68); background: rgba(244, 63, 94, 0.28); color: #ffffff; }

/* Big Red Gallery */
.tier-filters { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tier-btn { width: auto; margin: 0; padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.14); color: var(--muted); }
.tier-btn.is-active { background: rgba(244, 63, 94, 0.22); border-color: rgba(251, 113, 133, 0.65); color: #ffffff; }
.big-red-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 10px; }
.big-red-card {
  padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(251, 146, 60, 0.36); min-width: 0;
}
.big-red-card.tier-50w { border-color: rgba(244, 63, 94, 0.56); background: rgba(244, 63, 94, 0.08); }
.big-red-card.tier-100w { border-color: rgba(251, 191, 36, 0.72); background: linear-gradient(135deg, rgba(244, 63, 94, 0.14), rgba(251, 191, 36, 0.14)); box-shadow: 0 0 18px -6px rgba(251, 191, 36, 0.45); }
.big-red-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.big-red-badge { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(251, 146, 60, 0.22); color: #fed7aa; border: 1px solid rgba(251, 146, 60, 0.45); }
.big-red-badge.tier-50w { background: rgba(244, 63, 94, 0.25); color: #fecdd3; border-color: rgba(251, 113, 133, 0.55); }
.big-red-badge.tier-100w { background: rgba(251, 191, 36, 0.26); color: #fef08a; border-color: rgba(251, 191, 36, 0.65); }
.big-red-name { display: block; font-size: 14px; font-weight: 700; color: #ffffff; overflow-wrap: anywhere; word-break: break-word; }
.big-red-val { font-family: var(--mono); font-size: 17px; font-weight: 700; color: #fde68a; margin: 2px 0 6px; overflow-wrap: anywhere; }
.big-red-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--muted); font-family: var(--mono); }

/* Destination & Per-Round Loot Chips */
.dest-tag { display: inline-flex; padding: 1px 6px; border-radius: 999px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.dest-tag.is-cash { background: rgba(251, 146, 60, 0.22); color: #fed7aa; border: 1px solid rgba(251, 146, 60, 0.56); cursor: help; }
.dest-tag.is-auto-sold { background: rgba(52, 211, 153, 0.18); color: #a7f3d0; border: 1px solid rgba(52, 211, 153, 0.46); cursor: help; }
.dest-tag.is-warehouse { background: rgba(96, 165, 250, 0.18); color: #dbeafe; border: 1px solid rgba(147, 197, 253, 0.42); }
.loot-chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.loot-chip {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 5px; max-width: 100%; padding: 2px 7px; border-radius: 8px;
  font-size: 11.5px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.12);
}
.loot-chip b { font-weight: 600; color: #ffffff; overflow-wrap: anywhere; }
.loot-chip i { font-style: normal; font-family: var(--mono); color: var(--muted); }
.loot-chip.is-red { border-color: rgba(251, 146, 60, 0.55); background: rgba(251, 146, 60, 0.12); }
.loot-chip.tier-50w { border-color: rgba(244, 63, 94, 0.65); background: rgba(244, 63, 94, 0.16); }
.loot-chip.tier-100w { border-color: rgba(251, 191, 36, 0.78); background: rgba(251, 191, 36, 0.18); }
.red-tier-dot { font-style: normal; font-size: 10px; font-weight: 700; color: #fef08a; }

/* Rounds Table */
.history-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.history-tools select { margin: 0; height: 34px; width: auto; min-width: 160px; max-width: min(250px, 100%); font-size: 12px; border-radius: 10px; }
#last-updated { font-size: 11.5px; font-family: var(--mono); color: var(--muted); white-space: nowrap; }
.icon-button { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; border-radius: 10px; flex-shrink: 0; }
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(90deg, rgba(11, 17, 32, 0), rgba(11, 17, 32, 0)) left center / 1px 100%,
    linear-gradient(270deg, rgba(147, 197, 253, 0.16), rgba(147, 197, 253, 0) 20px) right center / 20px 100%;
  background-repeat: no-repeat;
  background-attachment: scroll;
}
table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-weight: 500; font-size: 12px; padding: 0 10px 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); font-size: 12.5px; vertical-align: middle; }
.round-log-open { width: auto; margin: 0; border: 1px solid rgba(255, 255, 255, 0.22); padding: 4px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.08); color: #ffffff; font-family: var(--mono); font-size: 12px; font-weight: 600; white-space: nowrap; }
.round-time-cell { white-space: nowrap; }
.round-time-cell small { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.round-time-cell small.is-live { color: var(--ice-bright); font-weight: 600; }
.round-loot-cell { min-width: 200px; max-width: 440px; }
.round-loss-reason { color: #fecdd3; font-size: 12px; }
td .badge { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge.success { background: rgba(134, 239, 172, 0.18); color: #bbf7d0; border: 1px solid rgba(134, 239, 172, 0.38); }
.badge.playing { background: rgba(147, 197, 253, 0.18); color: #dbeafe; border: 1px solid rgba(147, 197, 253, 0.40); }
.badge.failed { background: var(--danger-soft); color: #fecdd3; border: 1px solid rgba(253, 164, 175, 0.36); }
.numeric { text-align: right; font-family: var(--mono); white-space: nowrap; }
.fin-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 11.5px; }
.fin-exp { color: #fecdd3; }
.fin-inc { color: #fde68a; }
.fin-wallet { color: var(--muted); }
.earned { color: var(--ok); font-weight: 700; }
.loss-num { color: #fda4af; font-weight: 700; }
.muted { color: var(--muted); }
.empty-state { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 0; margin: 0; }

/* Dialogs & Toast */
.retry-dialog {
  width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 20px;
  background: rgba(8, 14, 28, 0.72); backdrop-filter: blur(12px) saturate(145%);
  color: #ffffff; padding: 22px;
}
.retry-dialog::backdrop { background: rgba(4, 8, 18, 0.55); backdrop-filter: blur(4px); }
.retry-dialog h2 { margin: 0; font-size: 17px; }
.retry-dialog .field-note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.retry-dialog .field-note:empty { display: none; }
.retry-dialog label { margin: 14px 0 0; display: block; font-size: 12.5px; color: var(--text-soft); }
.retry-dialog input[readonly] { color: var(--muted) !important; }
.round-log-dialog { width: min(820px, calc(100vw - 32px)); }
.round-log-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.round-log-heading h2 { margin: 0; font-size: 17px; }
.round-log-heading button { flex-shrink: 0; }
.round-finance-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.fin-pill { padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.12); }
.fin-pill span { display: block; font-size: 11px; color: var(--muted); }
.fin-pill b { font-family: var(--mono); font-size: 13px; }
.round-loot-detail { margin: 10px 0 14px; }
.loot-detail-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.loot-detail-empty { font-size: 12px; color: var(--muted); }
.round-log-list { list-style: none; margin: 12px 0 0; padding: 0; max-height: 45vh; overflow-y: auto; }
.timeline li { position: relative; margin-left: 4px; padding: 0 0 12px 18px; border-left: 1px solid rgba(147, 197, 253, 0.30); }
.timeline li:last-child { padding-bottom: 0; border: 0; }
.timeline li::before { content: ""; position: absolute; left: -3px; top: 6px; width: 5px; height: 5px; background: var(--ice); border-radius: 50%; }
.timeline time { font-family: var(--mono); font-size: 11px; color: var(--muted); min-width: 122px; margin-right: 6px; display: inline-block; }
.log-message { font-size: 12.5px; color: var(--text-soft); overflow-wrap: anywhere; }
.log-value { font-family: var(--mono); font-size: 12px; color: var(--ice-bright); font-weight: 600; margin-left: 8px; }
.retry-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.retry-actions button { width: auto; margin: 0; min-width: 88px; height: 40px; padding: 0 18px; border-radius: 12px; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; }
.retry-error { color: var(--danger); font-size: 12px; margin: 8px 0 0; }
.retry-error:empty { display: none; }
.toast {
  position: fixed; inset: auto; bottom: 24px; left: 50%; margin: 0; transform: translate(-50%, 10px);
  max-width: min(90vw, 520px); overflow: visible; text-align: center;
  opacity: 0; pointer-events: none; background: rgba(12, 20, 38, 0.88); backdrop-filter: blur(12px);
  border: 1px solid rgba(147, 197, 253, 0.42); color: #ffffff; font-weight: 600;
  padding: 10px 20px; border-radius: 999px; z-index: 10000; font-size: 13px; transition: opacity .2s, transform .2s;
}
.toast.show, .toast:popover-open { opacity: 1; transform: translate(-50%, 0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1180px) {
  .sd-counters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sd-stage-progress { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sd-current-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .mj-workspace { grid-template-columns: minmax(0, 1fr); }
  .controls { position: static; }
  .top-right time { display: none; }
}
@media (max-height: 700px) {
  .is-login-view .auth-panel { margin: clamp(28px, 10dvh, 96px) auto 24px; }
}
@media (max-width: 560px) {
  .shell { width: calc(100% - 20px); }
  .topbar { border-radius: 18px; padding: 9px 14px; }
  .is-login-view .auth-panel { margin: clamp(32px, 12dvh, 110px) auto 24px; padding: 20px 18px; }
  .license-bar { padding: 10px 14px; }
  .mj-workspace .panel { padding: 15px 14px; }
  .sd-counters, .sd-current-info { grid-template-columns: 1fr; }
  .ledger-strip, .sd-stage-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-jobs { max-height: 520px; }
  .account-job { flex-direction: column; align-items: stretch; }
  .round-finance-summary { grid-template-columns: repeat(2, 1fr); }
  .live-sell-bar { flex-direction: column; align-items: stretch; }
  .live-sell-controls { justify-content: space-between; }
  .live-sell-editor { width: 100%; }
  .live-sell-bar .live-sell-input { flex: 1; width: auto; min-width: 0; }
  .history-tools { width: 100%; justify-content: flex-start; }
  .history-tools select { flex: 1 1 160px; min-width: 0; max-width: 100%; width: 100%; }
  .round-loot-cell { min-width: 165px; max-width: 260px; }
  .timeline time { display: block; min-width: 0; margin: 0 0 2px; }
}
@media (max-width: 400px) {
  .topbar { gap: 6px 8px; padding: 8px 12px; }
  .brand, .brand span, .brand strong { font-size: 14.5px; }
  .top-right { gap: 6px; }
  .top-right .back, .conn-pill { padding: 4px 9px; font-size: 11.5px; }
  .map-picker { gap: 5px; }
  .map-option { padding: 8px 4px 7px; }
  .map-option-name { font-size: 11.5px; }
}
@media (max-width: 339px) {
  .map-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
