/* ============================================================
   RbxSwitch extension popup. Dark-only, matches the RbxSwitch
   landing: gold accent, Archivo + JetBrains Mono. Fixed 380px.
   ============================================================ */

:root {
  color-scheme: dark;

  /* Backgrounds (from the site) */
  --bg: #0A0B0D;
  --bg-2: #0E1013;
  --surface: #111317;
  --surface-2: #16181C;

  /* Borders (from the site) */
  --line: #1F2228;
  --line-strong: #2C3038;

  /* Text (from the site) */
  --text: #ECEAE3;
  --text-dim: #9A9690;
  --text-soft: #C9C4B8;

  /* Accent: gold (from the site) */
  --accent: #C9A24B;
  --accent-strong: #D8B868;
  --accent-ink: #15110A;
  --accent-soft: rgba(201, 162, 75, 0.13);
  --accent-line: rgba(201, 162, 75, 0.32);

  /* Active / signed-in: gold, like the site's OPEN state (no green) */
  --active: #C9A24B;
  --active-soft: rgba(201, 162, 75, 0.15);
  --active-line: rgba(201, 162, 75, 0.34);

  /* Danger / error: warm red that sits with the gold */
  --danger: #E0685A;
  --danger-soft: rgba(224, 104, 90, 0.13);
  --danger-line: rgba(224, 104, 90, 0.34);

  /* Glow */
  --aura: rgba(201, 162, 75, 0.17);

  /* Radius */
  --r-card: 14px;
  --r-control: 10px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-1: 0 18px 48px -16px rgba(0, 0, 0, 0.55);
  --shadow-2: 0 36px 90px -22px rgba(0, 0, 0, 0.6);

  /* Easing (from the site) */
  --ease: cubic-bezier(0.19, 1, 0.22, 1);

  /* Fonts (from the site) */
  --font-sans: "Archivo", system-ui, -apple-system, sans-serif;
  --font-display: "Archivo Expanded", "Archivo", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  width: 380px;
  overflow: hidden;
  background-color: var(--bg-2);
  color-scheme: dark;
}

body {
  width: 380px;
  min-height: 380px;
  max-height: 620px;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: var(--font-sans);
  color: var(--text);
  background-color: var(--bg-2);
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}

/* Scrollbars */
body::-webkit-scrollbar { width: 5px; }
body::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: var(--r-pill);
}

/* ============================================================
   Screen 1: Loader overlay
   ============================================================ */
.ldr-wrap {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  background:
    radial-gradient(ellipse at 50% 40%, var(--aura), transparent 70%),
    var(--bg);
  transition: opacity 0.4s var(--ease);
}
.ldr-wrap.hide {
  opacity: 0;
  pointer-events: none;
}
.ldr-cnt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.ldr {
  display: inline-block;
  width: 44px;
  height: 44px;
  position: relative;
}
.ldr::before,
.ldr::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--accent);
  animation: ldr-key 1.2s var(--ease) infinite;
}
.ldr::before { top: 1px; left: 1px; animation-delay: 0s; }
.ldr::after { bottom: 1px; right: 1px; animation-delay: 0.6s; }
.ldr-txt {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--text-dim);
  max-width: 320px;
  text-align: center;
}
@keyframes ldr-key {
  0%, 100% { transform: scale(1);    opacity: 0.45; }
  50%      { transform: scale(0.82); opacity: 1; }
}

/* ============================================================
   Shell (tools-stub layout) + main content show/hide
   ============================================================ */
.cnt,
.res {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.cnt.show,
.res.show {
  opacity: 1;
  transform: translateY(0);
}

.shell {
  padding: 18px 16px 16px;
  border-radius: calc(var(--r-card) + 6px); /* 22px */
  border: 1px solid var(--line-strong);
  background: linear-gradient(
    160deg,
    color-mix(in oklab, var(--accent) 8%, var(--surface)),
    var(--surface)
  );
  box-shadow: var(--shadow-2);
}
.shell.action-only {
  display: flex;
  flex-direction: column;
  min-height: 360px;
}
.shell.action-only .flow-block { margin-top: auto; }
.shell--compact { padding-top: 22px; }

/* ============================================================
   Screen 2: Accounts pane
   ============================================================ */
.acc-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px 14px;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* --- 2a Header --- */
.acc-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.acc-brand-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.acc-brand-text { flex: 1; min-width: 0; }
.acc-product-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
}
.acc-product-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-top: 3px;
}
.acc-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  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:disabled { opacity: 0.45; cursor: not-allowed; }

/* --- 2b Status row --- */
.acc-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 2px 2px;
}
.acc-status-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
}
.acc-status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 2px;
}
.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-sep {
  display: inline-block;
  width: 1px;
  height: 12px;
  background: var(--line);
  margin: 0 4px;
}
#acc-online-n, #acc-offline-n {
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.acc-device-pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  color: var(--text-dim);
}

/* --- 2c Section label --- */
.acc-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}
.acc-roster-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-soft);
}

/* --- 2d Account 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);
}

/* Empty state */
.acc-empty {
  text-align: center;
  padding: 28px 12px 24px;
  color: var(--text-dim);
}
.acc-empty-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-control);
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  margin: 0 auto 12px;
}
.acc-empty-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 4px;
}
.acc-empty-text {
  font-family: var(--font-sans);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 260px;
  margin: 0 auto;
}

/* Account card */
.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);
  position: relative;
  overflow: hidden;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
  cursor: default;
}
.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(
    135deg,
    color-mix(in oklab, var(--active-soft) 80%, var(--surface-2)),
    var(--surface-2)
  );
}
.acc-card.is-signed-in::before {
  content: '';
  position: absolute;
  left: 0;
  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);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.acc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.acc-avatar-fallback {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
}

.acc-mid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.acc-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.acc-name {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acc-subhint {
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-presence {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  flex-shrink: 0;
}
.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);
}
.acc-presence--starting {
  color: #fcd34d;
  background: rgba(252, 211, 77, 0.12);
  border: 1px solid rgba(252, 211, 77, 0.3);
}

.acc-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.acc-ib {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--r-control) - 2px); /* 8px */
  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--danger:hover {
  color: var(--danger);
  border-color: var(--danger-line);
  background: var(--danger-soft);
}
.acc-ib.is-pressed {
  color: var(--accent-strong);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

/* --- 2e Launch-all row --- */
.acc-launch-all {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  padding: 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-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.acc-launch-all-sub {
  font-family: var(--font-sans);
  font-size: 10px;
  line-height: 1.45;
  color: var(--text-dim);
  margin-top: 2px;
}

.acc-launch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r-control);
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition:
    background 0.18s var(--ease),
    transform 0.15s var(--ease),
    box-shadow 0.18s var(--ease),
    opacity 0.18s var(--ease);
}
.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-all-btn {
  width: auto !important;
  flex-shrink: 0;
  padding-left: 12px;
  padding-right: 12px;
  white-space: nowrap;
}

/* --- 2f Footer bar --- */
.acc-footer-bar {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-top: 8px;
}
.acc-foot-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 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) {
  background: var(--accent-strong);
  color: var(--accent-ink);
}

/* --- 2g Accounts log --- */
.acc-log {
  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); /* 8px */
  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);
}

/* ============================================================
   Screen 3: Success
   ============================================================ */
.res {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.res.show { display: flex; }
.suc-ring {
  width: 56px;
  height: 56px;
  border-radius: var(--r-card);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--accent-line);
  box-shadow: 0 0 0 4px var(--accent-soft);
  margin-bottom: 10px;
}
.suc-ring-img { width: 38px; height: 38px; }
.suc {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 10px;
}
.suc-sub {
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 18px;
  min-height: 1em;
  white-space: pre-line;
}
.back-btn {
  width: 100%;
  padding: 11px 20px;
  border-radius: var(--r-control);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-soft);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 0.18s var(--ease),
    color 0.18s var(--ease),
    background 0.18s var(--ease),
    transform 0.15s var(--ease);
}
.back-btn:hover {
  border-color: var(--accent-line);
  color: var(--text);
  background: var(--accent-soft);
}
.back-btn:active { transform: translateY(1px); }

/* ============================================================
   Screen 4: Tools stub (hidden, never shown)
   ============================================================ */
.mrm-tools-stub { display: none !important; }

/* ============================================================
   Component: Primary action button (tools stub)
   ============================================================ */
.btn-glow { display: none; }
.btn-label { position: relative; z-index: 1; }
.btn-primary {
  position: relative;
  display: block;
  width: 100%;
  padding: 12px 20px;
  border-radius: var(--r-control);
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-1);
  margin-bottom: 6px;
  cursor: pointer;
  overflow: hidden;
  transition:
    background 0.18s var(--ease),
    box-shadow 0.18s var(--ease),
    transform 0.15s var(--ease);
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:active { transform: translateY(1px) scale(0.99); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-open-site { margin-bottom: 10px; }

/* ============================================================
   Component: Status log (main, tools stub)
   ============================================================ */
.msg-log {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
  padding: 11px 12px;
  min-height: 44px;
  border-radius: var(--r-control);
  border: 1px dashed var(--line-strong);
  background: color-mix(in oklab, var(--bg) 55%, transparent);
  color: var(--text-dim);
  margin-top: 12px;
  transition:
    border-color 0.18s var(--ease),
    background 0.18s var(--ease),
    color 0.18s var(--ease);
}
.msg-log.info { border-style: solid; border-color: var(--line-strong); color: var(--text-soft); }
.msg-log.error {
  border-style: solid;
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
}
.msg-log.success {
  border-style: solid;
  border-color: var(--active-line);
  background: var(--active-soft);
  color: var(--active);
}

/* ============================================================
   Component: Page context card (tools stub)
   ============================================================ */
.page-context { width: 100%; margin-bottom: 12px; }
.page-context.hidden { display: none; }
.page-context-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.page-context-thumb {
  width: 88px;
  height: 88px;
  border-radius: var(--r-control);
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.page-context-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.page-context-title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.45;
  color: var(--text);
  word-break: break-all;
}
.shell.action-only .page-context-card {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ============================================================
   Component: ID input field (tools stub)
   ============================================================ */
.lbl {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.inp-wrap { position: relative; margin-bottom: 12px; }
.inp-wrap::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20stroke='%239A9690'%20stroke-width='1.5'%20stroke-linecap='round'%3E%3Cpath%20d='M5%204.5h8'/%3E%3Cpath%20d='M5%208h8'/%3E%3Cpath%20d='M5%2011.5h8'/%3E%3Ccircle%20cx='2.5'%20cy='4.5'%20r='0.6'%20fill='%239A9690'%20stroke='none'/%3E%3Ccircle%20cx='2.5'%20cy='8'%20r='0.6'%20fill='%239A9690'%20stroke='none'/%3E%3Ccircle%20cx='2.5'%20cy='11.5'%20r='0.6'%20fill='%239A9690'%20stroke='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 16px 16px;
  pointer-events: none;
}
.inp {
  width: 100%;
  padding: 11px 12px 11px 36px;
  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: 13px;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
  box-sizing: border-box;
}
.inp:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.inp::placeholder { color: color-mix(in oklab, var(--text-dim) 60%, transparent); }
.inp-area {
  min-height: 120px;
  resize: vertical;
  line-height: 1.45;
  padding-left: 12px;
  margin-bottom: 12px;
}
.follower-inp {
  text-align: center;
  font-weight: 600;
  padding-left: 12px;
}

/* ============================================================
   Component: Follower preset block (tools stub)
   ============================================================ */
.follower-block { width: 100%; margin: 4px 0; }
.follower-block.hidden { display: none; }
.follower-hint {
  font-family: var(--font-sans);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 10px;
}
.follower-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 10px;
}
.chip {
  padding: 7px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    border-color 0.18s var(--ease),
    background 0.18s var(--ease),
    color 0.18s var(--ease),
    transform 0.15s var(--ease);
}
.chip:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--text);
}
.chip:active { transform: scale(0.98); }

/* ============================================================
   Component: Add account modal (JS-injected)
   ============================================================ */
.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(4px);
  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;
  display: flex;
  flex-direction: column;
  gap: 12px;
  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(--surface)
  );
  box-shadow: var(--shadow-2);
  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-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.acc-modal-text {
  font-family: var(--font-sans);
  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);
}
.acc-token-input {
  width: 100%;
  resize: vertical;
  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;
  font-weight: normal;
  line-height: 1.4;
  letter-spacing: 0;
  word-break: break-all;
  outline: none;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
  box-sizing: border-box;
}
.acc-token-input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.acc-token-input::placeholder { color: color-mix(in oklab, var(--text-dim) 50%, transparent); }
.acc-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.acc-btn-ghost {
  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.18s var(--ease),
    border-color 0.18s var(--ease),
    background 0.18s var(--ease);
}
.acc-btn-ghost:hover {
  color: var(--text);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.acc-btn-primary {
  flex: 1.5;
  padding: 10px 14px;
  border-radius: var(--r-control);
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition:
    background 0.18s var(--ease),
    transform 0.15s var(--ease),
    opacity 0.18s var(--ease);
}
.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; }
.acc-btn-primary.is-busy::after {
  content: '';
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(7, 16, 31, 0.25);
  border-top-color: var(--accent-ink);
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: -2px;
  animation: acc-spin 0.8s linear infinite;
}
@keyframes acc-spin { to { transform: rotate(360deg); } }

/* ============================================================
   Component: YouTube promo overlay (CSS only)
   ============================================================ */
.yt-promo-wrap {
  position: fixed;
  inset: 0;
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  transition: opacity 0.35s var(--ease);
}
.yt-promo-wrap.hide { opacity: 0; pointer-events: none; }
.yt-promo-card {
  width: 100%;
  max-width: 348px;
  max-height: calc(100% - 8px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 18px 16px 16px;
  border-radius: var(--r-card);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}
.yt-promo-title {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-align: center;
  margin-bottom: 10px;
}
.yt-promo-text {
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 14px;
}
.yt-promo-text strong { font-weight: 600; color: var(--text-soft); }
.btn-yt {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-control);
  border: 1px solid var(--line-strong);
  background: color-mix(in oklab, var(--surface) 80%, transparent);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  transition:
    border-color 0.18s var(--ease),
    background 0.18s var(--ease),
    transform 0.15s var(--ease);
}
.btn-yt:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.btn-yt:active { transform: translateY(1px); }
.yt-promo-hint {
  font-family: var(--font-sans);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-dim);
  text-align: center;
  margin: 4px 0 10px;
  min-height: 2.8em;
}
.yt-promo-skip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-dim);
  margin: 6px 0 14px;
  cursor: pointer;
}
.yt-promo-skip input[type="checkbox"] { accent-color: var(--accent); }
.yt-promo-continue { margin-top: 0; }
.yt-promo-continue:disabled { opacity: 0.45; cursor: not-allowed; }

/* ============================================================
   Component: Tab bar (CSS only, JS-injected)
   ============================================================ */
.mrm-tab-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: calc(var(--r-control) + 4px); /* 14px */
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-2) 85%, transparent);
  margin-bottom: 12px;
}
.mrm-tab {
  flex: 1;
  padding: 9px 10px;
  border-radius: var(--r-control);
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  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-count {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-dim);
  margin-left: 5px;
}
.mrm-tab.is-active .mrm-tab-count {
  background: color-mix(in oklab, var(--accent) 22%, transparent);
  color: inherit;
}
.mrm-pane { display: none; }
.mrm-pane.is-active { display: block; }

/* ============================================================
   Focus-visible rings (keyboard a11y) for visible controls
   ============================================================ */
.acc-add-btn:focus-visible,
.acc-ib:focus-visible,
.acc-launch-btn:focus-visible,
.acc-foot-btn:focus-visible,
.back-btn:focus-visible,
.acc-btn-ghost:focus-visible,
.acc-btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ldr::before { opacity: 0.45; }
  .ldr::after { opacity: 1; }
}
