/* ==========================================================================
   Recursos Worship — Soporte (2026)
   Se carga después de css/styles.css y css/nav.css (mismo sistema que la home);
   aquí solo va lo propio de esta página. Todo plano: sin sombras ni glows.
   --------------------------------------------------------------------------
   1. Base de la página
   2. Hero corto + buscador
   3. Canales (franja oscura del shell)
   4. Temas frecuentes (pestañas + preguntas)
   5. Formulario de ticket
   6. Historial y detalle del ticket
   7. Responsive
   8. Movimiento reducido
   ========================================================================== */

/* 1. Base ------------------------------------------------------------------ */
.sp-page {
  --sp-danger: #d92d20;
  --sp-danger-soft: #fdecea;
  --sp-danger-ink: #9f1d14;
  --sp-ok: #12805c;
  --sp-ok-soft: #e2f5ec;
  --sp-warn: #a85a06;
  --sp-warn-soft: #fcf0de;
  --sp-wa: #25d366;
  --sp-line-strong: rgba(20, 20, 20, 0.22);
}
:root[data-theme="dark"] .sp-page {
  --sp-danger: #ff6b5e;
  --sp-danger-soft: rgba(255, 107, 94, 0.14);
  --sp-danger-ink: #ffb4ab;
  --sp-ok: #4ade9c;
  --sp-ok-soft: rgba(74, 222, 156, 0.14);
  --sp-warn: #fbbf62;
  --sp-warn-soft: rgba(251, 191, 98, 0.14);
  --sp-line-strong: rgba(255, 255, 255, 0.26);
}
.sp-page section[id] { scroll-margin-top: 96px; }
.sp-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
@keyframes spIn {
  from { opacity: 0; filter: blur(8px); transform: translateY(12px); }
  to   { opacity: 1; filter: blur(0); transform: none; }
}
@keyframes spSpin { to { transform: rotate(360deg); } }
@keyframes spHit { 0%, 35% { background-color: var(--accent-soft); } 100% { background-color: transparent; } }

/* Acordeón: enlaces dentro de las respuestas y sin foco en paneles cerrados */
.sp-page .acc-panel a { color: var(--accent-fg); font-weight: 560; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.sp-page .acc-panel > div { visibility: hidden; transition: visibility 0s linear 0.5s; }
.sp-page .acc-item.is-open .acc-panel > div { visibility: visible; transition-delay: 0s; }
.sp-page .acc-item.is-hit { animation: spHit 1.8s var(--ease-ui); border-radius: 12px; }

/* 2. Hero corto + buscador ------------------------------------------------- */
/* Sin muro de imágenes: panel limpio y más bajo que el de la home. Visible para que el
   desplegable de resultados pueda salir del panel sin recortarse. */
.sp-page .hero.sp-hero {
  min-height: 0;
  padding: clamp(140px, 12vw, 184px) 0 clamp(64px, 6.4vw, 104px);
  overflow: visible;
  z-index: 3;
}
.sp-hero .hero-content { gap: 22px; }
.sp-hero .hero-title { font-size: clamp(44px, 5.6vw, 84px); max-width: 14ch; }
.sp-hero .hero-sub { max-width: 44ch; }
.sp-badge { gap: 9px; padding-left: 5px; }
.sp-badge-ico { width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; }
.sp-badge-ico .ico { width: 14px; height: 14px; }
.sp-badge .chip { margin-left: 2px; }

/* z-index: los bloques con data-load crean su propio contexto de apilamiento; el desplegable va encima de los chips */
.sp-search { position: relative; z-index: 4; width: min(100%, 660px); margin-top: 8px; text-align: left; }
.sp-search-box {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  height: 62px; padding: 0 12px 0 22px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color var(--t-ui), box-shadow var(--t-ui);
}
.sp-search-box:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.sp-search-box:focus-within { background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--accent); }
.sp-search-ico { width: 20px; height: 20px; flex: none; color: var(--muted); }
.sp-search-box input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 17px; font-weight: 450; color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
.sp-search-box input::placeholder { color: var(--muted-2); }
.sp-search-box input::-webkit-search-cancel-button, .sp-search-box input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.sp-kbd {
  display: grid; place-items: center; flex: none;
  min-width: 26px; height: 26px; padding: 0 6px; margin-right: 6px;
  border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line-2);
  font-family: "Geist Mono", ui-monospace, monospace; font-size: 12.5px; color: var(--muted);
}
.sp-search.has-value .sp-kbd { display: none; }
.sp-clear { width: 38px; height: 38px; flex: none; border-radius: 999px; display: grid; place-items: center; color: var(--muted); transition: background-color var(--t-ui), color var(--t-ui); }
.sp-clear:hover { background: var(--fill); color: var(--ink); }
.sp-clear svg { width: 16px; height: 16px; }
.sp-clear[hidden] { display: none; }

.sp-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 5;
  max-height: min(440px, 58vh); overflow: auto; overscroll-behavior: contain;
  padding: 8px;
  border-radius: 22px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  animation: spIn 0.35s var(--ease-quint) both;
}
.sp-results[hidden] { display: none; }
.sp-result {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  cursor: pointer;
  transition: background-color var(--t-ui);
}
.sp-result:hover, .sp-result[aria-selected="true"] { background: var(--fill); }
.sp-result-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface); color: var(--accent-fg); }
.sp-result-ico .ico { width: 17px; height: 17px; }
.sp-result-ico img { width: 20px; height: 20px; }
.sp-result-text { display: grid; gap: 3px; min-width: 0; flex: 1; }
.sp-result-q { font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.sp-result-a { font-size: 13.5px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-result-topic { flex: none; margin-top: 1px; height: 24px; padding: 0 9px; font-size: 12px; }
.sp-results mark { background: var(--accent-soft); color: var(--accent-ink); border-radius: 4px; padding: 0 1px; }
.sp-results-empty { display: grid; justify-items: start; gap: 12px; padding: 14px 14px 12px; font-size: 15px; color: var(--muted); }
.sp-results-empty[hidden] { display: none; }
.sp-results-empty span { color: var(--ink); font-weight: 560; }

.sp-popular { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; max-width: 660px; font-size: 14px; color: var(--muted); }
.sp-popular > span { margin-right: 4px; }
.sp-chip { cursor: pointer; transition: background-color var(--t-ui), color var(--t-ui); }
.sp-chip:hover { background: var(--fill-hover); color: var(--ink); }
/* CTA del hero: separado del buscador por una línea fina */
.sp-hero-cta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 18px; width: min(100%, 660px); margin-top: 6px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 16px; font-weight: 500; color: var(--muted); }

/* 3. Canales --------------------------------------------------------------- */
.sp-channels { padding: clamp(48px, 5vw, 80px) 0 clamp(56px, 6vw, 96px); }
.sp-channels-label { margin-bottom: clamp(20px, 2.4vw, 32px); text-align: center; font-size: 15px; font-weight: 500; letter-spacing: 0; color: rgba(255, 255, 255, 0.7); }
.sp-channel-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.2vw, 18px); }
.sp-channel-grid > li { display: flex; }
.sp-channel {
  flex: 1;
  display: flex; flex-direction: column; gap: 10px;
  padding: clamp(22px, 2vw, 30px);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  transition: background-color 0.3s var(--ease-ui);
}
.sp-channel:hover { background: rgba(255, 255, 255, 0.1); }
.sp-channel:focus-visible { outline-color: #fff; }
.sp-channel-ico { width: 46px; height: 46px; margin-bottom: 8px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.08); color: #fff; }
.sp-channel-grid > li:first-child .sp-channel-ico { background: var(--accent); }
.sp-channel-ico.is-wa { background: var(--sp-wa); color: #fff; }
.sp-channel strong { font-size: 19px; font-weight: 620; letter-spacing: -0.02em; line-height: 1.2; }
.sp-channel-copy { flex: 1; font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, 0.66); }
.sp-channel-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 14.5px; font-weight: 600; }
.sp-channel-cta .arrow { width: 15px; height: 15px; transition: transform var(--t-ui) var(--ease-ui); }
.sp-channel:hover .sp-channel-cta .arrow { transform: translateX(3px); }

/* 4. Temas frecuentes ------------------------------------------------------ */
.sp-topics { padding-bottom: var(--space-md); }
.sp-topics .head { margin-bottom: clamp(28px, 3.4vw, 48px); }
.sp-topic-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.sp-topic {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  min-height: 140px; padding: 18px;
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition: background-color var(--t-ui) var(--ease-ui), color var(--t-ui) var(--ease-ui);
}
.sp-topic:hover { background: var(--surface-2); }
.sp-topic[aria-selected="true"] { background: var(--ink); color: var(--on-ink); }
.sp-topic-ico { width: 40px; height: 40px; margin-bottom: auto; border-radius: 12px; display: grid; place-items: center; background: var(--panel); color: var(--accent-fg); }
.sp-topic-ico .ico { width: 20px; height: 20px; }
.sp-topic-ico img { width: 24px; height: 24px; }
.sp-topic[aria-selected="true"] .sp-topic-ico { background: color-mix(in srgb, var(--on-ink) 14%, transparent); color: var(--on-ink); }
.sp-topic strong { margin-top: 14px; font-size: 16px; font-weight: 620; line-height: 1.25; letter-spacing: -0.015em; }
.sp-topic-meta { font-size: 13px; color: var(--muted); }
.sp-topic[aria-selected="true"] .sp-topic-meta { color: color-mix(in srgb, var(--on-ink) 62%, transparent); }

.sp-topic-panels { padding: clamp(24px, 3.2vw, 52px); border-radius: var(--r-xl); background: var(--surface); }
.sp-topic-panel { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(28px, 5vw, 88px); align-items: start; }
.sp-topic-panel[hidden] { display: none; }
.sp-topic-panel:focus-visible { outline-offset: 8px; border-radius: 16px; }
.sp-topic-panel.is-entering { animation: spIn 0.6s var(--ease-quint) both; }
.sp-topic-side { position: sticky; top: 112px; display: grid; gap: 16px; }
.sp-topic-side p { max-width: 36ch; font-size: 16.5px; line-height: 1.5; color: var(--muted); }
.sp-links { display: grid; gap: 10px; margin: 2px 0 6px; }
.sp-topic-side .btn { justify-self: start; }
.sp-topic-panels .acc-item, .sp-topic-panels .acc-item:first-child { border-color: var(--line-2); }

/* 5. Formulario de ticket -------------------------------------------------- */
.sp-ticket { padding-top: var(--space-md); }
.sp-ticket-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 5.4vw, 96px); align-items: start; }
.sp-ticket-aside { position: sticky; top: 112px; display: grid; gap: 18px; }
.sp-steps { display: grid; margin-top: 10px; }
.sp-steps li { display: flex; align-items: flex-start; gap: 14px; padding: 15px 0; border-top: 1px solid var(--line); }
.sp-steps li:last-child { border-bottom: 1px solid var(--line); }
.sp-step-dot { width: 28px; height: 28px; flex: none; border-radius: 999px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 650; }
.sp-steps strong { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.3; }
.sp-steps div > span { display: block; margin-top: 2px; font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.sp-note { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.sp-note svg { width: 18px; height: 18px; flex: none; color: var(--accent-fg); }

.sp-form-card { padding: clamp(20px, 3vw, 44px); border-radius: var(--r-xl); background: var(--surface); scroll-margin-top: 112px; }
.sp-form { display: grid; gap: 24px; }
.sp-form[hidden] { display: none; }
.sp-mono { font-family: "Geist Mono", ui-monospace, monospace; font-weight: 500; }
.sp-req-note { font-size: 13.5px; color: var(--muted); }
.sp-req { color: var(--accent-fg); font-weight: 600; }
.sp-optional { margin-left: 4px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.sp-field { display: grid; gap: 8px; min-width: 0; align-content: start; }
.sp-nowrap { white-space: nowrap; }
fieldset.sp-field { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.sp-label { padding: 0; font-size: 14.5px; font-weight: 600; line-height: 1.35; color: var(--ink); }
legend.sp-label { margin-bottom: 10px; }
.sp-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }

.sp-input {
  width: 100%; height: 50px; padding: 0 16px;
  border: 1px solid var(--line-2); border-radius: 14px;
  background: var(--panel); color: var(--ink);
  font: inherit; font-size: 16px; line-height: 1.4;
  transition: border-color var(--t-ui), outline-color var(--t-ui);
}
.sp-input::placeholder { color: var(--muted-2); }
.sp-input:hover { border-color: var(--sp-line-strong); }
.sp-input:focus, .sp-select select:focus { outline: 3px solid var(--accent-soft-2); outline-offset: 0; border-color: var(--accent); }
.sp-textarea { height: auto; min-height: 156px; padding: 14px 16px; line-height: 1.55; resize: vertical; }
.sp-input[aria-invalid="true"], .sp-select select[aria-invalid="true"] { border-color: var(--sp-danger); }
.sp-input[aria-invalid="true"]:focus, .sp-select select[aria-invalid="true"]:focus { outline-color: var(--sp-danger-soft); }
input.sp-input[type="date"] { padding-right: 12px; }

.sp-select { position: relative; }
.sp-select::after {
  content: ""; position: absolute; right: 18px; top: 50%;
  width: 8px; height: 8px; margin-top: -6px;
  border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted);
  transform: rotate(45deg); pointer-events: none;
}
.sp-select select {
  width: 100%; height: 50px; padding: 0 44px 0 16px;
  border: 1px solid var(--line-2); border-radius: 14px;
  background: var(--panel); color: var(--ink);
  font: inherit; font-size: 16px;
  -webkit-appearance: none; appearance: none; cursor: pointer;
  transition: border-color var(--t-ui);
}
.sp-select select:hover { border-color: var(--sp-line-strong); }
.sp-select select:disabled { opacity: 0.55; cursor: not-allowed; }
.sp-select select option { background: var(--panel); color: var(--ink); }

.sp-help { font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.sp-help-row { display: flex; justify-content: space-between; gap: 12px; }
.sp-count { flex: none; font-variant-numeric: tabular-nums; color: var(--muted-2); }
.sp-count.is-near { color: var(--sp-warn); }
.sp-error { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; font-weight: 540; line-height: 1.4; color: var(--sp-danger); animation: spIn 0.35s var(--ease-quint) both; }
.sp-error::before { content: "!"; flex: none; width: 16px; height: 16px; margin-top: 1px; border-radius: 999px; display: grid; place-items: center; background: var(--sp-danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.sp-error[hidden] { display: none; }

/* Producto: opciones tipo tarjeta (radios nativos, navegables con flechas) */
.sp-product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sp-product {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 10px 12px;
  border: 1px solid var(--line-2); border-radius: 14px;
  background: var(--panel);
  font-size: 14.5px; font-weight: 560; line-height: 1.25; color: var(--ink);
  cursor: pointer;
  transition: border-color var(--t-ui), background-color var(--t-ui);
}
.sp-product input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sp-product:hover { border-color: var(--sp-line-strong); }
.sp-product:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.sp-product:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.sp-product-ico { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface); color: var(--ink-2); }
.sp-product-ico img { width: 22px; height: 22px; }
.sp-product:has(input:checked) .sp-product-ico { background: var(--panel); color: var(--accent-fg); }
.sp-products.is-invalid .sp-product { border-color: color-mix(in srgb, var(--sp-danger) 55%, transparent); }

/* Detalles adicionales */
.sp-extra { display: grid; gap: 16px; padding: 20px; border-radius: 18px; background: var(--panel); animation: spIn 0.5s var(--ease-quint) both; }
.sp-extra[hidden] { display: none; }
.sp-extra-title { font-size: 15px; font-weight: 620; letter-spacing: -0.01em; }
.sp-extra .sp-input, .sp-extra .sp-select select { background: var(--surface); }
.sp-extra .sp-label { font-weight: 560; }

/* Adjunto con vista previa local */
.sp-drop { position: relative; display: grid; gap: 10px; }
.sp-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.sp-drop-zone {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 100px; padding: 18px;
  border: 1.5px dashed var(--sp-line-strong); border-radius: 16px;
  background: var(--panel);
  font-size: 15px; line-height: 1.45; text-align: left; color: var(--muted);
  cursor: pointer;
  transition: border-color var(--t-ui), background-color var(--t-ui);
}
.sp-drop-zone strong { color: var(--ink); font-weight: 600; }
.sp-drop-zone u { color: var(--accent-fg); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.sp-drop-ico { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--accent-fg); }
.sp-drop-ico .ico { transform: rotate(180deg); }
.sp-drop-zone:hover, .sp-drop.is-over .sp-drop-zone { border-color: var(--accent); background: var(--accent-soft); }
.sp-drop:has(.sp-file-input:focus-visible) .sp-drop-zone { outline: 2px solid var(--accent); outline-offset: 2px; }
.sp-drop.is-invalid .sp-drop-zone { border-color: var(--sp-danger); }
.sp-drop.has-file .sp-drop-zone { display: none; }
.sp-file { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--panel); animation: spIn 0.45s var(--ease-quint) both; }
.sp-file[hidden] { display: none; }
.sp-file-thumb { width: 72px; height: 72px; flex: none; overflow: hidden; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); font-family: "Geist Mono", ui-monospace, monospace; font-size: 13px; font-weight: 500; color: var(--muted); }
.sp-file-thumb img, .sp-file-thumb video { width: 100%; height: 100%; object-fit: cover; }
.sp-file-meta { display: grid; gap: 2px; min-width: 0; flex: 1; }
.sp-file-meta strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-file-meta span { font-size: 13.5px; color: var(--muted); }

/* Error de envío, pie, botón con indicador */
.sp-alert { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 16px; background: var(--sp-danger-soft); color: var(--sp-danger-ink); animation: spIn 0.4s var(--ease-quint) both; }
.sp-alert[hidden] { display: none; }
.sp-alert p { flex: 1; font-size: 14.5px; font-weight: 540; line-height: 1.4; }
.sp-alert-ico { width: 24px; height: 24px; flex: none; border-radius: 999px; display: grid; place-items: center; background: var(--sp-danger); color: #fff; font-size: 14px; font-weight: 700; }
.sp-form-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; }
.sp-status { font-size: 14.5px; font-weight: 520; color: var(--muted); }
.sp-status.is-error { color: var(--sp-danger); }
.sp-status.is-success { color: var(--sp-ok); }
.sp-spinner { display: none; width: 16px; height: 16px; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 999px; animation: spSpin 0.7s linear infinite; }
.sp-submit.is-loading .sp-spinner { display: inline-block; }
.sp-submit[aria-disabled="true"] { cursor: progress; opacity: 0.8; }

/* Pantalla de éxito */
.sp-success { display: grid; justify-items: start; gap: 14px; animation: spIn 0.7s var(--ease-quint) both; }
.sp-success[hidden] { display: none; }
.sp-success:focus { outline: none; }
.sp-success-ico { width: 56px; height: 56px; margin-bottom: 4px; border-radius: 18px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.sp-success-ico svg { width: 28px; height: 28px; }
.sp-success-copy { font-size: 17px; color: var(--muted); }
.sp-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 28px; width: 100%; margin: 8px 0 10px; padding: 18px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); font-size: 15px; }
.sp-summary dt { color: var(--muted); }
.sp-summary dd { margin: 0; min-width: 0; font-weight: 560; color: var(--ink); overflow-wrap: anywhere; }

/* 6. Historial y detalle --------------------------------------------------- */
.sp-history-count { color: var(--ink); font-weight: 560; }
.sp-history .text-tab:hover { background: var(--fill); }
.sp-history-card { padding: clamp(6px, 0.8vw, 10px); border-radius: var(--r-xl); background: var(--panel); }
.sp-history-list:empty { display: none; }
.sp-ticket-row {
  width: 100%;
  display: grid; grid-template-columns: minmax(120px, 1.1fr) minmax(0, 3fr) minmax(150px, auto) minmax(96px, auto) 18px;
  align-items: center; gap: 20px;
  padding: 18px 16px;
  border-radius: 18px;
  text-align: left;
  transition: background-color var(--t-ui);
  animation: spIn 0.5s var(--ease-quint) both; animation-delay: calc(var(--d, 0) * 50ms);
}
.sp-ticket-row + .sp-ticket-row { margin-top: 2px; }
.sp-ticket-row:hover, .sp-ticket-row.is-selected { background: var(--fill); }
.sp-ticket-ref { display: grid; gap: 2px; min-width: 0; }
.sp-ticket-ref strong { flex: none; font-family: "Geist Mono", ui-monospace, monospace; font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.sp-ticket-ref small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-ticket-subject { min-width: 0; font-size: 15.5px; font-weight: 560; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-ticket-date { font-size: 13.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.sp-ticket-row > svg { width: 18px; height: 18px; color: var(--muted-2); }

.sp-status-chip { display: inline-flex; align-items: center; gap: 7px; justify-self: start; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--fill); color: var(--ink-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.sp-status-chip::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.sp-status-chip[data-status="review"] { background: var(--accent-soft); color: var(--accent-ink); }
.sp-status-chip[data-status="waiting"] { background: var(--sp-warn-soft); color: var(--sp-warn); }
.sp-status-chip[data-status="answered"] { background: var(--accent); color: #fff; }
.sp-status-chip[data-status="resolved"] { background: var(--sp-ok-soft); color: var(--sp-ok); }
.sp-status-chip[data-status="closed"] { color: var(--muted); }

.sp-empty { display: grid; justify-items: center; gap: 12px; padding: clamp(36px, 5vw, 64px) 16px; text-align: center; font-size: 16px; color: var(--muted); }
.sp-empty[hidden] { display: none; }
.sp-empty-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); color: var(--muted); }

.sp-detail { scroll-margin-top: 112px; display: grid; gap: 20px; margin-top: clamp(14px, 1.4vw, 20px); padding: clamp(20px, 3vw, 44px); border-radius: var(--r-xl); background: var(--panel); animation: spIn 0.6s var(--ease-quint) both; }
.sp-detail[hidden] { display: none; }
.sp-detail:focus { outline: none; }
.sp-back { justify-self: start; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 10px; border-radius: 999px; background: var(--fill); font-size: 14px; font-weight: 560; transition: background-color var(--t-ui); }
.sp-back:hover { background: var(--fill-hover); }
.sp-back svg { width: 16px; height: 16px; }
.sp-detail-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; }
.sp-detail-ref { margin-bottom: 6px; font-family: "Geist Mono", ui-monospace, monospace; font-size: 13px; color: var(--muted); }
.sp-original[hidden] { display: none; }
.sp-original { display: grid; gap: 16px; padding: 20px; border-radius: 18px; background: var(--surface); }
.sp-original > p { font-size: 16px; line-height: 1.55; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.sp-original dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 14.5px; }
.sp-original dt { color: var(--muted); font-size: 13px; }
.sp-original dd { margin: 2px 0 0; font-weight: 560; overflow-wrap: anywhere; }
.sp-attach { display: inline-flex; align-items: center; gap: 8px; justify-self: start; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--panel); font-size: 13.5px; font-weight: 560; color: var(--ink-2); max-width: 100%; }
.sp-attach .ico { color: var(--accent-fg); }
.sp-attach span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-conv-title { font-size: 15px; font-weight: 620; }
.sp-messages { display: grid; gap: 10px; }
.sp-msg { justify-self: start; width: min(100%, 640px); padding: 14px 16px; border-radius: 18px; background: var(--accent-soft); animation: spIn 0.45s var(--ease-quint) both; }
.sp-msg.is-you { justify-self: end; background: var(--surface); }
.sp-msg-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.sp-msg-head strong { color: var(--ink); font-weight: 600; }
.sp-msg p { font-size: 15.5px; line-height: 1.5; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.sp-messages-empty { font-size: 14.5px; color: var(--muted); }
.sp-reply { display: grid; gap: 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.sp-reply[hidden], .sp-closed-note[hidden] { display: none; }
.sp-reply .sp-input { background: var(--surface); }
.sp-closed-note { padding-top: 20px; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.sp-closed-note a { color: var(--accent-fg); font-weight: 560; text-decoration: underline; text-underline-offset: 3px; }

.sp-wa-btn .ico { color: var(--sp-ok); }

/* 6b. Portal de soporte (soporte-portal.html) ------------------------------ */
.sp-portal-head { padding: clamp(128px, 11vw, 168px) 0 0; }
.sp-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 14px; color: var(--muted); }
.sp-crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--muted-2); }
.sp-crumbs a { color: var(--muted); transition: color var(--t-ui); }
.sp-crumbs a:hover { color: var(--ink); }
.sp-crumbs [aria-current] { font-weight: 560; color: var(--ink); }
.sp-portal-top { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 20px 40px; }
.sp-portal-copy { display: grid; gap: 14px; }
.sp-portal-title { font-size: clamp(40px, 5vw, 72px); }
.sp-portal-tabs { display: inline-flex; gap: 4px; margin-top: clamp(28px, 3vw, 40px); padding: 4px; border-radius: 999px; background: var(--fill); scroll-margin-top: 100px; }
.sp-portal-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border-radius: 999px;
  font-size: 15px; font-weight: 600; color: var(--muted); white-space: nowrap;
  transition: background-color var(--t-ui), color var(--t-ui);
}
.sp-portal-tab:hover { color: var(--ink); }
.sp-portal-tab[aria-selected="true"] { background: var(--panel); color: var(--ink); }
.sp-portal-tab[aria-selected="true"] .ico { color: var(--accent-fg); }
.sp-tab-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--accent); color: #fff; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.sp-tab-count[hidden] { display: none; }

.sp-portal-body { padding: clamp(28px, 3.4vw, 48px) 0 var(--space-lg); }
.sp-portal-body .sp-portal-panel { padding: 0; }
.sp-portal-panel[hidden] { display: none; }
.sp-portal-panel:focus-visible { outline-offset: 10px; border-radius: 20px; }
.sp-portal-panel.is-entering { animation: spIn 0.5s var(--ease-quint) both; }
.sp-portal-panel .h2 { font-size: clamp(28px, 2.7vw, 40px); }
.sp-portal-panel .sp-ticket-aside { gap: 16px; }
.sp-portal-panel.sp-history .head { margin-bottom: clamp(20px, 2.4vw, 32px); }
/* En el portal el fondo es blanco: el historial y el detalle pasan a superficie gris (como el formulario) */
.sp-portal-page .sp-history-card, .sp-portal-page .sp-detail { background: var(--surface); }
.sp-portal-page .sp-original, .sp-portal-page .sp-msg.is-you, .sp-portal-page .sp-reply .sp-input, .sp-portal-page .sp-empty-ico { background: var(--panel); }
.sp-portal-page .sp-attach { background: var(--surface); }

/* 7. Responsive ------------------------------------------------------------ */
@media (max-width: 1200px) {
  .sp-channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-topic-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sp-topic { min-height: 118px; }
}
@media (max-width: 900px) {
  .sp-hero .hero-title { font-size: clamp(38px, 10.4vw, 56px); }
  .sp-topic-panel, .sp-ticket-grid { grid-template-columns: 1fr; }
  .sp-topic-side, .sp-ticket-aside { position: static; }
  .sp-ticket-row { grid-template-columns: minmax(0, 1fr) auto 18px; grid-template-areas: "ref status chev" "subject subject chev" "date date chev"; gap: 6px 12px; }
  .sp-ticket-ref { grid-area: ref; display: flex; align-items: baseline; gap: 10px; }
  .sp-ticket-subject { grid-area: subject; white-space: normal; }
  .sp-ticket-row .sp-status-chip { grid-area: status; }
  .sp-ticket-date { grid-area: date; text-align: left; }
  .sp-ticket-row > svg { grid-area: chev; }
}
@media (max-width: 700px) {
  .sp-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-grid-2, .sp-original dl { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .sp-page .hero.sp-hero { padding: 116px 0 56px; }
  .sp-hero .hero-content { gap: 18px; }
  .sp-search-box { height: 56px; padding-left: 18px; }
  .sp-search-box input { font-size: 16px; }
  .sp-kbd { display: none; }
  .sp-popular { gap: 6px; font-size: 13px; }
  .sp-popular > span { width: 100%; margin: 0 0 2px; }
  .sp-hero-cta { flex-direction: column; gap: 12px; padding-top: 20px; font-size: 15px; }
  .sp-hero-cta .btn { width: 100%; }
  .sp-channel-grid { grid-template-columns: 1fr; gap: 10px; }
  .sp-channel { padding: 20px; gap: 8px; }
  .sp-channel-ico { width: 40px; height: 40px; margin-bottom: 4px; border-radius: 12px; }
  .sp-channel strong { font-size: 18px; }
  .sp-channel-cta { margin-top: 4px; }
  .sp-topic-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sp-topic { min-height: 0; padding: 12px; flex-direction: row; align-items: center; gap: 10px; border-radius: 16px; }
  .sp-topic-ico { width: 34px; height: 34px; margin: 0; flex: none; border-radius: 10px; }
  .sp-topic strong { margin: 0; font-size: 14px; }
  .sp-topic-meta { display: none; }
  .sp-topic-panels { padding: 20px 18px 8px; border-radius: var(--r-lg); }
  .sp-product { min-height: 52px; padding: 8px 10px; gap: 8px; font-size: 13.5px; }
  .sp-product-ico { width: 28px; height: 28px; border-radius: 8px; }
  .sp-product-ico img { width: 20px; height: 20px; }
  .sp-form-card, .sp-detail { border-radius: var(--r-lg); }
  .sp-extra { padding: 16px; }
  .sp-drop-zone { flex-direction: column; text-align: center; }
  .sp-form-foot .sp-submit { width: 100%; }
  .sp-file-thumb { width: 56px; height: 56px; }
  .sp-alert { flex-wrap: wrap; }
  .sp-summary { grid-template-columns: 1fr; gap: 2px; }
  .sp-summary dd + dt { margin-top: 10px; }
  .sp-history .head-split { gap: 18px; }
  .sp-portal-head { padding-top: 112px; }
  .sp-portal-title { font-size: clamp(36px, 10.4vw, 48px); }
  .sp-portal-tabs { display: flex; width: 100%; }
  .sp-portal-tab { flex: 1; min-width: 0; padding: 0 10px; gap: 6px; font-size: 14px; }
  .sp-portal-tab .ico { width: 16px; height: 16px; }
}

/* 8. Movimiento reducido --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .sp-topic-panel.is-entering, .sp-portal-panel.is-entering, .sp-results, .sp-error, .sp-extra, .sp-file, .sp-alert, .sp-success, .sp-ticket-row, .sp-detail, .sp-msg { animation: none; }
  .sp-page .acc-item.is-hit { animation: none; background: var(--accent-soft); }
  .sp-spinner { animation: spSpin 1.4s linear infinite !important; }
}
