/* ═══════════════════════════════════════════════════════
   Seasonality Panel — Vision-style sidebar (sn-)
   ═══════════════════════════════════════════════════════ */

/* ── Panel wrapper (fills rsbBody) ── */
.sn-vision {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ── Header (title + gear) ── */
.sn-v-header {
  padding: 16px 16px 12px;
  flex-shrink: 0;
}
.sn-v-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.sn-v-title {
  font-size: 1.1rem;
  font-weight: 600;
  font-family: var(--font-ui);
  letter-spacing: -0.3px;
  color: var(--text-bright);
}
.sn-v-title span { color: var(--blue); }

/* Gear button */
.sn-gear-btn {
  background: var(--hover-medium);
  border: 1px solid var(--border-hi);
  border-radius: 50%;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  cursor: pointer;
  transition: all .2s ease;
  position: relative;
}
.sn-gear-btn:hover {
  background: var(--surface-border-hi);
  transform: scale(1.05);
}
.sn-gear-btn.active {
  background: var(--blue-med);
  border-color: var(--blue-focus);
  color: var(--blue);
}

/* ── Settings Popover ── */
.sn-settings-pop {
  position: absolute;
  top: 56px; right: 16px;
  width: 200px;
  background: var(--card);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: 0 12px 28px rgba(0,0,0,.45), inset 0 1px 0 var(--surface-raised);
  opacity: 0;
  transform: scale(0.95) translateY(-8px);
  pointer-events: none;
  transition: all .25s cubic-bezier(.2,.8,.2,1);
  z-index: 100;
}
.sn-settings-pop.show {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
.sn-pop-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-raised);
}
.sn-pop-row:last-child { border-bottom: none; padding-bottom: 0; }
.sn-pop-row span {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
}

/* iOS-style Toggle */
.sn-ios-toggle {
  width: 38px; height: 20px;
  background: var(--surface-border-hi);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: background .3s ease;
  flex-shrink: 0;
}
.sn-ios-toggle.on { background: var(--green); }
.sn-ios-toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.sn-ios-toggle.on::after { transform: translateX(18px); }

/* ── Tabs ── */
.sn-v-tabs {
  display: flex;
  background: rgba(0,0,0,.25);
  border-radius: var(--radius-sm);
  padding: 3px;
  position: relative;
  border: 1px solid var(--divider-soft);
}
.sn-v-pill {
  position: absolute;
  top: 3px; bottom: 3px;
  background: var(--surface-border-hi);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  transition: all .3s cubic-bezier(.2,.8,.2,1);
  z-index: 1;
}
.sn-v-tab-btn {
  flex: 1; background: none; border: none;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: .82rem; font-weight: 500;
  padding: 5px 0; cursor: pointer;
  position: relative; z-index: 2;
  transition: color .2s;
}
.sn-v-tab-btn:not(.active) { color: var(--text-dim); }

/* ── Content Area ── */
.sn-v-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 14px 14px;
}
.sn-v-content::-webkit-scrollbar { width: 3px; }
.sn-v-content::-webkit-scrollbar-track { background: transparent; }
.sn-v-content::-webkit-scrollbar-thumb { background: var(--surface-border); border-radius: 3px; }

.sn-tab-pane {
  display: none;
  animation: snFadeIn .3s ease;
}
.sn-tab-pane.active { display: block; }

@keyframes snFadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Glass Card ── */
.sn-glass {
  background: var(--divider-soft);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
}

/* ── Labels ── */
.sn-v-label {
  font-size: .82rem; font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 10px; display: block;
}
.sn-section-label {
  font-size: .82rem; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ── Chips ── */
.sn-chip-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.sn-v-chip {
  padding: 6px 12px; border-radius: 16px;
  background: var(--divider-soft);
  border: 1px solid var(--border-hi);
  color: var(--text);
  font-size: .82rem; font-weight: 500;
  cursor: pointer; transition: all .2s;
  font-family: var(--font-ui);
}
.sn-v-chip:hover { background: var(--surface-border); }
.sn-v-chip.active {
  background: var(--pill-active-bg, #d9b66a);
  border-color: var(--pill-active-bg, #d9b66a);
  color: var(--pill-active-color, #0f1115);
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(217,182,106,.35), 0 2px 10px rgba(217,182,106,.25);
}
.sn-v-chip.active:hover { background: var(--pill-active-bg, #d9b66a); }

/* Small chip variant (inside range card) */
.sn-chip-grid-sm { margin-top: 12px; gap: 4px; }
.sn-v-chip-sm { padding: 3px 9px; font-size: .82rem; border-radius: 12px; }

/* ── Dual Range Slider ── */
.sn-range-header {
  display: flex; justify-content: space-between;
  margin-bottom: 12px; font-size: .85rem; font-weight: 600;
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.sn-slider-container {
  position: relative;
  height: 24px;
  margin-bottom: 6px;
}
.sn-slider-track {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 100%; height: 8px;
  border-radius: 4px;
  background: var(--surface-border);
}
.sn-slider-fill {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  height: 8px;
  border-radius: 4px;
  background: #d9b66a;
}
.sn-slider-handle {
  position: absolute;
  top: 50%; transform: translate(-50%, -50%);
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  cursor: grab;
  z-index: 2;
}
.sn-slider-handle:hover {
  transform: translate(-50%, -50%) scale(1.1);
}
.sn-slider-handle:active { cursor: grabbing; }

/* ── Legend Items ── */
.sn-legend { display: flex; flex-direction: column; gap: 4px; }
.sn-legend-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: var(--divider-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all .2s ease;
  cursor: pointer;
}
.sn-legend-item:hover { background: var(--hover-medium); }
.sn-legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sn-legend-name {
  font-size: .82rem; font-weight: 500;
  flex: 1; color: var(--text);
}
.sn-legend-range {
  font-size: .82rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
}
.sn-legend-action {
  width: 20px; height: 20px;
  border-radius: var(--radius-sm);
  background: var(--divider-soft);
  border: none;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: .82rem;
  opacity: 0;
  transition: all var(--ease);
}
.sn-legend-item:hover .sn-legend-action { opacity: 1; }
.sn-legend-action:hover { background: var(--red-med); color: var(--red); }

/* Color palette */
.sn-color-palette {
  display: flex; gap: 3px; flex-wrap: wrap;
  padding: 4px 0; max-width: 120px;
}
.sn-palette-swatch {
  width: 13px; height: 13px; border-radius: 50%;
  cursor: pointer; border: 1.5px solid transparent;
  transition: transform .12s, border-color .12s;
}
.sn-palette-swatch:hover { transform: scale(1.3); }
.sn-palette-swatch.active { border-color: #fff; }
.sn-dot-btn {
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.sn-dot-btn:hover {
  transform: scale(1.4);
  box-shadow: 0 0 6px currentColor;
}

/* Legend style/invert/remove buttons */
.sn-legend-actions {
  display: flex; gap: 2px; flex-shrink: 0;
}
.sn-legend-btn {
  background: none;
  border: 1px solid var(--surface-raised);
  color: var(--text-dim);
  font-size: .82rem;
  width: 20px; height: 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0; line-height: 1;
  transition: all var(--ease);
}
.sn-legend-btn:hover {
  background: var(--surface-raised);
  color: var(--text-soft);
}
.sn-legend-btn.active {
  background: var(--surface-border);
  color: #fff;
  border-color: var(--surface-border-hi);
}
.sn-legend-remove { color: var(--text-dim) !important; font-size: .85rem !important; }
.sn-legend-remove:hover { color: var(--red) !important; background: var(--red-dim) !important; }

/* Dashboard button */
.sn-dash-open-btn {
  width: 100%;
  padding: 10px;
  margin: 10px 0 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--blue-med), var(--purple-dim));
  border: 1px solid var(--blue-strong);
  color: var(--text-bright);
  font-size: .82rem;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all .25s ease;
}
.sn-dash-open-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--blue-strong), var(--purple-dim));
  box-shadow: 0 4px 14px var(--blue-med);
}

/* ── Active Lines header with + button ── */
.sn-glass-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.sn-plus-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--blue-dim);
  border: 1px solid var(--blue-strong);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: .82rem; font-weight: 700;
  transition: all .2s ease;
  line-height: 1;
}
.sn-plus-btn:hover {
  background: var(--blue-strong);
  transform: scale(1.08);
  box-shadow: 0 2px 8px var(--blue-strong);
}

/* Pinned year legend item — left color border */
.sn-legend-item.sn-pinned-year {
  border-left: 3px solid;
  padding-left: 7px;
}

/* ── Year Picker Popover ── */
.sn-year-picker {
  position: absolute;
  top: 36px; right: 6px;
  width: 195px;
  background: rgba(22,25,35,.96);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(0,0,0,.5), inset 0 1px 0 var(--divider-soft);
  opacity: 0;
  transform: scale(0.95) translateY(-6px);
  pointer-events: none;
  transition: all .25s cubic-bezier(.2,.8,.2,1);
  z-index: 100;
  overflow: hidden;
}
.sn-year-picker.show {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
.sn-yp-header {
  padding: 8px 10px 6px;
  border-bottom: 1px solid var(--divider-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sn-yp-title {
  font-size: .7rem; font-weight: 600;
  color: var(--text-dim);
}
.sn-yp-close {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: .82rem; width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 3px;
  transition: all var(--ease);
}
.sn-yp-close:hover { color: var(--text-bright); background: var(--surface-raised); }

.sn-yp-search {
  margin: 5px 8px;
  padding: 4px 7px;
  width: calc(100% - 16px);
  border-radius: var(--radius-sm);
  background: var(--divider-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: .82rem;
  outline: none;
  transition: border-color .2s;
}
.sn-yp-search:focus { border-color: var(--blue-focus); }
.sn-yp-search::placeholder { color: var(--text-muted); }

.sn-yp-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 3px 0;
}
.sn-yp-list::-webkit-scrollbar { width: 3px; }
.sn-yp-list::-webkit-scrollbar-thumb { background: var(--surface-raised); border-radius: 3px; }

.sn-yp-item {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 10px;
  cursor: pointer;
  transition: background var(--ease);
}
.sn-yp-item:hover { background: var(--divider-soft); }
.sn-yp-item.added, .sn-yp-item.active { background: var(--blue-dim); }
.sn-yp-check {
  font-size: .7rem; color: var(--blue); font-weight: 700;
  width: 16px; text-align: center; flex-shrink: 0;
}
.sn-yp-cb {
  width: 13px; height: 13px;
  accent-color: rgba(255,255,255,.45);
  cursor: pointer;
  flex-shrink: 0;
}
.sn-yp-year {
  font-family: var(--font-ui);
  font-size: .82rem; font-weight: 600;
  color: var(--text); flex: 1;
}
.sn-yp-perf {
  font-family: var(--font-ui);
  font-size: .82rem; font-weight: 600;
}
.sn-yp-pos { color: var(--green); }
.sn-yp-neg { color: var(--red); }

/* ══════════════════════════════════
   YEAR LIST (Overview tab)
   ══════════════════════════════════ */
.sn-year-list-card { padding-bottom: 6px; }
.sn-sb-year-list { display: flex; flex-direction: column; }
.sn-sb-year-list .sn-yl-rows { max-height: 280px; overflow-y: auto; }
.sn-yl-count {
  font-size: .82rem; font-weight: 700;
  background: var(--blue-dim); color: var(--blue);
  padding: 2px 8px; border-radius: var(--radius-sm);
  font-family: var(--font-ui);
}
.sn-yl-header {
  display: flex; align-items: center;
  padding: 4px 4px 6px;
  border-bottom: 1px solid var(--surface-raised);
  font-size: .82rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .4px;
}
.sn-yl-cb-col { width: 24px; flex-shrink: 0; }
.sn-yl-year-col { width: 40px; flex-shrink: 0; }
.sn-yl-bar-col { flex: 1; text-align: center; }
.sn-yl-ytd-col { width: 54px; flex-shrink: 0; text-align: right; padding-right: 6px; }
.sn-yl-eye-col { width: 22px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.sn-yl-eye {
  color: var(--text-dim);
  opacity: .2;
  cursor: pointer;
  transition: all var(--ease);
  display: flex; align-items: center; justify-content: center;
  padding: 2px;
  border-radius: var(--radius-sm);
}
.sn-yl-eye:hover { opacity: .6; }
.sn-yl-eye.on { opacity: 1; color: var(--accent); }
.sn-dash-year-list-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.sn-yl-rows {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.sn-yl-rows::-webkit-scrollbar { width: 3px; }
.sn-yl-rows::-webkit-scrollbar-thumb { background: var(--surface-border); border-radius: 3px; }
.sn-yl-footer {
  flex-shrink: 0;
  padding: 5px 8px;
  border-top: 1px solid var(--surface-raised);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sn-yl-footer .sn-dash-filter-wrap {
  position: relative;
}
.sn-yl-footer .sn-dash-filter-menu {
  bottom: 100%;
  top: auto;
  margin-bottom: 4px;
  margin-top: 0;
}
.sn-yl-row {
  display: flex; align-items: center;
  padding: 4px 4px;
  cursor: pointer;
  transition: background var(--ease);
  border-radius: 3px;
}
.sn-yl-row:hover { background: var(--divider-soft); }
.sn-yl-row.pinned { background: var(--blue-dim); }
.sn-yl-row.inverted { background: rgba(255,235,59,.08); }
.sn-yl-row.inverted.pinned { background: rgba(255,235,59,.1); }
.sn-yl-row.sparse { opacity: .55; }
.sn-yl-row.sparse.checked { opacity: 1; background: rgba(255,184,51,.10); border-left: 2px solid rgba(255,184,51,.55); }
.sn-yl-row.sparse:hover { opacity: .85; background: var(--divider-soft); }
.sn-yl-row.sparse .sn-yl-year-col { color: var(--text-dim); }
.sn-yl-row.sparse.checked .sn-yl-year-col { color: #ffb833; }
.sn-yl-sparse-icon { display: inline-block; margin-right: 4px; color: #ffb833; font-size: 0.85rem; vertical-align: -1px; }
.sn-yl-sparse-shortcut:hover { background: rgba(255,184,51,.16) !important; border-color: rgba(255,184,51,.7) !important; }
.sn-yl-sparse-shortcut:focus { outline: 2px solid rgba(255,184,51,.45); outline-offset: 2px; }

/* Toggle "Include extended data" — sotto lo slider, panel + dashboard */
.sn-ext-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 10px 0 0; padding: 6px 2px;
  font-family: var(--font-ui);
}
.sn-ext-toggle-label {
  font-size: 0.86rem;
  color: var(--text);
  opacity: .9;
  flex: 1;
  padding-right: 10px;
}
.sn-ext-toggle-row .sn-ios-toggle { flex-shrink: 0; cursor: pointer; }
.sn-ext-toggle-row .sn-ios-toggle:focus { outline: 2px solid rgba(255,184,51,.45); outline-offset: 2px; }

/* Divisore tra toggle "extended data" e i preset year */
.sn-section-divider {
  height: 1px;
  background: var(--surface-border-hi, rgba(255,255,255,.08));
  margin: 12px 0;
}

/* Label "Use Last" sopra i preset chip 5Y/10Y/.../ALL */
.sn-use-last-label {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text);
  opacity: .65;
  margin: 0 0 6px;
  letter-spacing: .02em;
}

/* Dashboard Seasonality Line header row */
.sn-dash-comp-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
}
.sn-dash-comp-left {
  display: flex; align-items: center; gap: 8px;
}
.sn-dash-comp-swatch {
  width: 14px; height: 14px;
  border-radius: 50%;
  cursor: pointer;
  border: 1.5px solid var(--surface-border-hi);
  transition: all var(--ease);
  flex-shrink: 0;
}
.sn-dash-comp-swatch:hover {
  transform: scale(1.2);
  border-color: rgba(255,255,255,.4);
}
.sn-dash-comp-name {
  font-family: var(--font-ui);
  font-size: .82rem; font-weight: 600;
  color: var(--text);
}
.sn-dash-comp-right {
  display: flex; align-items: center; gap: 4px;
}
.sn-dash-comp-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); opacity: .3;
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  transition: all var(--ease);
}
.sn-dash-comp-btn:hover { opacity: .6; background: var(--surface-raised); }
.sn-dash-comp-btn.on { opacity: 1; color: var(--accent); }

/* Dashboard Buy & Hold stats */
.sn-dash-bh-layout {
  display: flex;
  gap: 16px;
}
.sn-dash-bh-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 140px;
}
.sn-dash-bh-donut-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 8px 0 10px;
}
.sn-dash-bh-donut-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.sn-dash-bh-donut-pct {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.sn-dash-bh-donut-sub {
  font-family: var(--font-ui);
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: 1px;
}
.sn-dash-bh-legend {
  display: flex;
  gap: 12px;
}
.sn-dash-bh-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-ui);
  font-size: .6rem;
  color: var(--text-dim);
}
.sn-dash-bh-legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.sn-dash-bh-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sn-dash-bh-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: var(--hover-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--divider-soft);
}
.sn-dash-bh-row-lbl {
  font-family: var(--font-ui);
  font-size: .82rem;
  color: var(--text-dim);
}
.sn-dash-bh-row-val {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
}
.sn-dash-bh-row-val.pos { color: var(--green); }
.sn-dash-bh-row-val.neg { color: var(--red); }

/* Dashboard year list header bar */
.sn-dash-slider-card {
  margin: 6px 0;
  padding: 10px 14px 8px;
}
.sn-dash-yl-slider-labels {
  display: flex; justify-content: space-between; padding: 0 2px;
  margin-bottom: 6px;
}
.sn-dash-yl-header-right {
  display: flex; align-items: center; gap: 8px;
}
.sn-dash-filters-btn {
  font-family: var(--font-ui);
  font-size: .6rem; font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border-hi);
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--ease);
  display: flex; align-items: center; gap: 4px;
}
.sn-dash-filters-btn:hover {
  background: var(--surface-raised);
  border-color: var(--surface-border-strong);
  color: var(--text);
}
.sn-dash-filters-btn.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-color);
  border-color: transparent;
}

/* Filter dropdown menu */
.sn-dash-filter-wrap {
  position: relative;
}
.sn-dash-filter-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 180px;
  padding: 6px 0;
  border-radius: var(--radius-md);
  background: #1c1c20;
  backdrop-filter: var(--overlay-blur, blur(20px));
  border: 1px solid var(--surface-border);
  box-shadow: var(--overlay-shadow, 0 8px 32px rgba(0,0,0,.5));
  z-index: 100;
}
.sn-dash-filter-menu.open {
  display: block;
}
.sn-dash-fm-group {
  padding: 2px 0;
}
.sn-dash-fm-group + .sn-dash-fm-group {
  border-top: 1px solid var(--surface-raised);
}
.sn-dash-fm-title {
  font-family: var(--font-ui);
  font-size: .65rem;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 8px 12px 4px;
  pointer-events: none;
  user-select: none;
}
.sn-dash-fm-item {
  font-family: var(--font-ui);
  font-size: .82rem;
  color: var(--text);
  padding: 6px 12px 6px 16px;
  cursor: pointer;
  transition: all var(--ease);
  border-radius: 4px;
  margin: 1px 6px;
}
.sn-dash-fm-item:hover {
  background: var(--surface-border);
  color: #fff;
}
.sn-dash-fm-topn {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sn-dash-fm-input {
  width: 28px;
  text-align: center;
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: .82rem;
  padding: 1px 2px;
  -moz-appearance: textfield;
}
.sn-dash-fm-input::-webkit-outer-spin-button,
.sn-dash-fm-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sn-dash-fm-reset {
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
}

/* Active filter tag */
.sn-dash-filter-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-ui);
  font-size: .6rem; font-weight: 600;
  padding: 2px 6px 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255,235,59,.12);
  color: rgba(255,235,59,.95);
  border: 1px solid rgba(255,235,59,.25);
  white-space: nowrap;
}
.sn-dash-filter-tag-x {
  cursor: pointer;
  font-size: .82rem;
  line-height: 1;
  opacity: .7;
  transition: opacity var(--ease);
  padding: 0 2px;
}
.sn-dash-filter-tag-x:hover { opacity: 1; }

/* Dashboard filter controls */
.sn-dash-filters {
  display: flex; flex-direction: column; gap: 6px;
}
.sn-dash-filter-row {
  display: flex; align-items: center; gap: 8px;
}
.sn-dash-filter-label {
  font-family: var(--font-ui);
  font-size: .82rem; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  width: 52px; flex-shrink: 0;
}
.sn-dash-filter-btns {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.sn-dash-pill {
  font-family: var(--font-ui);
  font-size: .82rem; font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--ease);
  white-space: nowrap;
}
.sn-dash-pill:hover {
  background: var(--surface-raised);
  border-color: var(--surface-border-strong);
  color: var(--text);
}
.sn-dash-pill:active,
.sn-dash-pill.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-color);
  border-color: transparent;
}
.sn-dash-pill-disabled {
  opacity: .25;
  cursor: not-allowed;
}
.sn-dash-pill-disabled:hover {
  background: none;
  border-color: var(--surface-border);
  color: var(--text-dim);
}
.sn-dash-cycle-input {
  font-family: var(--font-ui);
  font-size: .82rem; font-weight: 600;
  width: 34px; padding: 3px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
  background: var(--hover-subtle);
  color: var(--text);
  text-align: center;
  outline: none;
  transition: border-color var(--ease);
}
.sn-dash-cycle-input:focus {
  border-color: rgba(255,255,255,.3);
}
.sn-dash-cycle-input::placeholder { color: var(--text-dim); opacity: .5; }
/* Hide number input spinner */
.sn-dash-cycle-input::-webkit-inner-spin-button,
.sn-dash-cycle-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sn-dash-cycle-input { -moz-appearance: textfield; }

/* (removed: sn-dash-ctrl-col, sn-dash-swatch, sn-dash-inv — now use right-click context menu) */

/* Inverted count */
.sn-yl-inv-count {
  text-align: center;
  font-family: var(--font-ui);
  font-size: .82rem; font-weight: 600;
  color: rgba(255,235,59,.6);
  padding: 4px 0 0;
}

/* Reset Default button */
.sn-yl-reset {
  display: block; width: calc(100% - 12px); margin: 6px auto 8px;
  padding: 5px 0;
  border: 1px solid rgba(255,235,59,.25);
  border-radius: var(--radius-sm);
  background: none; cursor: pointer;
  font-family: var(--font-ui);
  font-size: .7rem; font-weight: 600;
  color: rgba(255,235,59,.7);
  transition: all var(--ease);
}
.sn-yl-reset:hover { background: rgba(255,235,59,.08); color: rgba(255,235,59,.95); border-color: rgba(255,235,59,.4); }

/* Checkbox */
.sn-yl-cb {
  width: 14px; height: 14px;
  border-radius: 3px;
  border: 1.5px solid var(--border-hi);
  background: transparent;
  transition: all var(--ease);
  position: relative;
  cursor: pointer;
}
.sn-yl-cb.on {
  background: transparent;
  border-color: rgba(255,255,255,.45);
}
.sn-yl-cb.on::after {
  content: '';
  position: absolute;
  top: 1px; left: 4px;
  width: 4px; height: 7px;
  border: solid rgba(255,255,255,.9);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

/* Year label */
.sn-yl-row .sn-yl-year-col {
  font-family: var(--font-ui);
  font-size: .82rem; font-weight: 600;
  color: var(--text);
}
.sn-yl-row:not(.checked) .sn-yl-year-col { color: var(--text-dim); }

/* Performance bar */
.sn-yl-bar-track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: var(--hover-subtle);
  width: 100%;
}
.sn-yl-bar {
  position: absolute; top: 0; height: 100%;
  border-radius: 4px;
  min-width: 2px;
}
.sn-yl-bar-zero {
  position: absolute; top: -1px; bottom: -1px;
  left: 50%; width: 1px;
  background: var(--surface-border-hi);
}

/* YTD value */
.sn-yl-row .sn-yl-ytd-col {
  font-family: var(--font-ui);
  font-size: .82rem; font-weight: 600;
}

/* Sort pills (kept for periods tab) */
.sn-sort-pills { display: flex; gap: 6px; margin-bottom: 8px; }
.sn-sort-pill {
  padding: 5px 12px; border-radius: 16px;
  border: 1px solid var(--border-hi);
  background: var(--divider-soft);
  color: var(--text);
  font-family: var(--font-ui); font-size: .82rem; font-weight: 500;
  cursor: pointer; transition: all .2s ease;
}
.sn-sort-pill:hover { background: var(--surface-border); }
.sn-sort-pill.active {
  background: linear-gradient(135deg, var(--blue-strong), var(--purple-dim));
  border-color: var(--blue-strong);
  color: #fff;
}

/* ══════════════════════════════════
   PERIODS TAB
   ══════════════════════════════════ */
.sn-search-config {
  display: flex; gap: 6px; align-items: flex-end;
  margin-bottom: 12px;
}
.sn-config-field {
  flex: 1;
  display: flex; flex-direction: column; gap: 2px;
}
.sn-config-field span {
  font-size: .6rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.sn-config-input {
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: var(--divider-soft);
  border: 1px solid var(--border-hi);
  color: var(--text);
  font-size: .82rem; font-weight: 500;
  font-family: var(--font-ui);
  text-align: center;
  width: 100%;
  outline: none;
  transition: border-color .2s;
}
.sn-config-input:focus { border-color: var(--blue-focus); }
.sn-config-dash {
  color: var(--text-muted);
  font-size: .82rem;
  margin-bottom: 6px;
}
.sn-analyze-btn {
  padding: 6px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--blue-focus), var(--purple-med));
  border: 1px solid var(--blue-strong);
  color: #fff;
  font-size: .82rem; font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  margin-bottom: 2px;
  flex-shrink: 0;
  transition: all .2s ease;
  box-shadow: 0 2px 8px var(--blue-med);
}
.sn-analyze-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--blue-focus), var(--purple-med));
  box-shadow: 0 4px 12px var(--blue-strong);
}

/* Auto row */
.sn-auto-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px;
  background: var(--divider-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.sn-auto-row-left {
  display: flex; align-items: center; gap: 5px;
}
.sn-auto-label {
  font-size: .82rem; color: var(--text-dim);
}
.sn-threshold-badge {
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  background: var(--green-dim);
  color: var(--green);
  font-size: .82rem; font-weight: 700;
  font-family: var(--font-ui);
}
.sn-auto-links { display: flex; gap: 8px; }
.sn-auto-link {
  font-size: .82rem; color: var(--blue);
  background: none; border: none;
  cursor: pointer; font-family: var(--font-ui);
  font-weight: 600;
  transition: color .15s;
}
.sn-auto-link:hover { color: var(--text-bright); }

/* Opportunities Section */
.sn-opp-section { margin-bottom: 12px; }
.sn-opp-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.sn-opp-header-line {
  flex: 1; height: 2px; border-radius: 1px;
}
.sn-opp-header-line.long { background: linear-gradient(90deg, var(--green), transparent); }
.sn-opp-header-line.short { background: linear-gradient(90deg, var(--red), transparent); }
.sn-opp-header-text {
  font-size: .82rem; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}
.sn-opp-header-text.long { color: var(--green); }
.sn-opp-header-text.short { color: var(--red); }
.sn-opp-count {
  font-size: .82rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: var(--font-ui);
}

/* Period Card */
.sn-period-card {
  background: var(--divider-soft);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 6px;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.sn-period-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--surface-raised), transparent);
}
.sn-period-card:hover {
  background: var(--hover-medium);
  border-color: var(--surface-border-hi);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.sn-period-card.sn-period-active {
  border-color: var(--blue-focus);
  background: var(--blue-dim);
}

.sn-period-card-inner {
  display: flex; align-items: center; gap: 10px;
}

/* SVG Ring */
.sn-ring-container {
  width: 38px; height: 38px;
  flex-shrink: 0;
  position: relative;
}
.sn-ring-container svg {
  width: 38px; height: 38px;
  transform: rotate(-90deg);
}
.sn-ring-bg {
  fill: none;
  stroke: var(--surface-raised);
  stroke-width: 3.5;
}
.sn-ring-progress {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(.4,0,.2,1);
}
.sn-ring-progress.green { stroke: var(--green); }
.sn-ring-progress.red { stroke: var(--red); }
.sn-ring-text {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 800;
  font-family: var(--font-ui);
}

.sn-period-card-info {
  flex: 1; min-width: 0;
}
.sn-period-dates {
  font-size: .82rem; font-weight: 500;
  color: var(--text);
}
.sn-period-meta {
  display: flex; align-items: center; gap: 5px;
  margin-top: 2px;
}
.sn-gain-pill {
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  font-size: .82rem; font-weight: 700;
  font-family: var(--font-ui);
}
.sn-gain-pill.positive {
  background: var(--green-dim);
  color: var(--green);
}
.sn-gain-pill.negative {
  background: var(--red-dim);
  color: var(--red);
}
.sn-days-badge {
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--divider-soft);
  font-size: .82rem; font-weight: 500;
  color: var(--text-muted);
  font-family: var(--font-ui);
}

.sn-play-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--divider-soft);
  border: 1px solid var(--border-hi);
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .2s ease;
  flex-shrink: 0;
  font-size: .6rem;
}
.sn-play-btn:hover {
  background: var(--blue-dim);
  border-color: var(--blue-focus);
  color: var(--blue);
}

/* Panel footer */
.sn-panel-footer {
  padding: 8px 14px 12px;
  text-align: center;
  font-size: .82rem;
  color: var(--text-muted);
  flex-shrink: 0;
  border-top: 1px solid var(--hover-subtle);
  font-family: var(--font-ui);
}
.sn-panel-footer strong { color: var(--text-dim); font-weight: 600; }

/* Period card stagger animation */
@keyframes snCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.sn-period-card {
  animation: snCardIn .35s cubic-bezier(.4,0,.2,1) backwards;
}
.sn-period-card:nth-child(2) { animation-delay: .04s; }
.sn-period-card:nth-child(3) { animation-delay: .08s; }
.sn-period-card:nth-child(4) { animation-delay: .12s; }

/* Loading indicator */
.sn-v-loading {
  text-align: center;
  padding: 18px 12px;
  color: var(--text-dim);
  font-size: .82rem;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.sn-spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--surface-border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: sn-spin .6s linear infinite;
  flex-shrink: 0;
}
@keyframes sn-spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════
   DASHBOARD MODAL — 70/30 Layout
   Left 70%: pattern chart (top) + backtest charts (bottom)
   Right 30%: sidebar — periods tool (top) + backtest stats (bottom)
   ══════════════════════════════════════════════════════ */

.sn-bt-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(var(--overlay-blur));
}
.sn-dash-modal {
  background: var(--panel);
  border: none;
  border-radius: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: none;
}

/* ── Header ── */
.sn-dash-header {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  gap: 12px;
  border-bottom: 1px solid var(--surface-raised);
  background: var(--surface-veil);
}
.sn-dash-symbol {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-bright);
  background: var(--hover-subtle);
  padding: 5px 14px;
  border-radius: var(--radius-sm);
}
.sn-dash-divider {
  width: 1px;
  height: 20px;
  background: var(--surface-border);
}
.sn-dash-title {
  font-size: .95rem;
  font-weight: 500;
  color: var(--text-dim);
  flex: 1;
}
/* ── Dashboard Close Button ── */
.sn-dash-close-btn {
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 500;
  padding: 5px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}
.sn-dash-close-btn:hover {
  background: rgba(255,255,255, var(--hover-medium));
  color: var(--text-bright);
}
/* ── Dashboard Sidebar Control Blocks ── */
.sn-dash-ctrl-block {
  padding: 10px 12px;
  border-bottom: 1px solid var(--surface-raised);
}
.sn-dash-ctrl-title {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.sn-dash-range {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sn-dash-range-label {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.sn-dash-slider-container {
  position: relative;
  height: 24px;
  flex: 1;
}
.sn-dash-date-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sn-dash-kpis {
  display: flex;
  gap: 20px;
}
.sn-dash-kpi { text-align: center; }
.sn-dash-kpi-label {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.sn-dash-kpi-val {
  font-family: var(--font-ui);
  font-size: .9rem;
  font-weight: 600;
}
.sn-dash-kpi-pos { color: var(--green); }
.sn-dash-kpi-neg { color: var(--red); }
.sn-dash-kpi-acc { color: var(--blue); }
.sn-bt-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--ease);
}
.sn-bt-close:hover { color: var(--text-bright); background: var(--hover-medium); }

/* ── 3-Column Body: left sidebar | charts | right metrics ── */
.sn-dash-columns {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* ── LEFT: Command sidebar ── */
.sn-dash-left-sb {
  flex: 0 0 330px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--surface-raised);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* Seasonality controls inside left sidebar */
.sn-dash-sn-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--surface-raised);
  flex-shrink: 0;
}
.sn-dash-sn-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
/* Date pair: START and END side by side, labels above */
.sn-dash-date-pair {
  display: flex;
  gap: 8px;
}
.sn-dash-date-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sn-dash-date-selects {
  display: flex;
  gap: 4px;
}
.sn-dash-date-selects .sn-bt-day,
.sn-dash-date-selects .sn-bt-month {
  width: auto;
  flex: 1;
  min-width: 0;
}
.sn-dash-sn-range {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.sn-dash-sn-range .sn-dash-slider-container { flex: 1; min-width: 60px; margin-left: 5px; margin-right: 5px; }
.sn-dash-gear-row-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.sn-dash-gear-row-inline .sn-dash-rc-label {
  font-size: .82rem;
}

/* ── CENTER: Charts area ── */
.sn-dash-charts-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* ── RIGHT: Metrics sidebar (always visible) ── */
.sn-dash-metrics-sb {
  flex: 0 0 15%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--surface-raised);
  min-width: 0;
  overflow-y: auto;
}

/* Pattern chart — top half */
.sn-dash-chart-top {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sn-dash-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--divider-soft);
}
.sn-dash-chart-label {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
}
.sn-dash-hint {
  font-size: .82rem;
  color: var(--text-muted);
  font-style: italic;
}
.sn-dash-clean-btn {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  padding: 2px 8px;
  margin-left: 8px;
  background: none;
  border: 1px solid var(--surface-border-hi);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  pointer-events: auto;
  transition: var(--ease);
}
.sn-dash-clean-btn:hover {
  background: rgba(255,255,255, var(--hover-medium));
  border-color: var(--surface-border-strong);
  color: var(--text);
}
/* ── Inlay title (inside chart area) ── */
.sn-dash-chart-inlay {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
  pointer-events: none;
}
.sn-dash-chart-inlay-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
}
.sn-dash-chart-inlay-event {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-top: 20px;
  display: none;
}
.sn-dash-chart-inlay-event.visible {
  display: block;
}
.sn-dash-chart-toggle {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 1px solid var(--surface-border-hi);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: var(--ease);
}
.sn-dash-chart-toggle:hover {
  background: rgba(255,255,255, var(--hover-medium));
  border-color: var(--surface-border-strong);
  color: var(--text);
}
.sn-dash-chart-toggle.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-color);
  border-color: transparent;
}

/* Gear settings (detrend / depricing) */
.sn-dash-gear-wrap {
  position: absolute;
  left: 46px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: auto;
}
.sn-dash-gear-btn { position: static !important; transform: none !important; }
.sn-dash-gear-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 160px;
  background: var(--overlay-bg);
  backdrop-filter: var(--overlay-blur);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--overlay-shadow);
  padding: 8px 12px;
  display: none;
  z-index: 50;
}
.sn-dash-gear-popup.visible { display: block; }
.sn-dash-gear-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-family: var(--font-ui);
  font-size: .82rem;
  color: var(--text-muted);
}
.sn-dash-gear-row + .sn-dash-gear-row {
  border-top: 1px solid var(--hover-subtle);
}

.sn-dash-chart-inlay-bottom {
  position: absolute;
  bottom: 8px;
  right: 16px;
  z-index: 3;
  pointer-events: none;
}

.sn-dash-chart {
  flex: 1;
  min-height: 0;
  padding: 8px 12px;
  position: relative;
}
.sn-dash-chart canvas {
  width: 100%;
  height: 100%;
}

/* Backtest charts — bottom half */
/* ── Draggable horizontal divider ── */
.sn-dash-divider-h {
  height: 7px;
  cursor: row-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  background: var(--hover-subtle);
  border-top: 1px solid var(--surface-raised);
  border-bottom: 1px solid var(--surface-raised);
  transition: background var(--ease);
}
.sn-dash-divider-h:hover {
  background: var(--surface-raised);
}
.sn-dash-divider-h-grip {
  width: 36px;
  height: 3px;
  border-radius: 2px;
  background: var(--surface-border-hi);
}
.sn-dash-divider-h:hover .sn-dash-divider-h-grip {
  background: rgba(255,255,255,.3);
}

.sn-dash-bt-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.sn-dash-bt-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--divider-soft);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.sn-dash-bt-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.sn-dash-bt-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sn-dash-bt-controls .sn-bt-input {
  padding: 2px 4px;
  font-size: .82rem;
}
.sn-dash-bt-controls .sn-dash-rc-go {
  padding: 3px 12px;
  font-size: .82rem;
}
.sn-dash-bt-slider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-width: 140px;
  flex: 0 1 220px;
}
.sn-dash-bt-tag {
  font-size: .82rem;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 500;
  background: var(--green-dim);
  color: var(--green);
}
.sn-dash-bt-tag.sn-dash-bt-tag-bear {
  background: var(--red-dim);
  color: var(--red);
}
.sn-dash-bt-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* ── Events mode hint bar ── */
.sn-dash-bt-ev-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--divider-soft);
  flex-shrink: 0;
}
.sn-dash-bt-ev-hint-text {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-dim);
}
/* ── Backtest controls row (date selector | title | slider) ── */
.sn-dash-bt-controls-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--divider-soft);
  flex-shrink: 0;
}
.sn-dash-bt-controls-row .sn-dash-date-controls {
  flex-shrink: 0;
}
.sn-dash-bt-controls-row .sn-dash-range {
  max-width: 300px;
  flex: 1;
  min-width: 120px;
}
.sn-dash-bt-body {
  flex: 1;
  display: flex;
  gap: 10px;
  padding: 8px 12px;
  min-height: 0;
}
.sn-bt-chart-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
}
.sn-bt-chart-title {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 2;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  pointer-events: none;
  font-family: var(--font-ui);
}
/* ── Backtest chart tooltip ── */
.sn-dash-bt-tooltip {
  position: absolute;
  z-index: 10;
  background: rgba(16, 18, 25, .92);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: var(--font-ui);
  font-size: .82rem;
  line-height: 1.4;
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.sn-bt-chart {
  flex: 1;
  min-height: 0;
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}

/* ── OLD sidebar class (kept for compat, now used by left-sb) ── */
.sn-dash-sidebar {
  flex: 20;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--surface-raised);
  min-width: 0;
  overflow: hidden;
}

/* Sidebar tab switcher */
.sn-dash-sb-tabs {
  display: flex;
  background: rgba(0,0,0,.25);
  border-radius: var(--radius-sm);
  padding: 3px;
  position: relative;
  border: 1px solid var(--divider-soft);
  flex-shrink: 0;
  margin: 8px 10px;
}
.sn-dash-sb-pill {
  position: absolute;
  top: 3px; bottom: 3px;
  background: var(--surface-border-hi);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  transition: all .3s cubic-bezier(.2,.8,.2,1);
  z-index: 1;
}
.sn-dash-sb-tab {
  flex: 1;
  border: none;
  background: none;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: .905rem;
  font-weight: 500;
  padding: 5px 0;
  cursor: pointer;
  position: relative; z-index: 2;
  transition: color .2s;
}
.sn-dash-sb-tab:hover { color: var(--text); }
.sn-dash-sb-tab.active {
  color: var(--text);
}

/* Sidebar panels */
.sn-dash-sb-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow: hidden;
}
#snDashSbMetrics {
  overflow-y: auto;
  padding: 12px 14px;
}
#snDashSbMetrics::-webkit-scrollbar { width: 3px; }
#snDashSbMetrics::-webkit-scrollbar-thumb { background: var(--surface-raised); border-radius: 3px; }
#snDashSbYears {
  overflow: hidden;
}
#snDashYearList::-webkit-scrollbar { width: 3px; }
#snDashYearList::-webkit-scrollbar-thumb { background: var(--surface-raised); border-radius: 3px; }

/* ── Font bump +2px for dashboard right panel ── */
#snDashYearList .sn-dash-tab { font-size: .945rem; }
#snDashYearList .sn-v-label { font-size: .905rem; }
#snDashYearList .sn-dash-comp-name { font-size: .905rem; }
#snDashYearList .sn-yl-count { font-size: .775rem; }
#snDashYearList .sn-yl-header { font-size: .745rem; }
#snDashYearList .sn-yl-row .sn-yl-year-col { font-size: .82rem; }
#snDashYearList .sn-yl-row .sn-yl-ytd-col { font-size: .805rem; }
#snDashYearList .sn-dash-bh-donut-pct { font-size: 1.225rem; }
#snDashYearList .sn-dash-bh-donut-sub { font-size: .675rem; }
#snDashYearList .sn-dash-bh-legend-item { font-size: .725rem; }
#snDashYearList .sn-dash-bh-row-lbl { font-size: .845rem; }
#snDashYearList .sn-dash-bh-row-val { font-size: .925rem; }
#snDashYearList .sn-dash-filters-btn { font-size: .725rem; }
#snDashYearList .sn-dash-filter-tag { font-size: .725rem; }
#snDashYearList .sn-dash-filter-label { font-size: .775rem; }
#snDashYearList .sn-dash-pill { font-size: .775rem; }
#snDashYearList .sn-dash-cycle-input { font-size: .775rem; }

.sn-dash-rail-header {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--hover-subtle);
}
.sn-dash-rail-title {
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
}
.sn-dash-rail-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.sn-dash-rc-label {
  font-size: .82rem;
  color: var(--text-muted);
  text-transform: uppercase;
}
.sn-dash-rc-input {
  background: var(--hover-subtle);
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: .82rem;
  padding: 5px 8px;
  width: 46px;
  text-align: center;
  outline: none;
  transition: border-color var(--ease);
}
.sn-dash-rc-input:focus { border-color: var(--blue-focus); }
.sn-dash-rc-input.sn-dash-rc-wide { width: 62px; }
.sn-dash-rc-go {
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--surface-border-hi);
  border-radius: 4px;
  padding: 5px 12px;
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
  transition: all var(--ease);
}
.sn-dash-rc-go:hover { background: var(--surface-border-hi); border-color: rgba(255,255,255,.3); }
.sn-dash-bh-btn {
  background: none;
  color: var(--text-dim);
  border: 1px solid var(--surface-border-hi);
  border-radius: 4px;
  padding: 5px 10px;
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease);
  white-space: nowrap;
}
.sn-dash-bh-btn:hover {
  background: var(--surface-raised);
  border-color: var(--surface-border-strong);
  color: var(--text);
}

/* ═══ Best Periods — Container ═══ */
.sn-bp-container {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hi);
  background: var(--divider-soft);
  padding: 16px;
  margin: 10px;
  overflow: hidden;
}

/* Header: icon + title + sort pill */
.sn-bp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.sn-bp-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sn-bp-icon {
  width: 20px; height: 20px;
  color: var(--blue);
  flex-shrink: 0;
}
.sn-bp-title {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: -.02em;
}

/* Sort bar (above card list) */
.sn-bp-sort-bar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 6px 12px;
}

/* Sort pill */
.sn-bp-sort-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--divider-soft);
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--ease);
  position: relative;
}
.sn-bp-sort-pill:hover { background: var(--hover-medium); }
.sn-bp-sort-label {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: .03em;
}
.sn-bp-sort-chevron {
  width: 14px; height: 14px;
  color: var(--text-dim);
}

/* Sort dropdown */
.sn-bp-sort-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 160px;
  background: var(--card);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
  z-index: 50;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all .15s ease;
}
.sn-bp-sort-dropdown.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.sn-bp-sort-opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  border: none;
  background: none;
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--ease);
}
.sn-bp-sort-opt:hover { background: var(--hover-subtle); }
.sn-bp-sort-opt.active { color: var(--blue); background: var(--blue-dim); }

/* Inputs row: Min Days, Max Days, Run */
.sn-bp-inputs {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}
.sn-bp-input-group { flex: 1; }
.sn-bp-input-label {
  display: block;
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 4px;
}
.sn-bp-input {
  width: 100%;
  background: var(--divider-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 8px;
  font-family: var(--font-ui);
  font-size: .90rem;
  font-weight: 500;
  color: var(--text);
  outline: none;
  transition: border-color var(--ease);
}
.sn-bp-input:focus { border-color: var(--blue-focus); }
/* Hide spinner arrows */
.sn-bp-input::-webkit-inner-spin-button,
.sn-bp-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sn-bp-input { -moz-appearance: textfield; }

.sn-bp-run-btn {
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--surface-border-hi);
  padding: 6px 14px;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
}
.sn-bp-run-btn:hover { background: var(--surface-border-hi); border-color: rgba(255,255,255,.3); }

/* Bull/Bear toggle */
/* ── Mode toggle: Classic / Overall Ranking ── */
.sn-bp-mode-wrap {
  display: flex;
  gap: 0;
  margin: 0 10px 8px;
  background: rgba(0,0,0,.35);
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-raised);
  padding: 3px;
}
.sn-bp-mode {
  flex: 1;
  border: none;
  background: none;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: .85rem;
  font-weight: 600;
  padding: 7px 0;
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--ease);
  letter-spacing: .02em;
}
.sn-bp-mode:hover { color: var(--text); }
.sn-bp-mode.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-color);
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
}
.sn-bp-mode-desc {
  font-family: var(--font-ui);
  font-size: .82rem;
  color: var(--text-dim);
  padding: 0 12px 8px;
  line-height: 1.3;
  opacity: .7;
}

.sn-bp-toggle-wrap {
  display: flex;
  gap: 8px;
  padding: 3px;
  background: rgba(0,0,0,.25);
  border-radius: var(--radius-sm);
  border: 1px solid var(--divider-soft);
  margin-bottom: 4px;
}
.sn-bp-toggle {
  flex: 1;
  border: none;
  background: none;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 500;
  padding: 5px 0;
  cursor: pointer;
  border-radius: 4px;
  transition: all .2s;
}
.sn-bp-toggle:hover { color: var(--text); }
.sn-bp-toggle.active {
  background: var(--surface-border-hi);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.sn-bp-toggle.sn-bp-toggle-bull.active {
  background: rgba(38, 217, 127, .20);
  color: #26d97f;
}
.sn-bp-toggle.sn-bp-toggle-bear.active {
  background: rgba(240, 80, 110, .20);
  color: #f0506e;
}
/* Select dropdown for BP settings */
.sn-bp-select {
  appearance: auto;
  cursor: pointer;
  background: var(--surface-raised);
}
.sn-bp-select option {
  background: #1e1e1e;
  color: var(--text);
}
/* Show on chart — compact toggle */
.sn-bp-show-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
  background: var(--surface-raised);
  cursor: pointer;
  color: rgba(255,255,255,.4);
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  transition: all var(--ease);
  flex-shrink: 0;
}
.sn-bp-show-toggle:hover { border-color: var(--surface-border-strong); }
.sn-bp-show-toggle.active {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--blue-dim);
}
.sn-bp-show-toggle span:empty { display: none; }

/* ═══ Best Periods — Card List ═══ */
.sn-bp-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sn-bp-list::-webkit-scrollbar { width: 3px; }
.sn-bp-list::-webkit-scrollbar-track { background: transparent; }
.sn-bp-list::-webkit-scrollbar-thumb { background: var(--surface-border); border-radius: 3px; }

/* Period card */
.sn-bp-card {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--divider-soft);
  background: var(--hover-subtle);
  cursor: pointer;
  transition: all var(--ease);
  animation: snCardIn .35s cubic-bezier(.4,0,.2,1) backwards;
}
.sn-bp-card:nth-child(2) { animation-delay: .05s; }
.sn-bp-card:nth-child(3) { animation-delay: .1s; }
.sn-bp-card:nth-child(4) { animation-delay: .15s; }
.sn-bp-card:nth-child(5) { animation-delay: .2s; }
.sn-bp-card:hover {
  background: var(--hover-medium);
}
.sn-bp-card.sn-bp-active {
  border-color: var(--blue-focus);
  background: var(--blue-dim);
}
.sn-bp-degraded { opacity: .65; }

/* Card top row: dot + dates | WR big */
.sn-bp-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.sn-bp-card-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sn-bp-dot { display: none; }

/* Left edge accent */
.sn-bp-bull.sn-bp-card {
  border-left: 3px solid var(--green);
}
.sn-bp-bear.sn-bp-card {
  border-left: 3px solid var(--red);
}

.sn-bp-rank {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 700;
  color: rgba(255,255,255,.45);
  flex-shrink: 0;
  min-width: 22px;
}
.sn-bp-card-dates {
  font-family: var(--font-ui);
  font-size: .90rem;
  font-weight: 600;
  color: var(--text);
}
.sn-bp-card-wr {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.02em;
  flex-shrink: 0;
}
.sn-bp-bull .sn-bp-card-wr { color: var(--green); }
.sn-bp-bear .sn-bp-card-wr { color: var(--red); }

/* Badges */
.sn-bp-badge {
  font-size: .82rem;
  flex-shrink: 0;
  cursor: default;
  line-height: 1;
}
.sn-bp-badge-warn { color: var(--amber); }
.sn-bp-badge-star { color: var(--green); }

/* Card bottom: stats row */
.sn-bp-card-stats {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.sn-bp-stats-left {
  display: flex;
  gap: 20px;
}
.sn-bp-stat { text-align: left; }
.sn-bp-stat-label {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 2px;
}
.sn-bp-stat-value {
  font-family: var(--font-ui);
  font-size: .90rem;
  font-weight: 600;
  color: var(--text-soft);
}
.sn-bp-bull .sn-bp-stat-gain { color: var(--green); }
.sn-bp-bear .sn-bp-stat-gain { color: var(--red); }

.sn-bp-days-badge {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--hover-subtle);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}

/* Eye icon on each period card (bottom-right) */
.sn-bp-card-eye {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--surface-border-strong);
  cursor: pointer;
  transition: all var(--ease);
  flex-shrink: 0;
}
.sn-bp-card-eye:hover {
  color: rgba(255,255,255,.5);
  background: var(--hover-medium);
}
.sn-bp-card-eye.on {
  color: var(--blue);
}
.sn-bp-bull .sn-bp-card-eye.on { color: var(--green); }
.sn-bp-bear .sn-bp-card-eye.on { color: var(--red); }

/* Card highlight when period is shown on chart */
.sn-bp-card.sn-bp-on-chart {
  border-color: var(--blue-focus);
}
.sn-bp-bull.sn-bp-on-chart {
  border-color: var(--green-med);
}
.sn-bp-bear.sn-bp-on-chart {
  border-color: var(--red-med);
}


/* ═══ Best Periods — Loading animation ═══ */
.sn-bp-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 0;
}
.sn-bp-loading-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: snBpPulse 1s ease-in-out infinite;
}
.sn-bp-loading-dot:nth-child(2) { animation-delay: 0.15s; }
.sn-bp-loading-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes snBpPulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}

/* ═══ Send as Indicator — Modal ═══ */
.sn-bp-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--overlay-bg);
  backdrop-filter: var(--overlay-blur);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sn-bp-modal {
  background: #1e1e2a;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
  padding: 28px 32px 24px;
  width: 380px;
  max-width: 90vw;
}
.sn-bp-modal-title {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.sn-bp-modal-desc {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 18px;
  line-height: 1.45;
}
.sn-bp-modal-label {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 6px;
}
.sn-bp-modal-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--hover-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--ease);
}
.sn-bp-modal-input:focus {
  border-color: var(--blue);
}
.sn-bp-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.sn-bp-modal-cancel,
.sn-bp-modal-confirm {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  transition: all var(--ease);
}
.sn-bp-modal-cancel {
  background: var(--surface-raised);
  color: var(--text-muted);
}
.sn-bp-modal-cancel:hover {
  background: var(--surface-border);
  color: var(--text);
}
.sn-bp-modal-confirm {
  background: var(--blue);
  color: #fff;
}
.sn-bp-modal-confirm:hover {
  filter: brightness(1.15);
}

/* (Show Periods on Chart — now uses .sn-bp-show-toggle above) */

.sn-dash-rr-title {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Donut */
.sn-bt-donut-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 10px;
}
.sn-bt-donut-wrap canvas { width: 100%; height: 100%; }
.sn-bt-donut-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.sn-bt-donut-pct {
  font-family: var(--font-ui);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-bright);
}
.sn-bt-donut-sub {
  font-size: .82rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Stat rows */
.sn-bt-stat-list { width: 100%; }
.sn-bt-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: .82rem;
  border-bottom: 1px solid var(--hover-subtle);
}
.sn-bt-stat-row:last-child { border-bottom: none; }
.sn-bt-stat-label { color: var(--text-dim); }
.sn-bt-stat-val { font-family: var(--font-ui); font-weight: 600; color: var(--text); }
.sn-bt-val-pos { color: var(--green); }
.sn-bt-val-neg { color: var(--red); }

/* Shared input elements */
.sn-bt-input {
  background: var(--hover-subtle);
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: .82rem;
  padding: 5px 8px;
  outline: none;
  transition: border-color var(--ease);
}
.sn-bt-input:focus { border-color: var(--blue-focus); }
.sn-bt-input option { background: var(--panel); color: var(--text); }
.sn-bt-day { width: 52px; text-align: center; }
.sn-bt-month { width: 66px; }

/* Loading overlay */
.sn-bt-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 18, 30, 0.85);
  color: var(--text-dim);
  font-size: .85rem;
  z-index: 10;
}
/* ── Per-section spinner overlay ── */
.sn-dash-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  z-index: 5;
  border-radius: var(--radius-sm);
}
.sn-dash-spinner .sn-spinner {
  width: 22px;
  height: 22px;
}

/* Backtest icon in period cards (sidebar panel) */
.sn-bt-icon {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: .7rem;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.4;
  transition: opacity .15s, color .15s;
  flex-shrink: 0;
}
.sn-period-card:hover .sn-bt-icon { opacity: 0.8; }
.sn-bt-icon:hover {
  opacity: 1 !important;
  color: var(--blue);
}

.rsb-icon[data-tab="seasonality"] svg { fill: none; stroke: currentColor; }

/* ══════════════════════════════════════════════════════
   COMPOSITE CURVE ROW
   ══════════════════════════════════════════════════════ */
.sn-comp-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px !important;
}
.sn-comp-left { display: flex; align-items: center; gap: 8px; }
.sn-comp-swatch {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--surface-border-hi);
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease);
  flex-shrink: 0;
}
.sn-comp-swatch:hover { transform: scale(1.12); box-shadow: 0 0 0 2px var(--blue-focus); }
.sn-comp-name {
  font-family: var(--font-ui);
  font-size: .82rem; font-weight: 600;
  color: var(--text-dim);
  letter-spacing: .02em;
}
.sn-comp-right { display: flex; align-items: center; gap: 4px; }
.sn-comp-btn {
  width: 28px; height: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  transition: all var(--ease);
  padding: 0;
}
.sn-comp-btn:hover { border-color: var(--border-hi); background: var(--divider-soft); }
.sn-comp-btn.on { border-color: var(--blue); background: var(--blue-dim); color: var(--blue); }
.sn-comp-btn svg { overflow: visible; }
.sn-comp-eye { color: var(--text-muted); opacity: .45; }
.sn-comp-eye.on { opacity: 1; color: var(--accent); border-color: transparent; background: none; }
.sn-comp-eye.on:hover { background: var(--divider-soft); }
.sn-comp-close { color: var(--text-muted); border-color: transparent; background: none; }
.sn-comp-close:hover { color: var(--red, #e0625b); background: var(--divider-soft); border-color: transparent; }

/* View dropdown */
.sn-view-wrap { position: relative; }
.sn-view-drop {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 100;
  background: var(--card);
  border: 1px solid var(--border-hi); border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
  padding: 4px 0; min-width: 120px;
}
.sn-view-opt {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 6px 12px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-ui); font-size: .82rem; font-weight: 500;
  color: var(--text-dim); text-align: left;
  transition: background var(--ease);
}
.sn-view-opt:hover { background: rgba(255,255,255, var(--hover-medium)); }
.sn-view-opt.on { color: var(--blue); }
.sn-view-opt.on::before {
  content: '✓'; font-size: .75rem; color: var(--blue); margin-right: 2px;
}

/* ══════════════════════════════════════════════════════
   SEASONALITY LINE SETTINGS (reuses ctx-menu classes)
   ══════════════════════════════════════════════════════ */
.sn-line-ctx { z-index: 10000; min-width: 280px; background: var(--panel); }
.sn-line-ctx .ctx-body { height: auto; max-height: 420px; }
.sn-lctx-custom-input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: auto;
}
.sn-lctx-area-color {
  width: 28px; height: 22px;
  border: 1px solid var(--surface-border-hi);
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  padding: 0;
}
.sn-lctx-area-btn {
  width: auto !important;
  padding: 0 10px;
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Metrics tab — big donut + card grid */
.sn-bt-metrics-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 24px;
}
.sn-bt-wr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}
.sn-bt-wr-donut-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  cursor: default;
}
.sn-bt-wr-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) scale(.92);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(20,20,24,.92);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.sn-bt-wr-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(20,20,24,.92);
}
.sn-bt-wr-donut-wrap:hover .sn-bt-wr-tip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
.sn-bt-wr-tip .pos { color: var(--green); }
.sn-bt-wr-tip .neg { color: var(--red); }
.sn-bt-wr-tip .sep { color: var(--text-dim); }
.sn-bt-wr-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.sn-bt-wr-pct {
  font-family: var(--font-ui);
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--text);
}
.sn-bt-wr-pct.long { color: var(--green); }
.sn-bt-wr-pct.short { color: #ff2255; }
.sn-bt-wr-side {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--green);
  margin-top: 4px;
  line-height: 1;
}
.sn-bt-wr-side.short { color: #ff2255; }
.sn-bt-wr-label {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 6px;
}
.sn-bt-metrics-rows {
  width: 100%;
  display: flex;
  flex-direction: column;
}
.sn-bt-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--hover-subtle);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s ease, transform .3s ease;
}
.sn-bt-metric-row:last-child { border-bottom: none; }
.sn-bt-metric-row.visible {
  opacity: 1;
  transform: translateY(0);
}
.sn-bt-metric-val {
  font-family: var(--font-ui);
  font-size: 1.13rem;
  font-weight: 700;
  color: var(--text);
}
.sn-bt-metric-val.pos { color: var(--green); }
.sn-bt-metric-val.neg { color: var(--red); }

/* ── OOS (Out of Sample) ── */
.sn-bt-oos-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
}
.sn-bt-oos-text {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Vertical boundary line */
.sn-bt-oos-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px dashed rgba(255,170,51,0.6);
  pointer-events: none;
  z-index: 4;
}

/* Zone labels — sit one row below the chart title (top:8px) so the centered
   "IN SAMPLE" label never collides with the title text on the left. */
.sn-bt-oos-zone-label {
  position: absolute;
  top: 26px;
  font-family: var(--font-ui);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: rgba(255,255,255,0.3);
  pointer-events: none;
  z-index: 4;
  text-transform: uppercase;
}
.sn-bt-oos-zone-label-oos {
  color: rgba(255,170,51,0.50);
}

/* IS vs OOS comparison card */
.sn-bt-oos-card {
  padding: 10px 14px 8px;
}
.sn-bt-oos-card-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.sn-bt-oos-card-title {
  font-family: var(--font-ui);
  font-size: .90rem;
  font-weight: 700;
  color: var(--text-bright);
}
.sn-bt-oos-card-years {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-dim);
}
.sn-bt-oos-cmp-header {
  display: grid;
  grid-template-columns: 1fr 60px 60px;
  gap: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--surface-border);
  margin-bottom: 2px;
}
.sn-bt-oos-cmp-header .sn-bt-oos-cmp-col {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: right;
}
.sn-bt-oos-cmp-col-oos {
  color: #FFAA33 !important;
}
.sn-bt-oos-cmp-row {
  display: grid;
  grid-template-columns: 1fr 60px 60px;
  gap: 4px;
  padding: 4px 0;
  border-bottom: 1px solid var(--divider-soft);
}
.sn-bt-oos-cmp-lbl {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
}
.sn-bt-oos-cmp-val {
  font-family: var(--font-ui);
  font-size: .86rem;
  font-weight: 600;
  text-align: right;
  color: var(--text);
}
.sn-bt-oos-cmp-val.pos { color: var(--green); }
.sn-bt-oos-cmp-val.neg { color: var(--red); }
.sn-bt-oos-val-oos {
  opacity: 0.9;
}

.sn-bt-metric-lbl {
  font-family: var(--font-ui);
  font-size: .97rem;
  font-weight: 500;
  color: var(--text-muted);
}
.sn-bt-series-controls {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 4px 14px;
}
/* Cycle buttons */
.sn-dash-cycle-btn {
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--ease);
}
.sn-dash-cycle-btn:hover {
  background: var(--surface-border);
  color: var(--text);
}
.sn-dash-cycle-btn.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-color);
  border-color: var(--surface-border-hi);
}
.sn-dash-cycle-custom-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  transition: all var(--ease);
}
.sn-dash-cycle-custom-wrap.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-color);
  border-color: var(--surface-border-hi);
}
.sn-dash-cycle-custom-wrap .sn-dash-cycle-input {
  width: 22px;
  text-align: center;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  padding: 0;
  -moz-appearance: textfield;
}
.sn-dash-cycle-custom-wrap .sn-dash-cycle-input::placeholder { color: var(--text-faint); }
.sn-dash-cycle-custom-wrap .sn-dash-cycle-input::-webkit-outer-spin-button,
.sn-dash-cycle-custom-wrap .sn-dash-cycle-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.sn-bt-series-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--hover-subtle);
}
.sn-bt-series-row:last-child { border-bottom: none; }

/* Toggle switch */
.sn-toggle {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.sn-toggle input { display: none; }
.sn-toggle-track {
  display: block;
  width: 30px;
  height: 16px;
  border-radius: 8px;
  background: var(--surface-border);
  transition: background .2s ease;
  position: relative;
}
.sn-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  transition: transform .2s ease, background .2s ease;
}
.sn-toggle input:checked + .sn-toggle-track {
  background: var(--green);
}
.sn-toggle input:checked + .sn-toggle-track .sn-toggle-thumb {
  transform: translateX(14px);
  background: #fff;
}

/* ── Events panel (sn-ev-) — Seasonality year-list aligned ── */

/* Mode toggle: Recurring / List (same as bp-toggle) */
.sn-ev-mode-toggle {
  display: flex;
  gap: 8px;
  padding: 3px;
  background: rgba(0,0,0,.25);
  border-radius: var(--radius-sm);
  border: 1px solid var(--divider-soft);
  margin-bottom: 8px;
}
.sn-ev-mode-btn {
  flex: 1;
  border: none;
  background: none;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 500;
  padding: 5px 0;
  cursor: pointer;
  border-radius: 4px;
  transition: all .2s;
}
.sn-ev-mode-btn:hover { color: var(--text); }
.sn-ev-mode-btn.active {
  background: var(--surface-border-hi);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

/* Preset events dropdown button */
.sn-ev-preset-wrap {
  position: relative;
  margin-bottom: 10px;
}
.sn-ev-preset-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 10px;
  background: var(--divider-soft);
  border: 1px solid var(--border);
  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);
}
.sn-ev-preset-btn:hover { background: var(--hover-medium); border-color: var(--border-hi); color: var(--text); }
.sn-ev-preset-btn.active { background: var(--hover-medium); border-color: var(--border-hi); color: var(--text); }
.sn-ev-preset-chev {
  margin-left: auto;
  color: var(--text-muted);
  transition: transform .2s ease;
}
.sn-ev-preset-btn.open .sn-ev-preset-chev { transform: rotate(180deg); }
.sn-ev-preset-panel {
  display: none;
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 4px);
  background: var(--card);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
  z-index: 50;
  overflow: hidden;
  padding: 4px;
}
.sn-ev-preset-panel.visible { display: block; }
.sn-ev-preset-panel .sn-ev-dd-option { justify-content: space-between; }
.sn-ev-preset-freq {
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Controls rows inside sn-glass card */
.sn-ev-ctrl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.sn-ev-ctrl-row:last-child { margin-bottom: 0; }
.sn-ev-ctrl-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 50px;
  flex-shrink: 0;
}
.sn-ev-ctrl-unit {
  font-size: .82rem;
  color: var(--text-dim);
}
.sn-ev-num {
  width: 48px;
  background: var(--divider-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 6px;
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  outline: none;
  transition: border-color var(--ease);
}
.sn-ev-num:focus { border-color: var(--blue-focus); }
.sn-ev-num::-webkit-inner-spin-button,
.sn-ev-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sn-ev-num { -moz-appearance: textfield; }

/* ── Custom dropdown (sn-ev-dd) ── */
.sn-ev-dd {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--divider-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--ease);
}
.sn-ev-dd:hover { background: var(--hover-medium); border-color: var(--border-hi); }
.sn-ev-dd.open { z-index: 1000; }
.sn-ev-dd-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  flex: 1;
}
.sn-ev-dd-value {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  flex: 1;
}
.sn-ev-dd-chevron {
  width: 10px; height: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform .2s ease, color var(--ease);
}
.sn-ev-dd.open .sn-ev-dd-chevron { transform: rotate(180deg); color: var(--text-dim); }

/* Dropdown panel */
.sn-ev-dd-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 100%;
  max-height: 220px;
  overflow-y: auto;
  background: #1e2136;
  border-radius: var(--radius-md);
  border: .5px solid var(--surface-border-hi);
  box-shadow: 0 16px 48px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.3);
  padding: 4px;
  z-index: 1001;
}
.sn-ev-dd.open .sn-ev-dd-panel { display: block; }
.sn-ev-dd-panel::-webkit-scrollbar { width: 4px; }
.sn-ev-dd-panel::-webkit-scrollbar-track { background: transparent; }
.sn-ev-dd-panel::-webkit-scrollbar-thumb { background: var(--surface-border-hi); border-radius: 4px; }

.sn-ev-dd-option {
  padding: 7px 10px;
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 400;
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background .1s ease;
  display: flex;
  align-items: center;
  gap: 7px;
}
.sn-ev-dd-option:hover { background: var(--surface-border); color: var(--text-bright); }
.sn-ev-dd-option.selected { color: var(--text-bright); font-weight: 500; }
.sn-ev-dd-option.selected::before {
  content: '';
  width: 4px; height: 4px;
  background: var(--text-bright);
  border-radius: 50%;
  flex-shrink: 0;
}
.sn-ev-dd-option:not(.selected)::before {
  content: '';
  width: 4px; height: 4px;
  flex-shrink: 0;
}
.sn-ev-dd-sep {
  height: .5px;
  background: var(--surface-border);
  margin: 4px 8px;
}
.sn-ev-dd-group-label {
  padding: 5px 10px 3px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  cursor: default;
}

/* Grid day picker */
.sn-ev-dd-panel.sn-ev-grid-panel {
  max-height: none;
  padding: 6px;
  min-width: 190px;
}
.sn-ev-dd-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.sn-ev-dd-grid .sn-ev-dd-option {
  padding: 5px 0;
  text-align: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: .82rem;
}
.sn-ev-dd-grid .sn-ev-dd-option::before { display: none; }
.sn-ev-dd-grid .sn-ev-dd-option.selected {
  background: var(--surface-border-hi);
  font-weight: 600;
}

/* ── Textarea (list mode) ── */
.sn-ev-textarea {
  width: 100%;
  min-height: 80px;
  resize: none;
  background: var(--divider-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: .82rem;
  line-height: 1.6;
  outline: none;
  margin-top: 6px;
  transition: border-color var(--ease);
}
.sn-ev-textarea::placeholder { color: var(--surface-border-strong); }
.sn-ev-textarea:focus { border-color: var(--blue-focus); }

/* ── Occurrence list card (year-list pattern) ── */
.sn-ev-list-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin-bottom: 0;
}

/* Header — exact sn-yl-header pattern */
.sn-ev-header {
  display: flex;
  align-items: center;
  padding: 4px 4px 6px;
  border-bottom: 1px solid var(--surface-raised);
  font-size: .745rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.sn-ev-date-hcol { width: 80px; flex-shrink: 0; }
.sn-ev-bar-hcol { flex: 1; text-align: center; }
.sn-ev-ret-hcol { width: 56px; flex-shrink: 0; text-align: right; padding-right: 6px; }

/* Scrollable rows */
.sn-ev-rows {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.sn-ev-rows::-webkit-scrollbar { width: 3px; }
.sn-ev-rows::-webkit-scrollbar-track { background: transparent; }
.sn-ev-rows::-webkit-scrollbar-thumb { background: var(--surface-border); border-radius: 3px; }

/* Row — exact sn-yl-row pattern */
.sn-ev-row {
  display: flex;
  align-items: center;
  padding: 4px 4px;
  cursor: pointer;
  transition: background var(--ease);
  border-radius: 3px;
}
.sn-ev-row:hover { background: var(--divider-soft); }
.sn-ev-row:not(.checked) { opacity: .4; }
.sn-ev-row:not(.checked) .sn-yl-cb { opacity: 1; }

/* Date column */
.sn-ev-row .sn-ev-date-hcol {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
}
.sn-ev-row:not(.checked) .sn-ev-date-hcol { color: var(--text-dim); }

/* Performance bar — exact sn-yl-bar-track pattern */
.sn-ev-bar-track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: var(--hover-subtle);
  width: 100%;
}
.sn-ev-bar {
  position: absolute; top: 0; height: 100%;
  border-radius: 4px;
  min-width: 2px;
}
.sn-ev-bar-zero {
  position: absolute; top: -1px; bottom: -1px;
  left: 50%; width: 1px;
  background: var(--surface-border-hi);
}

/* Return column */
.sn-ev-row .sn-ev-ret-hcol {
  font-family: var(--font-ui);
  font-size: .805rem;
  font-weight: 600;
}

/* Footer — exact sn-yl-footer pattern */
.sn-ev-footer {
  flex-shrink: 0;
  padding: 5px 8px;
  border-top: 1px solid var(--surface-raised);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Skeleton loading shimmer */
.sn-skel-shimmer {
  color: transparent !important;
  background: linear-gradient(90deg, var(--divider-soft) 25%, var(--surface-border) 50%, var(--divider-soft) 75%);
  background-size: 200% 100%;
  animation: snSkelShimmer 1.5s ease infinite;
  border-radius: 4px;
}
.sn-skel-counter {
  opacity: .3;
}
@keyframes snSkelShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
