/**
 * my-ranges.css — My Ranges custom library view.
 *
 * Owned by the My Ranges zone agent. The "Set Editor" block (se-*) is the
 * post-2026-04-17 redesign: 2-column centered-cluster layout, modern Paint
 * + Stats sidebar, no middle void. The legacy .my-ranges-* list view below
 * is still referenced by my-ranges.js as a safety net but the nav routes
 * users straight into the Set Editor.
 *
 * Local tokens are scoped to #view-set-editor so theme.css stays untouched.
 */

/* ═══════════════════════════════════════════════════════════════════════
   Set Editor — local design tokens
   ═══════════════════════════════════════════════════════════════════════ */

#view-set-editor {
  /* Surfaces */
  --se-bg:            var(--bg-primary);
  --se-bg-2:          #0d1014;
  --se-card:          #141821;
  --se-card-elev:     #1a1f29;
  --se-border:        #232835;
  --se-border-strong: #2e3545;

  /* Text */
  --se-text:          var(--text-primary);
  --se-text-muted:    #8892a6;
  --se-text-dim:      #5b6478;

  /* Accents — softer palette so the matrix doesn't shout. */
  --se-raise:         #d05a58;
  --se-raise-fill:    rgba(208, 90, 88, 0.16);
  --se-call:          #4a88d1;
  --se-call-fill:     rgba(74, 136, 209, 0.16);
  --se-fold:          #41495a;
  --se-fold-fill:     rgba(65, 73, 90, 0.35);
  --se-accent:        var(--color-accent);
  --se-accent-dim:    rgba(0, 212, 160, 0.14);
  --se-warn:          #d4a000;
  --se-danger:        var(--color-wrong);

  /* Radii */
  --se-r-xs:          6px;
  --se-r-sm:          8px;
  --se-r-md:          10px;
  --se-r-lg:          14px;
  --se-r-pill:        999px;

  /* Shadows */
  --se-shadow-sm:     0 1px 0 rgba(0, 0, 0, 0.2);
  --se-shadow-md:     0 2px 8px rgba(0, 0, 0, 0.25);
  --se-shadow-lg:     0 10px 30px rgba(0, 0, 0, 0.45);

  /* Motion */
  --se-ease:          cubic-bezier(0.2, 0.7, 0.2, 1);
  --se-dur:           140ms;

  flex-direction: column;
  height: calc(100vh - 44px);
  overflow: hidden;
  background: var(--se-bg);
}
#view-set-editor.active { display: flex; }

/* ═══════════════════════════════════════════════════════════════════════
   Range Sets bar  (top chip rail)
   ═══════════════════════════════════════════════════════════════════════ */

.se-sets-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  background: var(--se-bg-2);
  border-bottom: 1px solid var(--se-border);
  flex-shrink: 0;
  min-height: 56px;
}

.se-sets-lead {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.se-sets-eyebrow {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--se-text-dim);
}

.se-library-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--se-card);
  border: 1px solid var(--se-border);
  border-radius: var(--se-r-sm);
  color: var(--se-text);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color var(--se-dur) var(--se-ease),
              background var(--se-dur) var(--se-ease),
              color var(--se-dur) var(--se-ease);
  font-family: inherit;
}
.se-library-btn:hover {
  border-color: var(--se-accent);
  color: var(--se-accent);
  background: var(--se-accent-dim);
}
.se-library-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--se-accent);
}
.se-library-icon { font-size: 13px; line-height: 1; }

/* Share button in sets bar */
.se-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-accent, #00d4a0);
  background: rgba(0,212,160,0.10);
  border: 1px solid rgba(0,212,160,0.28);
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.14s, border-color 0.14s, opacity 0.14s;
  white-space: nowrap;
}
.se-share-btn:hover:not(:disabled) {
  background: rgba(0,212,160,0.18);
  border-color: rgba(0,212,160,0.50);
}
.se-share-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.se-sets-divider {
  width: 1px;
  align-self: stretch;
  margin: 10px 0;
  background: var(--se-border);
}

.se-sets-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--se-border-strong) transparent;
  padding: 2px 0;
}
.se-sets-scroll::-webkit-scrollbar { height: 6px; }
.se-sets-scroll::-webkit-scrollbar-thumb {
  background: var(--se-border-strong);
  border-radius: 3px;
}

.se-sets-list {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-shrink: 0;
}

/* Individual set chip (injected by set-editor.js via .set-card className) */
.se-sets-list .set-card {
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 156px;
  max-width: 220px;
  padding: 10px 14px;
  background: var(--se-card);
  border: 1px solid var(--se-border);
  border-radius: var(--se-r-sm);
  cursor: pointer;
  transition: border-color var(--se-dur) var(--se-ease),
              background var(--se-dur) var(--se-ease),
              transform 80ms var(--se-ease);
}
.se-sets-list .set-card:hover {
  border-color: var(--se-border-strong);
  background: var(--se-card-elev);
  transform: translateY(-1px);
}
.se-sets-list .set-card:active { transform: translateY(0); }

.se-sets-list .set-card.set-card-active {
  border-color: var(--se-accent);
  background: var(--se-accent-dim);
  box-shadow: inset 0 0 0 1px var(--se-accent);
}
.se-sets-list .set-card.set-card-active::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--se-accent);
  box-shadow: 0 0 0 3px var(--se-accent-dim);
}

.se-sets-list .set-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--se-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}
.se-sets-list .set-card-active .set-card-name { color: var(--se-accent); }

.se-sets-list .set-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.se-sets-list .set-card-tags .tag {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: var(--se-r-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* Empty "no sets yet" inline message */
.se-sets-list .set-cards-empty {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--se-text-muted);
  padding: 10px 4px;
  line-height: 1.5;
}
.se-sets-list .set-cards-empty-lead {
  font-weight: 700;
  color: var(--se-text);
  white-space: nowrap;
}
.se-sets-list .set-cards-empty-tail {
  white-space: nowrap;
}
.se-sets-list .set-cards-empty strong {
  color: var(--se-accent);
  font-weight: 800;
  padding: 0 2px;
}

/* "+ Create New" chip */
.se-set-create {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  background: transparent;
  border: 1px dashed var(--se-border-strong);
  border-radius: var(--se-r-sm);
  color: var(--se-text-muted);
  cursor: pointer;
  transition: border-color var(--se-dur) var(--se-ease),
              color var(--se-dur) var(--se-ease),
              background var(--se-dur) var(--se-ease);
  align-self: stretch;
  font-family: inherit;
}
.se-set-create:hover {
  border-color: var(--se-accent);
  color: var(--se-accent);
  background: var(--se-accent-dim);
}
.se-set-create:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--se-accent);
}
/* Pulse — when no sets exist, make the Create New CTA obvious. */
.se-set-create.se-set-create-pulse {
  border-style: solid;
  border-color: var(--se-accent);
  color: var(--se-accent);
  background: var(--se-accent-dim);
  animation: se-set-create-pulse 2.2s var(--se-ease) infinite;
}
@keyframes se-set-create-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 160, 0); }
  50%      { box-shadow: 0 0 0 6px rgba(0, 212, 160, 0.20); }
}
.se-set-create-icon {
  font-size: 18px;
  font-weight: 300;
  line-height: 1;
}
.se-set-create-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════
   Preflop nav bar (reset + breadcrumb + save status + position cards)
   ═══════════════════════════════════════════════════════════════════════ */

#view-set-editor #set-pf-nav {
  background: var(--se-bg-2);
  border-bottom: 1px solid var(--se-border);
  padding: 8px 20px 8px;
  flex-shrink: 0;
}

#view-set-editor .se-nav-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

#view-set-editor .se-reset-btn {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--se-text-muted);
  background: transparent;
  border: 1px solid var(--se-border);
  border-radius: var(--se-r-sm);
  cursor: pointer;
  transition: color var(--se-dur) var(--se-ease),
              border-color var(--se-dur) var(--se-ease);
  font-family: inherit;
}
#view-set-editor .se-reset-btn:hover {
  color: var(--se-text);
  border-color: var(--se-border-strong);
}
#view-set-editor .se-reset-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--se-accent);
}

/* Tree nav card — leftmost card in the position-cards row. Same size as
   a position card, dashed accent border, live sizing summary. */
#view-set-editor .pf-tree-card {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 150px;
  max-width: 180px;
  padding: 8px 10px 6px;
  background: linear-gradient(180deg, rgba(0, 212, 160, 0.08), rgba(0, 212, 160, 0.03));
  border: 1px dashed rgba(0, 212, 160, 0.45);
  border-radius: var(--se-r-md);
  color: var(--se-text);
  cursor: pointer;
  transition: border-color var(--se-dur) var(--se-ease),
              background var(--se-dur) var(--se-ease),
              transform 80ms var(--se-ease),
              box-shadow var(--se-dur) var(--se-ease);
  align-self: stretch;
  font-family: inherit;
  position: relative;
}
#view-set-editor .pf-tree-card:hover {
  border-color: var(--se-accent);
  background: linear-gradient(180deg, rgba(0, 212, 160, 0.14), rgba(0, 212, 160, 0.05));
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 212, 160, 0.15);
}
#view-set-editor .pf-tree-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--se-accent);
}
#view-set-editor .pf-tree-card-custom {
  border-style: solid;
  border-color: var(--se-accent);
  background: linear-gradient(180deg, rgba(0, 212, 160, 0.16), rgba(0, 212, 160, 0.06));
  box-shadow: 0 0 0 1px rgba(0, 212, 160, 0.25);
}
#view-set-editor .pf-tree-card-hdr {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(0, 212, 160, 0.18);
}
#view-set-editor .pf-tree-card-icon {
  color: var(--se-accent);
  font-size: 11px;
  line-height: 1;
}
#view-set-editor .pf-tree-card-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--se-accent);
  flex: 1;
  white-space: nowrap;
}
#view-set-editor .pf-tree-card-badge {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--se-accent);
  color: #04161e;
}
#view-set-editor .pf-tree-card-hint {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--se-text-dim);
}
#view-set-editor .pf-tree-card-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  padding: 2px 0;
}
#view-set-editor .pf-tree-card-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
#view-set-editor .pf-tree-card-lbl {
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--se-text-dim);
  min-width: 20px;
}
#view-set-editor .pf-tree-card-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--se-text);
}
#view-set-editor .pf-tree-card-muted {
  color: var(--se-text-dim);
  font-weight: 500;
}
#view-set-editor .pf-tree-card-five {
  color: var(--se-accent);
}
#view-set-editor .pf-tree-card-cta {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--se-text-dim);
  opacity: 0;
  transition: opacity var(--se-dur) var(--se-ease);
  text-align: center;
  margin-top: auto;
}
#view-set-editor .pf-tree-card:hover .pf-tree-card-cta {
  opacity: 1;
  color: var(--se-accent);
}

/* Ghost position cards — rendered when no set is open so the nav row
   doesn't collapse (2026-04-23 empty-state polish). Dimmed + dashed
   border to signal "preview / create a set to edit". */
#view-set-editor .pf-pos-card.pf-card-ghost {
  opacity: 0.55;
  border-style: dashed;
  cursor: pointer;
  transition: opacity var(--se-dur) var(--se-ease),
              transform 80ms var(--se-ease);
}
#view-set-editor .pf-pos-card.pf-card-ghost:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

#view-set-editor .se-breadcrumb {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--se-text);
  letter-spacing: 0.02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.se-save-status {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.se-pill {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: var(--se-r-pill);
  line-height: 1.6;
}
.se-pill-dirty {
  background: rgba(212, 160, 0, 0.14);
  color: var(--se-warn);
  box-shadow: inset 0 0 0 1px rgba(212, 160, 0, 0.35);
}
.se-pill-saved {
  background: var(--se-accent-dim);
  color: var(--se-accent);
  box-shadow: inset 0 0 0 1px rgba(0, 212, 160, 0.4);
}

#view-set-editor .se-nav-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--se-border-strong) transparent;
}
#view-set-editor .se-nav-cards { padding-bottom: 2px; }

/* Polish + compact position cards. Base sizing in layout.css is tall
   because it targets the Study tab; inside the Set Editor we trim
   padding + action-list spacing so each card is ~36px shorter and
   the matrix gets that vertical space. */
#view-set-editor .pf-pos-card {
  background: var(--se-card);
  border: 1px solid var(--se-border);
  padding: 6px 10px 8px;
  min-width: 120px;
  transition: border-color var(--se-dur) var(--se-ease),
              background var(--se-dur) var(--se-ease),
              transform 80ms var(--se-ease);
}
#view-set-editor .pf-card-header {
  padding: 0 0 2px;
  margin-bottom: 2px;
}
#view-set-editor .pf-action-list { gap: 0; }
#view-set-editor .pf-action {
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.4;
}
#view-set-editor .pf-card-taken,
#view-set-editor .pf-card-prev-action,
#view-set-editor .pf-card-note {
  font-size: 11px;
  padding: 2px 0;
}
#view-set-editor .pf-pos-card:hover {
  border-color: var(--se-border-strong);
  background: var(--se-card-elev);
  transform: translateY(-1px);
}
#view-set-editor .pf-pos-card.pf-card-selected {
  border-color: var(--se-accent);
  background: var(--se-accent-dim);
  box-shadow: inset 0 0 0 1px var(--se-accent);
}
#view-set-editor .pf-pos-card.pf-card-no-rfi {
  opacity: 0.55;
  background: var(--se-bg-2);
}
#view-set-editor .pf-pos-card.pf-card-no-rfi .pf-card-note {
  color: var(--se-text-dim);
  font-style: italic;
}
#view-set-editor .pf-card-dot {
  top: 8px;
  right: 8px;
  background: var(--se-border-strong);
}
#view-set-editor .pf-card-dot.pf-card-dot-filled {
  background: var(--se-accent);
  box-shadow: 0 0 0 3px var(--se-accent-dim);
}
#view-set-editor .pf-card-pos {
  color: var(--se-text);
  letter-spacing: 0.04em;
}
#view-set-editor .pf-card-selected .pf-card-pos { color: var(--se-accent); }
#view-set-editor .pf-card-stack {
  color: var(--se-text-dim);
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════════════════
   Body — matrix column + info column (Study-style 3-panel layout)
   ═══════════════════════════════════════════════════════════════════════ */

/* Override the locked .ranges-body 1fr/380px grid from layout.css.
   Matrix auto-widths; info col takes the remainder (mirrors Study's
   `.ranges-body` grid at index.html ~3645). Stats + Breakdown cards
   live inside `.se-info-col.se-two-col` — side-by-side at ≥1500px,
   stacked below. */
#view-set-editor .se-body {
  grid-template-columns: auto minmax(0, 1fr) !important;
  justify-content: start;
  align-items: stretch;
  gap: 16px;
  padding: 12px 16px 14px;
  overflow: hidden;
  background: var(--se-bg);
  min-height: 0;
}

/* Matrix column — wide rectangular cells matching Study's 1.64:1 ratio.
   Width is driven by height via ratio (same formula Study uses at
   index.html ~2641). vh budget is 370 to account for: top nav 44 +
   Range Sets bar 56 + pf nav+position cards 140 + body padding 18
   + frame padding 16 + col labels 16 + gap 4 + safety 10 = ~304; the
   extra 66 headroom compensates for browser UI chrome (URL bar, etc.)
   on real devices and prevents clipping. */
#view-set-editor .se-matrix-col {
  --range-matrix-height: min(calc(100vh - 380px), 560px);
  --range-matrix-width:  calc(var(--range-matrix-height) * 1.64);
  align-items: center;
  padding: 0 4px 0 6px;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

/* Paint-card legend chip strip (moved here from above the matrix). */
.se-paint-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0;
  font-size: 11px;
  color: var(--se-text-muted);
  letter-spacing: 0.04em;
}
.se-paint-legend:empty { display: none; }
.se-paint-legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--se-text);
  font-size: 10px;
}
.se-paint-legend .legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

/* Matrix frame */
.se-matrix-frame {
  padding: 10px 12px 12px;
  background: var(--se-card);
  border: 1px solid var(--se-border);
  border-radius: var(--se-r-md);
  box-shadow: var(--se-shadow-md);
  gap: 4px !important;
}
.se-matrix-frame .range-matrix-col-labels {
  margin-left: 22px;
}
.se-matrix-frame .range-matrix-row-labels .matrix-axis-label,
.se-matrix-frame .range-matrix-col-labels .matrix-axis-label {
  color: var(--se-text-muted);
  background: transparent;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.se-matrix { border-radius: var(--se-r-xs); }

#set-editor-grid .matrix-cell {
  cursor: pointer;
  user-select: none;
  transition: filter 100ms var(--se-ease);
}
#set-editor-grid .matrix-cell:hover { filter: brightness(1.15); }
#set-editor-grid.is-painting { cursor: crosshair; }
#set-editor-grid.is-painting .matrix-cell { cursor: crosshair; }

/* ═══════════════════════════════════════════════════════════════════════
   Info column — Stats card (Paint + stats) + Breakdown card (tabs)
   Layout mirrors Study page: side-by-side at ≥1500px, stacked below.
   ═══════════════════════════════════════════════════════════════════════ */

#view-set-editor .se-info-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  overflow: hidden;
}

/* Desktop (≥1181px): Stats + Breakdown tool cards side-by-side across
   the full width of the info col, at every desktop viewport. */
@media (min-width: 1181px) {
  #view-set-editor .se-info-col.se-two-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-auto-rows: 1fr;
    align-items: stretch;
    gap: 12px;
  }
  #view-set-editor .se-tool-card[data-tool="stats"],
  #view-set-editor .se-tool-card[data-tool="breakdown"] {
    min-height: 0;
  }
}

/* Tool card — the shared visual container for Stats and Breakdown. */
#view-set-editor .se-tool-card {
  background: var(--se-card);
  border: 1px solid var(--se-border);
  border-radius: var(--se-r-md);
  box-shadow: var(--se-shadow-md);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

/* Subsection header — used inside the Stats card for "Paint" and "Stats"
   dividers, and in the Breakdown card for its title + tabs row. */
.se-subsection-hdr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 4px;
  flex-shrink: 0;
}
.se-eyebrow {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--se-text-muted);
}

/* Paint header — promoted: brighter, larger, with a paint-roller icon and
   a faint accent underline so users see it immediately. */
.se-subsection-hdr-paint {
  padding: 12px 14px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--se-accent, #5ad9ff) 18%, transparent);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--se-accent, #5ad9ff) 7%, transparent) 0%,
    transparent 100%);
}
.se-eyebrow-paint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--se-accent, #5ad9ff);
  text-shadow: 0 0 12px color-mix(in srgb, var(--se-accent, #5ad9ff) 35%, transparent);
}
.se-eyebrow-paint-icon {
  color: var(--se-accent, #5ad9ff);
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--se-accent, #5ad9ff) 50%, transparent));
  flex-shrink: 0;
}

/* Scroll-to-fine-tune hint under the frequency slider */
.se-paint-freq-hint {
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--se-text-muted, #8a9aa8);
  letter-spacing: 0.02em;
  text-align: center;
  opacity: 0.78;
}

/* Red dot prefix on the Stats eyebrow (matches Study's dot before the
   eyebrow label at index.html stats card). */
.se-eyebrow-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.se-eyebrow-dot .se-eyebrow-dot-glyph {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--se-raise);
  box-shadow: 0 0 6px rgba(208, 90, 88, 0.6);
  flex-shrink: 0;
}

/* Stats title row: title on the left, shape + solver pills on the right. */
#view-set-editor .se-stats-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  flex-wrap: wrap;
}
#view-set-editor .se-stats-title-col { min-width: 0; flex: 1 1 auto; }
#view-set-editor .se-stats-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
#view-set-editor .se-stats-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--se-r-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--se-border);
  color: var(--se-text-muted);
}
#view-set-editor .se-stats-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
#view-set-editor .se-stats-pill-linear {
  color: #6ab0f5;
  border-color: rgba(106, 176, 245, 0.45);
  background: rgba(106, 176, 245, 0.10);
}
#view-set-editor .se-stats-pill-polarized {
  color: #e08040;
  border-color: rgba(224, 128, 64, 0.45);
  background: rgba(224, 128, 64, 0.10);
}
#view-set-editor .se-stats-pill-merged {
  color: #80c080;
  border-color: rgba(128, 192, 128, 0.45);
  background: rgba(128, 192, 128, 0.10);
}
#view-set-editor .se-stats-pill-gto {
  color: var(--se-accent);
  border-color: rgba(0, 212, 160, 0.45);
  background: rgba(0, 212, 160, 0.10);
}
#view-set-editor .se-stats-pill-exploit {
  color: var(--se-warn);
  border-color: rgba(212, 160, 0, 0.45);
  background: rgba(212, 160, 0, 0.10);
}
.se-sub-hint {
  font-size: 11px;
  color: var(--se-text-dim);
  letter-spacing: 0.01em;
}

/* Horizontal divider between Paint and Stats subsections inside the
   combined tool card. */
.se-paint-divider {
  height: 1px;
  background: var(--se-border);
  margin: 8px 0 2px;
}

/* Back-compat aliases — kept so that any lingering references still work.
   Renamed primary wrapper is `.se-paint-block`. */
.se-paint-block {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

/* Legacy card-header class used outside the editor body (not by the
   redesigned layout). Retained for safety. */
.se-card {
  background: var(--se-card);
  border: 1px solid var(--se-border);
  border-radius: var(--se-r-md);
  box-shadow: var(--se-shadow-md);
  min-height: 0;
}
.se-card-hdr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--se-border);
  flex-shrink: 0;
}
.se-card-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--se-text-muted);
  margin: 0;
}
.se-card-hint {
  font-size: 11px;
  color: var(--se-text-dim);
  letter-spacing: 0.01em;
}

.se-paint-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  padding: 6px 12px 4px;
}

.se-paint-btn {
  --btn-accent: var(--se-text-muted);
  --btn-fill:   transparent;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  padding: 6px 6px;
  background: var(--se-bg-2);
  border: 1px solid var(--se-border);
  border-radius: var(--se-r-sm);
  color: var(--se-text-muted);
  cursor: pointer;
  transition: background var(--se-dur) var(--se-ease),
              border-color var(--se-dur) var(--se-ease),
              color var(--se-dur) var(--se-ease),
              transform 80ms var(--se-ease);
  font-family: inherit;
}
.se-paint-btn:hover {
  color: var(--se-text);
  border-color: var(--se-border-strong);
  transform: translateY(-1px);
}
.se-paint-btn:active { transform: translateY(0); }
.se-paint-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--se-accent);
}

.se-paint-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--btn-accent);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}
.se-paint-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.se-paint-btn.paint-raise { --btn-accent: var(--se-raise); --btn-fill: var(--se-raise-fill); }
.se-paint-btn.paint-call  { --btn-accent: var(--se-call);  --btn-fill: var(--se-call-fill);  }
.se-paint-btn.paint-fold  { --btn-accent: var(--se-fold);  --btn-fill: var(--se-fold-fill); }

.se-paint-btn.active {
  background: var(--btn-fill);
  border-color: var(--btn-accent);
  color: var(--btn-accent);
  box-shadow: inset 0 0 0 1px var(--btn-accent);
}
.se-paint-btn.active .se-paint-dot {
  background: var(--btn-accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

/* ── Frequency slider ──────────────────────────────────────────────────── */

.se-paint-freq {
  padding: 2px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.se-paint-freq[hidden] { display: none; }

.se-paint-freq-hdr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.se-paint-freq-eyebrow {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--se-text-muted);
}
.se-paint-freq-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--se-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.se-paint-freq-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: var(--se-r-pill);
  background: var(--paint-track-gradient, var(--se-bg-2));
  border: 1px solid var(--se-border);
  outline: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  transition: box-shadow var(--se-dur) var(--se-ease);
}
.se-paint-freq-slider:focus-visible {
  box-shadow: 0 0 0 2px var(--se-accent);
}
.se-paint-freq-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--se-card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  cursor: grab;
}
.se-paint-freq-slider::-webkit-slider-thumb:active { cursor: grabbing; }
.se-paint-freq-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--se-card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  cursor: grab;
}

/* ── Paint CTA row (Paste + Save) ──────────────────────────────────────── */

.se-paint-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 2px 12px 6px;
}

.se-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
  border-radius: var(--se-r-sm);
  cursor: pointer;
  transition: background var(--se-dur) var(--se-ease),
              border-color var(--se-dur) var(--se-ease),
              color var(--se-dur) var(--se-ease),
              filter var(--se-dur) var(--se-ease),
              transform 80ms var(--se-ease);
  font-family: inherit;
}
.se-btn:active:not(:disabled) { transform: translateY(1px); }
.se-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.se-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--se-accent);
}
.se-btn-icon { font-size: 13px; line-height: 1; }

.se-btn-ghost {
  background: var(--se-bg-2);
  border-color: var(--se-border);
  color: var(--se-text);
}
.se-btn-ghost:hover:not(:disabled) {
  border-color: var(--se-border-strong);
  background: var(--se-card-elev);
}

/* Paste — promoted to a prominent CTA so users find it instantly. Uses
   a tinted accent fill (distinct from Save's solid accent) and a subtle
   pulse-on-load when the spot has zero combos. */
.se-btn-paste {
  background: color-mix(in srgb, var(--se-accent) 18%, var(--se-bg-2));
  border-color: color-mix(in srgb, var(--se-accent) 55%, var(--se-border));
  color: var(--se-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--se-accent) 28%, transparent);
}
.se-btn-paste:not(:disabled):hover {
  background: color-mix(in srgb, var(--se-accent) 28%, var(--se-bg-2));
  border-color: var(--se-accent);
  filter: brightness(1.04);
}
.se-btn-paste:disabled {
  background: var(--se-bg-2);
  border-color: var(--se-border);
  color: var(--se-text-muted);
  box-shadow: none;
}
.se-btn-paste .se-btn-icon { color: var(--se-accent); }
.se-btn-paste:disabled .se-btn-icon { color: var(--se-text-muted); }

/* Paste modal — live format-detection chip + supported-formats help */

.se-paste-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--se-border, #2a3540);
  border-radius: 999px;
  background: var(--se-bg-2, #14202b);
  color: var(--se-text-muted, #8a9aa8);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.se-paste-chip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
  flex: 0 0 auto;
}
.se-paste-chip-idle  { color: var(--se-text-muted, #8a9aa8); }
.se-paste-chip-ok {
  color: #6ad29a;
  border-color: color-mix(in srgb, #6ad29a 45%, var(--se-border));
  background: color-mix(in srgb, #6ad29a 12%, var(--se-bg-2));
}
.se-paste-chip-warn {
  color: #e8b75a;
  border-color: color-mix(in srgb, #e8b75a 45%, var(--se-border));
  background: color-mix(in srgb, #e8b75a 12%, var(--se-bg-2));
}
.se-paste-chip-warn-detail { opacity: 0.85; font-weight: 500; text-transform: none; }
.se-paste-chip-error {
  color: #e87878;
  border-color: color-mix(in srgb, #e87878 45%, var(--se-border));
  background: color-mix(in srgb, #e87878 12%, var(--se-bg-2));
}

.se-paste-help {
  margin: 4px 0 10px;
  padding: 10px 12px;
  background: var(--se-bg-2, #14202b);
  border: 1px solid var(--se-border, #2a3540);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--se-text-muted, #b3c0cd);
}
.se-paste-help code {
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--se-text, #e6edf3);
}

.se-btn-save {
  background: var(--se-bg-2);
  border-color: var(--se-border);
  color: var(--se-text-muted);
}
.se-btn-save:not(:disabled) {
  background: var(--se-accent);
  border-color: var(--se-accent);
  color: #04161e;
  box-shadow: 0 0 0 2px var(--se-accent-dim);
}
.se-btn-save:not(:disabled):hover { filter: brightness(1.08); }

/* ── Clear-spot button (promoted to a prominent full-width button,
      sits at the bottom of the Paint card). Delete-set was removed
      from here — it lives in the All Ranges overlay per-card × chip. */

.se-paint-clear-wrap {
  padding: 2px 12px 8px;
}
.se-paint-clear-wrap[hidden] { display: none; }

.se-btn-clear {
  width: 100%;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--se-bg-2);
  color: var(--se-text-muted);
  border: 1px solid var(--se-border);
  border-radius: var(--se-r-sm);
  cursor: pointer;
  transition: background var(--se-dur) var(--se-ease),
              border-color var(--se-dur) var(--se-ease),
              color var(--se-dur) var(--se-ease),
              transform 80ms var(--se-ease);
  font-family: inherit;
}
.se-btn-clear:hover:not(:disabled) {
  color: var(--se-warn);
  border-color: rgba(212, 160, 0, 0.45);
  background: rgba(212, 160, 0, 0.10);
  transform: translateY(-1px);
}
.se-btn-clear:active:not(:disabled) { transform: translateY(0); }
.se-btn-clear:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--se-accent);
}
.se-btn-clear:disabled { opacity: 0.45; cursor: not-allowed; }
.se-btn-clear svg { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════════
   Stats card  (title + action cards + stacked progress bar)
   ═══════════════════════════════════════════════════════════════════════ */

/* Stats card grows to fill sidebar remainder, content scrolls internally
   only if ever it would exceed — normal content fits without scrolling. */
.se-stats {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.se-stats-hdr {
  padding: 10px 14px 10px;
  border-bottom: 1px solid var(--se-border);
  flex-shrink: 0;
}

.se-stats-heading { min-width: 0; }

.se-stats-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--se-text);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  border: 0;
  padding: 0;
  /* Override the baseline layout.css .ranges-spot-label row styles */
  display: block;
}
.se-stats-sub {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--se-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Stats-heading inside the redesigned Stats subsection (sits below the
   Paint subsection). Title + subtitle stacked. */
#view-set-editor .se-tool-card[data-tool="stats"] .se-stats-heading {
  padding: 0 12px 4px;
}

/* Breakdown action cards (rendered by set-editor.js → renderBreakdown).
   Content-sized so the KPI strip can sit directly below in the Stats card. */
.se-breakdown {
  padding: 4px 12px 8px;
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Stats tool card — allow internal scroll if the KPI + action cards ever
   exceed the allotted height (edge case; typical content fits). */
#view-set-editor .se-tool-card[data-tool="stats"] {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--se-border-strong) transparent;
}
#view-set-editor .se-tool-card[data-tool="stats"]::-webkit-scrollbar { width: 4px; }
#view-set-editor .se-tool-card[data-tool="stats"]::-webkit-scrollbar-thumb {
  background: var(--se-border-strong);
  border-radius: 2px;
}

#view-set-editor .action-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
#view-set-editor .action-card {
  min-width: 0;
  padding: 8px 10px 10px;
  border-radius: var(--se-r-sm);
  background: var(--se-bg-2);
  border: 1px solid var(--se-border);
  color: var(--se-text);
  transition: transform 80ms var(--se-ease),
              box-shadow var(--se-dur) var(--se-ease);
}
#view-set-editor .action-card-dominant {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), var(--se-shadow-md);
  transform: translateY(-1px);
}
#view-set-editor .action-card-header {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--se-text-muted);
  margin-bottom: 4px;
}
#view-set-editor .action-card-pct {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--se-text);
}
#view-set-editor .action-card-combos {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--se-text-dim);
  letter-spacing: 0.04em;
}
#view-set-editor .action-card-bar {
  margin-top: 6px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
#view-set-editor .action-card-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 220ms var(--se-ease);
}

/* Action card — Study-parity: position:relative so the ring SVG absolute-
   positions into the top-right corner. Bigger percent text, taller card. */
#view-set-editor .action-card {
  position: relative;
  aspect-ratio: 1.8 / 1;
  padding: 10px 12px 12px;
  cursor: pointer;
  transition: transform 80ms var(--se-ease),
              box-shadow var(--se-dur) var(--se-ease),
              filter var(--se-dur) var(--se-ease);
}
#view-set-editor .action-card:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
/* Active spotlight — ring + lift to show which card the matrix is
   currently highlighting (2026-04-23). */
#view-set-editor .action-card.action-card-spot-active {
  box-shadow: 0 0 0 2px var(--se-accent),
              0 6px 20px rgba(0, 212, 160, 0.25);
  transform: translateY(-1px);
}
#view-set-editor .action-card-pct {
  font-size: 22px;
  line-height: 1.05;
  margin-top: 2px;
}
#view-set-editor .action-card-header {
  font-size: 10px;
}
#view-set-editor .action-card-combos {
  font-size: 10px;
  opacity: 0.85;
}
#view-set-editor .action-card-bar {
  margin-top: 6px;
  height: 3px;
}

/* SVG ring indicator — EXACT Study parity (index.html:3263-3273 +
   4037-4040). 20×20, white stroke on all cards since cards are
   solid-colored and white is the high-contrast choice. */
#view-set-editor .ac-ring {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  opacity: 0.95;
  pointer-events: none;
  z-index: 2;
}
#view-set-editor .ac-ring .ring-bg {
  stroke: rgba(255, 255, 255, 0.25);
  fill: none;
  stroke-width: 3;
}
#view-set-editor .ac-ring .ring-fg {
  stroke: #f0f0f0;
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 0.6s var(--se-ease);
}
#view-set-editor .action-card.fold .ac-ring .ring-bg { stroke: rgba(255, 255, 255, 0.12); }

/* Action cards — EXACT Study parity (index.html:3244+). Solid bright fill,
   white text, 10px radius, no tinted gradient. */
#view-set-editor .action-card.raise {
  background: #e05252;
  border-color: #e05252;
  color: #f0f0f0;
  border-radius: 10px;
}
#view-set-editor .action-card.raise .action-card-header { color: rgba(255,255,255,0.85); font-weight: 600; }
#view-set-editor .action-card.raise .action-card-pct    { color: #fff; font-weight: 700; }
#view-set-editor .action-card.raise .action-card-combos { color: rgba(255,255,255,0.75); }
#view-set-editor .action-card.raise .action-card-bar    { background: rgba(255,255,255,0.18); }
#view-set-editor .action-card.raise .action-card-bar-fill { background: #fff; }

#view-set-editor .action-card.call {
  background: #3a7bd5;
  border-color: #3a7bd5;
  color: #f0f0f0;
  border-radius: 10px;
}
#view-set-editor .action-card.call .action-card-header { color: rgba(255,255,255,0.85); font-weight: 600; }
#view-set-editor .action-card.call .action-card-pct    { color: #fff; font-weight: 700; }
#view-set-editor .action-card.call .action-card-combos { color: rgba(255,255,255,0.75); }
#view-set-editor .action-card.call .action-card-bar    { background: rgba(255,255,255,0.18); }
#view-set-editor .action-card.call .action-card-bar-fill { background: #fff; }

#view-set-editor .action-card.fold {
  background: #1e1e1e;
  border-color: rgba(255,255,255,0.08);
  border-radius: 10px;
}
#view-set-editor .action-card.fold .action-card-header { color: rgba(255,255,255,0.65); font-weight: 600; }
#view-set-editor .action-card.fold .action-card-pct    { color: #f0f0f0; font-weight: 700; }
#view-set-editor .action-card.fold .action-card-combos { color: rgba(255,255,255,0.50); }
#view-set-editor .action-card.fold .action-card-bar    { background: rgba(255,255,255,0.08); }
#view-set-editor .action-card.fold .action-card-bar-fill { background: rgba(255,255,255,0.55); }

#view-set-editor .action-card.push {
  background: linear-gradient(180deg, rgba(137, 87, 229, 0.22), rgba(137, 87, 229, 0.08));
  border-color: rgba(137, 87, 229, 0.45);
}
#view-set-editor .action-card.push .action-card-header { color: #a985f0; }
#view-set-editor .action-card.push .action-card-bar-fill { background: #8957e5; }

#view-set-editor .action-card.allin {
  background: linear-gradient(180deg, rgba(228, 158, 0, 0.22), rgba(228, 158, 0, 0.08));
  border-color: rgba(228, 158, 0, 0.45);
}
#view-set-editor .action-card.allin .action-card-header { color: #f1b93b; }
#view-set-editor .action-card.allin .action-card-bar-fill { background: var(--color-allin, #e49e00); }

/* Stacked progress bar under the cards — Study parity
   (index.html:4068+). 10px tall, 8px radius, subtle bg + inset border. */
#view-set-editor .action-bar-track {
  display: flex;
  height: 10px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
}
#view-set-editor .action-bar-segment {
  height: 100%;
  transition: width 220ms var(--se-ease);
}
#view-set-editor .action-bar-segment.raise {
  background: linear-gradient(90deg, #c83f3f 0%, #f07070 100%);
}
#view-set-editor .action-bar-segment.call {
  background: linear-gradient(90deg, #2d66b8 0%, #5a93e0 100%);
}
#view-set-editor .action-bar-segment.fold  { background: #484f58; }
#view-set-editor .action-bar-segment.push  { background: #8957e5; }
#view-set-editor .action-bar-segment.allin { background: var(--color-allin, #e49e00); }

/* ═══════════════════════════════════════════════════════════════════════
   KPI strip (Stats subsection — Range % / Combos / Pure·Mixed / Shape)
   ═══════════════════════════════════════════════════════════════════════ */

/* KPI strip — EXACT Study parity (index.html:3275-3292). 2×2, 12px
   radius, 0.8px faint border, 1px gap, subtle bg. */
#view-set-editor .se-kpi-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  padding: 6px;
  margin: 0;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}
#view-set-editor .se-kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 6px 8px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  min-width: 0;
  transition: background 0.22s var(--se-ease);
}
#view-set-editor .se-kpi:hover { background: rgba(255, 255, 255, 0.04); }
#view-set-editor .se-kpi-val {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--se-text);
  letter-spacing: 0.01em;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
#view-set-editor .se-kpi-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--se-text-dim);
}
#view-set-editor .se-kpi-shape-linear    { color: #6ab0f5; }
#view-set-editor .se-kpi-shape-polarized { color: #e08040; }
#view-set-editor .se-kpi-shape-merged    { color: #80c080; }

/* ═══════════════════════════════════════════════════════════════════════
   Breakdown card — tabs + panels
   ═══════════════════════════════════════════════════════════════════════ */

#view-set-editor .se-breakdown-hdr {
  padding: 10px 12px 8px;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
/* Tabs — EXACT Study parity: pill container + white-gradient pill for
   active tab, dim transparent for inactive. */
#view-set-editor .se-tabs {
  display: flex;
  gap: 4px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 999px;
  flex: 1 1 auto;
  min-width: 0;
}
#view-set-editor .se-tab {
  flex: 1;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--se-text-muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--se-dur) var(--se-ease), color var(--se-dur) var(--se-ease);
}
#view-set-editor .se-tab:hover { color: var(--se-text); }
#view-set-editor .se-tab[aria-selected="true"] {
  color: #0a0a0a;
  background: linear-gradient(#e7e7e7 0%, #b5b5b5 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
#view-set-editor .se-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--se-accent);
}

#view-set-editor .se-tab-panels {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#view-set-editor .se-tab-panel {
  display: none;
  padding: 8px 12px 12px;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--se-border-strong) transparent;
}
#view-set-editor .se-tab-panel[data-active="true"] { display: block; }
#view-set-editor .se-tab-panel::-webkit-scrollbar { width: 4px; }
#view-set-editor .se-tab-panel::-webkit-scrollbar-thumb {
  background: var(--se-border-strong);
  border-radius: 2px;
}

/* ── Composition rows (name / bar / count) ─────────────────────────────── */

#view-set-editor .se-comp-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#view-set-editor .se-comp-row {
  display: grid;
  grid-template-columns: 112px 1fr 40px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s var(--se-ease);
}
#view-set-editor .se-comp-row:hover {
  background: rgba(255, 255, 255, 0.04);
}
#view-set-editor .se-comp-row:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 2px var(--se-accent);
}
#view-set-editor .se-comp-row.se-comp-row-active {
  background: rgba(224, 82, 82, 0.14);
  box-shadow: inset 0 0 0 1px rgba(224, 82, 82, 0.35);
}
#view-set-editor .se-comp-row.se-comp-row-active .se-comp-name {
  color: #f08080;
}
#view-set-editor .se-comp-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--se-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
#view-set-editor .se-comp-mixed-tag {
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  color: #e0a840;
  background: rgba(224, 168, 64, 0.12);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
/* Composition bar — EXACT Study parity (7px tall, coral-to-orange
   gradient, 4px radius). */
#view-set-editor .se-comp-bar-wrap {
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
#view-set-editor .se-comp-bar {
  height: 100%;
  background: linear-gradient(90deg, rgba(224, 82, 82, 0.88) 0%, rgb(255, 140, 90) 100%);
  border-radius: 4px;
  transition: width 250ms var(--se-ease);
}
#view-set-editor .se-comp-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--se-text-dim);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ── Patterns lines (key · value, with optional mixed callout) ─────────── */

#view-set-editor .se-patterns-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(106, 176, 245, 0.06);
  border: 1px solid rgba(106, 176, 245, 0.18);
  border-radius: var(--se-r-sm);
}
#view-set-editor .se-patterns-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(106, 176, 245, 0.12);
}
#view-set-editor .se-patterns-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
#view-set-editor .se-patterns-key {
  min-width: 88px;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--se-text-muted);
}
#view-set-editor .se-patterns-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--se-text);
  word-break: break-word;
}
#view-set-editor .se-patterns-mix {
  color: #e0a840;
  font-size: 10px;
  font-weight: 600;
}

/* ── Detail panel — hand breakdown (clicked cell) ──────────────────────── */

#view-set-editor .se-hand-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#view-set-editor .se-detail-hint {
  font-size: 11px;
  color: var(--se-text-dim);
  line-height: 1.4;
}

/* Hand header */
#view-set-editor .se-hd-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--se-border);
}
#view-set-editor .se-hd-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--se-text);
  letter-spacing: 0.02em;
}
#view-set-editor .se-hd-meta {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--se-text-muted);
}

/* Suit-combo grid: 2-4 columns depending on card width */
#view-set-editor .se-hd-combos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
}
#view-set-editor .se-hdc-card {
  padding: 6px 6px 4px;
  background: var(--se-bg-2);
  border: 1px solid var(--se-border);
  border-radius: var(--se-r-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
#view-set-editor .se-hdc-suits {
  font-size: 13px;
  font-weight: 800;
  color: var(--se-text);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#view-set-editor .se-hdc-freqs {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#view-set-editor .se-hdc-line {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}
#view-set-editor .se-hdc-act {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--se-text-dim);
}
#view-set-editor .se-hdc-val {
  font-weight: 700;
  color: var(--se-text-muted);
}

/* Frequency buttons row (matching Study's .hfb-*) */
#view-set-editor .se-hd-freqbtns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 6px;
}
#view-set-editor .se-hd-freqbtn {
  padding: 8px 10px;
  background: var(--se-bg-2);
  border: 1px solid var(--se-border);
  border-radius: var(--se-r-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
#view-set-editor .se-hd-freqbtn-lbl {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--se-text-muted);
}
#view-set-editor .se-hd-freqbtn-pct {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--se-text);
  line-height: 1.05;
}
#view-set-editor .se-hd-freqbtn-pct span {
  font-size: 11px;
  font-weight: 700;
  margin-left: 1px;
}
#view-set-editor .se-hd-freqbtn-combos {
  font-size: 9px;
  color: var(--se-text-dim);
  letter-spacing: 0.04em;
}
#view-set-editor .se-hd-freqbtn.hfb-raise { border-color: rgba(208, 90, 88, 0.45); background: linear-gradient(180deg, rgba(208,90,88,0.22), rgba(208,90,88,0.08)); }
#view-set-editor .se-hd-freqbtn.hfb-raise .se-hd-freqbtn-lbl { color: var(--se-raise); }
#view-set-editor .se-hd-freqbtn.hfb-call  { border-color: rgba(74,136,209,0.45);  background: linear-gradient(180deg, rgba(74,136,209,0.22),  rgba(74,136,209,0.08)); }
#view-set-editor .se-hd-freqbtn.hfb-call  .se-hd-freqbtn-lbl { color: var(--se-call); }
#view-set-editor .se-hd-freqbtn.hfb-push  { border-color: rgba(137,87,229,0.45);  background: linear-gradient(180deg, rgba(137,87,229,0.22),  rgba(137,87,229,0.08)); }
#view-set-editor .se-hd-freqbtn.hfb-push  .se-hd-freqbtn-lbl { color: #a985f0; }

/* Stacked freq bar at the bottom of the Detail panel */
#view-set-editor .se-hd-bar {
  display: flex;
  height: 8px;
  border-radius: var(--se-r-pill);
  overflow: hidden;
  background: var(--se-bg-2);
  box-shadow: inset 0 0 0 1px var(--se-border);
}
#view-set-editor .se-hd-bar-seg {
  height: 100%;
  transition: width 220ms var(--se-ease);
}

/* ── Highlight-mixed button (sits at the top of the Stats subsection) ── */

/* Highlight Mixed button — EXACT Study parity (index.html:4186-4236).
   Full-width chip-style pill with dark glassy background, grey text,
   green accent on press. */
#view-set-editor .se-mixed-btn {
  margin: 0;
  padding: 4px 10px;
  width: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--se-text-muted);
  background: rgba(18, 22, 24, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s var(--se-ease);
  font-family: inherit;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4),
              inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}
#view-set-editor .se-mixed-btn:hover {
  background: rgba(32, 180, 140, 0.12);
  border-color: rgba(32, 180, 140, 0.40);
  color: #29c99a;
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45),
              inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}
#view-set-editor .se-mixed-btn[aria-pressed="true"] {
  background: rgba(32, 180, 140, 0.18);
  border-color: rgba(32, 180, 140, 0.55);
  color: #29c99a;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45),
              0 0 12px rgba(41, 201, 154, 0.25);
}
#view-set-editor .se-mixed-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--se-accent);
}
#view-set-editor .se-mixed-btn[hidden] { display: none; }
#view-set-editor .se-mixed-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  transition: background 0.18s, box-shadow 0.18s;
}
#view-set-editor .se-mixed-btn:hover .se-mixed-dot,
#view-set-editor .se-mixed-btn[aria-pressed="true"] .se-mixed-dot {
  background: #29c99a;
  box-shadow: 0 0 8px rgba(41, 201, 154, 0.5);
}

/* Mixed highlight mode on the Set Editor grid (Study parity at
   index.html:2824-2834) — raise + fold fade out, mixed cells ring green. */
#view-set-editor #set-editor-grid.mixed-highlight-mode .matrix-cell.action-raise,
#view-set-editor #set-editor-grid.mixed-highlight-mode .matrix-cell.action-fold {
  opacity: 0.18;
}
#view-set-editor #set-editor-grid.mixed-highlight-mode .matrix-cell:not(.action-raise):not(.action-fold) {
  outline: 2px solid #29c99a;
  outline-offset: -2px;
  opacity: 1;
  z-index: 1;
  position: relative;
}

/* Composition spotlight — clicking a row in the Composition tab dims
   non-matching cells and rings the matching ones. Mirrors Study's
   composition-row spotlight at index.html:2824-2834. */
#view-set-editor #set-editor-grid .matrix-cell.cell-spotlight-off {
  opacity: 0.14;
  transition: opacity 180ms var(--se-ease);
}
#view-set-editor #set-editor-grid .matrix-cell.cell-spotlight-on {
  opacity: 1;
  outline: 2px solid #29c99a;
  outline-offset: -2px;
  z-index: 1;
  position: relative;
  transition: opacity 180ms var(--se-ease);
}

/* ═══════════════════════════════════════════════════════════════════════
   Tag palette (used by set cards + modal)
   ═══════════════════════════════════════════════════════════════════════ */

#view-set-editor .tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--se-r-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
#view-set-editor .tag-gto {
  background: rgba(0, 212, 160, 0.14);
  color: var(--se-accent);
}
#view-set-editor .tag-exploit {
  background: rgba(212, 160, 0, 0.14);
  color: var(--se-warn);
}
#view-set-editor .tag-stack {
  background: var(--se-bg-2);
  color: var(--se-text-muted);
  box-shadow: inset 0 0 0 1px var(--se-border);
}
#view-set-editor .tag-stakes {
  background: var(--se-bg-2);
  color: var(--se-text-muted);
  box-shadow: inset 0 0 0 1px var(--se-border);
}

/* ═══════════════════════════════════════════════════════════════════════
   Responsive — 2-col stacks below 1180px, single col below 780px
   ═══════════════════════════════════════════════════════════════════════ */

/* Short desktop viewports (≤900px height): tighten top chrome
   proportionally so the matrix keeps its share. Saves ~24px total
   by trimming padding + min-heights on the Range Sets bar and the
   preflop-nav row. Matrix vh budget drops from 380 → 356. */
@media (max-height: 900px) and (min-width: 1181px) {
  #view-set-editor .se-sets-bar {
    padding: 5px 16px;
    min-height: 48px;
  }
  #view-set-editor #set-pf-nav {
    padding: 5px 16px 5px;
  }
  #view-set-editor .se-nav-top {
    margin-bottom: 5px;
  }
  #view-set-editor .pf-pos-card {
    padding: 6px 10px !important;
  }
  #view-set-editor .pf-card-header {
    margin-bottom: 2px !important;
  }
  #view-set-editor .se-matrix-col {
    --range-matrix-height: min(calc(100vh - 356px), 560px);
  }
}

/* Very short viewports (≤800px height): further tighten. */
@media (max-height: 800px) and (min-width: 1181px) {
  #view-set-editor .se-sets-bar {
    padding: 4px 14px;
    min-height: 42px;
  }
  #view-set-editor .se-sets-list .set-card {
    min-width: 140px;
    padding: 6px 10px;
  }
  #view-set-editor #set-pf-nav {
    padding: 4px 14px 4px;
  }
  #view-set-editor .pf-pos-card {
    padding: 4px 8px !important;
  }
  #view-set-editor .pf-action {
    font-size: 10px !important;
    line-height: 1.3 !important;
  }
  #view-set-editor .se-matrix-col {
    --range-matrix-height: min(calc(100vh - 332px), 560px);
  }
}

/* Tablet & below (<1181px): info col falls below the matrix. */
@media (max-width: 1180px) {
  #view-set-editor .se-body {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 16px;
    gap: 16px;
  }
  #view-set-editor .se-matrix-col {
    --range-matrix-height: min(60vh, calc(100vw - 80px));
    --range-matrix-width:  var(--range-matrix-height);
    align-items: center;
    flex-shrink: 0;
  }
  .se-matrix-frame { align-self: center; }
  #view-set-editor .se-info-col {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    flex-shrink: 0;
  }
}

/* Mobile (<780px): single column inside info col. */
@media (max-width: 780px) {
  #view-set-editor #set-pf-nav { padding: 8px 12px 10px; }
  #view-set-editor .se-sets-bar {
    padding: 8px 12px;
    min-height: 58px;
  }
  #view-set-editor .se-nav-top { flex-wrap: wrap; }
  #view-set-editor .se-breadcrumb { order: 3; flex-basis: 100%; font-size: 12px; }
  #view-set-editor .se-matrix-col {
    --range-matrix-height: min(calc(100vw - 40px), 520px);
    --range-matrix-width:  var(--range-matrix-height);
  }
  #view-set-editor .se-info-col { grid-template-columns: 1fr; }
  .se-paint-actions { gap: 6px; padding: 10px 12px; }
  .se-paint-btn { min-height: 54px; }
  .se-paint-freq, .se-paint-cta { padding-left: 12px; padding-right: 12px; }
  .se-subsection-hdr { padding: 10px 12px 6px; }
  .se-breakdown { padding: 10px 12px; }
  #view-set-editor .se-kpi-strip { padding: 2px 12px 12px; }
  #view-set-editor .se-kpi { padding: 6px 8px; }
  #view-set-editor .se-tab-panel { padding: 8px 10px 10px; }
  #view-set-editor .se-comp-row { grid-template-columns: 96px 1fr 36px; }
  #view-set-editor .se-patterns-key { min-width: 72px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Breakdown card — stats metadata footer (moved from Paint card per
   2026-04-23 user feedback). Paint keeps only action % bars.
   ═══════════════════════════════════════════════════════════════════════ */

#view-set-editor .se-breakdown-stats {
  padding: 8px 14px 10px;
  border-top: 1px solid var(--se-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
#view-set-editor .se-breakdown-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
#view-set-editor .se-tool-card[data-tool="breakdown"] .se-tab-panels {
  flex: 1 1 auto;
  min-height: 0;
}
#view-set-editor .se-breakdown-inline {
  padding: 8px 12px 12px;
  flex: 0 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════
   Sizing inline editor (Paint block) — hero cards
   ═══════════════════════════════════════════════════════════════════════ */

#view-set-editor .se-sizing-inline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 12px 4px;
  padding: 0;
  background: transparent;
  border: 0;
}
#view-set-editor .se-sizing-inline[hidden] { display: none; }

/* Hero card — attention-grabbing but compact (2026-04-23 shrink). */
#view-set-editor .se-ctx-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 10px;
  background: linear-gradient(135deg, rgba(208, 90, 88, 0.14), rgba(208, 90, 88, 0.04));
  border: 1px solid rgba(208, 90, 88, 0.35);
  border-radius: 8px;
  transition: transform 80ms var(--se-ease),
              box-shadow var(--se-dur) var(--se-ease),
              border-color var(--se-dur) var(--se-ease);
}
#view-set-editor .se-ctx-hero-primary {
  background: linear-gradient(135deg, rgba(208, 90, 88, 0.20), rgba(208, 90, 88, 0.06));
  border-color: rgba(208, 90, 88, 0.55);
  box-shadow: 0 2px 12px rgba(208, 90, 88, 0.10);
}
#view-set-editor .se-ctx-hero-context {
  background: linear-gradient(135deg, rgba(74, 136, 209, 0.10), rgba(74, 136, 209, 0.03));
  border-color: rgba(74, 136, 209, 0.30);
}
#view-set-editor .se-ctx-hero-override {
  border-color: var(--se-accent);
  box-shadow: 0 0 0 1px var(--se-accent-dim);
}
#view-set-editor .se-ctx-hero-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
#view-set-editor .se-ctx-hero-icon {
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
}
#view-set-editor .se-ctx-hero-titles {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
#view-set-editor .se-ctx-hero-eyebrow {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--se-text-muted);
}
#view-set-editor .se-ctx-hero-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--se-text);
}
#view-set-editor .se-ctx-hero-saved {
  font-size: 10px;
  font-weight: 700;
  color: #29c99a;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.25s var(--se-ease), transform 0.25s var(--se-ease);
}
#view-set-editor .se-ctx-hero.se-tree-saved-flash .se-ctx-hero-saved {
  opacity: 1;
  transform: translateY(0);
}
#view-set-editor .se-ctx-hero.se-tree-saved-flash {
  box-shadow: 0 0 0 2px rgba(41, 201, 154, 0.4);
}
#view-set-editor .se-ctx-hero-control {
  display: grid;
  grid-template-columns: 26px 1fr 26px;
  align-items: stretch;
  gap: 4px;
}
#view-set-editor .se-ctx-hero-step {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--se-border);
  border-radius: 5px;
  color: var(--se-text);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  min-height: 26px;
  transition: background var(--se-dur) var(--se-ease),
              border-color var(--se-dur) var(--se-ease),
              color var(--se-dur) var(--se-ease);
}
#view-set-editor .se-ctx-hero-step:hover {
  background: rgba(0, 0, 0, 0.40);
  border-color: var(--se-text);
  color: var(--se-text);
}
#view-set-editor .se-ctx-hero-step:active { transform: scale(0.95); }
#view-set-editor .se-ctx-hero-input-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid var(--se-border);
  border-radius: 6px;
  padding: 2px 8px;
  transition: border-color var(--se-dur) var(--se-ease),
              box-shadow var(--se-dur) var(--se-ease);
}
#view-set-editor .se-ctx-hero-input-wrap:focus-within {
  border-color: var(--se-accent);
  box-shadow: 0 0 0 2px var(--se-accent-dim);
}
#view-set-editor .se-ctx-hero-input {
  width: 46px;
  border: 0;
  background: transparent;
  color: var(--se-text);
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 1px 0;
  outline: none;
  font-family: inherit;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}
#view-set-editor .se-ctx-hero-input::-webkit-outer-spin-button,
#view-set-editor .se-ctx-hero-input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
#view-set-editor .se-ctx-hero-unit {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--se-text-dim);
}
#view-set-editor .se-ctx-hero-foot {
  font-size: 10px;
  color: var(--se-text-dim);
  text-align: center;
  letter-spacing: 0.02em;
}
#view-set-editor .se-ctx-hero-diff strong {
  color: var(--se-text);
  font-weight: 700;
}
#view-set-editor .se-ctx-hero-custom-tag {
  display: inline-block;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--se-accent);
  color: #04161e;
  margin-left: 2px;
}
#view-set-editor .se-ctx-hero-diff-default {
  opacity: 0.75;
}

/* ═══════════════════════════════════════════════════════════════════════
   Sizing Tree modal v2 — 2-panel layout (outline rail + right panel)
   ═══════════════════════════════════════════════════════════════════════ */

/* The sizing modal lives outside #view-set-editor (it's a body-level
   modal), so the `--se-*` tokens defined on #view-set-editor don't
   cascade here. Redeclare the subset of tokens the modal uses so the
   modal renders opaquely with the right colors. */
#sizing-tree-backdrop .se-tree-modal-v2 {
  --se-bg:            var(--bg-primary, #0a0d12);
  --se-bg-2:          #0d1014;
  --se-card:          #141821;
  --se-card-elev:     #1a1f29;
  --se-border:        #232835;
  --se-border-strong: #2e3545;
  --se-text:          var(--text-primary, #f0f0f0);
  --se-text-muted:    #8892a6;
  --se-text-dim:      #5b6478;
  --se-accent:        var(--color-accent, #00d4a0);
  --se-accent-dim:    rgba(0, 212, 160, 0.14);
  --se-warn:          #d4a000;
  --se-raise:         #d05a58;
  --se-r-xs:          6px;
  --se-r-sm:          8px;
  --se-r-md:          10px;
  --se-ease:          cubic-bezier(0.2, 0.7, 0.2, 1);
  --se-dur:           140ms;
}

/* !important needed to override layout.css `.modal { max-width: 520px }`. */
#sizing-tree-backdrop.new-set-backdrop .modal.se-tree-modal-v2 {
  width: min(1200px, calc(100vw - 64px)) !important;
  max-width: none !important;
  height: min(780px, calc(100vh - 40px));
  max-height: calc(100vh - 40px);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--se-bg);
  color: var(--se-text);
  border: 1px solid var(--se-border);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

/* Header bar (spans both panels) */
.se-tree-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--se-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  flex-shrink: 0;
}
.se-tree-hdr-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}
.se-tree-hdr-icon {
  font-size: 18px;
  color: var(--se-accent);
  line-height: 1;
  transform: translateY(1px);
}
.se-tree-hdr-left h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--se-text);
}
/* Format + stack pill — promoted to a big visible badge so users always
   know which tree they're editing. */
.se-tree-modal-format {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--se-accent, #5ad9ff);
  padding: 6px 14px;
  background: color-mix(in srgb, var(--se-accent, #5ad9ff) 14%, var(--se-bg-2));
  border: 1.5px solid color-mix(in srgb, var(--se-accent, #5ad9ff) 50%, var(--se-border));
  border-radius: 999px;
  text-transform: none;
  box-shadow: 0 0 16px color-mix(in srgb, var(--se-accent, #5ad9ff) 20%, transparent);
  text-shadow: 0 0 12px color-mix(in srgb, var(--se-accent, #5ad9ff) 35%, transparent);
}
.se-tree-hdr-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
/* (bb/× unit toggle removed per 2026-04-23 user feedback) */

/* 2-panel body */
.se-tree-body-v2 {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
}

/* ── Left rail ──────────────────────────────────────────────────────── */
.se-tree-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 10px;
  border-right: 1px solid var(--se-border);
  background: var(--se-bg-2);
  overflow-y: auto;
  min-height: 0;
}
.se-tree-rail-section { display: flex; flex-direction: column; gap: 6px; }
.se-tree-rail-title {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--se-text-dim);
  padding: 0 6px 2px;
}
.se-tree-outline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.se-tree-outline-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--se-text-muted);
  text-decoration: none;
  transition: background var(--se-dur) var(--se-ease),
              color var(--se-dur) var(--se-ease);
}
.se-tree-outline-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--se-text); }
.se-tree-outline-item[aria-selected="true"] {
  background: rgba(0, 212, 160, 0.10);
  color: var(--se-accent);
}
.se-tree-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}
.se-tree-dot-open   { background: var(--se-raise); color: var(--se-raise); }
.se-tree-dot-3b     { background: #e05252; color: #e05252; }
.se-tree-dot-sqz    { background: #e08040; color: #e08040; }
.se-tree-dot-4b     { background: #8957e5; color: #8957e5; }
.se-tree-dot-5b     { background: #e49e00; color: #e49e00; }
.se-tree-dot-thresh { background: var(--se-accent); color: var(--se-accent); }

.se-tree-presets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.se-tree-preset-btn {
  position: relative;
  width: 100%;
  text-align: left;
  padding: 10px 12px 10px 16px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--se-accent, #00d4a0) 8%, var(--se-card)) 0%,
    var(--se-card) 100%);
  border: 1px solid color-mix(in srgb, var(--se-accent, #00d4a0) 28%, var(--se-border-strong));
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  transition: border-color var(--se-dur) var(--se-ease),
              background var(--se-dur) var(--se-ease),
              box-shadow var(--se-dur) var(--se-ease),
              transform 80ms var(--se-ease);
}
/* Left accent bar — the visual cue that says "click to apply" */
.se-tree-preset-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--se-accent, #00d4a0);
  opacity: 0.55;
  transition: opacity var(--se-dur) var(--se-ease), width var(--se-dur) var(--se-ease);
}
.se-tree-preset-btn:hover {
  border-color: var(--se-accent);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--se-accent, #00d4a0) 22%, var(--se-card)) 0%,
    color-mix(in srgb, var(--se-accent, #00d4a0) 8%, var(--se-card)) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35),
              0 0 16px color-mix(in srgb, var(--se-accent, #00d4a0) 18%, transparent);
}
.se-tree-preset-btn:hover::before {
  opacity: 1;
  width: 4px;
  box-shadow: 0 0 8px var(--se-accent);
}
.se-tree-preset-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--se-text);
  letter-spacing: 0.02em;
}
.se-tree-preset-desc {
  font-size: 10px;
  color: var(--se-text-muted);
  line-height: 1.4;
}
/* Templates section title — bigger, accent-coloured, with a subtle
   underline glow so it reads as an actionable cluster, not a footer. */
.se-tree-rail-templates {
  padding: 8px 6px;
  background: linear-gradient(180deg, rgba(0, 212, 160, 0.06), transparent);
  border: 1px solid color-mix(in srgb, var(--se-accent, #00d4a0) 18%, var(--se-border));
  border-radius: 9px;
}
.se-tree-rail-templates .se-tree-rail-title {
  color: var(--se-accent, #00d4a0);
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 800;
  padding: 0 4px 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--se-accent, #00d4a0) 20%, transparent);
  margin-bottom: 6px;
  text-shadow: 0 0 8px color-mix(in srgb, var(--se-accent, #00d4a0) 45%, transparent);
}

.se-tree-rail-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--se-border); }
.se-tree-reset-all-btn {
  width: 100%;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--se-text-muted);
  background: transparent;
  border: 1px solid var(--se-border);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: color var(--se-dur) var(--se-ease),
              border-color var(--se-dur) var(--se-ease);
}
.se-tree-reset-all-btn:hover {
  color: var(--se-warn);
  border-color: rgba(212, 160, 0, 0.45);
}

/* ── Right panel — 2-col block grid so IP/OOP blocks sit side-by-side.
   Full-width blocks (Opens / Thresholds / Preview) span both columns
   via `grid-column: 1 / -1`. Goal: NO scrollbars at normal desktop
   sizes (2026-04-23 user feedback). ─────────────────────────────── */
.se-tree-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-flow: dense;
  gap: 10px;
  padding: 12px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  background: var(--se-bg);
  scrollbar-width: thin;
  scrollbar-color: var(--se-border-strong) transparent;
}
.se-tree-panel::-webkit-scrollbar { width: 8px; }
.se-tree-panel::-webkit-scrollbar-thumb {
  background: var(--se-border-strong);
  border-radius: 4px;
}
.se-tree-panel::-webkit-scrollbar-thumb:hover { background: var(--se-accent); }
.se-tree-panel > .se-tree-block[data-block="opens"],
.se-tree-panel > .se-tree-block[data-block="thresh"],
.se-tree-panel > .se-tree-preview {
  grid-column: 1 / -1;
}
.se-tree-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: var(--se-card);
  border: 1px solid var(--se-border);
  border-radius: 8px;
  scroll-margin-top: 8px;
  min-width: 0;
  position: relative;
  transition: border-color var(--se-dur) var(--se-ease),
              box-shadow var(--se-dur) var(--se-ease),
              background var(--se-dur) var(--se-ease);
}
/* Active section highlight — when user clicks a rail item, the matching
   block gets a subtle accent ring + shimmer. (2026-04-23 user feedback) */
.se-tree-block[data-active="true"] {
  border-color: rgba(0, 212, 160, 0.55);
  background: linear-gradient(180deg, rgba(0, 212, 160, 0.06), var(--se-card) 40%);
  box-shadow: 0 0 0 1px rgba(0, 212, 160, 0.25),
              0 4px 18px rgba(0, 212, 160, 0.08);
}
.se-tree-block[data-active="true"] .se-tree-block-title {
  color: var(--se-accent);
}
.se-tree-block-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.se-tree-block-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--se-text);
}
.se-tree-block-reset {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--se-text-dim);
  background: transparent;
  border: 1px solid var(--se-border);
  border-radius: 999px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: inherit;
  transition: color var(--se-dur) var(--se-ease),
              border-color var(--se-dur) var(--se-ease);
}
.se-tree-block-reset:hover {
  color: var(--se-warn);
  border-color: rgba(212, 160, 0, 0.45);
}

/* RFI cells grid — compact, fits 6-8 cells on one row */
.se-tree-block-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.se-tree-rfi-per-seat {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 6px;
}

/* General (master) RFI is now an inline cell sharing the same grid row
   as UTG/HJ/CO/BTN/SB. It uses the same .se-tree-rfi-cell base layout,
   then layers an accent border + GEN badge on top. */
.se-tree-rfi-cell-general {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--se-accent, #00d4a0) 16%, var(--se-bg-2)) 0%,
    color-mix(in srgb, var(--se-accent, #00d4a0) 4%, var(--se-bg-2)) 100%) !important;
  border-color: color-mix(in srgb, var(--se-accent, #00d4a0) 50%, var(--se-border)) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--se-accent, #00d4a0) 25%, transparent);
  transition: border-color var(--se-dur, 160ms) var(--se-ease, ease),
              box-shadow   var(--se-dur, 160ms) var(--se-ease, ease);
}
.se-tree-rfi-cell-general:hover {
  border-color: color-mix(in srgb, var(--se-accent, #00d4a0) 80%, var(--se-border)) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--se-accent, #00d4a0) 40%, transparent),
              0 0 14px color-mix(in srgb, var(--se-accent, #00d4a0) 22%, transparent);
}
.se-tree-rfi-general-mixed {
  background: linear-gradient(180deg,
    color-mix(in srgb, #e8b75a 16%, var(--se-bg-2)) 0%,
    color-mix(in srgb, #e8b75a 4%, var(--se-bg-2)) 100%) !important;
  border-color: color-mix(in srgb, #e8b75a 55%, var(--se-border)) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, #e8b75a 30%, transparent);
}
.se-tree-rfi-general-mixed:hover {
  border-color: color-mix(in srgb, #e8b75a 80%, var(--se-border)) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, #e8b75a 45%, transparent),
              0 0 14px color-mix(in srgb, #e8b75a 25%, transparent);
}
.se-tree-rfi-general-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.10em;
  color: #04161e;
  background: var(--se-accent, #00d4a0);
  border-radius: 4px;
  text-transform: uppercase;
  box-shadow: 0 0 8px color-mix(in srgb, var(--se-accent, #00d4a0) 50%, transparent);
}
.se-tree-rfi-general-mixed .se-tree-rfi-general-badge {
  background: #e8b75a;
  box-shadow: 0 0 8px rgba(232, 183, 90, 0.5);
}

/* SB cell gets a subtle amber mark so users see it's not part of the
   General fill-all. */
.se-tree-rfi-cell-sb {
  border-color: color-mix(in srgb, #e8b75a 22%, var(--se-border)) !important;
}
.se-tree-rfi-cell-sb-tag {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #e8b75a;
  text-transform: uppercase;
  opacity: 0.85;
}

/* Scroll-to-nudge hint shown on contextual Paint sizing cards */
.se-ctx-hero-scroll-hint {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--se-text-muted, #8a9aa8);
  text-transform: uppercase;
  opacity: 0.8;
}
.se-tree-rfi-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 6px;
  background: var(--se-bg-2);
  border: 1px solid var(--se-border);
  border-radius: 8px;
  transition: border-color var(--se-dur) var(--se-ease),
              background var(--se-dur) var(--se-ease);
}
.se-tree-rfi-cell:hover {
  border-color: var(--se-border-strong);
}
.se-tree-rfi-cell.se-tree-rfi-cell-override {
  border-color: var(--se-accent);
  background: linear-gradient(180deg, var(--se-accent-dim), transparent);
}
.se-tree-rfi-cell-pos {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--se-text);
}
.se-tree-rfi-cell.se-tree-rfi-cell-override .se-tree-rfi-cell-pos {
  color: var(--se-accent);
}
.se-tree-rfi-cell-revert {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  padding: 0;
  font-size: 10px;
  font-family: inherit;
  background: transparent;
  border: 0;
  color: var(--se-text-dim);
  cursor: pointer;
  border-radius: 50%;
  line-height: 1;
  transition: color var(--se-dur) var(--se-ease),
              background var(--se-dur) var(--se-ease);
}
.se-tree-rfi-cell-revert:hover {
  color: var(--se-warn);
  background: rgba(212, 160, 0, 0.15);
}

/* Matrix rows (non-RFI blocks) — 2-col grid puts IP+OOP side-by-side */
.se-tree-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}
.se-tree-matrix-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 2px 0;
  min-width: 0;
}
.se-tree-matrix-lbl {
  font-size: 12px;
  font-weight: 800;
  color: var(--se-text);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  text-align: center;
}
/* Thresholds slider row spans full width */
.se-tree-block[data-block="thresh"] .se-tree-matrix-row:first-child {
  grid-column: 1 / -1;
}
.se-tree-input-wrap-v2 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--se-bg-2);
  border: 1px solid var(--se-border);
  border-radius: 6px;
  padding: 3px 8px;
  width: fit-content;
  margin: 0 auto;
  min-width: 0;
  transition: border-color var(--se-dur) var(--se-ease),
              box-shadow var(--se-dur) var(--se-ease),
              background var(--se-dur) var(--se-ease);
}
.se-tree-input-wrap-v2:focus-within {
  border-color: var(--se-accent);
  box-shadow: 0 0 0 2px var(--se-accent-dim);
}
.se-tree-input-wrap-v2.se-tree-input-override {
  border-color: var(--se-accent);
  background: linear-gradient(180deg, var(--se-accent-dim), transparent);
}
.se-tree-input-v2 {
  width: 48px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--se-text);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
  padding: 2px 0;
  outline: none;
  font-family: inherit;
  appearance: textfield;
  -moz-appearance: textfield;
}
.se-tree-input-v2::-webkit-outer-spin-button,
.se-tree-input-v2::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.se-tree-unit-v2 {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--se-text-dim);
}
.se-tree-saved-flash .se-tree-input-v2,
.se-tree-saved-flash.se-tree-input-v2 {
  animation: se-saved-pulse 0.5s var(--se-ease);
}
@keyframes se-saved-pulse {
  0%, 100% { background: transparent; }
  40% { background: rgba(41, 201, 154, 0.25); }
}

/* 5-bet tabs */
.se-tree-fivebet-v2 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.se-tree-fivebet-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: var(--se-bg-2);
  border: 1px solid var(--se-border);
  border-radius: 10px;
}
.se-tree-fivebet-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 14px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--se-text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: color var(--se-dur) var(--se-ease),
              background var(--se-dur) var(--se-ease);
}
.se-tree-fivebet-tab span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.se-tree-fivebet-tab em {
  font-size: 9px;
  font-style: normal;
  color: var(--se-text-dim);
  letter-spacing: 0.02em;
}
.se-tree-fivebet-tab:hover { color: var(--se-text); }
.se-tree-fivebet-tab[aria-pressed="true"] {
  color: var(--se-accent);
  background: var(--se-accent-dim);
}
.se-tree-fivebet-tab[aria-pressed="true"] em { color: rgba(0, 212, 160, 0.70); }
.se-tree-fivebet-input-wrap-v2 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--se-bg-2);
  border: 1px solid var(--se-border);
  border-radius: 8px;
  padding: 4px 10px;
}
.se-tree-fivebet-input-wrap-v2[hidden] { display: none; }

/* Threshold slider */
.se-tree-slider-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}
.se-tree-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0, 212, 160, 0.6) 0%, rgba(0, 212, 160, 0.22) 100%);
  outline: none;
  cursor: pointer;
}
.se-tree-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--se-accent);
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.se-tree-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--se-accent);
  cursor: grab;
}
.se-tree-slider-val {
  min-width: 40px;
  text-align: right;
  font-size: 12px;
  font-weight: 800;
  color: var(--se-accent);
  font-variant-numeric: tabular-nums;
}
.se-tree-thresh-hint {
  margin: 0;
  font-size: 11px;
  color: var(--se-text-dim);
  line-height: 1.4;
}
.se-tree-thresh-hint strong {
  color: var(--se-text);
  font-weight: 700;
}

/* Live preview strip — the primary "what am I building" overview.
   Given extra weight + size per 2026-04-23 user feedback. */
.se-tree-preview {
  padding: 12px 16px 14px;
  background: linear-gradient(180deg, rgba(0, 212, 160, 0.06), var(--se-bg-2));
  border: 1px solid rgba(0, 212, 160, 0.28);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.25);
}
.se-tree-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.se-tree-preview-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--se-accent);
}
.se-tree-preview-sub {
  font-size: 10px;
  color: var(--se-text-dim);
  letter-spacing: 0.02em;
  margin-top: 2px;
}
.se-tree-preview-path {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.se-tree-preview-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 14px;
  background: var(--se-card);
  border: 1px solid var(--se-border);
  border-radius: 8px;
  min-width: 86px;
  align-items: center;
  flex: 1 1 auto;
  transition: transform var(--se-dur) var(--se-ease),
              box-shadow var(--se-dur) var(--se-ease);
}
.se-tree-preview-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.se-tree-preview-chip-pos {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.10em;
  color: var(--se-text-dim);
  text-transform: uppercase;
}
.se-tree-preview-chip-act {
  font-size: 15px;
  font-weight: 800;
  color: var(--se-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.se-tree-preview-chip-open .se-tree-preview-chip-act { color: #e05252; }
.se-tree-preview-chip-3b   .se-tree-preview-chip-act { color: #e08040; }
.se-tree-preview-chip-4b   .se-tree-preview-chip-act { color: #a985f0; }
.se-tree-preview-chip-5b   .se-tree-preview-chip-act { color: #f1b93b; }
.se-tree-preview-arrow {
  color: var(--se-text-dim);
  font-size: 16px;
  opacity: 0.7;
}

/* Footer */
.se-tree-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--se-border);
  background: var(--se-bg-2);
  flex-shrink: 0;
}
.se-tree-save-hint {
  font-size: 10px;
  font-weight: 600;
  color: var(--se-text-dim);
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════════════════
   Library overlay  (kept as-is — rebuilt in a future pass)
   ═══════════════════════════════════════════════════════════════════════ */

.library-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(0, 0, 0, 0.78);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow-y: auto;
}
.library-overlay.open { display: flex; }

.library-card {
  width: 100%;
  max-width: 1200px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 64px);
  overflow: hidden;
}
.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.library-header-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.library-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.library-count {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.library-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.library-filters select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 7px 28px 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.library-filters select:hover { border-color: var(--color-accent); }
.library-close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.library-close:hover {
  color: var(--color-wrong);
  border-color: rgba(224, 82, 82, 0.5);
  background: rgba(224, 82, 82, 0.08);
}
.library-body {
  padding: 20px 24px 28px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.library-grid .range-card { margin: 0; }
.library-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
}
.library-empty h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.library-empty p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 24px;
  max-width: 380px;
}
.library-empty-filtered {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  grid-column: 1 / -1;
}

/* ═══════════════════════════════════════════════════════════════════════
   Segmented button groups (New Set modal) — unchanged
   ═══════════════════════════════════════════════════════════════════════ */

.segmented-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}
.segmented-btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  white-space: nowrap;
  font-family: inherit;
}
.segmented-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}
.segmented-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-accent);
}
.segmented-btn.active {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--color-accent);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(59, 130, 246, 0.35) inset;
}
.segmented-btn.active:hover { background: var(--bg-card); }

/* "Custom…" segmented chip — subdued styling so it reads as secondary
   to the preset values. Reveals a follow-up input below when active. */
.segmented-btn-custom {
  font-style: italic;
  font-weight: 600;
  opacity: 0.85;
}
.segmented-btn-custom.active { font-style: normal; opacity: 1; }

.segmented-custom-wrap {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.segmented-custom-wrap[hidden] { display: none; }
.segmented-custom-wrap .form-hint {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* Single number + unit (e.g. "75" + "bb"). The row uses focus-within to
   mirror the input's focus ring onto the whole shell. */
.segmented-custom-input-row {
  display: flex;
  align-items: stretch;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.segmented-custom-input-row:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(0, 212, 160, 0.2);
}

.segmented-custom-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  appearance: textfield;
  -moz-appearance: textfield;
}
.segmented-custom-input::-webkit-outer-spin-button,
.segmented-custom-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.segmented-custom-input::placeholder { color: var(--text-muted); }

.segmented-custom-unit {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-left: 1px solid var(--border);
}
.segmented-custom-unit-prefix {
  border-left: none;
  border-right: 1px solid var(--border);
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
}

/* Two-up grid for Rake % + Rake cap. */
.segmented-custom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.segmented-custom-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.segmented-custom-field-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .segmented-custom-grid { grid-template-columns: 1fr; }
}

/* Format tag on set chips in the Set Editor Range Sets bar. */
#view-set-editor .tag-format {
  background: rgba(137, 87, 229, 0.16);
  color: #a985f0;
}

.new-set-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.new-set-backdrop.open { display: flex; }

/* ═══════════════════════════════════════════════════════════════════════
   Legacy My Ranges list view (no longer reachable via nav, kept as a
   safety net for any stale route).
   ═══════════════════════════════════════════════════════════════════════ */

#view-my-ranges {
  flex-direction: column;
  height: calc(100vh - 44px);
  overflow: hidden;
}
#view-my-ranges.active { display: flex; }

.my-ranges-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.my-ranges-header .view-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.my-ranges-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.my-ranges-filters select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 32px 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.my-ranges-filters select:hover { border-color: var(--color-accent); }

.my-ranges-body {
  display: grid;
  grid-template-columns: 380px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.my-ranges-list {
  overflow-y: auto;
  padding: 16px;
  border-right: 1px solid var(--border);
}
.my-ranges-detail {
  overflow-y: auto;
  padding: 24px;
  background: #111;
}

.range-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.range-card:hover { background: var(--bg-elevated); }
.range-card.active { border-color: var(--color-accent); }
.range-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.range-card-name {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.range-card-delete {
  color: var(--text-muted);
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
  flex-shrink: 0;
}
.range-card-delete:hover {
  color: var(--color-wrong);
  background: rgba(224, 82, 82, 0.1);
}
.range-card-meta {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tag-gto {
  background: rgba(0, 212, 160, 0.15);
  color: var(--color-accent);
}
.tag-exploit {
  background: rgba(212, 160, 0, 0.15);
  color: var(--color-mixed);
}
.tag-stack {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.tag-stakes {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.range-card-stats {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}
.range-card-progress { margin-top: 10px; }
.range-progress-bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}
.range-progress-fill {
  height: 100%;
  background: var(--color-accent);
  transition: width 0.25s ease;
}
.range-progress-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.my-ranges-hint {
  max-width: 420px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.my-ranges-hint h3 {
  font-size: 16px;
  color: var(--text-primary);
  margin: 0 0 8px;
  font-weight: 600;
}
.my-ranges-hint p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}
.my-ranges-list-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.range-detail-card { max-width: 540px; }
.range-detail-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px;
}
.range-detail-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.range-detail-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0 0 24px;
}
.range-detail-stats > div {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}
.range-detail-stats dt {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.range-detail-stats dd {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.range-detail-hint {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.my-ranges-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  flex: 1;
}
.my-ranges-empty h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.my-ranges-empty p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 24px;
  max-width: 360px;
}
.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.7;
}

@media (max-width: 767px) {
  .my-ranges-header {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 12px;
  }
  .my-ranges-filters { gap: 8px; }
  .my-ranges-filters select {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }
  .my-ranges-filters #btn-new-range { flex: 1 1 100%; }
  .my-ranges-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .my-ranges-list {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 40vh;
  }
  .my-ranges-detail { padding: 16px; }
  .range-card { width: 100%; }
  .range-detail-stats { grid-template-columns: 1fr; }
  .my-ranges-empty { padding: 48px 16px; }
}

@media (max-width: 767px) {
  .library-overlay { padding: 0; }
  .library-card {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
  .library-header { padding: 14px 16px; }
  .library-filters { width: 100%; justify-content: flex-start; }
  .library-filters select {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }
  .library-body { padding: 16px; }
  .library-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════
   Share-to-Friend (Phase C) — range-card Share button, Inbox pill +
   panel, Share-with-friend modal. All additive — no touches to locked
   matrix.css / theme.css / layout.css.
   ══════════════════════════════════════════════════════════════════════ */

/* Range card: Share button (added next to Delete) */
.range-card-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 120ms ease, background 120ms ease;
}
.range-card-share:hover {
  color: var(--color-accent, #5ad9ff);
  background: color-mix(in srgb, var(--color-accent, #5ad9ff) 14%, transparent);
}
.range-card-header-actions {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  flex-shrink: 0;
}

/* Library Inbox pill + badge (in library header) */
.library-inbox-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.library-inbox-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: color-mix(in srgb, var(--color-accent, #5ad9ff) 50%, var(--border));
  color: var(--text-primary);
}
.library-inbox-btn.library-inbox-btn-active {
  background: color-mix(in srgb, var(--color-accent, #5ad9ff) 15%, transparent);
  border-color: var(--color-accent, #5ad9ff);
  color: var(--color-accent, #5ad9ff);
}
.library-inbox-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 800;
  color: #04161e;
  background: #e85a5a;
  border-radius: 9px;
  line-height: 1;
  box-shadow: 0 0 8px rgba(232, 90, 90, 0.45);
}

/* Inbox panel (stacked share cards) */
.library-inbox-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0;
}
.library-inbox-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted);
  text-align: center;
  gap: 8px;
}
.library-inbox-empty-icon { font-size: 42px; opacity: 0.7; }
.library-inbox-empty-title { font-size: 16px; font-weight: 700; color: var(--text-secondary); }
.library-inbox-empty-hint { font-size: 13px; max-width: 320px; line-height: 1.5; }

.inbox-share-card {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-card, #14202b);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.inbox-share-card:hover {
  border-color: color-mix(in srgb, var(--color-accent, #5ad9ff) 40%, var(--border));
  box-shadow: 0 0 16px color-mix(in srgb, var(--color-accent, #5ad9ff) 10%, transparent);
}
.inbox-share-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-accent, #5ad9ff) 25%, var(--bg-primary, #0b1520));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent, #5ad9ff);
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.inbox-share-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.inbox-share-line1 {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.inbox-share-sender { font-weight: 700; color: var(--text-primary); }
.inbox-share-action-text { color: var(--text-muted); font-size: 13px; }
.inbox-share-setname {
  font-weight: 700;
  color: var(--color-accent, #5ad9ff);
  font-size: 15px;
}
.inbox-share-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.inbox-share-meta .tag {
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
}
.inbox-share-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.inbox-share-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.inbox-share-btn {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  transition: all 120ms ease;
}
.inbox-share-btn-accept {
  background: var(--color-accent, #5ad9ff);
  border-color: var(--color-accent, #5ad9ff);
  color: #04161e;
}
.inbox-share-btn-accept:hover { filter: brightness(1.08); }
.inbox-share-btn-decline:hover {
  color: #e85a5a;
  border-color: #e85a5a;
}
.inbox-share-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Share Range Modal — full redesign ─────────────────────────────── */

.share-range-modal {
  max-width: 580px;
  width: min(580px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
}

/* Header */
.share-range-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
}
.share-range-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.share-range-title-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-accent, #00d4a0) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-accent, #00d4a0) 28%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent, #00d4a0);
  flex-shrink: 0;
}
.share-range-title-group h3 {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}
.share-range-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

/* Set info banner */
.share-range-setinfo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 10px;
  margin: 14px 20px 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
}
.share-range-setinfo-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.share-range-setinfo-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.share-range-setinfo-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.share-range-setinfo-meta {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* Tab bar */
.share-range-tabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  margin-top: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.share-range-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.share-range-tab:hover { color: var(--text-primary); }
.share-range-tab-active {
  color: var(--color-accent, #00d4a0);
  border-bottom-color: var(--color-accent, #00d4a0);
}
.share-range-tab-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0,212,160,0.12);
  color: var(--color-accent, #00d4a0);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Modal body */
.share-range-modal-body {
  padding: 0 20px;
  overflow: hidden;
}
.share-range-tab-content {
  padding-top: 14px;
}

/* Search bar */
.share-range-search-wrap {
  position: relative;
  margin-bottom: 10px;
}
.share-range-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.share-range-search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.share-range-search-input:focus {
  border-color: var(--color-accent, #00d4a0);
}
.share-range-search-input::placeholder { color: var(--text-muted); }

/* Friends list */
.share-range-friends {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}
.share-range-friend {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: var(--text-primary);
}
.share-range-friend:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}
.share-range-friend.share-range-friend-selected {
  background: color-mix(in srgb, var(--color-accent, #00d4a0) 10%, transparent);
  border-color: color-mix(in srgb, var(--color-accent, #00d4a0) 50%, transparent);
}
.share-range-friend-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  flex-shrink: 0;
  color: #fff;
}
/* Colour cycle for avatars — applied via data-color-index on the element */
.share-range-friend-avatar[data-ci="0"] { background: #4a88d1; }
.share-range-friend-avatar[data-ci="1"] { background: #6ad29a; color: #000; }
.share-range-friend-avatar[data-ci="2"] { background: #d05a58; }
.share-range-friend-avatar[data-ci="3"] { background: #e8b75a; color: #000; }
.share-range-friend-avatar[data-ci="4"] { background: #9c6ad2; }
.share-range-friend-avatar[data-ci="5"] { background: #e8724a; }
.share-range-friend-avatar:not([data-ci]) {
  background: color-mix(in srgb, var(--color-accent, #00d4a0) 22%, var(--bg-primary, #0b1520));
  color: var(--color-accent, #00d4a0);
}
.share-range-friend-avatar { position: relative; }
.share-range-friend-status {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #6ad29a;
  border: 2px solid var(--bg-elevated, #1a1f29);
  box-shadow: 0 0 6px rgba(106, 210, 154, 0.6);
}
.share-range-friend-online .share-range-friend-name { color: var(--text-primary); }
.share-range-friend-online .share-range-friend-username {
  color: #6ad29a;
}
.share-range-friend-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.share-range-friend-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.share-range-friend-username {
  font-size: 11px;
  color: var(--text-muted);
}
.share-range-friend-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-accent, #00d4a0);
  color: #000;
  font-weight: 900;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.12s;
}
.share-range-friend-selected .share-range-friend-check { opacity: 1; }

/* Empty state */
.share-range-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  gap: 6px;
}
.share-range-empty-icon { font-size: 32px; opacity: 0.6; }
.share-range-empty-title { font-weight: 700; font-size: 14px; color: var(--text-secondary); }
.share-range-empty-hint { font-size: 12px; max-width: 280px; line-height: 1.5; }

/* Error msg (used in both tabs) */
.share-range-error-msg {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(208,90,88,0.10);
  border: 1px solid rgba(208,90,88,0.25);
  border-radius: 7px;
  color: #e07070;
  font-size: 12px;
}

/* ── Link tab ── */
.share-range-link-hero {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  margin-bottom: 14px;
}
.share-range-link-hero-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.share-range-link-hero-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}
.share-range-link-hero-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}
.share-range-link-box {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 12px;
}
.share-range-link-input {
  flex: 1;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-family: monospace;
  outline: none;
  cursor: text;
  min-width: 0;
}
.share-range-copy-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.share-range-copy-btn.copied {
  color: var(--color-accent, #00d4a0);
  border-color: var(--color-accent, #00d4a0);
}
.share-range-ext-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.share-range-ext-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 9px;
  border: 1px solid;
  cursor: pointer;
  flex: 1;
  justify-content: center;
  min-width: 120px;
}
.share-range-whatsapp {
  background: rgba(37,211,102,0.12);
  color: #25d366;
  border-color: rgba(37,211,102,0.30);
}
.share-range-whatsapp:hover { background: rgba(37,211,102,0.20); }
.share-range-telegram {
  background: rgba(40,160,240,0.12);
  color: #29a0f0;
  border-color: rgba(40,160,240,0.30);
}
.share-range-telegram:hover { background: rgba(40,160,240,0.20); }

#share-range-link-generate-wrap {
  margin-bottom: 12px;
}
.share-range-generate-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  justify-content: center;
  padding: 11px;
  font-size: 14px;
  font-weight: 700;
}
.share-range-link-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}

/* Footer */
.share-range-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.share-range-expiry-note {
  flex: 1;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
#btn-send-share-range {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Inbox tab bar ─────────────────────────────────────────────────── */

.inbox-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding-bottom: 0;
}

.inbox-tab {
  position: relative;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.inbox-tab:hover { color: var(--text-primary); }

.inbox-tab-active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.inbox-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--color-accent);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

/* ── Inbox status pills ────────────────────────────────────────────── */

.inbox-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.inbox-status-pending  { color: #e8b75a; background: rgba(232,183,90,0.12); }
.inbox-status-accepted { color: #6ad29a; background: rgba(106,210,154,0.12); }
.inbox-status-declined { color: #8892a6; background: rgba(136,146,166,0.10); }
.inbox-status-revoked  { color: #8892a6; background: rgba(136,146,166,0.10); text-decoration: line-through; }
.inbox-status-expiring { color: #e8724a; background: rgba(232,114,74,0.14); }

/* ── Sent-by-me card extras ────────────────────────────────────────── */

.inbox-sent-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  margin-bottom: 8px;
  transition: background 0.15s;
}

.inbox-sent-card:hover { background: rgba(255,255,255,0.04); }

.inbox-share-btn-revoke {
  background: rgba(208,90,88,0.12);
  color: #d05a58;
  border: 1px solid rgba(208,90,88,0.22);
}

.inbox-share-btn-revoke:hover {
  background: rgba(208,90,88,0.22);
}

/* ── Public share import banner (deep-link ?pshare=) ──────────────── */

.pshare-import-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  max-width: 560px;
  width: calc(100vw - 32px);
}
.pshare-import-banner-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.pshare-import-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #1a1f29;
  border: 1px solid rgba(0,212,160,0.30);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
}
.pshare-import-icon { font-size: 24px; flex-shrink: 0; }
.pshare-import-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  min-width: 0;
}
.pshare-import-text strong { color: var(--text-primary); font-size: 14px; }
.pshare-import-text span   { color: var(--text-muted); }

/* ── Cold-call auto-bump row (in Squeeze block) ───────────────────── */
.se-tree-coldcall-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-top: 8px;
  background: linear-gradient(135deg,
    color-mix(in srgb, #e08040 12%, var(--se-bg-2)) 0%,
    var(--se-bg-2) 100%);
  border: 1px solid color-mix(in srgb, #e08040 30%, var(--se-border));
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.se-tree-coldcall-row:hover {
  border-color: color-mix(in srgb, #e08040 55%, var(--se-border));
  box-shadow: 0 0 12px rgba(224, 128, 64, 0.15);
}
.se-tree-coldcall-icon { font-size: 18px; line-height: 1; flex-shrink: 0; }
.se-tree-coldcall-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.se-tree-coldcall-title { font-size: 12px; font-weight: 800; color: var(--se-text); letter-spacing: 0.02em; }
.se-tree-coldcall-sub   { font-size: 10px; color: var(--se-text-muted, #8892a6); letter-spacing: 0.01em; }

.se-tree-input-prefix {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #e08040;
  padding-right: 2px;
  user-select: none;
}
.se-tree-input-prefixed { padding-left: 4px !important; }

/* Auto-bump badge on nav-card actions (rendered when a 3-bet/sqz
   action got coldCallerCount >= 1 from the rewriter) */
.pf-nav-action-bump-tag,
.se-action-bump-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #e08040;
  background: rgba(224, 128, 64, 0.14);
  border: 1px solid rgba(224, 128, 64, 0.30);
  border-radius: 999px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════
   Friends Widget — floating bottom-left toggle (Lichess-style)
   ═══════════════════════════════════════════════════════════════════════ */

#friends-widget-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9000;
  font-family: inherit;
}

.friends-widget-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  background: #1a1f29;
  color: #f0f0f0;
  border: 1px solid #2e3545;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  transition: background 0.14s, border-color 0.14s, transform 0.14s;
}
.friends-widget-toggle:hover {
  background: #232835;
  border-color: var(--color-accent, #00d4a0);
  transform: translateY(-1px);
}
.friends-widget-toggle-label { font-weight: 700; }
.friends-widget-online-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #5b6478; flex-shrink: 0;
  transition: background 0.14s, box-shadow 0.14s;
}
.friends-widget-toggle-has-online .friends-widget-online-dot {
  background: #6ad29a;
  box-shadow: 0 0 8px rgba(106,210,154,0.7);
  animation: friendsPulse 2.4s ease-in-out infinite;
}
@keyframes friendsPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(106,210,154,0.7); }
  50%      { box-shadow: 0 0 14px rgba(106,210,154,0.9); }
}
.friends-widget-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 6px;
  background: rgba(0,212,160,0.16);
  color: var(--color-accent, #00d4a0);
  border-radius: 999px;
  font-size: 10px; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.friends-widget-toggle-has-online .friends-widget-count {
  background: var(--color-accent, #00d4a0);
  color: #04161e;
}

.friends-widget-panel {
  position: absolute;
  right: 0;
  bottom: 48px;
  width: 320px;
  max-height: min(540px, calc(100vh - 80px));
  background: #141821;
  border: 1px solid #2e3545;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: friendsSlideUp 0.18s ease-out;
}
/* CRITICAL: HTML `hidden` attribute is normally overridden by an
   explicit `display: flex` on the same element. Force it back so
   panel.hidden = true actually hides. */
.friends-widget-panel[hidden],
.friends-widget-find-panel[hidden] { display: none !important; }
@keyframes friendsSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.friends-widget-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.friends-widget-hdr-title { display: flex; flex-direction: column; gap: 2px; }
.friends-widget-hdr-title strong { font-size: 13px; font-weight: 800; color: #f0f0f0; letter-spacing: 0.02em; }
.friends-widget-summary { font-size: 10px; color: #8892a6; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.friends-widget-close {
  background: transparent; border: none; color: #8892a6;
  font-size: 18px; cursor: pointer; padding: 4px 8px;
  border-radius: 4px; line-height: 1;
}
.friends-widget-close:hover { color: #f0f0f0; background: rgba(255,255,255,0.06); }

.friends-widget-search-wrap { position: relative; padding: 10px 12px 6px; }
.friends-widget-search-wrap svg {
  position: absolute; left: 22px; top: 50%;
  transform: translateY(calc(-50% + 2px));
  color: #8892a6; pointer-events: none;
}
#friends-widget-search {
  width: 100%; padding: 7px 12px 7px 32px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 7px; color: #f0f0f0; font-size: 12px;
  font-family: inherit; outline: none; box-sizing: border-box;
  transition: border-color 0.15s;
}
#friends-widget-search:focus { border-color: var(--color-accent, #00d4a0); }
#friends-widget-search::placeholder { color: #8892a6; }

.friends-widget-body { flex: 1; overflow-y: auto; padding: 4px 6px 8px; scrollbar-width: thin; }
.friends-widget-section { margin-top: 6px; }
.friends-widget-section-hdr {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 10px; font-size: 9px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase; color: #5b6478;
}
.friends-widget-section-count {
  background: rgba(255,255,255,0.06); border-radius: 999px;
  padding: 1px 6px; font-size: 9px; font-variant-numeric: tabular-nums;
}

.friends-widget-row {
  display: grid; grid-template-columns: 32px 1fr auto;
  gap: 9px; align-items: center;
  padding: 6px 10px; border-radius: 7px;
  transition: background 0.12s;
}
.friends-widget-row:hover { background: rgba(255,255,255,0.04); }
.friends-widget-row-avatar {
  position: relative; width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 11px; text-transform: uppercase;
  color: #fff; flex-shrink: 0;
}
.friends-widget-row-avatar[data-ci="0"] { background: #4a88d1; }
.friends-widget-row-avatar[data-ci="1"] { background: #6ad29a; color: #000; }
.friends-widget-row-avatar[data-ci="2"] { background: #d05a58; }
.friends-widget-row-avatar[data-ci="3"] { background: #e8b75a; color: #000; }
.friends-widget-row-avatar[data-ci="4"] { background: #9c6ad2; }
.friends-widget-row-avatar[data-ci="5"] { background: #e8724a; }
.friends-widget-row-status {
  position: absolute; right: -2px; bottom: -2px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #6ad29a; border: 2px solid #141821;
  box-shadow: 0 0 6px rgba(106,210,154,0.6);
}
.friends-widget-row-info { min-width: 0; }
.friends-widget-row-name {
  font-size: 12px; font-weight: 700; color: #f0f0f0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.friends-widget-row:not(.friends-widget-row-online) .friends-widget-row-name { color: #b8c0d0; }
.friends-widget-row-uname {
  font-size: 10px; color: #8892a6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.friends-widget-row-activity {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.04em;
  color: #6ad29a;
  background: rgba(106, 210, 154, 0.12);
  border-radius: 999px;
  margin-top: 2px;
  max-width: max-content;
}
.friends-widget-row-actions {
  display: flex; gap: 3px;
  opacity: 0.55; transition: opacity 0.14s;
}
.friends-widget-row:hover .friends-widget-row-actions,
.friends-widget-row-online .friends-widget-row-actions { opacity: 1; }
.friends-widget-row-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px; color: #b8c0d0;
  cursor: pointer; padding: 0;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.friends-widget-row-btn:hover { background: rgba(255,255,255,0.10); color: #fff; }
.friends-widget-row-btn-challenge:hover { color: #e8b75a; border-color: rgba(232,183,90,0.5); }
.friends-widget-row-btn-share:hover { color: var(--color-accent, #00d4a0); border-color: rgba(0,212,160,0.5); }

.friends-widget-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 26px 18px; text-align: center;
  color: #8892a6; font-size: 12px;
}
.friends-widget-empty-icon { font-size: 26px; opacity: 0.65; }
.friends-widget-empty-title { font-weight: 700; color: #b8c0d0; font-size: 13px; }
.friends-widget-empty-hint { line-height: 1.5; max-width: 240px; }

.friends-widget-foot { padding: 8px 10px; border-top: 1px solid rgba(255,255,255,0.06); }
.friends-widget-find {
  width: 100%; background: transparent;
  color: var(--color-accent, #00d4a0);
  border: 1px dashed rgba(0,212,160,0.45);
  border-radius: 7px; padding: 7px;
  font-family: inherit; font-size: 12px; font-weight: 700;
  letter-spacing: 0.02em; cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
}
.friends-widget-find:hover {
  background: rgba(0,212,160,0.10);
  border-color: var(--color-accent, #00d4a0);
}

/* Find-friends inline panel (expands above "+ Find friends" button) */
.friends-widget-find-panel { margin-top: 8px; }
.friends-widget-find-input {
  width: 100%;
  padding: 7px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 7px;
  color: #f0f0f0;
  font-family: inherit;
  font-size: 12px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.14s;
}
.friends-widget-find-input:focus { border-color: var(--color-accent, #00d4a0); }
.friends-widget-find-input::placeholder { color: #8892a6; }
.friends-widget-find-results {
  margin-top: 6px;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.friends-widget-find-hint {
  padding: 12px;
  text-align: center;
  font-size: 11px;
  color: #8892a6;
}
.friends-widget-find-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 7px;
  transition: background 0.12s;
}
.friends-widget-find-row:hover { background: rgba(255,255,255,0.04); }
.friends-widget-add-btn {
  background: var(--color-accent, #00d4a0);
  color: #04161e;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.14s, background 0.14s;
}
.friends-widget-add-btn:hover:not(:disabled) { filter: brightness(1.08); }
.friends-widget-add-btn:disabled {
  background: rgba(255,255,255,0.06);
  color: #8892a6;
  cursor: not-allowed;
}
.friends-widget-add-btn-sent {
  background: rgba(106, 210, 154, 0.15) !important;
  color: #6ad29a !important;
  cursor: default;
}

/* ═══════════════════════════════════════════════════════════════════════
   Notifications Bell — header dot + dropdown
   ═══════════════════════════════════════════════════════════════════════ */

#notif-bell-root { position: relative; display: inline-flex; align-items: center; }

.notif-bell-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-secondary, #b8c0d0);
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.notif-bell-toggle:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary, #f0f0f0);
}
.notif-bell-toggle-has-unread { color: var(--color-accent, #00d4a0); }
.notif-bell-toggle-has-unread:hover { color: var(--color-accent, #00d4a0); }

.notif-bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #d05a58;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary, #0a0d12);
  box-shadow: 0 0 8px rgba(208, 90, 88, 0.5);
  animation: notifBadgePop 0.3s ease-out;
}
@keyframes notifBadgePop {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.notif-bell-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-height: min(540px, calc(100vh - 80px));
  background: #141821;
  border: 1px solid #2e3545;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9000;
  animation: notifSlide 0.18s ease-out;
}
.notif-bell-panel[hidden] { display: none !important; }
/* Hide the badge until JS unhides it */
.notif-bell-badge[hidden] { display: none !important; }
@keyframes notifSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.notif-bell-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.notif-bell-hdr strong {
  font-size: 13px;
  font-weight: 800;
  color: #f0f0f0;
  letter-spacing: 0.02em;
}
.notif-bell-mark-all {
  background: transparent;
  border: none;
  color: #8892a6;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  transition: color 0.14s, background 0.14s;
}
.notif-bell-mark-all:hover {
  color: var(--color-accent, #00d4a0);
  background: rgba(0,212,160,0.08);
}

.notif-bell-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  scrollbar-width: thin;
}

.notif-bell-empty {
  padding: 30px 18px;
  text-align: center;
  font-size: 12px;
  color: #8892a6;
  line-height: 1.5;
}

.notif-bell-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.12s;
}
.notif-bell-row:hover { background: rgba(255,255,255,0.04); }
.notif-bell-row-unread {
  background: rgba(0, 212, 160, 0.05);
  border-left: 3px solid var(--color-accent, #00d4a0);
  padding-left: 11px;
}
.notif-bell-row-icon {
  font-size: 18px;
  line-height: 1;
  width: 32px;
  text-align: center;
  padding-top: 2px;
}
.notif-bell-row-body { min-width: 0; }
.notif-bell-row-text {
  font-size: 12px;
  color: #f0f0f0;
  font-weight: 600;
  line-height: 1.4;
}
.notif-bell-row-sub {
  font-size: 11px;
  color: var(--color-accent, #00d4a0);
  margin-top: 2px;
  font-weight: 600;
}
.notif-bell-row-time {
  font-size: 10px;
  color: #5b6478;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.notif-bell-row-actions { display: flex; gap: 4px; align-items: center; }
.notif-bell-row-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: #b8c0d0;
  border-radius: 5px;
  padding: 4px 9px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.notif-bell-row-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.notif-bell-row-btn-primary {
  background: var(--color-accent, #00d4a0);
  color: #04161e;
  border-color: var(--color-accent, #00d4a0);
}
.notif-bell-row-btn-primary:hover { filter: brightness(1.08); color: #04161e; }

@media (max-width: 640px) {
  .notif-bell-panel { width: calc(100vw - 24px); right: -8px; }
}

@media (max-width: 640px) {
  #friends-widget-root { right: 12px; bottom: 12px; }
  .friends-widget-toggle-label { display: none; }
  .friends-widget-panel { width: calc(100vw - 24px); right: 0; left: auto; }
}
