/* ============================================
   scope-tool — toggles MVP/V-next/Out
   Complexity badges S/M/L/XL
   ============================================ */

/* ----- Toggle group (chips) ----- */
.toggle-group {
  display: inline-flex;
  background: #f0f0f0;
  border-radius: 16px;
  padding: 2px;
  gap: 0;
  font-size: 11px;
  font-weight: 600;
  user-select: none;
}

.toggle-group button {
  background: transparent;
  border: none;
  padding: 4px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #777;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
}

.toggle-group button:hover {
  color: #1a1a1a;
}

/* Active states by value */
.toggle-group button.active[data-value="MVP"] {
  background: #1e7a36;
  color: #fff;
}

.toggle-group button.active[data-value="V-next"] {
  background: #1a1a1a;
  color: #fff;
}

.toggle-group button.active[data-value="Out"] {
  background: #b13a23;
  color: #fff;
}

/* Cascade-overridden visual state (actual stored value preserved) */
[data-cascade="Out"] {
  opacity: 0.45;
}

[data-cascade="Out"] .toggle-group {
  pointer-events: none;
}

/* ----- Complexity badges ----- */
.complexity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  position: relative;
}

.complexity-badge[data-tshirt="S"]  { background: #e8f4ff; color: #1862a8; border: 1px solid #b8d8f0; }
.complexity-badge[data-tshirt="M"]  { background: #fff4d6; color: #8a6300; border: 1px solid #f0dca0; }
.complexity-badge[data-tshirt="L"]  { background: #ffe4d0; color: #a03e00; border: 1px solid #f0c0a0; }
.complexity-badge[data-tshirt="XL"] { background: #ffd0d0; color: #9a1010; border: 1px solid #f0a8a8; }

/* Tooltip — multi-line, contained, anchored to the right edge of the badge
   so the long text never overflows off-screen on right-aligned badges. */
.complexity-badge:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: #1a1a1a;
  color: #fff;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  line-height: 1.4;
  white-space: normal;
  width: max-content;
  max-width: 240px;
  text-align: left;
  z-index: 50;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.complexity-badge:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 1px);
  right: 8px;
  border: 5px solid transparent;
  border-top-color: #1a1a1a;
  z-index: 50;
  pointer-events: none;
}

/* ----- Actor tags (MCRC, DP, CSC, POC, CA, CRC) ----- */
.actor-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  vertical-align: middle;
}

.actor-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #eef0f4;
  color: #444;
  border: 1px solid #d8dde4;
  cursor: help;
  white-space: nowrap;
  position: relative;
}

/* Rich tooltip — same pattern as .complexity-badge but multi-line.
   Anchored to the right edge of the tag so it never overflows off-screen
   when the tag sits on the right side of a card. */
.actor-tag[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: #1a1a1a;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  line-height: 1.45;
  white-space: pre-line;
  width: max-content;
  max-width: 320px;
  text-align: left;
  z-index: 50;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.actor-tag[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  right: 8px;
  border: 5px solid transparent;
  border-top-color: #1a1a1a;
  z-index: 50;
  pointer-events: none;
}

/* Per-actor color hints (subtle, just enough to differentiate at a glance) */
.actor-tag[data-actor="MCRC"] { background: #efe7f7; color: #5b3987; border-color: #d9c8eb; }
.actor-tag[data-actor="DP"]   { background: #e7f0fb; color: #1c5aa3; border-color: #c8dcf0; }
.actor-tag[data-actor="CSC"]  { background: #e6f4ec; color: #1e6a3a; border-color: #c5e1d0; }
.actor-tag[data-actor="POC"]  { background: #fdf1e3; color: #8a4a10; border-color: #f0d6b3; }
.actor-tag[data-actor="CA"]   { background: #fde7eb; color: #9c2e44; border-color: #f0c0cb; }
.actor-tag[data-actor="CRC"]  { background: #f0f0f0; color: #555;    border-color: #d8d8d8; }

/* Aggregate badge on epic card (smaller variant) */
.complexity-aggregate {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #666;
}

.complexity-aggregate .seg {
  display: inline-block;
  height: 6px;
  border-radius: 2px;
}

.complexity-aggregate .seg[data-t="S"]  { background: #b8d8f0; }
.complexity-aggregate .seg[data-t="M"]  { background: #f0dca0; }
.complexity-aggregate .seg[data-t="L"]  { background: #f0c0a0; }
.complexity-aggregate .seg[data-t="XL"] { background: #f0a8a8; }
