/* =========================================================
   Ionik+ — Split slider (ionik-split-slider.js)
   A bar of N coloured sections split by N−1 oval dots, with a
   tag hanging under each section naming what the colour means.
   Load after ionik-motion.css (uses its spring + duration tokens).
   ========================================================= */

.iss {
  position: relative;
  padding: 14px 0 2px;
  user-select: none;
  -webkit-user-select: none;
  --iss-h: 30px;
  --iss-ink: #2a241c;
}

/* ---- track + sections --------------------------------------------- */
.iss-track {
  position: relative;
  height: var(--iss-h);
  border-radius: var(--r-pill);
  background: var(--bg-3);
  box-shadow: inset 0 0 0 1px var(--rule-soft);
}
.iss-seg {
  position: absolute; top: 0; bottom: 0;
  background: var(--c);
  /* 1px of the track shows through between sections */
  box-shadow: inset -1px 0 0 var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition:
    left var(--m-base) var(--spring-soft),
    width var(--m-base) var(--spring-soft),
    background-color var(--m-base) var(--ease-sharp),
    filter var(--m-quick) var(--ease-sharp),
    opacity var(--m-quick) var(--ease-sharp);
}
.iss-seg.iss-first { border-radius: var(--r-pill) 0 0 var(--r-pill); }
.iss-seg.iss-last  { border-radius: 0 var(--r-pill) var(--r-pill) 0; box-shadow: none; }
.iss-seg.iss-first.iss-last { border-radius: var(--r-pill); }
.iss-seg:hover { filter: brightness(1.05) saturate(1.08); }
.iss-seg.iss-leaving { opacity: 0; }
.iss-pct {
  font-size: 11px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--iss-ink); opacity: 0.82;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: opacity var(--m-quick) var(--ease-sharp), transform var(--m-quick) var(--spring-snappy);
}
.iss-seg.iss-narrow .iss-pct { opacity: 0; transform: scale(0.6); }

/* While a dot is held, everything follows the pointer 1:1. */
.iss.iss-dragging .iss-seg,
.iss.iss-dragging .iss-handle,
.iss.iss-dragging .iss-tag { transition: none; }
.iss.iss-dragging { cursor: grabbing; }

/* ---- dots (vertical ovals, as drawn) ------------------------------ */
.iss-handle {
  position: absolute; top: 50%;
  width: 16px; height: 40px;
  margin-left: -8px; margin-top: -20px;
  border-radius: var(--r-pill);
  background: #fbf8f1;
  border: 1px solid rgba(42,36,28,0.18);
  box-shadow: 0 2px 8px -2px rgba(42,36,28,0.35), 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent);
  cursor: grab;
  z-index: 2;
  display: flex; align-items: center; justify-content: center;
  touch-action: none;
  transition:
    left var(--m-base) var(--spring-soft),
    transform var(--m-quick) var(--spring-bouncy),
    box-shadow var(--m-quick) var(--ease-sharp);
}
.iss-grip {
  width: 2px; height: 14px; border-radius: 2px;
  background: rgba(42,36,28,0.28);
  box-shadow: -4px 0 0 rgba(42,36,28,0), 4px 0 0 rgba(42,36,28,0);
}
.iss-handle:hover { transform: scale(1.1); }
.iss-handle:focus-visible {
  outline: none;
  box-shadow: 0 2px 8px -2px rgba(42,36,28,0.35), 0 0 0 4px color-mix(in srgb, var(--accent) 26%, transparent);
}
.iss-handle.iss-active {
  transform: scale(1.16);
  cursor: grabbing;
  box-shadow: 0 6px 16px -4px rgba(42,36,28,0.45), 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent);
}
.iss-handle.iss-handle-in { animation: ionik-bubble-in var(--m-bubble) var(--spring-bouncy) both; }

/* ---- tags (pentagon notch pointing up at the section) ------------- */
.iss-tags {
  position: relative;
  margin-top: 12px;
  height: 30px;
  transition: height var(--m-base) var(--spring-soft);
}
.iss-tag {
  position: absolute; top: 0;
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px 0 7px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--c) 22%, var(--bg-2));
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  color: var(--ink);
  font-size: 11px; line-height: 1; white-space: nowrap;
  cursor: default;
  transition:
    left var(--m-base) var(--spring-soft),
    top var(--m-base) var(--spring-soft),
    background-color var(--m-base) var(--ease-sharp),
    border-color var(--m-base) var(--ease-sharp),
    opacity var(--m-quick) var(--ease-sharp),
    transform var(--m-quick) var(--spring-bouncy);
}
.iss-tag b { font-weight: 600; letter-spacing: 0.01em; }
.iss-tag:hover { transform: translateY(-1px) scale(1.04); }
/* the notch */
.iss-tag::before {
  content: '';
  position: absolute; top: -5px; left: var(--nx, 50%);
  width: 8px; height: 8px; margin-left: -4px;
  background: color-mix(in srgb, var(--c) 22%, var(--bg-2));
  border-left: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  transform: rotate(45deg);
  border-radius: 2px 0 0 0;
}
/* tags pushed to a lower row keep a hairline back up to their section */
.iss-tag::after {
  content: '';
  position: absolute; left: var(--nx, 50%); bottom: 100%;
  width: 1px; height: 0; margin-left: -0.5px;
  background: color-mix(in srgb, var(--c) 70%, transparent);
  transition: height var(--m-base) var(--spring-soft);
}
.iss-tag.iss-dropped::after { height: calc(var(--stem) - 4px); }
.iss-tag.iss-dropped::before { display: none; }
.iss-sw {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 25%, transparent);
  flex: none;
}
.iss-tag-d { color: var(--ink-muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.iss-tag.iss-tag-in { animation: ionik-spring-in var(--m-slow) var(--spring-soft) both; }
.iss-tag.iss-leaving { opacity: 0; transform: scale(0.8); }

.iss-alternating { padding-block: 6px; }
.iss-tags-above { margin: 0 0 12px; }
.iss-tags-above .iss-tag::before { top: auto; bottom: -5px; transform: rotate(225deg); }
.iss-tags-above .iss-tag::after { top: 100%; bottom: auto; }

/* ---- hover read-out ------------------------------------------------ */
.iss-pop {
  position: absolute; bottom: calc(100% - 8px); left: 0;
  transform: translate(-50%, 6px) scale(0.94);
  transform-origin: 50% 100%;
  min-width: 150px; max-width: 280px;
  padding: 9px 12px 10px;
  border-radius: var(--r-md);
  background: var(--ink); color: var(--bg);
  box-shadow: 0 14px 34px -14px rgba(42,36,28,0.55);
  pointer-events: none;
  opacity: 0;
  z-index: 5;
  transition: opacity var(--m-quick) var(--ease-sharp), transform var(--m-quick) var(--spring-bouncy), left var(--m-quick) var(--ease-sharp);
}
.iss-pop.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.iss-pop-t { font-size: 12px; font-weight: 600; line-height: 1.35; display: flex; gap: 6px; align-items: baseline; }
.iss-pop-t::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; transform: translateY(-1px); }
.iss-pop-s { font-size: 11px; opacity: 0.72; margin-top: 3px; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .iss-seg, .iss-handle, .iss-tag, .iss-tags, .iss-pop { transition: none; }
  .iss-handle.iss-handle-in, .iss-tag.iss-tag-in { animation: none; }
}

@media (max-width: 600px) {
  .iss-handle { width: 20px; height: 44px; margin-left: -10px; margin-top: -22px; }
}
