.musi-notchtabs {
  /* Tokens: cambia estos valores para adaptar las pestañas */
  --musi-bg: #f4f1ea; /* color de la barra */
  --musi-fg: #0d0d0d; /* texto de las pestañas */
  --musi-accent: #ff4d1f; /* color de la ficha */
  --musi-size: 1rem; /* todo el componente escala con este tamaño */
  --musi-width: 26em;
  --musi-chip: 0.7em; /* lado de la ficha */
  --musi-chip-radius: 0.35em; /* redondeo de la ficha: 0 = cuadrada */
  --musi-notch-gap: 0.22em; /* aire entre la ficha y la mordida */
  --musi-shadow: 0; /* intensidad de la sombra: 0 = sin sombra */
  --musi-duration: 0.45s;
  --musi-ease: cubic-bezier(0.65, 0, 0.35, 1);

  /* Sitio que ocupa la mordida: el texto de las pestañas lo esquiva */
  --musi-bite: calc(var(--musi-chip) + var(--musi-notch-gap));

  display: grid;
  gap: 1.6em;
  width: min(100%, var(--musi-width));
  color: inherit;
  /* Inter es opcional: si tu sitio no la carga, se usa la fuente del sistema */
  font: 300 var(--musi-size) / 1.3 "Inter", system-ui, sans-serif;
}

/* ---------- Barra ---------- */
.musi-notchtabs__track {
  position: relative;
  isolation: isolate;
  display: flex;
  color: var(--musi-fg);
}

/* Sin script no hay silueta dibujada: la barra es un rectángulo redondeado */
.musi-notchtabs:not([data-musi-ready]) .musi-notchtabs__track {
  border-radius: 0.75em;
  background: var(--musi-bg);
}

/* La silueta: un SVG que hace de fondo; el script dibuja el contorno */
.musi-notchtabs__shape {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: var(--musi-bg);
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / calc(0.08 * var(--musi-shadow))))
    drop-shadow(0 8px 12px rgb(0 0 0 / calc(0.22 * var(--musi-shadow))));
}

/* ---------- Mordida y ficha ----------
   El hueco va pegado a un borde de la barra. --musi-pos (la pone el script,
   cuadro a cuadro) es su posición a lo largo de ella. */
.musi-notchtabs__slot {
  position: absolute;
  bottom: 0;
  left: 0;
  visibility: hidden;
  padding: var(--musi-notch-gap) var(--musi-notch-gap) 0;
  translate: var(--musi-pos, 0px) 0;
  pointer-events: none;
}

.musi-notchtabs[data-musi-notch="top"] .musi-notchtabs__slot {
  top: 0;
  bottom: auto;
  padding: 0 var(--musi-notch-gap) var(--musi-notch-gap);
}

.musi-notchtabs[data-musi-ready] .musi-notchtabs__slot {
  visibility: visible;
}

.musi-notchtabs__chip {
  display: block;
  width: var(--musi-chip);
  height: var(--musi-chip);
  border-radius: var(--musi-chip-radius);
  background: var(--musi-accent);
}

/* ---------- Pestañas ---------- */
.musi-notchtabs__tab {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 0.85em 1em calc(var(--musi-bite) + 0.45em);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.musi-notchtabs[data-musi-notch="top"] .musi-notchtabs__tab {
  padding: calc(var(--musi-bite) + 0.45em) 1em 0.85em;
}

/* El control real: invisible, pero presente para teclado y lectores de pantalla */
.musi-notchtabs__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.musi-notchtabs__text {
  display: inline-block;
  opacity: 0.5;
  transition:
    opacity var(--musi-duration) var(--musi-ease),
    translate var(--musi-duration) var(--musi-ease);
}

.musi-notchtabs__tab:hover .musi-notchtabs__text {
  opacity: 1;
}

/* La elegida se enciende y se aparta un poco de la mordida */
.musi-notchtabs__input:checked ~ .musi-notchtabs__text {
  opacity: 1;
  translate: 0 -0.12em;
}

.musi-notchtabs[data-musi-notch="top"] .musi-notchtabs__input:checked ~ .musi-notchtabs__text {
  translate: 0 0.12em;
}

.musi-notchtabs__input:focus-visible ~ .musi-notchtabs__text {
  outline: 2px solid var(--musi-accent);
  outline-offset: 4px;
  border-radius: 0.3em;
}

/* ---------- Paneles ----------
   Todos ocultos salvo el que ocupa la misma posición que la pestaña elegida. */
.musi-notchtabs__panel {
  display: none;
}

.musi-notchtabs:has(.musi-notchtabs__tab:nth-of-type(1) :checked) .musi-notchtabs__panel:nth-child(1),
.musi-notchtabs:has(.musi-notchtabs__tab:nth-of-type(2) :checked) .musi-notchtabs__panel:nth-child(2),
.musi-notchtabs:has(.musi-notchtabs__tab:nth-of-type(3) :checked) .musi-notchtabs__panel:nth-child(3),
.musi-notchtabs:has(.musi-notchtabs__tab:nth-of-type(4) :checked) .musi-notchtabs__panel:nth-child(4),
.musi-notchtabs:has(.musi-notchtabs__tab:nth-of-type(5) :checked) .musi-notchtabs__panel:nth-child(5) {
  display: block;
}

.musi-notchtabs__title {
  margin: 0 0 0.4em;
  font-weight: 200;
  font-size: 1.5em;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.musi-notchtabs__body {
  margin: 0;
  line-height: 1.55;
  opacity: 0.7;
}

/* El panel entra como la mordida: el título cae desde arriba con un rebote
   y el texto sube detrás */
.musi-notchtabs__panel > * {
  animation: musi-notchtabs-in calc(var(--musi-duration) * 1.4) cubic-bezier(0.34, 1.4, 0.64, 1) backwards;
}

.musi-notchtabs__body {
  --musi-from: 0.8em;
  animation-delay: calc(var(--musi-duration) * 0.15);
}

@keyframes musi-notchtabs-in {
  from {
    opacity: 0;
    translate: 0 var(--musi-from, -0.8em);
  }
}

@media (prefers-reduced-motion: reduce) {
  .musi-notchtabs__text {
    transition: none;
  }
  .musi-notchtabs__panel > * {
    animation: none;
  }
}
