*,
*::before,
*::after {
  box-sizing: border-box;
}
/* celular: sin la capa celeste que pone el navegador al tocar (cada botón ya tiene su propio efecto) */
html {
  -webkit-tap-highlight-color: transparent;
}
/* ningún diseño ancho debe empujar la página hacia el costado (las tablas ya tienen su propio scroll) */
html,
body {
  overflow-x: clip;
}
a,
button,
summary,
label,
[role='button'],
[role='tab'],
[role='radio'] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
/* al tocar, una leve respuesta propia en lugar de la del navegador (sin achicar el botón: si se achica,
   un clic cerca del borde termina afuera y el navegador no lo cuenta → «hay que darle dos veces») */
@media (hover: none) {
  .btn:active:not(:disabled),
  .icon-btn:active:not(:disabled) {
    filter: brightness(1.12);
  }
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3 {
  font-family: var(--font-head);
  font-weight: 600;
  margin: 0;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}
.muted {
  color: var(--muted);
}

/* ───── Página ───── */
.page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.page-head h1 {
  font-size: 22px;
}
.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
}
.page-head .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/*
 * Encabezado tipo banner en todas las pantallas (como «Manage Lines» de XUI,
 * con los colores del tema). El ícono es el de la sección del menú (--page-icon).
 */
.page > .page-head {
  position: relative;
  align-items: center;
  margin-bottom: 0;
  padding: 18px 20px 18px 86px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, rgb(255 255 255 / 0.14), transparent 55%),
    linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #000));
  color: var(--on-accent);
  box-shadow: 0 10px 28px -14px color-mix(in srgb, var(--accent) 80%, transparent);
  overflow: hidden;
  animation: banner-in 0.35s ease-out;
}
.page > .page-head::before,
.page > .page-head::after {
  content: '';
  position: absolute;
  left: 20px;
  top: 50%;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  border-radius: 12px;
}
.page > .page-head::before {
  background: rgb(255 255 255 / 0.18);
}
.page > .page-head::after {
  inset: 50% auto auto 32px;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  border-radius: 0;
  background: currentColor;
  -webkit-mask: var(--page-icon) center / contain no-repeat;
  mask: var(--page-icon) center / contain no-repeat;
}
.page > .page-head h1 {
  color: inherit;
}
.page > .page-head p {
  color: inherit;
  opacity: 0.82;
  max-width: 820px;
}
/* todos los botones del banner: fondo oscuro del tema (el de agregar con el texto del color del tema) */
.page > .page-head .actions .btn,
.page > .page-head .actions > select {
  min-height: 46px;
  background: var(--surface);
  border-color: transparent;
  color: var(--text);
  box-shadow: 0 6px 16px -8px rgb(0 0 0 / 0.45);
}
.page > .page-head .actions .btn:hover:not(:disabled) {
  color: var(--accent);
}
.page > .page-head .actions .btn-primary {
  min-height: 46px;
  padding: 0 20px;
  background: var(--surface);
  border-color: transparent;
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 6px 16px -8px rgb(0 0 0 / 0.45);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.page > .page-head .actions .btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -8px rgb(0 0 0 / 0.5);
}
@keyframes banner-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}
@media (max-width: 640px) {
  /* celular: el botón de agregar ocupa todo el ancho, debajo del título */
  .page > .page-head {
    padding: 14px 16px 16px;
  }
  .page {
    gap: 14px;
  }
  .page > .page-head::before,
  .page > .page-head::after {
    display: none;
  }
  .page > .page-head > div:first-child {
    display: flex;
    flex-direction: column;
  }
  /* la descripción no se ve: se abre tocando el título (ícono «i») o pasando el mouse */
  .page > .page-head:has(> div:first-child > p) h1 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }
  .page > .page-head:has(> div:first-child > p) h1::after {
    content: 'i';
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    font: italic 700 14px/1 Georgia, 'Times New Roman', serif;
    background: rgb(0 0 0 / 0.16);
    border: 1.5px solid currentColor;
    opacity: 0.85;
    transition:
      transform 0.25s ease,
      background 0.2s ease;
  }
  .page > .page-head.show-info h1::after {
    transform: rotate(360deg);
    background: rgb(0 0 0 / 0.3);
  }
  .page > .page-head > div:first-child > p {
    position: relative;
    max-height: 0;
    margin: 0;
    padding: 0 14px;
    overflow: hidden;
    opacity: 0;
    border-radius: 12px;
    background: rgb(0 0 0 / 0.14);
    font-style: italic;
    line-height: 1.45;
    transition:
      max-height 0.35s ease,
      opacity 0.25s ease,
      margin 0.35s ease,
      padding 0.35s ease;
  }
  .page > .page-head > div:first-child > p::before {
    content: '“';
  }
  .page > .page-head > div:first-child > p::after {
    content: '”';
  }
  .page > .page-head.show-info > div:first-child > p {
    max-height: 260px;
    margin-top: 10px;
    padding: 10px 14px;
    opacity: 0.95;
  }
  @media (hover: hover) {
    .page > .page-head h1:hover + p {
      max-height: 260px;
      margin-top: 10px;
      padding: 10px 14px;
      opacity: 0.95;
    }
  }
  .page > .page-head h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  .page > .page-head .actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }
  .page > .page-head .actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  /* el botón de agregar llena la fila; el de filtro (si hay) queda a su lado */
  .page > .page-head .actions .btn-primary {
    order: 10;
    flex: 1 1 60%;
    min-height: 52px;
    border-radius: 12px;
    font-size: 16px;
  }
  .page > .page-head .actions .xt-fbtn-head {
    order: 11;
    min-height: 52px;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.card h2 {
  font-size: 15px;
  margin-bottom: 12px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

/* ───── Botones ───── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--muted);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover {
  filter: brightness(1.06);
  border-color: var(--accent);
}
.btn-danger {
  background: var(--bad);
  border-color: var(--bad);
  color: var(--on-pill);
}
.btn-info {
  background: var(--info);
  border-color: var(--info);
  color: var(--on-pill);
}
.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}
.btn-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0 4px;
}
.icon-btn {
  /* todos con el mismo fondo; el color de cada acción va en el ícono y en el borde */
  --ib: var(--accent);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--ib) 70%, transparent);
  border-radius: 9px;
  background: var(--icon-idle);
  color: var(--ib);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.1s ease;
}
.icon-btn.info {
  --ib: var(--info);
}
.icon-btn.warn {
  --ib: var(--warn);
}
.icon-btn.bad {
  --ib: var(--bad);
}
.icon-btn.good {
  --ib: var(--good);
}
.icon-btn.accent {
  --ib: var(--accent);
}
/* al pasar el mouse o tenerlo apretado/seleccionado: el fondo se oscurece un poco y el borde se marca */
.icon-btn:hover:not(:disabled),
.icon-btn:focus-visible,
.icon-btn.on,
.icon-btn[aria-expanded='true'] {
  background: color-mix(in srgb, var(--icon-idle) 82%, #000);
  border-color: var(--ib);
}
:root[data-theme='light'] .icon-btn:hover:not(:disabled),
:root[data-theme='light'] .icon-btn:focus-visible,
:root[data-theme='light'] .icon-btn.on,
:root[data-theme='light'] .icon-btn[aria-expanded='true'] {
  background: color-mix(in srgb, var(--icon-idle) 93%, #000);
}
.icon-btn:active:not(:disabled) {
  background: color-mix(in srgb, var(--icon-idle) 70%, #000);
}
:root[data-theme='light'] .icon-btn:active:not(:disabled) {
  background: color-mix(in srgb, var(--icon-idle) 84%, #000);
}
.icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ───── Formularios ───── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.field small {
  color: var(--muted);
  font-size: 12px;
}
.input,
.field input:not([type='checkbox']):not([type='radio']),
.field select,
.field textarea {
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  width: 100%;
}
.field textarea {
  padding: 10px 12px;
  resize: vertical;
}
/* nunca más anchos que su contenedor (en el celular se salían del modal) */
.input,
.field input,
.field select,
.field textarea {
  min-width: 0;
  max-width: 100%;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
}
.input::placeholder,
.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
  opacity: 0.8;
}
.input:hover:not(:disabled),
.field input:not([type='checkbox']):not([type='radio']):hover:not(:disabled),
.field textarea:hover:not(:disabled) {
  border-color: var(--border-strong, var(--muted));
}
.input:focus,
.field input:not([type='checkbox']):not([type='radio']):focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input:disabled,
.field input:disabled,
.field textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
textarea.input {
  padding: 10px 12px;
}
.input.sm {
  min-height: 34px;
  padding: 0 8px;
  font-size: 13px;
}
/* buscadores con lupa */
input.input[type='search'] {
  -webkit-appearance: none;
  appearance: none;
  padding-left: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b8f98' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 16px;
}
/* sin las flechitas nativas de los números (se escribe o se usan las flechas del teclado) */
input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type='search']::-webkit-search-cancel-button {
  cursor: pointer;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 16px;
}
.form-grid > *,
.field {
  min-width: 0;
}
.form-grid .full {
  grid-column: 1 / -1;
}
.check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  min-height: 32px;
}
/* ───────── Casillas, interruptores y opciones (más elegantes que los nativos) ───────── */
input[type='checkbox'],
input[type='radio'] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 2px solid var(--border-strong, var(--muted));
  border-radius: 6px;
  background: var(--surface);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
input[type='radio'] {
  border-radius: 50%;
}
input[type='checkbox']::before {
  content: '';
  width: 11px;
  height: 11px;
  transform: scale(0);
  transition: transform 0.15s cubic-bezier(0.3, 1.6, 0.5, 1);
  background: var(--on-accent);
  clip-path: polygon(14% 44%, 0 59%, 40% 100%, 100% 22%, 86% 8%, 40% 70%);
}
input[type='radio']::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.15s cubic-bezier(0.3, 1.6, 0.5, 1);
  background: var(--accent);
}
input[type='checkbox']:checked {
  background: var(--accent);
  border-color: var(--accent);
}
input[type='checkbox']:checked::before,
input[type='radio']:checked::before {
  transform: scale(1);
}
input[type='radio']:checked {
  border-color: var(--accent);
}
input[type='checkbox']:hover:not(:disabled),
input[type='radio']:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
input[type='checkbox']:disabled,
input[type='radio']:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* En las filas de ajustes («label.check» con el texto a la izquierda) la casilla es un interruptor */
.check:not(.inline) > input[type='checkbox'] {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  border: 0;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
  place-content: center start;
  padding: 3px;
}
.check:not(.inline) > input[type='checkbox']::before {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  clip-path: none;
  transform: translateX(0);
  background: var(--muted);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
  transition:
    transform 0.2s cubic-bezier(0.3, 1.3, 0.5, 1),
    background 0.2s;
}
.check:not(.inline) > input[type='checkbox']:checked {
  background: var(--accent);
  box-shadow: none;
}
.check:not(.inline) > input[type='checkbox']:checked::before {
  transform: translateX(20px);
  background: #fff;
}
.check:not(.inline) > input[type='checkbox']:hover:not(:disabled) {
  box-shadow:
    inset 0 0 0 1px var(--accent),
    0 0 0 4px var(--accent-soft);
}
.check.inline {
  justify-content: flex-start;
  gap: 10px;
  cursor: pointer;
}

/* ───────── Selectores modernos (ver components/SelectHost.vue) ───────── */
/* el select real queda escondido arriba a la izquierda de su contenedor: si se dejaba en su lugar,
   dentro de una tabla con scroll «se escapaba» del recuadro y estiraba la página (espacio vacío abajo
   y la página corrida hacia los lados) */
select.sx-native {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(50%);
}
.sx-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 120px;
  min-height: 42px;
  padding: 0 10px 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.field .sx-trigger {
  width: 100%;
}
.sx-trigger:hover:not(:disabled) {
  border-color: var(--accent);
}
.sx-trigger[aria-expanded='true'] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.sx-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.sx-trigger.sx-placeholder .sx-value {
  color: var(--muted);
}
.sx-value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sx-caret {
  flex: none;
  color: var(--muted);
  transition: transform 0.2s;
}
.sx-trigger[aria-expanded='true'] .sx-caret {
  transform: rotate(180deg);
  color: var(--accent);
}
.sx-pop {
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow:
    0 16px 40px rgb(0 0 0 / 0.35),
    0 2px 6px rgb(0 0 0 / 0.15);
  transform-origin: top center;
}
.sx-pop.up {
  transform-origin: bottom center;
}
.sx-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.sx-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font-size: 14px;
  color: var(--text);
}
.sx-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  outline: 0;
}
.sx-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.sx-opt.active {
  background: var(--surface-2);
}
.sx-opt.selected {
  color: var(--accent);
  font-weight: 600;
}
.sx-opt.disabled {
  opacity: 0.5;
  cursor: default;
}
.sx-group {
  padding: 10px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.sx-empty {
  padding: 14px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.sx-enter-active,
.sx-leave-active {
  transition:
    opacity 0.16s ease,
    transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.sx-enter-from,
.sx-leave-to {
  opacity: 0;
  transform: translateY(-6px) scaleY(0.92);
}
.sx-pop.up.sx-enter-from,
.sx-pop.up.sx-leave-to {
  transform: translateY(6px) scaleY(0.92);
}
@media (prefers-reduced-motion: reduce) {
  .sx-enter-active,
  .sx-leave-active {
    transition: opacity 0.1s;
  }
}
.error-box {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 13px;
  font-weight: 600;
}
.warn-box {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(241, 192, 79, 0.12);
  color: var(--warn);
  font-size: 13px;
  font-weight: 600;
}

/* ───── Etiquetas de estado ───── */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-pill);
  background: var(--muted);
}
.pill.good {
  background: var(--good);
}
.pill.warn {
  background: var(--warn);
}
.pill.bad {
  background: var(--bad);
}
.pill.info {
  background: var(--info);
}
.pill.accent {
  background: var(--accent);
}

/* ───── KPIs ───── */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1100px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.kpi {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi .label {
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.kpi .value {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 600;
}
.kpi .value.good {
  color: var(--good);
}
.kpi .value.warn {
  color: var(--warn);
}
.kpi .value.bad {
  color: var(--bad);
}
.kpi .note {
  font-size: 13px;
  color: var(--muted);
}

/* cambio de tema suave */
.theme-anim,
.theme-anim *,
.theme-anim *::before,
.theme-anim *::after {
  transition:
    background-color 0.4s ease,
    border-color 0.4s ease,
    color 0.4s ease,
    fill 0.4s ease,
    stroke 0.4s ease !important;
}

/* cartel con la acción de los botones que solo tienen ícono (composables/tooltips.ts) */
.ptip {
  --arrow: 50%;
  position: fixed;
  z-index: 9999;
  max-width: min(280px, calc(100vw - 16px));
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, var(--accent));
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow:
    0 12px 28px -12px rgb(0 0 0 / 0.65),
    0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px) scale(0.96);
  transform-origin: var(--arrow) 100%;
  transition:
    opacity 0.14s ease,
    transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.3),
    visibility 0s linear 0.18s;
}
.ptip[data-below='true'] {
  transform-origin: var(--arrow) 0%;
  transform: translateY(-4px) scale(0.96);
}
/* flechita que apunta al botón */
.ptip::after {
  content: '';
  position: absolute;
  left: var(--arrow);
  bottom: -5px;
  width: 9px;
  height: 9px;
  margin-left: -5px;
  background: inherit;
  border-right: inherit;
  border-bottom: inherit;
  transform: rotate(45deg);
}
.ptip[data-below='true']::after {
  bottom: auto;
  top: -5px;
  transform: rotate(-135deg);
}
.ptip.on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.14s ease,
    transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.3),
    visibility 0s;
}
/* en el celular el dedo tapa el botón: el cartel sale un poco más grande */
@media (hover: none) {
  .ptip {
    padding: 9px 14px;
    font-size: 14px;
  }
}
/* dejar apretado un botón de ícono no selecciona texto ni abre el menú del sistema */
.icon-btn,
.xt-actions button {
  -webkit-touch-callout: none;
  user-select: none;
}

/* ojo para mostrar/ocultar contraseñas (composables/passwordEyes.ts) */
input.has-eye {
  padding-right: 42px !important;
}
.pw-eye {
  position: absolute;
  z-index: 2;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.pw-eye:hover {
  color: var(--text);
  background: color-mix(in srgb, currentColor 10%, transparent);
}

/* Pestañas de formularios (canal, película, serie, episodios…): recuadro con pestañas del mismo ancho,
   ícono arriba y nombre debajo, la elegida resaltada (igual que en Bouquets) */
.seg-tabs {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.seg-tabs > button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 9px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}
.seg-tabs > button > span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seg-tabs > button:hover:not(.on) {
  color: var(--text);
  background: color-mix(in srgb, currentColor 8%, transparent);
}
.seg-tabs > button.on {
  background: var(--accent);
  color: var(--on-accent);
}
