/* ═══════════════════════════════════════════════════════
   Right Sidebar — Icon Strip + Panel
   ═══════════════════════════════════════════════════════ */

/* Icon strip (always visible, right edge) */
.rsb-strip {
  width: var(--rsb-strip-w);
  min-width: var(--rsb-strip-w);
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 6px 0;
  gap: 2px;
  z-index: 50;
  overflow: visible;
}

.rsb-icon {
  max-width: 42px; height: 38px;
  display: flex; align-items: center;
  flex-direction: row-reverse;
  gap: 0;
  background: var(--panel); border: none;
  color: var(--text-dim); cursor: pointer;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  transition: max-width .35s cubic-bezier(.4,0,.2,1),
              background .15s ease,
              color .15s ease,
              box-shadow .3s ease;
  position: relative;
  padding: 0 11px;
  overflow: hidden;
  white-space: nowrap;
}
.rsb-icon svg {
  width: 22px; height: 22px;
  min-width: 22px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.rsb-icon .rsb-label {
  font: 13px/1 var(--font-ui);
  letter-spacing: .02em;
  opacity: 0;
  overflow: hidden;
  transition: opacity .2s ease .1s;
  margin-right: 8px;
  pointer-events: none;
}
.rsb-icon:hover {
  max-width: 180px;
  background: var(--panel);
  color: var(--text);
  box-shadow: -4px 0 16px var(--shadow-strong, rgba(0,0,0,.3));
  z-index: 51;
}
.rsb-icon:hover svg {
  transform: scale(1.15);
}
.rsb-icon:hover .rsb-label {
  opacity: 1;
}
.rsb-icon.active {
  color: var(--blue);
  background: var(--blue-dim);
}
.rsb-icon.active:hover {
  color: var(--blue);
  background: var(--panel);
}

/* AI Report — purple accent, animated stars */
.rsb-icon-ai { color: #c4b5fd; }
.rsb-icon-ai:hover { color: #e9d5ff; }
.rsb-icon-ai.active { color: #a78bfa; background: rgba(167,139,250,.14); }
.rsb-icon-ai.active:hover { color: #c4b5fd; background: var(--panel); }
.rsb-icon-ai svg { fill: currentColor !important; stroke: none !important; }
.rsb-ai-stars .rsb-ai-star-big {
  transform-origin: center; transform-box: fill-box;
  animation: rsbAiSparkle 2.4s ease-in-out infinite;
}
.rsb-ai-stars .rsb-ai-star-small {
  transform-origin: center; transform-box: fill-box;
  animation: rsbAiSparkle 2.4s ease-in-out infinite .6s;
}
@keyframes rsbAiSparkle {
  0%,100% { transform: scale(.85) rotate(-8deg); filter: drop-shadow(0 0 3px rgba(196,181,253,.55)); }
  50%     { transform: scale(1.15) rotate(8deg);  filter: drop-shadow(0 0 8px rgba(196,181,253,1)); }
}

/* Sliding panel */
.rsb-panel {
  width: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border-left: 1px solid transparent;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: width .3s ease, min-width .3s ease, border-color .3s ease;
}
.rsb-panel.open {
  width: var(--rsb-panel-w);
  min-width: var(--rsb-panel-w);
  border-left: 2px solid var(--border-hi);
  box-shadow: -4px 0 12px var(--shadow-strong, rgba(0,0,0,.35));
}
.rsb-panel.resizing { transition: none !important; }

/* Resize handle (left edge) */
.rsb-resize {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  cursor: ew-resize;
  z-index: 60;
  background: transparent;
  transition: background .15s ease;
}
.rsb-panel:not(.open) .rsb-resize { display: none; }
.rsb-resize:hover,
.rsb-resize.active { background: var(--blue); opacity: .6; }
body.rsb-resizing,
body.rsb-resizing * { cursor: ew-resize !important; user-select: none !important; }

.rsb-header {
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.rsb-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.rsb-close {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 1.2rem; font-weight: 700;
  transition: all var(--ease);
}
.rsb-close:hover { background: var(--hover-medium); color: var(--text-bright); }

.rsb-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: var(--rsb-panel-w);
  padding: 0 14px;
}
.rsb-body.rsb-body-split {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ═══════════════════════════════════════════════════════
   Watchlist — unified row layout (logo + info + price/score)
   ═══════════════════════════════════════════════════════ */

.wl-list { padding: 4px 10px 10px; }
.wl-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .14em;
  padding: 12px 4px 6px;
}
.wl-group-label:first-child { padding-top: 4px; }
.wl-group-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-group-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  opacity: .5;
  transition: opacity var(--ease);
}
.wl-group-label:hover .wl-group-actions { opacity: 1; }
.wl-cat-add, .wl-cat-del {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 22px; height: 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--ease), color var(--ease);
}
.wl-cat-add:hover { background: var(--hover-medium); color: var(--blue); }
.wl-cat-del:hover { background: var(--red-dim); color: var(--red); }

/* Drag & Drop — riordino categorie + spostamento simboli */
.wl-group-label[draggable="true"] { cursor: grab; }
.wl-group-label[draggable="true"]:active { cursor: grabbing; }
.wl-item[draggable="true"] { cursor: grab; }
.wl-item[draggable="true"]:active { cursor: grabbing; }
.wl-dragging { opacity: .4; }
.wl-drop-before { box-shadow: inset 0 2px 0 0 var(--blue); }
.wl-drop-after  { box-shadow: inset 0 -2px 0 0 var(--blue); }
.wl-drop-into   { background: var(--hover-medium); outline: 1px dashed var(--blue); outline-offset: -2px; }

.wl-empty-cat {
  padding: 6px 14px 10px;
  font-size: .78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Footer: new category button */
.wl-footer {
  padding: 10px 4px 14px;
}
.wl-footer-btn {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px dashed var(--border-hi);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease);
}
.wl-footer-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--hover-subtle);
}

/* Row: grid [logo 32] [info flex] [price/score auto] [remove auto] */
.wl-item,
.wl-screener-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: background var(--ease), border-color var(--ease);
  position: relative;
}
.wl-item { grid-template-columns: 32px 1fr auto 20px; }
.wl-item:hover,
.wl-screener-item:hover { background: var(--hover-subtle); }
.wl-item.active {
  background: linear-gradient(90deg, rgba(195,160,95,.10), transparent 60%);
  border-left-color: var(--blue);    /* blue var = gold #c3a05f su tema Gold Luxe */
}

/* Logo (tondo 32x32, fallback iniziale colorata) */
.wl-logo {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wl-logo img {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: contain;
  background: rgba(255,255,255,.05);
}
.wl-logo-fb {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 600 .85rem/1 var(--font-ui);
  color: #fff;
  background: linear-gradient(135deg, #6b7280, #374151);
  text-transform: uppercase;
  user-select: none;
}

/* Info (symbol sopra, name sotto) */
.wl-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wl-sym {
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--text-bright);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wl-name {
  font-size: .78rem;
  font-weight: 400;
  color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Price + change (stacked right) */
.wl-px {
  display: flex; flex-direction: column; gap: 2px;
  align-items: flex-end; text-align: right;
  font-variant-numeric: tabular-nums;
}
.wl-price {
  font-size: .92rem;
  font-weight: 600;
  color: var(--text-bright);
  font-family: var(--font-ui);
}
.wl-change {
  font-size: .78rem;
  font-weight: 600;
  font-family: var(--font-ui);
}
.wl-change.up    { color: var(--green); }
.wl-change.down  { color: var(--red); }
.wl-change.flat  { color: var(--text-muted); }

/* Score + win (seasonality) */
.wl-score {
  display: flex; flex-direction: column; gap: 2px;
  align-items: flex-end; text-align: right;
  font-variant-numeric: tabular-nums;
}
.wl-score-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
  font-family: var(--font-ui);
}
.wl-score-val small {
  color: var(--text-dim);
  font-weight: 500;
  font-size: .72rem;
  margin-left: 1px;
}
.wl-score-val.mid  { color: var(--amber); }
.wl-score-val.low  { color: var(--red); }
.wl-score-win {
  font-size: .72rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* Remove button (visible on hover) */
.wl-remove {
  opacity: 0;
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: all var(--ease);
}
.wl-item:hover .wl-remove { opacity: 1; }
.wl-remove:hover { color: var(--red); background: var(--red-dim); }

/* Add symbol input */
.wl-add-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: var(--divider-soft);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: .84rem;
  outline: none;
  transition: border-color var(--ease);
}
.wl-add-input:focus { border-color: var(--blue); }
.wl-add-input::placeholder { color: var(--text-muted); }

.wl-loading {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: .82rem;
}

/* ── Main tabs (Market Movers / Seasonality) — pill prominenti ── */
.wl-section-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 14px 8px;
  margin: 0;
}
.wl-section-tab {
  flex: 1;
  padding: 7px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: all var(--ease);
  text-transform: none;
}
.wl-section-tab:hover:not(.active) {
  background: var(--hover-medium);
  color: var(--text);
  border-color: var(--border-hi);
}
.wl-section-tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--pill-active-color);
  box-shadow: 0 2px 10px rgba(195,160,95,.22);
}

/* ── Season category dropdown ── */
.wl-season-select-wrap {
  padding: 6px 14px 10px;
}
.wl-season-select {
  width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border-hi);
  background: var(--surface-raised);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color var(--ease);
  appearance: auto;
}
.wl-season-select:hover,
.wl-season-select:focus { border-color: var(--surface-border-strong); }
.wl-season-select option { background: var(--panel-bg, #1e1e1e); color: var(--text); }

/* ── Seasonality list header (Top 10 — Mese Anno) ── */
.wl-season-list-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 14px 6px;
  border-bottom: 1px solid var(--border);
  margin: 0 0 4px;
}
.wl-season-list-header .wl-season-list-title {
  font-family: var(--font-ui);
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
}
.wl-season-list-header .wl-season-list-month {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Sub tabs (Gainers / Losers / Active) — minimal underline ── */
.wl-screener-tabs {
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 6px 18px 10px;
}
.wl-screener-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 0;
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color var(--ease);
}
.wl-screener-tab::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: transparent;
  border-radius: 1px;
  transition: background var(--ease);
}
.wl-screener-tab:hover { color: var(--text); }
.wl-screener-tab.active {
  color: var(--blue);
  font-weight: 600;
}
.wl-screener-tab.active::after { background: var(--blue); }

/* ── Watchlist Split Panes ── */
.wl-split {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.wl-pane {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}
.wl-pane-divider {
  height: 3px;
  flex-shrink: 0;
  background: linear-gradient(90deg, transparent, var(--surface-border-strong) 20%, var(--surface-border-strong) 80%, transparent);
  box-shadow: 0 1px 6px rgba(0,0,0,.5), 0 -1px 0 var(--divider-soft);
  margin: 4px 0;
}

/* ── Company Profile (Soft Glass) ── */
.cp-loading {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: .82rem;
}

.cp-company-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 6px;
}
.cp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.cp-tag {
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  background: var(--surface-raised);
  color: var(--text-dim);
  text-transform: uppercase;
}
.cp-tag a {
  color: var(--blue);
  text-decoration: none;
}
.cp-tag a:hover { text-decoration: underline; }

/* Description */
.cp-desc {
  font-size: .87rem;
  line-height: 1.5;
  color: var(--text-dim);
  max-height: 60px;
  overflow: hidden;
  position: relative;
  transition: max-height .3s ease;
}
.cp-desc.expanded {
  max-height: 800px;
}
.cp-desc:not(.expanded)::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 24px;
  background: linear-gradient(transparent, var(--card));
}
/* Toggle button (chevron pill) */
.cp-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 20px;
  margin: 6px auto 2px;
  background: none;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.cp-toggle-btn svg {
  width: 14px;
  height: 14px;
  transition: transform .25s ease;
}
.cp-toggle-btn.open svg {
  transform: rotate(180deg);
}
.cp-toggle-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
  background: var(--divider-soft);
}

/* Stats grid */
.cp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 12px;
}
.cp-stat {
  padding: 5px 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--divider-soft);
}
.cp-stat-label {
  font-size: .87rem;
  color: var(--text-dim);
  font-weight: 500;
}
.cp-stat-value {
  font-family: var(--font-ui);
  font-size: .92rem;
  font-weight: 600;
  color: var(--text-bright);
}

/* Analyst recommendation bar */
.cp-analyst-bar-wrap {
  margin-top: 6px;
}
.cp-analyst-bar {
  display: flex;
  height: 20px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.cp-analyst-bar > div {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 700;
  color: #fff;
  min-width: 0;
  transition: flex .3s ease;
}
.cp-analyst-bar .cp-ab-sb { background: var(--green); }
.cp-analyst-bar .cp-ab-b  { background: var(--green); }
.cp-analyst-bar .cp-ab-h  { background: var(--amber); }
.cp-analyst-bar .cp-ab-s  { background: var(--red); }
.cp-analyst-bar .cp-ab-ss { background: var(--red); }

.cp-analyst-labels {
  display: flex;
  justify-content: space-between;
  font-size: .82rem;
  color: var(--text-muted);
}

.cp-error {
  padding: 16px 12px;
  text-align: center;
  color: var(--red);
  font-size: .82rem;
}

/* Insights strip — enterprise layout */
.cp-insights-strip {
  padding: 12px !important;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cp-ins-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cp-ins-label {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Signal cards — valuation & recommendation */
.cp-ins-signals {
  display: flex;
  gap: 6px;
}
.cp-signal {
  flex: 1;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-veil);
  transition: border-color .15s;
}
.cp-signal:hover {
  border-color: var(--border-hi);
}
.cp-signal-label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.cp-signal-value {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 700;
}
.cp-signal-red .cp-signal-value { color: var(--red); }
.cp-signal-green .cp-signal-value { color: var(--green); }
.cp-signal-amber .cp-signal-value { color: var(--amber); }

/* Key Technical Levels — segmented card */
.cp-levels {
  display: flex;
  gap: 1px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.cp-level {
  flex: 1;
  padding: 7px 6px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.cp-level:first-child { border-radius: 6px 0 0 6px; }
.cp-level:last-child  { border-radius: 0 6px 6px 0; }
.cp-level-label {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cp-level-value {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
}

/* Significant development — accent card */
.cp-sigdev {
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 3px solid var(--amber);
  background: var(--amber-dim);
  font-size: .82rem;
  line-height: 1.5;
  color: var(--text-dim);
}

/* Upcoming events */
.cp-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cp-event {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--divider-soft);
}
.cp-event:last-child { border-bottom: none; }
.cp-event-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 700;
  background: var(--blue-dim);
  color: var(--blue);
  flex-shrink: 0;
}
.cp-event-label {
  font-size: .87rem;
  color: var(--text-dim);
  font-weight: 500;
  flex: 1;
}
.cp-event-date {
  font-family: var(--font-ui);
  font-size: .92rem;
  color: var(--text-bright);
  font-weight: 600;
}

/* Upgrade/Downgrade list */
.cp-ud-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cp-ud-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .87rem;
  padding: 5px 0;
  border-bottom: 1px solid var(--divider-soft);
}
.cp-ud-item:last-child { border-bottom: none; }
.cp-ud-action {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 700;
  flex-shrink: 0;
}
.cp-ud-up { color: var(--green); background: var(--green-dim); }
.cp-ud-down { color: var(--red); background: var(--red-dim); }
.cp-ud-init { color: var(--text-muted); background: var(--surface-raised); }
.cp-ud-firm {
  color: var(--text-dim);
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.cp-ud-grade {
  font-family: var(--font-ui);
  font-size: .92rem;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
}
.cp-ud-date {
  font-family: var(--font-ui);
  font-size: .82rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Profile info row (website, employees, country) */
.cp-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}
.cp-info-link {
  font-size: .82rem;
  color: var(--blue);
  text-decoration: none;
}
.cp-info-link:hover { text-decoration: underline; }
.cp-info-item {
  font-size: .82rem;
  color: var(--text-dim);
}
.cp-info-item::before {
  content: '\00b7';
  margin-right: 6px;
  color: var(--text-muted);
}

/* Key Stats accordion */
.cp-stats-extra {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}
.cp-stats-extra.open {
  max-height: 400px;
}
.cp-acc-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: default;
}
.cp-acc-arrow {
  font-size: .7rem;
  transition: transform .2s;
}
.cp-acc-trigger.expanded .cp-acc-arrow {
  transform: rotate(180deg);
}

/* Dividends section */
.cp-div-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0;
}
.cp-div-donut {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
}
.cp-div-metrics {
  flex: 1;
  min-width: 0;
}
.cp-div-yield {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 1px;
}
.cp-div-yield-label {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.cp-div-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px solid var(--divider-soft);
}
.cp-div-row:last-child { border-bottom: none; }
.cp-div-label {
  font-size: .87rem;
  color: var(--text-dim);
  font-weight: 500;
}
.cp-div-val {
  font-family: var(--font-ui);
  font-size: .92rem;
  font-weight: 600;
  color: var(--text-bright);
}

/* Financials controls (dropdown + toggle) */
.cp-fin-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.cp-fin-select {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: .82rem;
  font-family: var(--font-ui);
  cursor: pointer;
  outline: none;
  flex: 1;
  min-width: 0;
}
.cp-fin-select:focus { border-color: var(--blue); }
.cp-fin-toggle {
  display: flex;
  gap: 3px;
  flex: 1;
}
.cp-fin-btn {
  flex: 1;
  padding: 5px 0;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: .82rem;
  font-family: var(--font-ui);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all var(--ease);
}
.cp-fin-btn:hover { color: var(--text); }
.cp-fin-btn.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-color);
}

/* Analyst rating — horizontal bars */
.cp-analyst-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.cp-analyst-val {
  font-family: var(--font-ui);
  font-size: 1.3rem;
  font-weight: 700;
}
.cp-analyst-label {
  font-size: .84rem;
  font-weight: 600;
}
.cp-analyst-total {
  font-size: .82rem;
  color: var(--text-muted);
  margin-left: auto;
}
.cp-analyst-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}
.cp-analyst-row-label {
  font-size: .82rem;
  color: var(--text-dim);
  font-weight: 500;
  min-width: 68px;
  flex-shrink: 0;
  text-align: right;
}
.cp-analyst-bar-track {
  flex: 1;
  height: 8px;
  background: var(--surface-raised);
  border-radius: 4px;
  overflow: hidden;
}
.cp-analyst-bar-fill {
  height: 100%;
  border-radius: 4px;
  min-width: 2px;
  transition: width 0.3s ease;
}
.cp-analyst-row-val {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 700;
  width: 20px;
  text-align: right;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   User Badge in rsb-strip + popover
   ═══════════════════════════════════════════════════════ */

.rsb-user-badge {
  width: 34px; height: 34px;
  margin: 4px 4px 8px auto;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: linear-gradient(135deg, #6b7280, #374151);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  flex-shrink: 0;
}
.rsb-user-badge:hover {
  transform: scale(1.05);
  border-color: rgba(255,255,255,.2);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.rsb-user-badge[data-tier="guest"]   { background: linear-gradient(135deg, #ef4444, #991b1b); }
.rsb-user-badge[data-tier="free"]    { background: linear-gradient(135deg, #facc15, #ca8a04); }
.rsb-user-badge[data-tier="basic"]   { background: linear-gradient(135deg, #22c55e, #15803d); }
.rsb-user-badge[data-tier="premium"] { background: linear-gradient(135deg, #22c55e, #15803d); }

.rsb-user-initial {
  font: 600 .95rem/1 var(--font-ui);
  letter-spacing: -.01em;
  text-transform: uppercase;
  user-select: none;
}

/* Popover (shown on click, anchored to badge, exits to the left of rsb-strip) */
.rsb-user-pop {
  position: absolute;
  top: 6px;
  right: calc(var(--rsb-strip-w) + 6px);
  width: 240px;
  background: var(--card);
  border: 1px solid var(--surface-border-hi);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 40px var(--shadow-strong, rgba(0,0,0,.35));
  padding: 14px;
  z-index: 100;
  font-family: var(--font-ui);
}
.rsb-user-pop[hidden] { display: none; }

.rsb-user-pop-head {
  display: flex; align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.rsb-user-pop-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 600 1.1rem/1 var(--font-ui);
  color: #fff;
  background: linear-gradient(135deg, #6b7280, #374151);
  flex-shrink: 0;
  text-transform: uppercase;
}
.rsb-user-pop-avatar[data-tier="guest"]   { background: linear-gradient(135deg, #ef4444, #991b1b); }
.rsb-user-pop-avatar[data-tier="free"]    { background: linear-gradient(135deg, #facc15, #ca8a04); }
.rsb-user-pop-avatar[data-tier="basic"]   { background: linear-gradient(135deg, #22c55e, #15803d); }
.rsb-user-pop-avatar[data-tier="premium"] { background: linear-gradient(135deg, #22c55e, #15803d); }

.rsb-user-pop-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rsb-user-pop-name {
  font-size: .95rem; font-weight: 600; color: var(--text, #e8ebf4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rsb-user-pop-tier {
  font-size: .82rem; font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.08);
  color: var(--text-dim, #9aa3b8);
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.rsb-user-pop-tier[data-tier="guest"]   { background: rgba(239,68,68,.18);  color: #fca5a5; }
.rsb-user-pop-tier[data-tier="free"]    { background: rgba(250,204,21,.16); color: #ffd85a; }
.rsb-user-pop-tier[data-tier="basic"]   { background: rgba(192,198,212,.12); color: #c0c6d4; }
.rsb-user-pop-tier[data-tier="premium"] { background: rgba(195,160,95,.16); color: #c3a05f; letter-spacing: .06em; }

.rsb-user-pop-action {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text, #e8ebf4);
  font: 500 .9rem/1 var(--font-ui);
  cursor: pointer;
  transition: background var(--ease, .15s ease), color var(--ease, .15s ease);
}
.rsb-user-pop-action:hover {
  background: var(--hover-medium, rgba(255,255,255,.08));
}
.rsb-user-pop-action + .rsb-user-pop-action { margin-top: 6px; }
.rsb-user-pop-settings svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .85; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .dd-label { display: none; }
  .stat { display: none; }
  .tb-tf-group { gap: 1px; }
  .tb-tf { padding: 4px 5px; }
  .opt-main { flex-direction: column; }
  .opt-metric-area { border-right: none; border-bottom: 1px solid var(--border); }
  .opt-insight-area { max-width: none; max-height: 40vh; }
  .opt-cards { grid-template-columns: repeat(3, 1fr); }
  .rsb-panel.open { width: 260px; min-width: 260px; }
  .rsb-body { min-width: 260px; }
}
@media (max-width: 600px) {
  .toolbar { width: 40px; min-width: 40px; }
  .tb-btn { width: 34px; height: 34px; font-size: 1rem; }
  .tb-tf-group { display: none; }
  .opt-cards { grid-template-columns: repeat(2, 1fr); }
  .opt-panel { height: 95vh; width: 100vw; border-radius: 0; }
  .rsb-strip { display: none; }
  .rsb-panel { display: none; }
}

