/* =================================================================
   Accounts pane, RbxDesk (scoped .mrm-* / .acc-*).
   Blue-Steel tokens come from theme.css on the landing site.
   ================================================================= */

.mrm-tab-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 4px;
  margin-bottom: 12px;
  border-radius: calc(var(--r-control) + 4px);
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-2) 85%, transparent);
}

.mrm-tab {
  flex: 1;
  appearance: none;
  background: transparent;
  border: 0;
  padding: 9px 10px;
  border-radius: var(--r-control);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.18s var(--ease), background 0.18s var(--ease), transform 0.15s var(--ease);
}

.mrm-tab:hover {
  color: var(--text-soft);
}

.mrm-tab.is-active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.mrm-tab:active {
  transform: scale(0.99);
}

.mrm-tab .mrm-tab-count {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  color: var(--text-dim);
}

.mrm-tab.is-active .mrm-tab-count {
  background: color-mix(in oklab, var(--accent) 22%, transparent);
  color: inherit;
}

.mrm-pane {
  display: none;
  width: 100%;
}

.mrm-pane.is-active {
  display: block;
}

/* ===== Accounts pane shell (full-bleed; popup window is the panel) ===== */
.acc-shell {
  width: 100%;
  min-height: 380px;
  padding: 16px 16px 14px;
  border: none;
  border-radius: 0;
  background: linear-gradient(160deg, color-mix(in oklab, var(--accent) 8%, var(--surface)), var(--bg-2));
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===== Product header (Accounts tab) ===== */
.acc-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.acc-brand-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.acc-brand-mark img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 0;
}

.acc-brand-text {
  flex: 1;
  min-width: 0;
}

.acc-product-title {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
}

.acc-product-tag {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.acc-header-brand .acc-add-btn {
  flex-shrink: 0;
}

/* ===== Presence summary ===== */
.acc-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 2px 2px;
}

.acc-status-pair {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
}

.acc-status-pair #acc-online-n,
.acc-status-pair #acc-offline-n {
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.acc-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 2px;
  vertical-align: middle;
}

.acc-status-dot--on {
  background: var(--active);
  box-shadow: 0 0 0 3px var(--active-soft);
}

.acc-status-dot--off {
  background: var(--line-strong);
}

.acc-status-label {
  margin-right: 4px;
}

.acc-status-sep {
  width: 1px;
  height: 12px;
  background: var(--line);
  margin: 0 4px;
}

.acc-device-pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  flex-shrink: 0;
}

.acc-section-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 4px 2px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.acc-roster-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-soft);
}

.acc-add-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: var(--r-control);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), transform 0.15s var(--ease);
}

.acc-add-btn:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.acc-add-btn:active {
  transform: translateY(1px);
}

.acc-add-btn svg {
  width: 11px;
  height: 11px;
}

/* ===== List ===== */
.acc-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
}

.acc-list::-webkit-scrollbar {
  width: 4px;
}

.acc-list::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: var(--r-pill);
}

.acc-empty {
  text-align: center;
  padding: 28px 12px 24px;
  color: var(--text-dim);
}

.acc-empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: var(--r-control);
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  border: 1px solid var(--line);
  color: var(--text-dim);
}

.acc-empty-icon svg {
  width: 22px;
  height: 22px;
}

.acc-empty-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.acc-empty-text {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 260px;
  margin: 0 auto;
}

.acc-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: var(--surface-2);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
  position: relative;
}

.acc-card:hover {
  border-color: var(--line-strong);
}

.acc-card.is-signed-in {
  border-color: color-mix(in oklab, var(--active) 40%, transparent);
  background: linear-gradient(145deg, var(--active-soft), transparent 55%), var(--surface-2);
}

.acc-card.is-signed-in::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--active);
}

.acc-card.is-selected {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 1px var(--accent-line);
}

.acc-card.is-starting {
  animation: acc-pulse 0.9s ease infinite;
}

@keyframes acc-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.acc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.acc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.acc-avatar-fallback {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-dim);
}

.acc-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.acc-ib {
  appearance: none;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--r-control) - 2px);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.15s var(--ease);
}

.acc-ib:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: color-mix(in oklab, var(--surface) 80%, transparent);
}

.acc-ib:active {
  transform: scale(0.94);
}

.acc-ib.acc-ib--danger:hover {
  color: var(--danger);
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.acc-ib svg {
  width: 12px;
  height: 12px;
}

/* ===== Row layout (name + presence + actions) ===== */
.acc-mid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.acc-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.acc-name-row .acc-name {
  flex: 1;
  min-width: 0;
}

.acc-presence {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-pill);
}

.acc-presence--on {
  color: var(--active);
  background: var(--active-soft);
  border: 1px solid color-mix(in oklab, var(--active) 28%, transparent);
}

.acc-presence--off {
  color: var(--text-dim);
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  border: 1px solid var(--line);
}

/* starting tone matches the site's panel.css */
.acc-presence--starting {
  color: #fcd34d;
  background: rgba(252, 211, 77, 0.12);
  border: 1px solid rgba(252, 211, 77, 0.3);
}

.acc-subhint {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-ib.is-pressed,
.acc-sel-btn.is-pressed {
  color: var(--accent-strong);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

/* ===== Launch all row ===== */
.acc-launch-all {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  padding: 10px 10px;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 55%, transparent);
}

.acc-launch-all-text {
  flex: 1;
  min-width: 0;
}

.acc-launch-all-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.acc-launch-all-sub {
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.45;
  color: var(--text-dim);
}

.acc-launch-all-btn {
  width: auto !important;
  flex-shrink: 0;
  padding-left: 12px;
  padding-right: 12px;
  white-space: nowrap;
}

/* ===== Footer bar ===== */
.acc-footer-bar {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-top: 8px;
}

.acc-foot-btn {
  appearance: none;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 8px;
  border-radius: var(--r-control);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.15s var(--ease);
}

.acc-foot-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.acc-foot-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.acc-foot-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.acc-foot-btn--primary {
  flex: 1.35;
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.acc-foot-btn--primary:hover:not(:disabled) {
  color: var(--accent-ink);
  border-color: transparent;
  background: var(--accent-strong);
}

.acc-foot-btn svg {
  width: 10px;
  height: 10px;
}

.acc-launch-btn {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r-control);
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s var(--ease), transform 0.15s var(--ease), box-shadow 0.18s var(--ease), opacity 0.18s var(--ease);
  box-shadow: var(--shadow-1);
}

.acc-launch-btn:hover:not(:disabled) {
  background: var(--accent-strong);
}

.acc-launch-btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

.acc-launch-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.acc-launch-btn svg {
  width: 11px;
  height: 11px;
}

.acc-log {
  min-height: 1em;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.01em;
  text-align: center;
  padding: 6px 8px;
  border-radius: calc(var(--r-control) - 2px);
  border: 1px solid transparent;
  transition: color 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.acc-log:empty {
  display: none;
}

.acc-log.is-info {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.acc-log.is-ok {
  color: var(--active);
  background: var(--active-soft);
  border-color: var(--active-line);
}

.acc-log.is-err {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-line);
}

/* ===== Add account modal ===== */
.acc-modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(8px) saturate(1.05);
  -webkit-backdrop-filter: blur(8px) saturate(1.05);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--ease), visibility 0s linear 0.2s;
}

.acc-modal.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s var(--ease), visibility 0s linear 0s;
}

.acc-modal-card {
  width: 100%;
  max-width: 340px;
  padding: 18px 16px 16px;
  border-radius: var(--r-card);
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, color-mix(in oklab, var(--accent) 6%, var(--surface)), var(--bg-2));
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateY(6px) scale(0.985);
  transition: transform 0.22s var(--ease);
}

.acc-modal.is-open .acc-modal-card {
  transform: translateY(0) scale(1);
}

.acc-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.acc-modal-text {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-dim);
}

.acc-modal-text code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-soft);
}

.acc-token-input {
  resize: vertical;
  width: 100%;
  min-height: 88px;
  max-height: 200px;
  padding: 10px 12px;
  border-radius: var(--r-control);
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.4;
  letter-spacing: 0;
  outline: none;
  word-break: break-all;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.acc-token-input::placeholder {
  color: color-mix(in oklab, var(--text-dim) 50%, transparent);
}

.acc-token-input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.acc-modal-card .btn {
  margin-bottom: 0;
}

.acc-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.acc-btn-ghost {
  appearance: none;
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--r-control);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-soft);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.acc-btn-ghost:hover {
  color: var(--text);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.acc-btn-primary {
  appearance: none;
  flex: 1.5;
  padding: 10px 14px;
  border-radius: var(--r-control);
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s var(--ease), transform 0.15s var(--ease), opacity 0.18s var(--ease);
  box-shadow: var(--shadow-1);
}

.acc-btn-primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.acc-btn-primary:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

.acc-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

@keyframes acc-spin {
  to {
    transform: rotate(360deg);
  }
}

.acc-btn-primary.is-busy::after {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 6px;
  border-radius: 50%;
  border: 2px solid rgba(7, 16, 31, 0.25);
  border-top-color: var(--accent-ink);
  animation: acc-spin 0.8s linear infinite;
  vertical-align: -2px;
}

/* =================================================================
   Landing overrides — card wrapper around hero demo panel
   ================================================================= */

.panel-shell {
  border-radius: calc(var(--r-card) + 6px);
  border: 1px solid var(--line-strong);
  background: linear-gradient(
    160deg,
    color-mix(in oklab, var(--accent) 8%, var(--surface)),
    var(--bg-2)
  );
  box-shadow: var(--shadow-2);
  overflow: visible;
}

.panel-shell .acc-shell {
  min-height: 0;
  max-height: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.panel-shell .acc-list {
  max-height: none;
  overflow: visible;
}
