/* ═══════════════════════════════════════════════════════
   Range Bar
   ═══════════════════════════════════════════════════════ */
.range-bar {
  height: 26px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  display: flex; align-items: center; justify-content: flex-start;
  gap: 2px; flex-shrink: 0;
  padding: 0 8px;
}
.rb-btn {
  background: none; border: none; color: var(--text-dim);
  font-family: var(--font-ui); font-size: .87rem; font-weight: 500;
  padding: 4px 8px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background .15s, color .15s;
}
.rb-btn:hover { color: var(--text); background: var(--hover-subtle); }
.rb-btn.active { color: var(--blue); background: var(--blue-dim); }

/* X-Axis Mode Dropdown */
.rb-xaxis-dropdown { position: relative; }
.rb-xaxis-btn {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  font-family: var(--font-ui); font-size: .82rem; font-weight: 500;
  padding: 2px 10px; border-radius: var(--radius-sm); cursor: pointer;
  transition: all var(--ease);
}
.rb-xaxis-btn:hover { color: var(--text); border-color: var(--text-muted); }
.rb-xaxis-btn::after { content: ' ▴'; font-size: .6rem; opacity: .5; }
.rb-xaxis-menu {
  display: none; position: absolute; bottom: calc(100% + 4px); right: 0;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; min-width: 130px;
  box-shadow: 0 4px 16px rgba(0,0,0,.4); z-index: 50;
}
.rb-xaxis-menu.open { display: block; }
/* Tz dropdown when placed on the left of the bar — anchor menu to left edge */
.rb-tz-left .rb-xaxis-menu { right: auto; left: 0; }
.rb-tz-left { margin: 0 4px 0 6px; }
/* Hidden in intraday mode (toggled by JS via #rangeBar.intraday) */
#rangeBar.intraday .rb-daily-only { display: none; }
/* Hidden when not intraday */
#rangeBar:not(.intraday) .rb-tz-left { display: none; }
.rb-xaxis-opt {
  padding: 6px 12px; font-family: var(--font-ui); font-size: .82rem;
  color: var(--text-dim); cursor: pointer; transition: all var(--ease);
}
.rb-xaxis-opt:hover { background: rgba(255,255,255, var(--hover-medium)); color: var(--text); }
.rb-xaxis-opt.active { color: var(--blue); }

/* ═══════════════════════════════════════════════════════
   Shift Overlay Controls (so-)
   ═══════════════════════════════════════════════════════ */
.so-controls {
  display: flex; align-items: center; gap: 0;
  margin-right: 8px;
}
.so-pm-btn {
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  font-family: var(--font-ui); font-size: .9rem; cursor: pointer;
  transition: all var(--ease);
}
#soMinus { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: none; }
#soPlus { border-radius: 0; }
.so-pm-btn:hover { color: var(--text); border-color: var(--text-muted); }
.so-amount {
  width: 32px; height: 22px; text-align: center;
  background: var(--card); border: 1px solid var(--border); border-left: none;
  color: var(--text); font-family: var(--font-ui); font-size: .82rem;
  outline: none; -moz-appearance: textfield;
}
.so-amount::-webkit-inner-spin-button,
.so-amount::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.so-unit-dropdown { position: relative; }
.so-unit-btn {
  height: 22px; min-width: 28px; padding: 0 6px;
  background: none; border: 1px solid var(--border); border-left: none;
  color: var(--amber); font-family: var(--font-ui); font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: all var(--ease);
}
.so-unit-btn:hover { color: var(--text); border-color: var(--text-muted); }
.so-unit-btn::after { content: ' ▾'; font-size: .55rem; opacity: .5; }
.so-unit-menu {
  display: none; position: absolute; bottom: calc(100% + 4px); right: 0;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; min-width: 60px;
  box-shadow: 0 4px 16px rgba(0,0,0,.4); z-index: 50;
}
.so-unit-menu.open { display: block; }
.so-unit-opt {
  padding: 6px 12px; font-family: var(--font-ui); font-size: .82rem;
  color: var(--text-dim); cursor: pointer; transition: all var(--ease);
}
.so-unit-opt:hover { background: rgba(255,255,255, var(--hover-medium)); color: var(--text); }
.so-unit-opt.active { color: var(--amber); }
.so-add-btn {
  height: 22px; padding: 0 10px; margin-left: 0;
  background: none; border: 1px solid var(--border);
  border-left: none; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-dim); font-family: var(--font-ui); font-size: .82rem; font-weight: 500;
  cursor: pointer; transition: all var(--ease);
}
.so-add-btn:hover { color: var(--text); border-color: var(--text-muted); background: var(--hover-subtle); }
.so-date {
  height: 22px; padding: 0 6px;
  background: var(--card); border: 1px solid var(--border); border-left: none; border-right: none;
  color: var(--text); font-family: var(--font-ui); font-size: .82rem;
  outline: none; color-scheme: dark;
}
.so-tags {
  display: flex; align-items: center; gap: 4px; margin-right: 6px;
}
.so-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 6px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: var(--font-ui); font-size: .82rem;
  color: var(--text-dim);
}
.so-tag.hidden-item { opacity: .45; }
.so-tag-eye {
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted); flex-shrink: 0;
  transition: color var(--ease);
}
.so-tag-eye svg {
  width: 12px; height: 12px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.so-tag-eye:hover { color: var(--text); }
.so-tag-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  cursor: pointer; transition: transform var(--ease);
}
.so-tag-dot:hover { transform: scale(1.35); }
.so-tag-x {
  cursor: pointer; margin-left: 2px; font-size: .9rem; color: var(--text-muted);
  transition: color var(--ease);
}
.so-tag-x:hover { color: var(--red); }

/* Drag cursor for locked overlays */
#chartWrap[data-so-cursor="drag"] { cursor: ew-resize; }

/* ═══════════════════════════════════════════════════════
   Status Bar
   ═══════════════════════════════════════════════════════ */
.statusbar {
  height: 26px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  display: flex; align-items: center;
  padding: 0 14px;
  font-family: var(--font-ui);
  font-size: .82rem; color: var(--text-muted);
  gap: 14px; flex-shrink: 0;
}
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* Statusbar — user info (right side, under zoom/shift controls) */
.st-spacer { flex: 1; }

.st-user {
  display: flex; align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: .82rem;
  color: var(--text-dim, #9aa3b8);
  letter-spacing: .01em;
  max-width: 360px;
  overflow: hidden;
}
.st-user-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(239,68,68,.22);
}
.st-user[data-tier="guest"]   .st-user-dot { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,.22); }
.st-user[data-tier="free"]    .st-user-dot { background: #facc15; box-shadow: 0 0 0 2px rgba(250,204,21,.28); }
.st-user[data-tier="basic"]   .st-user-dot { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.22); }
.st-user[data-tier="premium"] .st-user-dot { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.22); }

.st-user-name {
  font-weight: 500;
  color: var(--text, #e8ebf4);
  max-width: 200px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.st-user-sep { opacity: .5; }
.st-user-tier {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .78rem;
}
.st-user[data-tier="guest"]   .st-user-tier { color: #fca5a5; }
.st-user[data-tier="free"]    .st-user-tier { color: #ffd85a; }
.st-user[data-tier="basic"]   .st-user-tier { color: #c0c6d4; }
.st-user[data-tier="premium"] .st-user-tier { color: #c3a05f; letter-spacing: .06em; font-weight: 700; }
