/* ============================================
   BIBLIOTECA "EDITA A TU MANERA"
   Design System — Girly Premium ✦
   ============================================ */

/* ---- 1. DESIGN TOKENS ---- */
:root {
  /* Palette */
  --rosa: #FF2D9B;
  --rosa-hover: #E8238B;
  --rosa-10: rgba(255, 45, 155, 0.1);
  --rosa-20: rgba(255, 45, 155, 0.2);
  --rosa-glow: rgba(255, 45, 155, 0.28);
  --lila: #C77DFF;
  --lila-10: rgba(199, 125, 255, 0.1);
  --dorado: #F5C542;
  --dorado-15: rgba(245, 197, 66, 0.15);
  --blush: #FFF0F8;
  --blush-deep: #FFE3F1;
  --blush-border: #FFD1E8;
  --plum: #3D0A26;
  --plum-60: rgba(61, 10, 38, 0.6);
  --plum-light: #8A5C74;
  /* Era #C99CB3: sobre blanco daba 2.3:1 y reprobaba el mínimo de accesibilidad
     (4.5:1). Se usa en textos —placeholders, etiquetas, el "nada por aquí" del
     buscador—, así que se oscureció lo justo para llegar a 4.7:1 sin salirse
     del malva del kit. */
  --plum-muted: #9A6480;
  --plum-muted-soft: #C99CB3;   /* el tono original, solo para adornos y bordes */
  --papel: #FFFDF6;
  --borde-nota: #F2E4D8;
  --white: #FFFFFF;
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #E8E8E8;
  --gray-300: #D4D4D4;
  --error: #E53E3E;
  --error-bg: #FFF5F5;
  --success: #38A169;
  --success-bg: #F0FFF4;

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(61, 10, 38, 0.04);
  --shadow-sm: 0 2px 8px rgba(61, 10, 38, 0.06);
  --shadow-md: 0 8px 20px rgba(61, 10, 38, 0.08);
  --shadow-lg: 0 16px 40px rgba(61, 10, 38, 0.12);
  --shadow-cta: 0 8px 22px var(--rosa-glow);
  --shadow-modal: 0 24px 60px rgba(61, 10, 38, 0.35);

  /* Radii */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* Layout */
  --sidebar-w: 260px;
  --topbar-h: 68px;   /* alto real de la barra superior con el buscador */
  --container-max: 1200px;

  /* Timing */
  --ease-fast: 0.15s ease;
  --ease: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z */
  --z-sidebar: 100;
  --z-overlay: 200;
  --z-modal: 300;
  --z-toast: 400;
}

/* ---- 2. RESET & BASE ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--plum);
  background: var(--blush);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--rosa);
  text-decoration: none;
  transition: color var(--ease-fast);
}

a:hover { color: var(--rosa-hover); }

ul, ol { list-style: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ---- 3. TYPOGRAPHY ---- */
.font-display,
h1, h2 {
  font-family: 'Anton', sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--plum);
}

h1 { font-size: clamp(32px, 5vw, 48px); }
h2 { font-size: clamp(24px, 4vw, 36px); }
h3 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.35;
}
h4 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 15px;
}

.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--plum-light); }
.text-rosa { color: var(--rosa); }
.text-center { text-align: center; }

/* ---- 4. UTILITIES ---- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

/* ---- 5. LAYOUT: LOGIN PAGE ---- */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--blush) 0%, var(--white) 50%, var(--blush-deep) 100%);
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.login-card {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: clamp(32px, 6vw, 48px);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 2;
  text-align: center;
  animation: fadeInUp 0.6s var(--ease) both;
}

.login-logo {
  font-family: 'Anton', sans-serif;
  font-size: 28px;
  text-transform: uppercase;
  color: var(--rosa);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.login-card h1 {
  font-size: clamp(22px, 4vw, 28px);
  margin-bottom: 4px;
}

.login-card > p {
  color: var(--plum-light);
  font-size: 14px;
  margin-bottom: 32px;
}

.login-card .form-group {
  text-align: left;
  margin-bottom: 16px;
}

.login-card .form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--plum-light);
  margin-bottom: 6px;
}

.login-card .btn-block {
  width: 100%;
  margin-top: 8px;
}

/* ---- 6. LAYOUT: APP SHELL ---- */
.app-page,
.admin-page {
  display: flex;
  min-height: 100dvh;
}

.main-content {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.app-content {
  flex: 1;
  padding: clamp(20px, 4vw, 40px);
  animation: fadeIn 0.3s ease both;
}

.app-content > .container {
  padding-bottom: 60px;
}

/* ---- 7. SIDEBAR ---- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--blush-border);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--ease);
}

.sidebar-header {
  padding: 24px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-logo {
  font-family: 'Anton', sans-serif;
  font-size: 22px;
  text-transform: uppercase;
  color: var(--rosa);
  letter-spacing: 0.03em;
}

.sidebar-close {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  color: var(--plum-light);
  transition: background var(--ease-fast);
}

.sidebar-close:hover {
  background: var(--rosa-10);
  color: var(--rosa);
}

.sidebar-nav {
  flex: 1;
  padding: 0 12px;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--plum-muted);
  padding: 20px 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--plum);
  cursor: pointer;
  transition: all var(--ease-fast);
  text-decoration: none;
  user-select: none;
  min-height: 40px;
}

.nav-item:hover {
  background: var(--rosa-10);
  color: var(--rosa);
}

.nav-item.active {
  background: var(--rosa);
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 4px 12px var(--rosa-glow);
}

.nav-item .nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--blush-border);
  flex-shrink: 0;
}

.sidebar-footer .admin-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--plum-light);
  transition: all var(--ease-fast);
  margin-bottom: 8px;
}

.sidebar-footer .admin-link:hover {
  background: var(--lila-10);
  color: var(--lila);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: var(--plum-60);
  z-index: calc(var(--z-sidebar) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease);
  backdrop-filter: blur(2px);
}

.sidebar-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---- 8. TOPBAR (MOBILE) ---- */
.topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--blush-border);
  position: sticky;
  top: 0;
  z-index: calc(var(--z-sidebar) - 2);
}

.menu-btn {
  width: 36px;
  height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border-radius: 8px;
  transition: background var(--ease-fast);
}

.menu-btn:hover { background: var(--rosa-10); }

.menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--plum);
  border-radius: 2px;
  transition: all var(--ease-fast);
}

.topbar-logo {
  font-family: 'Anton', sans-serif;
  font-size: 18px;
  text-transform: uppercase;
  color: var(--rosa);
  letter-spacing: 0.03em;
}

/* ---- 9. SEARCH ---- */
.search-wrapper {
  position: relative;
  max-width: 600px;
  margin: 0 auto 32px;
}

.search-bar {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border: 2px solid var(--blush-border);
  border-radius: var(--r-pill);
  background: var(--white);
  font-size: 15px;
  color: var(--plum);
  outline: none;
  transition: all var(--ease);
  box-shadow: var(--shadow-xs);
}

.search-bar::placeholder {
  color: var(--plum-muted);
}

.search-bar:focus {
  border-color: var(--rosa);
  box-shadow: 0 0 0 4px var(--rosa-10), var(--shadow-sm);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--plum-muted);
  font-size: 18px;
  pointer-events: none;
  transition: color var(--ease-fast);
}

.search-bar:focus ~ .search-icon {
  color: var(--rosa);
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  border: 1px solid var(--blush-border);
}

.search-results-dropdown.visible {
  display: block;
  animation: fadeInUp 0.2s ease both;
}

.search-result-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background var(--ease-fast);
  border-bottom: 1px solid var(--gray-100);
}

.search-result-item:last-child { border-bottom: none; }

.search-result-item:hover {
  background: var(--rosa-10);
}

.search-result-item .result-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.search-result-item .result-title {
  font-weight: 600;
  font-size: 14px;
}

.search-result-item .result-type {
  font-size: 11px;
  color: var(--plum-muted);
}

.search-result-item mark {
  background: var(--dorado-15);
  color: var(--plum);
  border-radius: 3px;
  padding: 0 2px;
}

/* ---- 10. CARDS ---- */
.card {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--ease);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Category Card */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.category-card {
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  color: var(--plum);
}

.category-card:hover {
  border-color: var(--rosa-20);
  color: var(--plum);
}

.category-card .cat-icon {
  font-size: 32px;
  margin-bottom: 10px;
  display: block;
}

.category-card .cat-name {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
}

/* Article Card */
.article-list {
  display: grid;
  gap: 16px;
}

.article-card {
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  cursor: pointer;
  border: 1px solid var(--blush-border);
  text-decoration: none;
  color: var(--plum);
}

.article-card:hover {
  border-color: var(--rosa-20);
  color: var(--plum);
}

.article-card .article-icon {
  font-size: 28px;
  flex-shrink: 0;
  margin-top: 2px;
}

.article-card .article-info { flex: 1; min-width: 0; }

.article-card .article-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
  line-height: 1.3;
}

.article-card .article-desc {
  color: var(--plum-light);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .article-arrow {
  color: var(--plum-muted);
  font-size: 20px;
  flex-shrink: 0;
  align-self: center;
  transition: transform var(--ease-fast);
}

.article-card:hover .article-arrow {
  transform: translateX(4px);
  color: var(--rosa);
}

/* Prompt Card */
.prompt-grid {
  display: grid;
  gap: 20px;
}

.prompt-card {
  padding: 24px;
  border: 1px solid var(--blush-border);
}

.prompt-card .prompt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.prompt-card .prompt-title {
  font-weight: 700;
  font-size: 16px;
}

.prompt-card .prompt-objective {
  color: var(--plum-light);
  font-size: 13px;
  margin-bottom: 16px;
}

.prompt-block {
  background: var(--plum);
  color: #F8E8F0;
  padding: 16px 20px;
  border-radius: var(--r-sm);
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
  margin-bottom: 16px;
}

.prompt-block .copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  background: var(--rosa);
  border-radius: var(--r-pill);
  transition: all var(--ease-fast);
  opacity: 0.85;
}

.prompt-block .copy-btn:hover {
  opacity: 1;
  transform: scale(1.05);
}

.prompt-block .copy-btn.copied {
  background: var(--success);
}

.prompt-card .prompt-example {
  background: var(--gray-50);
  padding: 14px 18px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--plum-light);
  border-left: 3px solid var(--dorado);
}

.prompt-card .prompt-example strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--plum);
  margin-bottom: 4px;
}

/* Resource Card */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.resource-card {
  padding: 24px;
  border: 1px solid var(--blush-border);
  display: flex;
  flex-direction: column;
}

.resource-card .resource-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.resource-card .resource-name {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 6px;
}

.resource-card .resource-desc {
  color: var(--plum-light);
  font-size: 13px;
  margin-bottom: 4px;
  flex: 1;
}

.resource-card .resource-usage {
  font-size: 12px;
  color: var(--rosa);
  font-weight: 600;
  margin-bottom: 16px;
}

/* Wallpaper Card */
.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.wallpaper-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.wallpaper-img-wrap {
  aspect-ratio: 9 / 16;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--gray-100);
  margin-bottom: 12px;
}

.wallpaper-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wallpaper-frase {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.wallpaper-caption {
  color: var(--plum-light);
  font-size: 12.5px;
  margin-bottom: 12px;
  flex: 1;
}

.wallpaper-download {
  width: 100%;
}

/* ---- 11. ARTICLE VIEW ---- */
.article-view {
  max-width: 720px;
}

.article-view .article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--plum-light);
  margin-bottom: 20px;
  transition: color var(--ease-fast);
}

.article-view .article-back:hover { color: var(--rosa); }

.article-view h1 {
  margin-bottom: 12px;
}

.article-view .article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.article-view .article-section {
  margin-bottom: 28px;
}

.article-view .article-section h3 {
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--blush-deep);
}

.article-view .article-section p,
.article-view .article-section ul {
  color: var(--plum);
  line-height: 1.75;
}

.article-view .article-section ul {
  padding-left: 20px;
}

.article-view .article-section li {
  list-style: disc;
  margin-bottom: 6px;
}

.article-view .article-section li::marker {
  color: var(--rosa);
}

/* Video embed */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--plum);
  margin: 20px 0;
  box-shadow: var(--shadow-md);
}

.video-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* Nota de Perla */
.nota-perla {
  background: var(--papel);
  border: 2px dashed var(--borde-nota);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  position: relative;
  margin: 24px 0;
  transform: rotate(-0.5deg);
}

.nota-perla::before {
  content: '💡';
  position: absolute;
  top: -14px;
  left: 20px;
  font-size: 24px;
  background: var(--papel);
  padding: 0 8px;
}

.nota-perla .nota-label {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rosa);
  margin-bottom: 8px;
}

.nota-perla p {
  font-style: italic;
  color: var(--plum-light);
  line-height: 1.7;
}

/* Subtitle-only section (no body content) */
.article-subtitle {
  margin: 24px 0 12px;
}

.article-subtitle h4 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rosa);
}

/* Related articles */
.related-section {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 2px solid var(--blush-deep);
}

.related-section h3 { margin-bottom: 16px; }

/* ---- 12. BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 14px;
  min-height: 44px;
  transition: all var(--ease);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--rosa);
  color: var(--white);
  box-shadow: var(--shadow-cta);
}

.btn-primary:hover {
  background: var(--rosa-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px var(--rosa-glow);
}

.btn-secondary {
  background: var(--white);
  color: var(--plum);
  border-color: var(--blush-border);
}

.btn-secondary:hover {
  border-color: var(--rosa);
  color: var(--rosa);
  background: var(--rosa-10);
}

.btn-gold {
  background: var(--dorado);
  color: var(--plum);
  box-shadow: 0 4px 12px rgba(245, 197, 66, 0.3);
}

.btn-gold:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--plum-light);
  padding: 8px 16px;
}

.btn-ghost:hover {
  background: var(--rosa-10);
  color: var(--rosa);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 13px;
  min-height: 36px;
}

.btn-danger {
  background: var(--error);
  color: var(--white);
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-block { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ---- 13. FORMS ---- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--plum-light);
  margin-bottom: 6px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--blush-border);
  border-radius: var(--r-sm);
  background: var(--white);
  outline: none;
  transition: all var(--ease-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--rosa);
  box-shadow: 0 0 0 3px var(--rosa-10);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238A5C74' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-error {
  color: var(--error);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  background: var(--error-bg);
  border-radius: var(--r-sm);
  margin-top: 12px;
}

.form-helper {
  font-size: 12px;
  color: var(--plum-muted);
  margin-top: 4px;
}

.form-success {
  color: var(--success);
  background: var(--success-bg);
}

.forgot-password-link {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--plum-light);
  margin-top: 16px;
}

.forgot-password-link:hover {
  color: var(--rosa);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Section block editor (admin: artículos) */
.section-block {
  background: var(--gray-50);
  border: 1px solid var(--blush-border);
  border-radius: var(--r-md);
  padding: 14px;
  margin-bottom: 12px;
}

.section-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.sb-actions {
  display: flex;
  gap: 4px;
}

.sb-actions button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--blush-border);
  color: var(--plum-light);
  font-size: 13px;
  transition: all var(--ease-fast);
}

.sb-actions button:hover:not(:disabled) {
  border-color: var(--rosa);
  color: var(--rosa);
}

.sb-actions button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.sb-actions .sb-remove:hover {
  border-color: var(--error);
  color: var(--error);
}

.sb-item-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.sb-item-row .form-input {
  flex: 1;
}

.sb-item-remove {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--blush-border);
  color: var(--plum-light);
}

.sb-item-remove:hover {
  border-color: var(--error);
  color: var(--error);
}

/* ---- 14. TAGS & BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-rosa {
  background: var(--rosa-10);
  color: var(--rosa);
}

.badge-lila {
  background: var(--lila-10);
  color: var(--lila);
}

.badge-dorado {
  background: var(--dorado-15);
  color: #9A7B1E;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 500;
  background: var(--gray-100);
  color: var(--plum-light);
}

/* ---- 15. CHECKLIST ---- */
.checklist-group {
  margin-bottom: 32px;
}

.checklist-group h3 {
  margin-bottom: 14px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--white);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  border: 1px solid var(--blush-border);
  cursor: pointer;
  transition: all var(--ease-fast);
  user-select: none;
}

.checklist-item:hover { border-color: var(--rosa-20); }

.checklist-item input[type="checkbox"] {
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--blush-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--ease-fast);
  position: relative;
  flex-shrink: 0;
}

.checklist-item input[type="checkbox"]:checked {
  background: var(--rosa);
  border-color: var(--rosa);
}

.checklist-item input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.checklist-item.checked .checklist-text {
  text-decoration: line-through;
  color: var(--plum-muted);
}

.checklist-text {
  font-size: 14px;
  transition: all var(--ease-fast);
}

/* ---- 16. WELCOME & QUICK ACCESS ---- */
.welcome-section {
  text-align: center;
  margin-bottom: 16px;
}

.welcome-section .greeting {
  font-size: 28px;
  margin-bottom: 4px;
}

.welcome-section .subtitle {
  color: var(--plum-light);
  font-size: 14px;
}

.section-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .sparkle-icon {
  color: var(--dorado);
  font-size: 14px;
}

/* Quick Access */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.quick-item {
  padding: 16px;
  background: var(--white);
  border-radius: var(--r-md);
  border: 1px solid var(--blush-border);
  text-align: center;
  cursor: pointer;
  transition: all var(--ease);
  text-decoration: none;
  color: var(--plum);
}

.quick-item:hover {
  border-color: var(--rosa-20);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  color: var(--plum);
}

.quick-item .quick-icon {
  font-size: 24px;
  margin-bottom: 8px;
  display: block;
}

.quick-item .quick-label {
  font-size: 13px;
  font-weight: 600;
}

/* Quote */
.quote-card {
  background: var(--papel);
  border: 2px dashed var(--borde-nota);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  text-align: center;
  margin: 32px 0;
  transform: rotate(-0.3deg);
}

.quote-card .quote-text {
  font-style: italic;
  font-size: 16px;
  color: var(--plum);
  line-height: 1.6;
  margin-bottom: 8px;
}

.quote-card .quote-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--rosa);
}

/* ---- 17. TOAST ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease both;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 400px;
}

.toast-success {
  background: var(--success);
  color: var(--white);
}

.toast-error {
  background: var(--error);
  color: var(--white);
}

.toast-info {
  background: var(--plum);
  color: var(--white);
}

.toast.removing {
  animation: slideOutRight 0.25s ease both;
}

/* ---- 18. MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--plum-60);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease);
  backdrop-filter: blur(4px);
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: clamp(24px, 5vw, 40px);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  transform: translateY(20px) scale(0.97);
  transition: transform var(--ease);
}

.modal-overlay.visible .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 22px;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--plum-light);
  transition: all var(--ease-fast);
}

.modal-close:hover {
  background: var(--rosa-10);
  color: var(--rosa);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--blush-border);
}

/* ---- 19. SPARKLES ---- */
.sparkle {
  position: absolute;
  color: var(--dorado);
  font-size: 16px;
  pointer-events: none;
  animation: twinkle 2.5s ease-in-out infinite;
  user-select: none;
}

.sparkle:nth-child(2) { animation-delay: 0.6s; font-size: 12px; }
.sparkle:nth-child(3) { animation-delay: 1.2s; font-size: 20px; }
.sparkle:nth-child(4) { animation-delay: 1.8s; font-size: 14px; }
.sparkle:nth-child(5) { animation-delay: 0.3s; font-size: 10px; }

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.7) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.1) rotate(15deg); }
}

/* ---- 20. LOADING ---- */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--plum-muted);
}

.sparkle-loader {
  font-size: 32px;
  color: var(--rosa);
  animation: twinkle 1.2s ease-in-out infinite;
}

.loading-state p {
  margin-top: 12px;
  font-size: 14px;
}

/* ---- 21. ADMIN ---- */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  border: 1px solid var(--blush-border);
}

.stat-card .stat-number {
  font-family: 'Anton', sans-serif;
  font-size: 36px;
  color: var(--rosa);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--plum-light);
  font-weight: 500;
}

/* Admin table */
.admin-table-wrapper {
  background: var(--white);
  border-radius: var(--r-lg);
  border: 1px solid var(--blush-border);
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  padding: 14px 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--plum-light);
  background: var(--gray-50);
  border-bottom: 1px solid var(--blush-border);
}

.admin-table td {
  padding: 14px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-100);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: var(--rosa-10);
}

.admin-table .actions {
  display: flex;
  gap: 8px;
}

.admin-table .actions button {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  transition: all var(--ease-fast);
}

.admin-table .actions .edit-btn {
  background: var(--lila-10);
  color: var(--lila);
}

.admin-table .actions .edit-btn:hover {
  background: var(--lila);
  color: var(--white);
}

.admin-table .actions .delete-btn {
  background: var(--error-bg);
  color: var(--error);
}

.admin-table .actions .delete-btn:hover {
  background: var(--error);
  color: var(--white);
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--blush-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-tab {
  padding: 12px 20px;
  font-weight: 600;
  font-size: 14px;
  color: var(--plum-light);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--ease-fast);
}

.admin-tab:hover {
  color: var(--rosa);
}

.admin-tab.active {
  color: var(--rosa);
  border-bottom-color: var(--rosa);
}

/* ---- 22. EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--plum-muted);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.empty-state h3 {
  color: var(--plum-light);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  max-width: 360px;
  margin: 0 auto 20px;
}

/* ---- 23. VIEW TRANSITIONS ---- */
.view-entering {
  animation: fadeIn 0.25s ease both;
}

/* ---- 23.5 NEW LIBRARY COMPONENTS ---- */
/* ---- NEW: Eyebrow Section Label ---- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 38px 0 16px;
  font-family: 'Anton', sans-serif;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--rosa);
}
.eyebrow::before {
  content: "✦";
  color: var(--dorado);
  font-size: 16px;
}

/* ---- NEW: Quick Access Chips ---- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.chip {
  background: var(--white);
  border: 1px solid var(--blush-border);
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--ease-fast), box-shadow var(--ease), border-color var(--ease);
  color: var(--plum);
  cursor: pointer;
  text-decoration: none;
  border: none;
  font-family: inherit;
}
.chip:hover {
  transform: translateY(-3px);
  border-color: var(--rosa-20);
  box-shadow: var(--shadow-md);
}
.chip .e {
  font-size: 18px;
}

/* ---- NEW: Start Cards ---- */
.start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.start-card {
  background: linear-gradient(150deg, var(--white), var(--blush));
  border: 1px solid var(--blush-border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--ease-fast), box-shadow var(--ease);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  color: var(--plum);
  display: block;
}
.start-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  color: var(--plum);
}
.start-card .n {
  font-family: 'Anton', sans-serif;
  color: var(--rosa);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.start-card h3 {
  margin: 8px 0 6px;
  font-size: 17px;
}
.start-card p {
  margin: 0;
  color: var(--plum-light);
  font-size: 14px;
  line-height: 1.5;
}

/* ---- NEW: Section View Head ---- */
.view-head {
  margin-bottom: 6px;
}
.view-head h2 {
  font-family: 'Anton', sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(24px, 4vw, 36px);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.1;
}
.view-head p {
  color: var(--plum-light);
  margin: 0 0 4px;
  max-width: 640px;
  font-size: 15px;
  line-height: 1.6;
}

/* ---- NEW: Prompt AI Badge ---- */
/* Vive en la columna izquierda de .two (y en los pop-ups del Kit), así que
   no cuelga de .prompt-card ni se empuja con margin-left:auto. */
.ai-badge {
  align-self: flex-start;
  background: var(--blush);
  border: 1px solid var(--blush-border);
  color: var(--rosa);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.ai-badge.rec {
  background: var(--white);
  color: var(--plum-muted);
  font-weight: 500;
}

/* ---- NEW: Prompt Note ---- */
.pnote {
  margin: 0;
  font-size: 13px;
  color: var(--plum-light);
  line-height: 1.5;
  background: var(--blush);
  border: 1px solid var(--blush-border);
  border-radius: var(--r-sm);
  padding: 11px 13px;
}

/* ---- NEW: Prompt Group Headers ---- */
.grp-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin: 28px 0 14px;
}
.grp-name {
  font-family: 'Anton', sans-serif;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--rosa);
}
.grp-name::before {
  content: "✦ ";
  color: var(--dorado);
}
.grp-sub {
  color: var(--plum-light);
  font-size: 14px;
}

/* ---- NEW: Setup Panel (Trabajar por proyectos) ---- */
/* Es la puerta de entrada de Prompts —entrenar la IA una vez y que todos los
   prompts salgan con tu voz—, así que pesa como tal: borde de dos puntos,
   sombra propia y la cabecera entera pulsable. */
.setup-panel {
  background: linear-gradient(150deg, var(--white), var(--blush));
  border: 2px solid var(--blush-border);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 26px;
  transition: border-color var(--ease-fast), box-shadow var(--ease), transform var(--ease-fast);
}

.setup-panel:hover,
.setup-panel:focus-within,
.setup-panel.open {
  border-color: var(--rosa);
  box-shadow: 0 10px 28px var(--rosa-glow);
}

.setup-panel:hover { transform: translateY(-1px); }

/* La cabecera ES el botón: se abre pulsando en cualquier parte, no solo en
   la pastilla de la derecha. */
.setup-head {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  text-align: left;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}

.setup-txt {
  display: block;
  flex: 1;
  min-width: 0;
}

.setup-ic {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}

.setup-head b {
  display: block;
  font-family: 'Anton', sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  font-size: 20px;
  letter-spacing: 0.02em;
  margin-bottom: 3px;
}

.setup-head small {
  display: block;
  color: var(--plum-light);
  font-size: 14px;
  line-height: 1.5;
}

/* La pastilla: con el número de pasos y el caret, que es lo que avisa de que
   esto se despliega. */
.setup-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: var(--rosa);
  color: var(--white);
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  box-shadow: var(--shadow-cta);
  transition: all var(--ease-fast);
}

.setup-head:hover .setup-cta { background: var(--rosa-hover); }

.setup-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.25);
  font-size: 11px;
  font-weight: 700;
}

.setup-cta .caret {
  font-size: 11px;
  transition: transform var(--ease-fast);
}

.setup-panel.open .setup-cta .caret { transform: rotate(180deg); }

/* Móvil: el botón baja a su propio renglón y ocupa todo el ancho —al lado del
   título quedaba apretado contra el borde y no se veía como acción. */
@media (max-width: 640px) {
  .setup-panel {
    padding: 20px;
  }

  .setup-cta {
    flex-basis: 100%;
    justify-content: center;
    margin-top: 4px;
    padding: 12px 18px;
    font-size: 14px;
  }

  /* Con la bajada en tres renglones, el emoji centrado quedaba suelto a media
     altura: se alinea con el título, que es a quien nombra. */
  .setup-head { align-items: flex-start; }
  .setup-ic { margin-top: 2px; }

  .setup-head b { font-size: 19px; }
}
.setup-steps {
  list-style: none;
  counter-reset: s;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.setup-steps li {
  counter-increment: s;
  display: flex;
  gap: 13px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.5;
  color: var(--plum);
}
.setup-steps li::before {
  content: counter(s);
  flex-shrink: 0;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--rosa);
  color: var(--white);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- NEW: Step Number Badge ---- */
.stepnum {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--rosa);
  color: var(--white);
  font-family: 'Anton', sans-serif;
  font-weight: 400;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

/* ---- NEW: Flash Highlight (deep-link) ---- */
.flash {
  animation: flashHighlight 1.5s ease;
}
/* El anillo arranca y termina transparente, no en shadow-sm: las filas de
   dos zonas y la lista liviana no tienen sombra propia, y si el keyframe la
   imponía aparecía una tarjeta fantasma al llegar por deep-link. */
@keyframes flashHighlight {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 45, 155, 0); }
  25%, 55% { box-shadow: 0 0 0 3px rgba(255, 45, 155, 1); }
}

/* ---- NEW: Accordion (CapCut) ---- */
.acc {
  margin-top: auto;
  border-top: 1px solid var(--blush-border);
  padding-top: 12px;
}
.acc-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  color: var(--rosa);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.acc-toggle .caret {
  font-size: 12px;
  transition: transform var(--ease-fast);
}
.acc-toggle[aria-expanded="true"] .caret {
  transform: rotate(90deg);
}
.acc-body {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--plum-light);
  background: var(--blush);
  border-radius: var(--r-sm);
  padding: 12px 14px;
}
.acc-body b {
  color: var(--plum);
}
.acc-body a {
  color: var(--rosa);
  font-weight: 600;
  text-decoration: underline;
}

/* ---- NEW: Card Cross-link ---- */
.cardlink {
  align-self: flex-start;
  margin-top: 4px;
  background: none;
  border: none;
  padding: 0;
  color: var(--rosa);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.cardlink:hover {
  text-decoration: underline;
}

/* ---- NEW: Narrative Example ---- */
.narr-lead {
  color: var(--plum-light);
  max-width: 660px;
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.55;
}
.narr-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.narr-step {
  background: var(--white);
  border: 1px solid var(--blush-border);
  border-radius: 16px;
  padding: 15px 17px;
  box-shadow: var(--shadow-sm);
}
.narr-step b {
  display: block;
  font-size: 14px;
  color: var(--rosa);
  margin-bottom: 4px;
}
.narr-step span {
  font-size: 13px;
  color: var(--plum-light);
  line-height: 1.45;
}
.narr-compare {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.narr-compare figure {
  margin: 0;
  width: 100%;
  text-align: center;
}
.narr-compare img {
  border-radius: 16px;
  border: 1px solid var(--blush-border);
  box-shadow: var(--shadow-sm);
  max-width: 100%;
}
.narr-compare .boceto img {
  max-height: 360px;
  width: auto;
}
.narr-compare .gpt img {
  width: 100%;
}
.narr-compare figcaption {
  margin-top: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--plum);
}
.narr-arrow {
  font-family: 'Anton', sans-serif;
  color: var(--rosa);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ---- NEW: Resource Grid (updated) ---- */
.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.res {
  background: var(--white);
  border: 1px solid var(--blush-border);
  border-radius: var(--r-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--ease-fast), box-shadow var(--ease);
}
.res:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.res-top {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}
.res .re {
  font-size: 24px;
  line-height: 1.2;
}
.res b {
  display: block;
  font-size: 15px;
}
.res small {
  color: var(--plum-light);
  font-size: 13px;
}
.plat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--plum-muted);
  margin-top: auto;
}
.plats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.plat {
  font-size: 12px;
  font-weight: 600;
  color: var(--rosa);
  background: var(--blush);
  border: 1px solid var(--blush-border);
  border-radius: var(--r-pill);
  padding: 5px 13px;
  transition: all var(--ease-fast);
  text-decoration: none;
}
.plat:hover {
  background: var(--rosa);
  color: var(--white);
  transform: translateY(-1px);
}

/* ---- NEW: Wallpapers with Description ---- */
.wall2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin-top: 8px;
}
.wall2 {
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.wall2-img {
  aspect-ratio: 9/16;
  border-radius: var(--r-lg);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--white);
  font-family: 'Anton', sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  font-size: 18px;
  line-height: 1.3;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.wall2-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wall2-img .dl2 {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,.93);
  color: var(--plum);
  border: none;
  border-radius: var(--r-pill);
  padding: 8px 20px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--ease-fast);
  font-family: inherit;
  text-decoration: none;
  z-index: 2;
}
.wall2-img .dl2:hover {
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.wall2-desc {
  margin: 0;
  color: var(--plum-light);
  font-size: 14px;
  line-height: 1.55;
}

/* ---- NEW: Section Note ---- */
.section-note {
  background: var(--blush);
  border: 1px dashed var(--rosa);
  border-radius: 16px;
  padding: 14px 18px;
  margin-top: 18px;
  color: var(--plum);
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.55;
}

/* ---- NEW: Footer Signature ---- */
.firma-foot {
  margin-top: 52px;
  padding: 26px 0 6px;
  border-top: 1px solid var(--blush-border);
  text-align: center;
  font-family: 'Anton', sans-serif;
  font-weight: 400;
  font-size: 15px;
  color: var(--rosa);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.firma-foot span {
  color: var(--dorado);
}

/* ---- NEW: Content Card (generic sections) ---- */
.content-card {
  background: var(--white);
  border: 1px solid var(--blush-border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--ease-fast), box-shadow var(--ease);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.content-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.content-card .ce {
  font-size: 24px;
}
.content-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}
.content-card p {
  margin: 0;
  color: var(--plum-light);
  font-size: 14px;
  line-height: 1.55;
}
.content-card .tag {
  align-self: flex-start;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--lila);
  background: var(--lila-10);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}

/* ---- NEW: Featured Prompt ---- */
.prompt-card.featured {
  border: 2px solid var(--rosa);
  box-shadow: var(--shadow-md);
}

/* ---- NEW: Prompt Visible Text ---- */
.prompt-visible {
  margin: 0;
  background: var(--plum);
  color: #FFE6F3;
  border-radius: 14px;
  padding: 16px 18px;
  font-family: 'Poppins', monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(74, 26, 76, 0.5);
  position: relative;
}

/* ---- NEW: Prompt Copy Button (alternative) ---- */
.copy-prompt-btn {
  align-self: flex-start;
  background: var(--rosa);
  color: var(--white);
  border: none;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--ease-fast);
  font-family: inherit;
}
.copy-prompt-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.copy-prompt-btn.done {
  background: var(--lila);
}

/* ---- 24. RESPONSIVE ---- */
@media (max-width: 1024px) {
  .main-content {
    margin-left: 0;
  }

  .topbar { display: flex; }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-close { display: flex; }
}

@media (max-width: 640px) {
  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }

  .category-card { padding: 16px 12px; }
  .category-card .cat-icon { font-size: 26px; }

  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .resource-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .article-card {
    padding: 16px;
  }

  .prompt-card {
    padding: 16px;
  }

  .prompt-block {
    padding: 14px;
    font-size: 12px;
  }

  .modal-dialog {
    padding: 20px;
    border-radius: var(--r-lg);
  }

  .admin-table-wrapper {
    overflow-x: auto;
  }

  .admin-table {
    min-width: 500px;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }

  .chips { gap: 8px; }
  .chip { padding: 10px 14px; font-size: 13px; }
  .start-grid { grid-template-columns: 1fr; }
  .res-grid { grid-template-columns: 1fr; }
  .narr-steps { grid-template-columns: 1fr; }
  .wall2-grid { grid-template-columns: 1fr; }
  /* El acomodo móvil de .setup-head vive con el resto del panel (§ Setup):
     emoji y título en un renglón, y el botón entero abajo. */
}

/* ---- 25. ACCESSIBILITY ---- */
*:focus-visible {
  outline: 3px solid var(--lila);
  outline-offset: 3px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--lila);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- 26. KEYFRAMES ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ============================================================
   27. BIBLIOTECA — AJUSTES DEL PORT DEL MOCKUP
   ============================================================ */

/* El atributo hidden debe ganarle a display:flex/grid (acordeones y pasos) */
[hidden] { display: none !important; }

/* ---- Marca del sidebar ---- */
.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sidebar-brand .sidebar-logo {
  font-size: 19px;
  line-height: 1.1;
}

.sidebar-sub {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--plum-muted);
}

/* ---- Grilla de tarjetas (Kit, Narrativa, Mentalidad) ----
   align-items:stretch es a propósito: las tarjetas de una misma fila miden
   todas lo mismo y la grilla se lee como una grilla. Con start cada una
   medía lo que su texto y los bordes de abajo quedaban dentados. */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  margin-top: 8px;
  align-items: stretch;
}

.cards + .grp-head { margin-top: 34px; }

/* ---- Pop-ups del Kit de marca ---- */
.modal-sub {
  color: var(--plum-light);
  font-size: 14px;
  margin: -8px 0 16px;
}

.modal-body .ai-badge {
  display: inline-block;
  background: var(--blush);
  border: 1px solid var(--blush-border);
  color: var(--rosa);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: var(--r-pill);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.modal-body .prompt-visible {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--plum);
  background: var(--blush);
  border: 1px solid var(--blush-border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin: 0;
}

.modal-body .copy-prompt-btn { margin-top: 14px; }

.modal-body .plats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---- Wallpapers ---- */
/* Se muestran a tamaño de teléfono, no ocupando toda la pantalla */
.wall2-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 300px));
  justify-content: start;
}

.wall2-img {
  overflow: hidden;
}

.wall2-img > span,
.wall2-img .dl2 {
  position: relative;
  z-index: 1;
}

.wall2-img .dl2 {
  position: absolute;
}

.wall2-img a.dl2 { text-decoration: none; }

/* Con foto real la tarjeta no necesita el degradado ni el nombre encima:
   la imagen ya trae su frase. El nombre baja a su propia línea. */
.wall2-img.has-img {
  background: var(--blush) !important;
}

.wall2-name {
  margin: 0;
  font-family: 'Anton', sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  font-size: 16px;
  letter-spacing: 0.3px;
  color: var(--plum);
}

/* ---- Ejemplo real: el wallpaper puesto en la pantalla de bloqueo ----
   No lleva botón de descarga: no es un wallpaper, es la prueba de cómo
   queda puesto. Por eso va fuera de la grilla y más chico. */
.wall2-example {
  margin: 26px 0 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.wall2-example img {
  display: block;
  width: 160px;
  flex-shrink: 0;
  border-radius: var(--r-md);
  border: 1px solid var(--blush-border);
  box-shadow: var(--shadow-sm);
}

.wall2-example figcaption {
  color: var(--plum-light);
  font-size: 14px;
  line-height: 1.55;
  max-width: 260px;
}

@media (max-width: 640px) {
  .wall2-example { gap: 14px; }
  .wall2-example img { width: 118px; }
}

/* ---- Móvil: el botón ☰ se oculta con el menú abierto ---- */
@media (max-width: 1024px) {
  .sidebar.open ~ .main-content .menu-btn {
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 640px) {
  .cards {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* ============================================================
   28. ESCRITORIO — LECTURA
   Solo de 1025px para arriba: en móvil la biblioteca queda igual.
   En pantallas grandes las tarjetas se leían como un muro: el
   contenedor angosto corría todo hacia un lado, los renglones se
   partían cada pocas palabras y el "Cómo acceder" se iba al fondo
   de una tarjeta estirada, dejando un hueco muerto en el medio.
   ============================================================ */
@media (min-width: 1025px) {
  /* Texto de lectura un punto más grande y más aireado */
  .content-card p {
    font-size: 15px;
    line-height: 1.62;
  }

  /* Los pasos del panel no siguen el ancho del contenedor.
     La nota de sección sí: va a todo el ancho, como cierre de la sección. */
  .setup-steps li {
    max-width: 760px;
  }

  .setup-head small {
    max-width: 640px;
  }
}

/* ============================================================
   29. LAYOUTS POR SECCIÓN (doc §11)
   El contenido no cambia; cambia el acomodo según qué es cada
   cosa. Tres formas, no una:

   · DOS ZONAS (Prompts, CapCut, Recursos) — hay un payload que
     copiar, desplegar o abrir. Izquierda qué es, derecha qué
     haces con eso.
   · LISTA LIVIANA (Narrativa, Mentalidad) — son principios que
     se leen de corrido; una tarjeta por idea los pone a
     competir entre sí.
   · TARJETAS (Kit, Wallpapers) — objetos sueltos que sí se
     miran de a uno.

   De 760px para abajo las tres recuperan la piel de tarjeta:
   el móvil queda exactamente como estaba.
   ============================================================ */

/* El doc pide el contenido centrado a ~1180px; solo la biblioteca,
   no el admin ni el login, que tienen su propio ancho. */
.app-content > .container {
  max-width: 1180px;
}

/* ---- Dos zonas ---- */
.two-list {
  margin-top: 12px;
}

.two {
  display: grid;
  grid-template-columns: 38% 1fr;
  gap: 38px;
  align-items: start;
  padding: 26px 0;
  border-bottom: 1px solid var(--blush-border);
  border-radius: 14px;   /* para que el anillo del deep-link no salga cuadrado */
}

.two-l,
.two-r {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;          /* sin esto, un prompt largo estira la columna */
}

.two-r { gap: 13px; }

/* Emoji y título en la misma línea: el emoji nombra al título, no es un icono suelto */
.two-head {
  line-height: 1.3;
}

.two-head .pe {
  font-size: 21px;
}

.two-head h3 {
  display: inline;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--plum);
}

.two .desc {
  margin: 0;
  color: var(--plum-light);
  font-size: 15px;
  line-height: 1.6;
}

.two .tag {
  align-self: flex-start;
  margin: 0;
}

/* El acordeón ya está en su propia columna: no necesita la línea que lo separaba
   del texto cuando vivía al pie de una tarjeta. */
.two .acc {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

/* La nota cruza las dos columnas: comenta la fila entera */
.note-full {
  grid-column: 1 / -1;
  margin-top: 4px;
}

/* ---- CapCut: el acordeón como panel ----
   Suelto en una columna del 62% era un link chiquito flotando en un hueco:
   la fila se veía a medio terminar. Como panel pesa lo mismo que el recuadro
   del prompt en Prompts, que es lo que hace que las dos secciones se sientan
   de la misma familia. */
.two-r > .acc {
  background: var(--white);
  border: 1px solid var(--blush-border);
  border-radius: var(--r-md);
  padding: 15px 18px;
  transition: border-color var(--ease-fast), box-shadow var(--ease);
}

.two-r > .acc:hover {
  border-color: var(--rosa);
  box-shadow: var(--shadow-sm);
}

.two-r > .acc .acc-body {
  background: var(--blush);
  margin-top: 13px;
}

/* ---- Móvil: las dos zonas vuelven a ser una tarjeta ----
   El móvil ya estaba perfecto y no se toca. Mismo marcado nuevo, pero
   con la piel de tarjeta de siempre: emoji en su propia línea, tamaños
   de texto de .content-card y el acordeón otra vez separado por su
   línea. Lo único que cambia arriba de 760px es el acomodo. */
@media (max-width: 760px) {
  .two {
    display: flex;
    flex-direction: column;
    /* sin esto, el align-items:start de escritorio encoge las columnas
       al ancho de su texto y el acordeón queda con media línea */
    align-items: stretch;
    gap: 8px;
    padding: 22px;
    margin-bottom: 14px;
    background: var(--white);
    border: 1px solid var(--blush-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
  }

  .two-list { display: block; }

  /* El emoji vuelve arriba del título, suelto */
  .two-head .pe,
  .two-head h3 {
    display: block;
  }

  .two-head .pe {
    margin-bottom: 8px;
    font-size: 24px;
  }

  .two-head h3 {
    font-size: 17px;
    margin: 0;
  }

  .two .desc {
    font-size: 14px;
    line-height: 1.55;
  }

  .two-l,
  .two-r {
    gap: 8px;
  }

  /* Adentro de la tarjeta el acordeón no es un panel aparte: vuelve a ser
     la línea al pie que ya tenía. */
  .two-r > .acc {
    margin-top: 6px;
    padding: 12px 0 0;
    background: none;
    border: none;
    border-top: 1px solid var(--blush-border);
    border-radius: 0;
  }

  .two-r > .acc:hover {
    box-shadow: none;
  }
}

/* ============================================================
   30. LECTURA CÓMODA
   La biblioteca es un manual de consulta: se lee en el teléfono,
   con una mano y a veces de noche. Este bloque va al final a
   propósito —pisa los tamaños de más arriba— y toca solo el
   texto de lectura: los títulos, los chips y los botones quedan
   como estaban.
   ============================================================ */

/* ---- 30.1 Escala de lectura ----
   La alumna elige su tamaño en el pie del menú y el navegador se lo
   recuerda. Todo lo que se lee de corrido se multiplica por esta escala. */
:root { --read-scale: 1; }
html[data-text-size="lg"] { --read-scale: 1.12; }
html[data-text-size="xl"] { --read-scale: 1.26; }

.view-head p        { font-size: calc(15px * var(--read-scale)); }
.two .desc          { font-size: calc(16px * var(--read-scale)); }
.content-card p     { font-size: calc(15px * var(--read-scale)); line-height: 1.62; }
.acc-body           { font-size: calc(14.5px * var(--read-scale)); line-height: 1.6; }
.setup-steps li     { font-size: calc(14.5px * var(--read-scale)); }
.section-note       { font-size: calc(14.5px * var(--read-scale)); }
.pnote              { font-size: calc(13.5px * var(--read-scale)); }
.narr-lead          { font-size: calc(15px * var(--read-scale)); }
.wall2-desc         { font-size: calc(14.5px * var(--read-scale)); }
.prompt-visible,
.modal-body .prompt-visible { font-size: calc(13.5px * var(--read-scale)); }

/* En móvil la bajada de las filas a dos zonas es un punto más chica que en
   escritorio, como ya estaba; solo se mueve con la escala. */
@media (max-width: 760px) {
  .two .desc { font-size: calc(15px * var(--read-scale)); }
}

/* ---- 30.2 Control de tamaño (pie del menú) ---- */
.textsize {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.textsize-lbl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--plum-muted);
  margin-right: auto;
}

.ts-btn {
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--blush-border);
  background: var(--white);
  color: var(--plum-light);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  transition: all var(--ease-fast);
}

.ts-btn:nth-of-type(2) { font-size: 13px; }
.ts-btn:nth-of-type(3) { font-size: 14px; }

.ts-btn:hover { border-color: var(--rosa); color: var(--rosa); }

.ts-btn[aria-pressed="true"] {
  background: var(--rosa);
  border-color: var(--rosa);
  color: var(--white);
}

/* ---- 30.3 Barra superior con buscador ----
   En móvil ya existía con el menú; ahora también está en escritorio, donde
   solo lleva el buscador (el ☰ no hace falta: el menú está siempre a la
   vista). El Panel Admin no la usa. */
@media (min-width: 1025px) {
  body:not(.admin-page) .topbar { display: flex; }

  body:not(.admin-page) .topbar .menu-btn,
  body:not(.admin-page) .topbar .topbar-logo { display: none; }
}

.topbar { min-height: 60px; }

/* Con el buscador abierto el logo cede el sitio: en un teléfono angosto no
   entran los dos y buscar es lo que se viene a hacer. */
.topbar:has(.topsearch:not([hidden])) .topbar-logo { display: none; }

.topsearch {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: 560px;
}

.topsearch-input {
  width: 100%;
  padding: 9px 44px 9px 38px;
  border: 2px solid var(--blush-border);
  border-radius: var(--r-pill);
  background: var(--white);
  font-size: 14px;
  color: var(--plum);
  outline: none;
  transition: all var(--ease);
}

.topsearch-input::placeholder { color: var(--plum-muted); }

.topsearch-input:focus {
  border-color: var(--rosa);
  box-shadow: 0 0 0 4px var(--rosa-10);
}

.topsearch-ic {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}

/* La pista del atajo solo tiene sentido donde hay teclado */
.topsearch-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  padding: 1px 7px;
  border: 1px solid var(--blush-border);
  border-radius: 6px;
  background: var(--blush);
  color: var(--plum-muted);
  font-family: inherit;
  font-size: 11px;
  pointer-events: none;
}

@media (min-width: 1025px) {
  .topsearch-kbd { display: block; }
}

.topsearch-input:focus ~ .topsearch-kbd { opacity: 0; }

.topsearch-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 2;
  max-height: 60vh;
  overflow-y: auto;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--blush-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}

.topsearch-panel .chips {
  justify-content: flex-start;
  margin: 0;
}

/* ---- 30.4 Resultados del buscador ---- */
.search-hits {
  justify-content: center;
  margin-top: 22px;
}

.search-hits .chip small {
  margin-left: 4px;
  color: var(--plum-light);
}

.search-empty {
  margin-top: 20px;
  color: var(--plum-light);
}

.topsearch-panel .search-empty { margin: 4px 2px; font-size: 14px; }

/* ---- 30.5 Prompts recortados ----
   Se muestran unas diez líneas y el resto se despliega a pedido, así el
   botón de copiar queda siempre cerca. */
.prompt-box { position: relative; }

.prompt-box.clamped .prompt-visible {
  max-height: calc(17em * var(--read-scale));
  overflow: hidden;
}

.prompt-box.clamped .prompt-visible::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70px;
  background: linear-gradient(to bottom, rgba(61, 10, 38, 0), var(--plum));
  border-radius: 0 0 14px 14px;
  pointer-events: none;
}

.prompt-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 13px;
}

.prompt-more {
  color: var(--rosa);
  font-weight: 600;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prompt-more:hover { color: var(--rosa-hover); }

/* ---- 30.6 Índice de grupos (Prompts) ----
   Es la sección más larga: sin índice se recorría a ciegas. */
.grp-nav {
  position: sticky;
  top: var(--topbar-h);   /* justo debajo de la barra, no tapada por ella */
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 6px;
  padding: 10px 0;
  background: var(--blush);
}

/* En el teléfono, en dos renglones se comía media pantalla al quedarse
   pegada: una sola fila que se desliza con el dedo. */
@media (max-width: 640px) {
  .grp-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .grp-nav::-webkit-scrollbar { display: none; }

  .grp-nav-item { flex-shrink: 0; }
}

.grp-nav-item {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--blush-border);
  background: var(--white);
  color: var(--plum-light);
  font-size: 12.5px;
  font-weight: 600;
  transition: all var(--ease-fast);
}

.grp-nav-item:hover {
  border-color: var(--rosa);
  color: var(--rosa);
  transform: translateY(-1px);
}

/* ---- 30.7 Que el salto no quede debajo de la barra ---- */
.two,
.content-card,
.wall2,
.grp-head {
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}

/* ---- 30.8 Volver arriba ---- */
.to-top {
  position: fixed;
  right: clamp(16px, 3vw, 28px);
  bottom: clamp(16px, 3vw, 28px);
  z-index: calc(var(--z-sidebar) - 3);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--blush-border);
  color: var(--rosa);
  font-size: 18px;
  line-height: 1;
  box-shadow: var(--shadow-md);
  transition: all var(--ease-fast);
  animation: fadeIn 0.2s ease both;
}

.to-top:hover {
  background: var(--rosa);
  border-color: var(--rosa);
  color: var(--white);
  transform: translateY(-2px);
}

/* ============================================================
   31. PANEL ADMIN — USUARIAS
   El ABM de quién entra: buscador, estado, y las acciones de
   cada fila. Los estilos de tabla ya existían; esto es lo que
   suma la pantalla de usuarias.
   ============================================================ */
.admin-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-intro {
  color: var(--plum-light);
  max-width: 62ch;
  margin-bottom: 22px;
}

/* Aviso de los accesos con formato antiguo: pide una acción, no es decorativo */
.admin-warn {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding: 16px 18px;
  background: var(--dorado-15);
  border: 1px solid var(--dorado);
  border-radius: var(--r-md);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--plum);
}

.admin-warn > div { flex: 1; min-width: 260px; }

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.admin-toolbar .form-input { flex: 1; min-width: 220px; }
.admin-toolbar .form-select { width: auto; }

.admin-count {
  color: var(--plum-light);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.admin-sub {
  color: var(--plum-light);
  font-size: 12.5px;
}

.admin-note {
  margin-top: 4px;
  color: var(--plum-muted);
  font-size: 12px;
  font-style: italic;
}

.admin-empty {
  padding: 28px 0;
  text-align: center;
  color: var(--plum-light);
}

.badge-ok {
  background: var(--success-bg);
  color: #1F6B45;
}

.badge-off {
  background: var(--gray-100);
  color: var(--plum-light);
}

/* Pausar / reactivar: misma familia que Editar y Eliminar */
.toggle-btn {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--blush-border);
  background: var(--white);
  color: var(--plum-light);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--ease-fast);
}

.toggle-btn:hover {
  border-color: var(--lila);
  color: var(--lila);
  background: var(--lila-10);
}

/* Casilla del formulario (puede entrar / no puede) */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--plum);
  cursor: pointer;
}

.form-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--rosa);
  cursor: pointer;
}

.form-optional {
  color: var(--plum-light);
  font-weight: 400;
}
