/**
 * @file 9mm-pos-mgr.css
 * Semantic utility classes for the 9mm v3 Position Manager dashboard.
 * All custom classes are prefixed with `9mm-pos-mgr-` to avoid collisions.
 */

/* ── Tooltip cursor convention ───────────────────────────────────────────── */

/*  Any non-interactive element (div/span) with a non-empty `title` attribute
    shows the help cursor on hover. Interactive elements (button, a, input,
    select, textarea) keep their own cursor — only the inert ones flip.    */
div[title]:not([title=""]):hover,
span[title]:not([title=""]):hover {
  cursor: help;
}

/* ── Privacy Toggle ──────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-settings-item.\39 mm-pos-mgr-privacy-setting {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  line-height: 1;
}

.\39 mm-pos-mgr-privacy-setting input { display: none; }

.\39 mm-pos-mgr-privacy-icon {
  font-size: 21px;
  opacity: 0.6;
}

.\39 mm-pos-mgr-privacy-icon.\39 mm-pos-mgr-privacy-active {
  opacity: 1;
  text-decoration: line-through;
}

.\39 mm-pos-mgr-toggle-track {
  width: 54px;
  height: 27px;
  border-radius: 14px;
  background: rgb(124 252 0 / 20%);
  border: 1px solid rgb(124 252 0 / 30%);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
  margin-left: auto;
}

.\39 mm-pos-mgr-toggle-track::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  top: 3px;
  left: 3px;
  transition: transform 0.2s, background 0.2s;
}

.\39 mm-pos-mgr-privacy-setting input:checked ~ .\39 mm-pos-mgr-toggle-track,
.\39 mm-pos-mgr-browser-toggle input:checked ~ .\39 mm-pos-mgr-toggle-track {
  background: rgb(124 252 0 / 35%);
  border-color: var(--accent3);
}

.\39 mm-pos-mgr-privacy-setting input:checked ~ .\39 mm-pos-mgr-toggle-track::after,
.\39 mm-pos-mgr-browser-toggle input:checked ~ .\39 mm-pos-mgr-toggle-track::after {
  transform: translateX(27px);
  background: var(--accent3);
  box-shadow: 0 0 6px var(--accent3);
}

.\39 mm-pos-mgr-privacy-blur {
  filter: blur(8px);
  user-select: none;
  transition: filter 0.2s;
}

/* ── Privacy Sub-Form (under master Privacy Mode toggle) ──────────────────── */

.\39 mm-pos-mgr-privacy-group {
  border-radius: 6px;
}

.\39 mm-pos-mgr-privacy-group:hover {
  background: rgb(255 255 255 / 8%);
  color: #fff;
}

.\39 mm-pos-mgr-privacy-group:hover .\39 mm-pos-mgr-settings-item {
  color: #fff;
}

.\39 mm-pos-mgr-privacy-group .\39 mm-pos-mgr-settings-item:hover {
  background: transparent;
}

.\39 mm-pos-mgr-privacy-subform {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 8px 8px 28px;
  margin: 0;
  border: 0;
  cursor: default;
  background: transparent;
}

.\39 mm-pos-mgr-privacy-subitem {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  line-height: 1.2;
}

.\39 mm-pos-mgr-privacy-subitem input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.\39 mm-pos-mgr-privacy-threshold-row {
  cursor: default;
  padding-left: 22px;
}

.\39 mm-pos-mgr-privacy-threshold-input {
  width: 60px;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card-bg, #0d1b2a);
  color: var(--text);
  font-family: "Space Mono", monospace;
  font-size: 13px;
  text-align: right;
}

.\39 mm-pos-mgr-logo-buy {
  display: flex;
  flex-direction: column;
  align-items: center;
}


/* ── Display & Visibility ─────────────────────────────────────────────────── */

.\39 mm-pos-mgr-initially-hidden {
  display: none;
}

.\39 mm-pos-mgr-disabled {
  opacity: 0.38;
  pointer-events: none;
}

.\39 mm-pos-mgr-subtle {
  opacity: 0.8;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-input-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.\39 mm-pos-mgr-offset-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 1;
}

.\39 mm-pos-mgr-offset-row {
  flex-wrap: wrap;
  row-gap: 9px;
}

.\39 mm-pos-mgr-ml-sm {
  margin-left: 9px;
}

.\39 mm-pos-mgr-action-row {
  display: flex;
  gap: 12px;
  margin-top: 21px;
}

.\39 mm-pos-mgr-btn-row {
  display: flex;
  gap: 15px;
  margin-top: 12px;
}

.\39 mm-pos-mgr-flex-fill {
  flex: 1;
}

.\39 mm-pos-mgr-btn-compact {
  flex: 0 0 auto;
  width: auto;
  padding: 17px 24px;
}

.\39 mm-pos-mgr-table-scroll {
  overflow-x: auto;
  flex: 1;
}

.\39 mm-pos-mgr-scrollable-card {
  overflow-y: visible;
}

/* ── Text & Color ─────────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-text-muted {
  color: var(--muted);
}

.\39 mm-pos-mgr-text-primary {
  color: var(--text);
}

.\39 mm-pos-mgr-text-accent {
  color: var(--accent);
}



.\39 mm-pos-mgr-text-accent3 {
  color: var(--accent3);
}

.\39 mm-pos-mgr-text-nft {
  color: #c471ed;
}

.\39 mm-pos-mgr-text-warn {
  color: var(--warn);
}

.\39 mm-pos-mgr-text-danger {
  color: var(--danger);
}

.\39 mm-pos-mgr-secret-key {
  color: var(--danger);
  font-size: 14px;
}

.\39 mm-pos-mgr-seed-phrase {
  color: var(--warn);
}

.\39 mm-pos-mgr-text-muted-sm {
  font-size: 20px;
  font-family: Urbanist, sans-serif;
  color: var(--muted);
}

.\39 mm-pos-mgr-text-muted-sm a {
  color: var(--accent);
}

.\39 mm-pos-mgr-text-accent-sm {
  font-size: 15px;
  color: var(--accent);
}

.\39 mm-pos-mgr-text-md {
  font-size: 17px;
}

.\39 mm-pos-mgr-text-left {
  text-align: left;
}

.\39 mm-pos-mgr-text-right {
  text-align: right;
}

.\39 mm-pos-mgr-mb-6 {
  margin-bottom: 9px;
}

/* ── Panel Titles ────────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-panel-title {
  font-family: Urbanist, sans-serif;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 2.3px;
}

/* ── Descriptive / Non-Critical Text ─────────────────────────────────────── */

.\39 mm-pos-mgr-sans {
  font-family: Urbanist, sans-serif;
}

/* ── Hints & Help Text ────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-hint {
  font-size: 14px;
  color: var(--muted);
  font-family: Urbanist, sans-serif;
  margin-top: 5px;
}

.\39 mm-pos-mgr-micro-hint {
  font-size: 18px;
  color: var(--muted);
  font-family: Urbanist, sans-serif;
  margin-top: 3px;
}

.\39 mm-pos-mgr-empty-msg {
  font-size: 15px;
  color: var(--muted);
  padding: 12px 0;
}

.\39 mm-pos-mgr-table-empty {
  text-align: center;
  color: var(--muted);
  padding: 18px;
}

/* ── Spacing ──────────────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-mt-xs {
  margin-top: 6px;
}

.\39 mm-pos-mgr-mt-sm {
  margin-top: 9px;
}

.\39 mm-pos-mgr-mt-md {
  margin-top: 12px;
}

.\39 mm-pos-mgr-mt-lg {
  margin-top: 15px;
}

.\39 mm-pos-mgr-mt-xl {
  margin-top: 18px;
}

.\39 mm-pos-mgr-mt-2xl {
  margin-top: 21px;
}

.\39 mm-pos-mgr-ml-auto {
  margin-left: auto;
}

/* ── Modal Variants ───────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-modal-md {
  max-width: 840px;
}

.\39 mm-pos-mgr-modal-sm {
  max-width: 660px;
}

.\39 mm-pos-mgr-modal-sm .modal-logo-icon {
  font-size: 45px;
  height: auto;
  margin-top: -12px;
}

.\39 mm-pos-mgr-modal-note {
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.5;
}

.\39 mm-pos-mgr-modal-close-btn {
  width: auto;
  margin-left: auto;
  margin-top: 0;
  flex-shrink: 0;
}

/* ── Section Titles ───────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-section-title {
  margin-top: 15px;
  margin-bottom: 12px;
  font-size: 21px;
}

.\39 mm-pos-mgr-section-title-spaced {
  margin-top: 21px;
  margin-bottom: 12px;
  font-size: 21px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-btn-sm {
  font-family: "Space Mono", monospace;
  font-size: 18px;
  height: 53px;
  padding: 0 15px;
  border: 1px solid rgb(0 229 255 / 20%);
  border-radius: 8px;
  background: rgb(0 229 255 / 7%);
  color: var(--accent);
  cursor: pointer;
}

.\39 mm-pos-mgr-eye-btn {
  line-height: 1;
  padding: 6px 12px;
}

.\39 mm-pos-mgr-btn-sm:disabled {
  opacity: 0.5;
  cursor: help;
  pointer-events: all;
}

.\39 mm-pos-mgr-btn-sm:hover:not(:disabled) {
  background: rgb(0 229 255 / 15%);
}

.\39 mm-pos-mgr-btn-danger {
  background: var(--danger);
}

/* ── Info & Notice Boxes ──────────────────────────────────────────────────── */

.\39 mm-pos-mgr-info-box {
  font-size: 15px;
  color: var(--accent);
  padding: 11px 14px;
  background: rgb(0 229 255 / 4%);
  border: 1px solid rgb(0 229 255 / 12%);
  border-radius: 9px;
  margin-bottom: 15px;
}

.\39 mm-pos-mgr-notice-box {
  font-size: 15px;
  color: var(--muted);
  padding: 11px 14px;
  background: rgb(255 59 92 / 5%);
  border: 1px solid rgb(255 59 92 / 15%);
  border-radius: 9px;
  margin-bottom: 15px;
}

/* ── Confirm Dialog ───────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-confirm-body {
  font-size: 17px;
  color: var(--fg);
  font-family: Urbanist, sans-serif;
  line-height: 1.6;
  padding: 18px 0;
}

.\39 mm-pos-mgr-confirm-list {
  margin: 12px 0 0 24px;
  padding: 0;
}

.\39 mm-pos-mgr-confirm-footer {
  margin-top: 15px;
  font-family: Urbanist, sans-serif;
  color: var(--muted);
}

/* ── Wallet Strip ─────────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-last-check {
  margin-left: auto;
  font-size: 15px;
  color: var(--muted);
}

/* ── Import+LP Tab ────────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-or-divider {
  font-size: 15px;
  margin-top: 6px;
  color: var(--muted);
}

.\39 mm-pos-mgr-label-spaced {
  margin-top: 9px;
}

.\39 mm-pos-mgr-input-spaced {
  margin-top: 6px;
}

/* ── Optimizer Controls ───────────────────────────────────────────────────── */

.\39 mm-pos-mgr-input-narrow {
  max-width: 240px;
}

.\39 mm-pos-mgr-opt-auto-row {
  border: none;
  padding: 0;
  margin: 0;
}

.\39 mm-pos-mgr-opt-label {
  font-size: 17px;
  color: var(--muted);
  margin-right: 12px;
}

.\39 mm-pos-mgr-toggle-value {
  font-size: 17px;
  margin-left: 9px;
}

/* ── Range Visual ─────────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-range-start {
  left: 0;
}

.\39 mm-pos-mgr-range-end {
  left: 100%;
  font-size: 1.6em;
  transform: translateX(-100%);
  bottom: -3px;
  line-height: 1;
}

/* ── Trigger Hint ─────────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-trigger-hint {
  font-size: 21px;
  color: var(--muted);
}

/* ── Token Label with Copy ───────────────────────────────────────────────── */

/* ── Realized Gains ──────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-realized-hint {
  font-size: 18px;
  color: var(--muted);
  font-family: Urbanist, sans-serif;
  margin-top: 3px;
  margin-bottom: 6px;
}

.\39 mm-pos-mgr-pnl-breakdown {
  margin-top: 16px;
  font-size: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.\39 mm-pos-mgr-pnl-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.\39 mm-pos-mgr-pnl-value {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.\39 mm-pos-mgr-pnl-value.pos {
  color: var(--accent3);
}

.\39 mm-pos-mgr-pnl-value.neg {
  color: var(--danger);
}

.\39 mm-pos-mgr-pnl-value.neu {
  color: var(--text);
}

.\39 mm-pos-mgr-edit-link {
  cursor: pointer;
  color: var(--accent);
  font-size: 15px;
  opacity: 0.7;
  margin-left: 6px;
}

.\39 mm-pos-mgr-edit-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.\39 mm-pos-mgr-price-override-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}

.\39 mm-pos-mgr-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 12px 0;
  cursor: pointer;
}

.\39 mm-pos-mgr-price-override-input {
  display: flex;
  align-items: center;
  gap: 6px;
}

.\39 mm-pos-mgr-price-override-input input {
  width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: "Space Mono", monospace;
  font-size: 18px;
}


/* ── KPI Divider ───────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-kpi-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 15px 0 12px;
}

/* ── Sync Status ────────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-sync-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 21px;
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1px solid rgb(255 255 255 / 6%);
}

.\39 mm-pos-mgr-sync-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 150px;
  height: 53px;
  padding: 0;
  border-radius: 1499px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.8px;
  background: rgb(255 184 0 / 10%);
  color: var(--warn);
  border: 1px solid rgb(255 184 0 / 20%);
  animation: sync-pulse 2s ease-in-out infinite;
}

.\39 mm-pos-mgr-sync-badge.done {
  background: rgb(124 252 0 / 10%);
  color: var(--accent3);
  border-color: rgb(124 252 0 / 20%);
  animation: none;
}

@keyframes sync-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.\39 mm-pos-mgr-sources-badge {
  width: auto;
  min-width: 120px;
  padding: 0 15px;
  background: rgb(124 252 0 / 10%);
  color: var(--accent3);
  border-color: rgb(124 252 0 / 20%);
  animation: none;
}

/* ── Donate modal ────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-donate-box {
  background: var(--bg2);
  border: 1px solid var(--accent);
  border-radius: 21px;
  max-width: 720px;
  width: 90%;
  margin: auto;
  padding: 36px;
  text-align: center;
  box-shadow: 0 0 60px rgb(0 229 255 / 12%);
}

.\39 mm-pos-mgr-donate-header {
  font-family: Urbanist, sans-serif;
  font-size: 24px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2.3px;
  color: var(--accent);
  margin-bottom: 24px;
}

.\39 mm-pos-mgr-donate-body {
  font-size: 20px;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 30px;
}

.\39 mm-pos-mgr-donate-addr-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.\39 mm-pos-mgr-donate-addr {
  display: inline-flex;
  align-items: center;
  cursor: text;
  user-select: all;
  font-size: 17px;
  word-break: break-all;
}

.\39 mm-pos-mgr-copy-icon.\39 mm-pos-mgr-donate-copy {
  font-size: 39px;
  margin-left: 0;
}

.\39 mm-pos-mgr-donate-thanks {
  margin-top: 30px;
}

/* ── About modal ─────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-about-box {
  max-width: 660px;
}

.\39 mm-pos-mgr-about-body {
  font-size: 20px;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 30px;
}

.\39 mm-pos-mgr-about-logo {
  text-align: center;
  margin-bottom: 30px;
}

.\39 mm-pos-mgr-about-title {
  font-family: Rye, Urbanist, sans-serif;
  font-size: 36px;
  font-weight: 400;
  letter-spacing: 0.8px;
  color: var(--fg);
}

.\39 mm-pos-mgr-about-subtitle {
  font-size: 17px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 6px;
}

.\39 mm-pos-mgr-about-update {
  color: var(--accent3);
  font-weight: 700;
}

.\39 mm-pos-mgr-about-easter-egg {
  margin-top: 14pt;
  margin-bottom: 14pt;
}

.\39 mm-pos-mgr-about-body a {
  color: var(--accent);
  text-decoration: none;
}

.\39 mm-pos-mgr-about-body a:hover {
  text-decoration: underline;
}

/* ── IL/G debug popover ────────────────────────────────────────────────── */

.\39 mm-pos-mgr-il-info-btn {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  font-size: 15px;
  border-radius: 50%;
  background: rgb(255 255 255 / 10%);
  color: var(--muted);
  text-transform: lowercase;
  cursor: pointer;
  margin-left: 9px;
  vertical-align: middle;
  padding-left: 1px;
  padding-bottom: 1px;
}

.\39 mm-pos-mgr-il-info-btn:hover {
  background: #00e5ff;
  color: #27303a;
}

.\39 mm-pos-mgr-kpi-val-wrap {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.\39 mm-pos-mgr-kpi-info {
  flex-shrink: 0;
  position: relative;
  top: -5px;
}

.\39 mm-pos-mgr-il-info-btn.\39 mm-pos-mgr-info-accent2 {
  color: var(--accent2);
}

.\39 mm-pos-mgr-il-info-btn.\39 mm-pos-mgr-info-accent2:hover {
  background: var(--accent2);
  color: #27303a;
}

.\39 mm-pos-mgr-info-dot {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  font-size: 15px;
  border-radius: 50%;
  background: rgb(255 255 255 / 10%);
  color: var(--muted);
  text-transform: lowercase;
  cursor: help;
  margin-left: 9px;
  vertical-align: middle;
  padding-left: 1px;
  padding-bottom: 1px;
}

.\39 mm-pos-mgr-info-dot:hover {
  color: var(--accent);
}

.\39 mm-pos-mgr-info-wrap {
  position: relative;
  display: inline-block;
}

.\39 mm-pos-mgr-info-popover {
  display: none;
  position: absolute;
  top: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px 18px;
  font-size: 18px;
  font-weight: 400;
  color: #00e5ff;
  white-space: normal;
  width: 330px;
  text-align: left;
  box-shadow: 0 6px 18px rgb(0 0 0 / 40%);
  pointer-events: none;
}

.\39 mm-pos-mgr-info-wrap:hover .\39 mm-pos-mgr-info-popover {
  display: block;
}

/* "Above" variant: flip vertical position AND anchor the popover's
 * left edge to the icon so it extends rightward.
 *
 * History: the base class centres on the icon (left: 50%;
 * transform: translateX(-50%)). When the hint text wraps and pushes
 * the icon to start a new line near the modal's left padding, a
 * centred 330px popover's left half extends past the modal's left
 * edge and `.modal { overflow-x: hidden; }` clips the text. An earlier
 * `right: 0; left: auto` variant had the mirror of this problem when
 * the icon was near the right edge. Anchoring the left edge to the
 * icon works for this site's only usage (rebalance-range modal hint),
 * where the icon follows a long wrapping line and lands at the left
 * side of the modal body. */
.\39 mm-pos-mgr-info-popover-above {
  top: auto;
  bottom: calc(100% + 9px);
  left: 0;
  transform: none;
}

/* "Right-anchored" variant: anchor the popover's right edge to the
 * icon so the popover extends leftward. Use when the icon sits near
 * the right edge of its container (e.g., the Residual column header
 * in the Per-Day P&L table), where the default centred popover would
 * overflow and get clipped by the card. */
.\39 mm-pos-mgr-info-popover-right {
  left: auto;
  right: 0;
  transform: none;
}

.\39 mm-pos-mgr-il-popover {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(0 0 0 / 60%);
}

.\39 mm-pos-mgr-il-popover-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 30px 36px;
  max-width: 630px;
  width: 90vw;
  font-size: 20px;
}

.\39 mm-pos-mgr-il-popover-inner.\39 mm-pos-mgr-il-popover-wide {
  max-width: 726px;
}

.\39 mm-pos-mgr-il-heading {
  font-weight: 700;
  font-size: 21px;
  margin-bottom: 18px;
  color: var(--accent);
}

.\39 mm-pos-mgr-il-popover-p {
  margin: 0.8em 0;
}

.\39 mm-pos-mgr-il-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
}

.\39 mm-pos-mgr-il-table td {
  padding: 5px 0;
}

.\39 mm-pos-mgr-il-table td:last-child {
  text-align: right;
  font-family: var(--mono);
}

.\39 mm-pos-mgr-il-sep td {
  border-top: 1px solid var(--border);
  padding-top: 9px;
}

.\39 mm-pos-mgr-il-result td {
  font-weight: 700;
  padding-top: 6px;
}

.\39 mm-pos-mgr-il-formula {
  font-size: 17px;
  color: var(--muted);
  margin-bottom: 21px;
  font-family: var(--mono);
}

.\39 mm-pos-mgr-il-now-vs-hodl {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding-top: 18px;
  padding-bottom: 6px;
  margin-bottom: 21px;
}

.\39 mm-pos-mgr-il-ok-btn {
  display: block;
  margin: 0 auto;
  padding: 9px 42px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: rgb(0 229 255 / 10%);
  color: var(--accent);
  font-size: 20px;
  cursor: pointer;
}

.\39 mm-pos-mgr-il-ok-btn:hover {
  background: rgb(0 229 255 / 20%);
}

.\39 mm-pos-mgr-header-logo {
  height: 68px;
  width: auto;
}

.\39 mm-pos-mgr-pchain-logo {
  height: 62px;
}

.\39 mm-pos-mgr-logo-on {
  font-size: 18px;
  color: var(--muted);
  font-style: italic;
  align-self: center;
  margin-right: 9px;
}

.\39 mm-pos-mgr-range-pct-row {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  padding: 0 6px;
}

.\39 mm-pos-mgr-range-pct {
  font-family: Urbanist, sans-serif;
  font-size: 18px;
  color: var(--muted);
}

.\39 mm-pos-mgr-kpi-pct-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.\39 mm-pos-mgr-kpi-pct {
  font-size: 21px;
  font-weight: 500;
  opacity: 0.75;
  margin-left: auto;
}

.\39 mm-pos-mgr-pos-status {
  font-size: 17px;
  font-weight: 600;
  padding: 1px 9px;
  border-radius: 5px;
  vertical-align: middle;
}

.\39 mm-pos-mgr-pos-status.closed {
  background: rgb(158 158 158 / 20%);
  color: #9e9e9e;
}

.\39 mm-pos-mgr-pos-status.active {
  background: rgb(0 200 83 / 15%);
  color: #00c853;
}

/* ── Range Boundary Lines ───────────────────────────────────────────────── */

.\39 mm-pos-mgr-range-line {
  position: absolute;
  top: 50%;
  width: 3px;
  height: 45px;
  background: var(--danger);
  box-shadow: 0 0 9px var(--danger);
  transform: translate(-50%, -50%);
  z-index: 5;
  transition: left 0.4s;
  cursor: help;
}

/* ── Error Modal ────────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 70%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 9999;
  padding: 30px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.\39 mm-pos-mgr-modal {
  background: var(--bg2);
  border: 1px solid var(--danger);
  border-radius: 15px;
  padding: 36px 48px;
  max-width: min(780px, 90vw);
  text-align: center;
  color: var(--text);
  font-size: 18px;
  margin: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.\39 mm-pos-mgr-modal h3 {
  color: var(--accent);
  margin: 0 0 18px;
  font-size: 21px;
}

.\39 mm-pos-mgr-modal-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  text-align: left;
  overflow-wrap: break-word;
  word-break: normal;
}

.\39 mm-pos-mgr-modal p {
  margin: 12px 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.\39 mm-pos-mgr-modal-close {
  margin-top: 24px;
  padding: 9px 36px;
  background: rgb(255 107 53 / 15%);
  border: 1px solid var(--danger);
  border-radius: 8px;
  color: var(--danger);
  cursor: pointer;
  font-family: 'Space Mono', monospace;
  font-size: 17px;
}

.\39 mm-pos-mgr-modal-close:hover {
  background: rgb(255 107 53 / 25%);
}

/* ── Param Help Modal (educational, accent-blue) ─────────────────────── */

.\39 mm-pos-mgr-modal.\39 mm-pos-mgr-modal-help {
  border-color: var(--accent);
  text-align: left;
}

.\39 mm-pos-mgr-modal-help h3 {
  color: var(--accent);
}

.\39 mm-pos-mgr-modal-help .\39 mm-pos-mgr-modal-close {
  background: rgb(0 229 255 / 10%);
  border: 1px solid var(--accent);
  border-radius: 9px;
  color: var(--accent);
  align-self: center;
  padding: 9px 42px;
}

.\39 mm-pos-mgr-modal-help .\39 mm-pos-mgr-modal-close:hover {
  background: rgb(0 229 255 / 20%);
}

.\39 mm-pos-mgr-help-subtitle {
  color: var(--muted);
  font-size: 18px;
  font-style: italic;
  margin: -12px 0 18px;
}

.\39 mm-pos-mgr-help-heading {
  color: var(--accent);
  font-family: Urbanist, sans-serif;
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 24px 0 6px;
}

.\39 mm-pos-mgr-help-heading:first-child {
  margin-top: 0;
}

.\39 mm-pos-mgr-pnl-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 20px;
}

.\39 mm-pos-mgr-pnl-breakdown-table td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
}

.\39 mm-pos-mgr-pnl-breakdown-table td:last-child {
  text-align: right;
  font-family: 'Space Mono', monospace;
}

.\39 mm-pos-mgr-pnl-breakdown-total td {
  border-top: 3px solid var(--accent);
  border-bottom: none;
  color: var(--accent);
}

.\39 mm-pos-mgr-modal-help a {
  color: var(--accent);
  text-decoration: none;
}

.\39 mm-pos-mgr-modal-help a:hover {
  text-decoration: underline;
}

.\39 mm-pos-mgr-modal-caution {
  border-color: var(--warn);
}

.\39 mm-pos-mgr-modal-caution h3 {
  color: var(--accent);
}

.\39 mm-pos-mgr-modal-caution .\39 mm-pos-mgr-modal-close {
  background: rgb(255 184 0 / 15%);
  border-color: var(--warn);
  color: var(--warn);
}

.\39 mm-pos-mgr-modal-caution .\39 mm-pos-mgr-modal-close:hover {
  background: rgb(255 184 0 / 25%);
}

.\39 mm-pos-mgr-scan-help {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  font-size: 15px;
  border-radius: 50%;
  background: rgb(255 255 255 / 10%);
  color: var(--text-dim);
  cursor: help;
  margin-left: 6px;
  vertical-align: middle;
}

/* ── Token Label with Copy ───────────────────────────────────────────────── */

.\39 mm-pos-mgr-token-copy-btn {
  cursor: pointer;
  opacity: 0.5;
  font-size: 24px;
  margin-left: auto;
  border: none;
  background: none;
  color: var(--muted);
  padding: 0;
  align-self: flex-start;
  position: relative;
  top: -3px;
}

.stat-label:has(.\39 mm-pos-mgr-token-copy-btn) {
  display: flex;
  align-items: flex-start;
}

.\39 mm-pos-mgr-token-copy-btn:hover,
.\39 mm-pos-mgr-token-copy-btn:active {
  opacity: 1;
  color: var(--accent);
}

/* Residual row in token stat-items: inline to the right of the big
 * value, sharing the same baseline so the panel height does not grow. */
.\39 mm-pos-mgr-stat-val-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.\39 mm-pos-mgr-stat-residual {
  font-size: 15px;
  color: var(--muted);
}

/* Info-dot's default margin-left: 9px would add space between the colon
 * and the dot inside the residual row. Zero it so the dot sits directly
 * adjacent to "Residual:", with a single space char before the number. */
.\39 mm-pos-mgr-stat-residual .\39 mm-pos-mgr-info-dot {
  margin-left: 0;
}

/* ── Copy Icon (inline) ─────────────────────────────────────────────────── */

.\39 mm-pos-mgr-copy-icon {
  cursor: pointer;
  opacity: 0.5;
  font-size: 24px;
  margin-left: 6px;
  color: var(--muted);
  position: relative;
  top: -3px;
}

.\39 mm-pos-mgr-copy-icon:hover,
.\39 mm-pos-mgr-copy-icon:active {
  opacity: 1;
  color: var(--accent);
}

/* ── Help Popover ────────────────────────────────────────────────────────── */

.\39 mm-pos-mgr-help-popover {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 100;
  width: 548px;
  margin-top: 12px;
  padding: 24px;
  background: var(--card);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgb(0 0 0 / 40%);
}

.\39 mm-pos-mgr-help-popover.\39 mm-pos-mgr-visible {
  display: block;
}

.\39 mm-pos-mgr-help-title {
  font-weight: 700;
  font-size: 21px;
  margin-top: 18px;
  margin-bottom: 15px;
}

.\39 mm-pos-mgr-help-title:first-child {
  margin-top: 0;
}

.\39 mm-pos-mgr-help-list {
  margin: 0;
  padding: 0 0 0 27px;
  font-family: Urbanist, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--muted);
}

.\39 mm-pos-mgr-help-list li {
  margin-bottom: 9px;
}

.\39 mm-pos-mgr-help-text {
  margin: 6px 0 0;
  font-size: 20px;
  font-family: Urbanist, sans-serif;
  line-height: 1.5;
  color: var(--muted);
}

.\39 mm-pos-mgr-info-icon {
  font-size: calc(1em + 6px);
  vertical-align: middle;
}

.\39 mm-pos-mgr-help-close {
  margin-top: 18px;
  width: 100%;
  height: 53px;
  border: 1px solid rgb(0 229 255 / 20%);
  border-radius: 8px;
  background: rgb(0 229 255 / 7%);
  color: var(--accent);
  cursor: pointer;
  font-family: "Space Mono", monospace;
  font-size: 18px;
}

.\39 mm-pos-mgr-help-close:hover {
  background: rgb(0 229 255 / 15%);
}

/* ── Settings Popover ────────────────────────────────────────────────── */

.\39 mm-pos-mgr-icon-btn {
  background: transparent;
  border: none;
  padding: 6px 9px;
  cursor: pointer;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  opacity: 0.7;
}

.\39 mm-pos-mgr-icon-btn:hover {
  opacity: 1;
}

.\39 mm-pos-mgr-settings-wrap {
  position: relative;
}

.\39 mm-pos-mgr-settings-popover {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 100;
  min-width: 390px;
  margin-top: 12px;
  padding: 9px;
  background: var(--card);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgb(0 0 0 / 40%);
}

.\39 mm-pos-mgr-settings-popover.\39 mm-pos-mgr-visible {
  display: block;
}

.\39 mm-pos-mgr-settings-item {
  display: block;
  width: 100%;
  padding: 12px 18px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: "Space Mono", monospace;
  font-size: 18px;
  text-align: left;
  cursor: pointer;
}

.\39 mm-pos-mgr-settings-item:hover {
  background: rgb(255 255 255 / 8%);
  color: #fff;
}

.\39 mm-pos-mgr-settings-key-row {
  cursor: default;
}

.\39 mm-pos-mgr-settings-key-row label {
  display: block;
  margin-bottom: 6px;
}

.\39 mm-pos-mgr-settings-key-wrap {
  display: flex;
  gap: 6px;
}

.\39 mm-pos-mgr-settings-key-input {
  flex: 1;
  padding: 6px 9px 6px 17px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--card-bg, #0d1b2a);
  color: var(--text);
  font-family: "Space Mono", monospace;
  font-size: 17px;
}

.\39 mm-pos-mgr-settings-key-save {
  padding: 6px 15px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: transparent;
  color: var(--accent);
  font-family: "Space Mono", monospace;
  font-size: 17px;
  cursor: pointer;
}

.\39 mm-pos-mgr-settings-key-save:hover {
  background: var(--accent);
  color: #000;
}

/* ── Closed-Position History Banner ────────────────────────────────────── */


.\39 mm-pos-mgr-btn-small {
  padding: 6px 18px;
  font-size: 17px;
  border: 1px solid rgb(255 193 7 / 40%);
  border-radius: 6px;
  background: rgb(255 193 7 / 15%);
  color: #ffc107;
  cursor: pointer;
  white-space: nowrap;
  font-family: 'Space Mono', monospace;
}

.\39 mm-pos-mgr-btn-small:hover {
  background: rgb(255 193 7 / 25%);
}

.\39 mm-pos-mgr-disclaimer-license {
  margin-top: 15px;
  font-size: 17px;
  color: var(--muted);
  text-align: center;
}

.\39 mm-pos-mgr-disclaimer-license a {
  color: var(--accent);
  text-decoration: none;
}

.\39 mm-pos-mgr-disclaimer-license a:hover {
  text-decoration: underline;
}

/* ── Manage Toggle + Badge (NFT bar) ────────────────────────────────────── */

.\39 mm-pos-mgr-manage-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.\39 mm-pos-mgr-manage-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 53px;
  width: 330px;
  padding: 0 21px;
  border-radius: 1499px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: rgb(255 184 0 / 10%);
  color: var(--warn);
  border: 1px solid rgb(255 184 0 / 20%);
}

.\39 mm-pos-mgr-manage-badge.managed {
  background: rgb(124 252 0 / 10%);
  color: var(--accent3);
  border: 1px solid rgb(124 252 0 / 20%);
}

.\39 mm-pos-mgr-manage-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent3);
  margin-right: 9px;
  animation: blink 2s infinite;
}



.\39 mm-pos-mgr-nft-bar {
  font-size: 21px;
  font-weight: 700;
  flex-direction: column;
  gap: 3px;
  position: relative;
}

.\39 mm-pos-mgr-nft-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* Fee-Tier always wraps onto its own line under Pool (both views).
   flex-basis:100% forces the break inside the wrapping .nft-row. */
.\39 mm-pos-mgr-nft-fee-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-basis: 100%;
}

/* LP-provider label + its leading dot separator, shown to the right
   of Fee Tier when the NFT contract is keyed in nft-providers.json. */
.\39 mm-pos-mgr-nft-provider-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.\39 mm-pos-mgr-nft-sep {
  color: var(--muted);
  font-weight: 400;
}

/* Per-token ellipsis for the NFT-panel Pool line. Default (three-
   column view, > 1980px) allows longer symbols; the narrow override
   inside the @media block below clips to the single-column budget. */
.\39 mm-pos-mgr-nft-bar-tok {
  display: inline-block;
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.\39 mm-pos-mgr-nft-bar .\39 mm-pos-mgr-nft-row:first-child {
  margin-top: -8px;
}

.\39 mm-pos-mgr-nft-bar .\39 mm-pos-mgr-nft-row:nth-child(2) {
  font-size: 18px;
  margin-top: 3px;
}

/* Pushes the Manage button (and the badge that follows it) to the
   right edge of the NFT# row, saving a whole extra row. */
.\39 mm-pos-mgr-manage-toggle-btn {
  margin-left: auto;
}

.\39 mm-pos-mgr-nft-detail-btn {
  position: absolute;
  top: 15px;
  right: 21px;
}

.\39 mm-pos-mgr-detail-panel {
  background: var(--bg3, #131d28);
  border: 1px solid var(--border, #1e2d3d);
  border-radius: 12px;
  padding: 15px 21px;
  margin: 0 15px 9px;
}

.\39 mm-pos-mgr-detail-panel.hidden {
  display: none;
}

.\39 mm-pos-mgr-modal-btn-row {
  text-align: center;
  margin-top: 18px;
}

.\39 mm-pos-mgr-pool-detail-val {
  font-size: 20px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.\39 mm-pos-mgr-pool-details-list {
  margin: 0 0 21px;
}

.\39 mm-pos-mgr-pool-details-list dt {
  display: block;
  font-size: 20px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 9px;
}

.\39 mm-pos-mgr-pool-details-list dd {
  margin: 0 0 21px;
}

.\39 mm-pos-mgr-pool-details-list dd:last-of-type {
  margin-bottom: 0;
}

.\39 mm-pos-mgr-monospace {
  font-family: "Space Mono", monospace;
  word-break: break-all;
  font-size: 20px;
}

.\39 mm-pos-mgr-pool-details-list .\39 mm-pos-mgr-copy-icon {
  font-size: 48px;
}

/* ── Pool Details: row layout (details list + Chart Links aside) ───────── */

.\39 mm-pos-mgr-pool-details-row {
  display: flex;
  align-items: flex-start;
  gap: 36px;
}

.\39 mm-pos-mgr-pool-details-row .\39 mm-pos-mgr-pool-details-list {
  flex: 1 1 auto;
  min-width: 0;
}

.\39 mm-pos-mgr-pool-details-charts {
  flex: 0 0 auto;
  text-align: right;
  margin-left: auto;
}

/* Visually align the Chart Links heading with "Position Type" — the
   first <dt> in the details list. The <dt> uses the same 20px size and
   muted colour, so we mirror it here and zero out the default <h3>
   margins so both headings sit on the same baseline. */
.\39 mm-pos-mgr-pool-details-charts-title {
  display: block;
  margin: 0 0 9px;
  font-size: 20px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: inherit;
}

.\39 mm-pos-mgr-pool-details-charts-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.\39 mm-pos-mgr-pool-details-charts-list li {
  margin-bottom: 9px;
}

.\39 mm-pos-mgr-pool-details-charts-list li:last-child {
  margin-bottom: 0;
}

.\39 mm-pos-mgr-pool-details-charts-list a {
  font-size: 20px;
  color: var(--accent);
  text-decoration: underline;
}

.\39 mm-pos-mgr-pool-details-charts-list a[aria-disabled="true"] {
  color: var(--muted);
  text-decoration: none;
  pointer-events: none;
}

/* ── Full-Range Labels ──────────────────────────────────────────────────── */

.\39 mm-pos-mgr-fullrange-labels {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 54px;
  margin-top: -44px;
  padding: 0 3px;
}

.\39 mm-pos-mgr-fullrange-zero {
  font-size: 24px;
  font-weight: 700;
  color: var(--muted);
  position: relative;
  top: -3px;
}

.\39 mm-pos-mgr-fullrange-inf {
  font-size: 54px;
  line-height: 1;
  color: var(--muted);
}

/* ── Trigger Row (2-line layout) ────────────────────────────────────────── */

.\39 mm-pos-mgr-trigger-grid {
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
}

.\39 mm-pos-mgr-trigger-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.\39 mm-pos-mgr-trigger-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.\39 mm-pos-mgr-trigger-badge {
  display: inline-flex;
  align-items: center;
  height: 53px;
  padding: 0 21px;
  border-radius: 1499px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: rgb(124 252 0 / 10%);
  color: var(--accent3);
  border: 1px solid rgb(124 252 0 / 20%);
}

/* ── Toggle Switches (Position Browser) ─────────────────────────────────── */

.\39 mm-pos-mgr-justify-end {
  justify-content: flex-end;
}

.\39 mm-pos-mgr-browser-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.\39 mm-pos-mgr-browser-toggle input { display: none; }

/* ── Managed Position Dot (pulsing green) ───────────────────────────────── */

.\39 mm-pos-mgr-managed-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent3);
  margin-left: 6px;
  vertical-align: middle;
  animation: 9mm-pos-mgr-pulse 2s ease-in-out infinite;
}

@keyframes 9mm-pos-mgr-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

/* ── API Key Status Dot ────────────────────────────────────────────────── */

.\39 mm-pos-mgr-api-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: transparent;
  border: 2.3px solid var(--accent);
  vertical-align: middle;
  margin-right: 6px;
  cursor: help;
}

.\39 mm-pos-mgr-api-dot--valid {
  background: var(--accent3);
  border-color: var(--accent3);
  animation: api-dot-glow-green 2s ease-in-out infinite;
}

.\39 mm-pos-mgr-api-dot--invalid {
  background: #b00;
  border-color: #b00;
  animation: api-dot-glow-red 2s ease-in-out infinite;
}

.\39 mm-pos-mgr-api-dot--quota {
  background: #fa0;
  border-color: #fa0;
  animation: api-dot-glow-orange 2s ease-in-out infinite;
}

@keyframes api-dot-glow-green {
  0%,
  100% {
    box-shadow: 0 0 6px 1px var(--accent3);
    opacity: 1;
  }

  50% {
    box-shadow: 0 0 1px 0 var(--accent3);
    opacity: 0.4;
  }
}

@keyframes api-dot-glow-red {
  0%,
  100% {
    box-shadow: 0 0 6px 1px #b00;
    opacity: 1;
  }

  50% {
    box-shadow: 0 0 1px 0 #b00;
    opacity: 0.4;
  }
}

@keyframes api-dot-glow-orange {
  0%,
  100% {
    box-shadow: 0 0 6px 1px #fa0;
    opacity: 1;
  }

  50% {
    box-shadow: 0 0 1px 0 #fa0;
    opacity: 0.4;
  }
}


.\39 mm-pos-mgr-ranger-star-wrap {
  display: inline-block;
  width: 50px;
  height: 50px;
  position: relative;
  top: 11px;
  margin: 0 6px;
  cursor: help;
  background: linear-gradient(to top right, #ff3b5c, #9b30ff 50%, #00c8ff);
  border-radius: 6px;
}

.\39 mm-pos-mgr-ranger-star {
  width: 100%;
  height: 100%;
  display: block;
}

.\39 mm-pos-mgr-title-tune {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  transition: color 0.15s ease;
}

.\39 mm-pos-mgr-title-tune:hover,
.\39 mm-pos-mgr-title-tune:focus-visible {
  color: var(--accent, #00e5ff);
  outline: none;
}

.\39 mm-pos-mgr-hover-only {
  cursor: help;
}

.\39 mm-pos-mgr-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 3px 9px;
  line-height: 1;
}

.\39 mm-pos-mgr-search-clear:hover {
  color: var(--accent);
}

/* ── Mission Control ────────────────────────────── */

.\39 mm-pos-mgr-mission-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.\39 mm-pos-mgr-mission-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 620px;
  background: #260700;
  border-radius: 15px;
  padding: 21px 30px 6px;
  margin: 0 0 6px;
  color: #ff8f42;
}

.\39 mm-pos-mgr-mission-bottom {
  margin-top: auto;
}

.\39 mm-pos-mgr-mission-top-gap {
  height: 21px;
}


.\39 mm-pos-mgr-mission-title {
  color: #ff8f42;
}

.\39 mm-pos-mgr-mission-btn {
  display: block;
  width: 100%;
  padding: 12px 0;
  margin-bottom: 12px;
  border: 1px solid #ff8f42;
  border-radius: 9px;
  background: rgb(255 143 66 / 10%);
  color: #ff8f42;
  font-family: "Space Mono", monospace;
  font-size: 18px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
}

.\39 mm-pos-mgr-mission-btn:hover:not(:disabled) {
  background: rgb(255 143 66 / 20%);
}

.\39 mm-pos-mgr-mission-btn:disabled {
  opacity: 0.55;
  cursor: help;
  pointer-events: all;
}

.\39 mm-pos-mgr-mission-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 9px;
  font-size: 21px;
  color: #ff8f42;
}

.\39 mm-pos-mgr-mission-compound-block {
  margin-top: 30px;
  padding-bottom: 9px;
}

/* Special-Action status badge — Mission Control orange theme.
 * Default ("None") is a subtle dark-orange tint; active states
 * (Rebalancing / Compounding) invert to bright orange with a
 * pulsing dot. Mirrors the .9mm-pos-mgr-manage-badge pattern. */
.\39 mm-pos-mgr-mission-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 396px;
  min-height: 107px;
  height: auto;
  margin: 0 auto;
  padding: 9px 21px;
  border-radius: 24px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-align: center;
  background: rgb(255 143 66 / 10%);
  color: #b8652f;
  border: 1px solid rgb(255 143 66 / 25%);
}

.\39 mm-pos-mgr-mission-status-line1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.\39 mm-pos-mgr-mission-status-dot {
  display: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentcolor;
}

.\39 mm-pos-mgr-mission-status-line2,
.\39 mm-pos-mgr-mission-status-line3 {
  display: none;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.\39 mm-pos-mgr-mission-status.active {
  background: #ff8f42;
  color: #260700;
  border-color: #ff8f42;
}

.\39 mm-pos-mgr-mission-status.active .\39 mm-pos-mgr-mission-status-dot {
  display: inline-block;
  animation: blink 2s infinite;
}

.\39 mm-pos-mgr-mission-status.active .\39 mm-pos-mgr-mission-status-line2,
.\39 mm-pos-mgr-mission-status.active .\39 mm-pos-mgr-mission-status-line3 {
  display: block;
}

/* Stacked extras container: shown only when there is more than one
 * Special Action in progress.  Each extra entry repeats the three-line
 * layout of the primary entry (label / position / tokens). */
.\39 mm-pos-mgr-mission-status-extras {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin-top: 6px;
}

.\39 mm-pos-mgr-mission-status-extras:empty {
  display: none;
  margin-top: 0;
}

.\39 mm-pos-mgr-mission-status-extra {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 6px;
  border-top: 1px solid rgb(38 7 0 / 25%);
}

.\39 mm-pos-mgr-mission-status-extra-label {
  font-weight: 700;
}

.\39 mm-pos-mgr-mission-status-extra-pos,
.\39 mm-pos-mgr-mission-status-extra-tokens {
  font-weight: 400;
  letter-spacing: 0.5px;
}

/*
 * Gas-status badge: two tiers.
 *   - tier 1 ("low"): static amber, balance < recommended (N × 3× worst-case)
 *   - tier 2 ("critical"): blinking bright/dark orange, balance < one-rebalance floor
 * Hidden by default; the dashboard toggles visibility via JS based on
 * global.gasStatus.level from /api/status.
 */
.\39 mm-pos-mgr-gas-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 396px;
  height: 107px;
  margin: 9px auto 0;
  padding: 9px 21px;
  border-radius: 24px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-align: center;
  background: rgb(255 143 66 / 15%);
  color: #b8652f;
  border: 1px solid rgb(255 143 66 / 35%);
  cursor: help;
}

.\39 mm-pos-mgr-gas-status-line1 {
  font-weight: 700;
}

.\39 mm-pos-mgr-gas-status-line2 {
  font-weight: 400;
  letter-spacing: 0.5px;
  font-size: 17px;
}

.\39 mm-pos-mgr-gas-hidden {
  display: none;
}

.\39 mm-pos-mgr-gas-critical {
  animation: gas-critical-blink 1s infinite;
}

@keyframes gas-critical-blink {
  0%,
  100% {
    background: #ff6a00;
    color: #fff;
    border-color: #ff6a00;
  }

  50% {
    background: #5a1e00;
    color: #ffb77a;
    border-color: #ffb77a;
  }
}

.\39 mm-pos-mgr-mission-grid {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 9px 12px;
  font-size: 21px;
  color: #ff8f42;
}

.\39 mm-pos-mgr-mission-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-weight: 400;
}

.\39 mm-pos-mgr-mission-label {
  font-weight: 400;
  font-size: 21px;
  color: #ff8f42;
}

.\39 mm-pos-mgr-mission-currency {
  font-weight: 400;
  font-size: 30px;
  color: #ff8f42;
  margin-right: -6px;
}

.\39 mm-pos-mgr-mission-input {
  width: 90px;
  padding: 5px 9px;
  border: 1px solid #ff8f42;
  border-radius: 6px;
  background: rgb(255 143 66 / 8%);
  color: #ff8f42;
  font-family: "Space Mono", monospace;
  font-size: 21px;
}

.\39 mm-pos-mgr-mission-spacer {
  flex: 1;
}

.\39 mm-pos-mgr-mission-divider {
  border: none;
  border-top: 1px solid #cc3000;
  margin: 27px 0;
}

.\39 mm-pos-mgr-mission-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 1px 11px;
  border-radius: 1499px;
  font-size: 18px;
  font-family: "Space Mono", monospace;
  font-weight: 400;
  letter-spacing: 0.8px;
  text-align: center;
}

.\39 mm-pos-mgr-mission-badge.on {
  background: rgb(124 252 0 / 10%);
  color: var(--accent3);
  border: 1px solid rgb(124 252 0 / 20%);
}

.\39 mm-pos-mgr-mission-badge.off {
  background: transparent;
  color: #ff8f42;
  border: 1px solid #ff8f42;
}

.\39 mm-pos-mgr-compound-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  margin-left: auto;
}

.\39 mm-pos-mgr-compound-toggle input {
  display: none;
}

.\39 mm-pos-mgr-compound-track {
  width: 54px;
  height: 27px;
  border-radius: 14px;
  background: rgb(255 143 66 / 10%);
  border: 1px solid #cc3000;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.\39 mm-pos-mgr-compound-track::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #cc3000;
  top: 3px;
  left: 3px;
  transition: transform 0.2s, background 0.2s;
}

.\39 mm-pos-mgr-compound-toggle input:checked ~ .\39 mm-pos-mgr-compound-track {
  background: rgb(124 252 0 / 20%);
  border-color: var(--accent3);
}

.\39 mm-pos-mgr-compound-toggle input:checked ~ .\39 mm-pos-mgr-compound-track::after {
  transform: translateX(27px);
  background: var(--accent3);
  box-shadow: 0 0 6px var(--accent3);
}

.\39 mm-pos-mgr-mission-btn-sm {
  padding: 5px 12px;
  border: 1px solid #ff8f42;
  border-radius: 8px;
  background: rgb(255 143 66 / 10%);
  color: #ff8f42;
  font-family: "Space Mono", monospace;
  font-size: 18px;
  font-weight: 400;
  cursor: pointer;
  margin-left: auto;
}

.\39 mm-pos-mgr-mission-btn-sm:hover {
  background: rgb(255 143 66 / 20%);
}

.\39 mm-pos-mgr-mission-help {
  font-size: 15px;
  margin-top: 6px;
  min-height: 21px;
}

.\39 mm-pos-mgr-mission-help:empty {
  margin-top: 0;
  min-height: 0;
}

/* Telegram events fieldset */
.\39 mm-pos-mgr-tg-events {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px 18px;
}

.\39 mm-pos-mgr-tg-events legend {
  padding: 0 6px;
}

.\39 mm-pos-mgr-tg-events label {
  display: block;
  margin: 6px 0;
  cursor: pointer;
}

.\39 mm-pos-mgr-text-ok {
  color: var(--accent);
}

.\39 mm-pos-mgr-text-err {
  color: #f44;
}

/* Telegram modal — must sit above wallet setup modal (both z-index:1000) */
.\39 mm-pos-mgr-tg-modal {
  z-index: 1001;
}

.\39 mm-pos-mgr-tg-modal h3 {
  color: var(--accent);
}

/* Blur panels while syncing — applied/removed by _updateSyncBadge */
.\39 mm-pos-mgr-syncing-blur {
  filter: blur(5px);
  opacity: 0.5;
  pointer-events: none;
  transition: filter 0.3s, opacity 0.3s;
}

/* Below 1981px, the Auto-Rebalance Settings panel reflows to three rows:
   (1) Trigger Type + badge, (2) Threshold + badge, (3) Timeout + badge.
   The Position Offset row breaks the No Offset + Save buttons onto
   their own right-justified sub-row. */
@media (width <= 1980px) {
  .\39 mm-pos-mgr-trigger-row {
    flex-wrap: wrap;
  }

  .\39 mm-pos-mgr-trigger-right {
    flex-basis: 100%;
    margin-left: 0;
  }

  .\39 mm-pos-mgr-offset-row .\39 mm-pos-mgr-input-row {
    flex-basis: 100%;
    justify-content: flex-end;
  }

  .\39 mm-pos-mgr-nft-bar-tok {
    max-width: 17ch;
  }
}

/* ── Password-form utilities ──────────────────────────────────────────────
 * Chrome's password-manager heuristic rejects type="hidden" username
 * inputs and warns when a password field is not wrapped in a form.
 * These helpers let us present the hidden username as a real text input
 * visually clipped from view, and replace the handful of inline styles
 * that previously lived on unlock-form inputs and rows.
 */

.\39 mm-pos-mgr-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.\39 mm-pos-mgr-pinput-full {
  width: 100%;
}

.\39 mm-pos-mgr-mb-sm {
  margin-bottom: 12px;
}

.\39 mm-pos-mgr-row-gap-sm {
  display: flex;
  gap: 12px;
}

/* -
 * Inline yellow validation banner for the Settings panel — used when
 * one user-entered value would render another setting meaningless
 * (e.g. Min Time Between Rebalances >= OOR Rebalance Time Threshold).
 * Visible only when the warning is populated; the JS toggles `hidden`.
 */
.\39 mm-pos-mgr-settings-warning {
  /*
   * Do not set `display` here — it would override the user-agent
   * `[hidden] { display: none }` rule and leave an empty yellow bar
   * visible on page load before the JS has populated any text.
   * Div is block by default, which is what we want when shown.
   */
  margin: 8px 0 12px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.4;
  background: rgb(255 184 0 / 7%);
  border: 1px solid rgb(255 184 0 / 30%);
  border-radius: 4px;
  color: var(--warn);
}
