/* Biblioteca del Predicador — Área de Miembros (CSS) */

:root {
  /* ── acento: dourado mantido do original ── */
  --gold: #d4a437;
  --gold-light: #f0c96a;
  --gold-deep: #a97c1f;
  --gold-grad: linear-gradient(135deg, #f0c96a 0%, #d4a437 50%, #a97c1f 100%);
  --gold-rgb: 212,164,55;

  /* ── neutros: eixo marrom-tinta ── */
  --bg: #14100c;
  --bg-deep: #0e0b08;
  --bg-sidebar: #0b0805;
  --bg-card: #1e1813;
  --bg-card2: #251d16;
  --bg-card3: #2a2119;
  --border: #332920;
  --on-gold: #1a1206;

  /* ── texto ── */
  --text: #f5f1e8;
  --muted: #b8ae9c;
  --faint: #8d8273;

  /* ── semanticos ── */
  --green: #4a9d6e;
  --red: #d2664c;

  /* ── tipografia ── */
  --font-display: 'Lora', Georgia, serif;
  --font-body: 'Inter', sans-serif;
  --font-num: 'Montserrat', sans-serif;

  --sidebar-w: 236px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); line-height: 1.6; overflow-x: hidden; }
body[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
svg { display: block; }

/* ── Logo ── */
.logo-link { display: flex; align-items: center; gap: 12px; }
.logo svg { color: var(--gold); }
.title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.subtitle { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }

/* ── Layout raíz ── */
body.has-sidebar { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: margin-left 0.25s ease;
}
.sidebar.collapsed { margin-left: calc(var(--sidebar-w) * -1); }
.sidebar-logo { padding: 4px 8px 24px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-size: 0.9rem; font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { flex-shrink: 0; opacity: 0.8; }
.nav-item:hover { background: var(--bg-card); color: var(--text); }
.nav-item.active { background: rgba(212,164,55,0.12); color: var(--gold-light); }
.nav-item.active svg { opacity: 1; }
.nav-item[hidden] { display: none !important; }
.nav-count {
  min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--faint); font: 800 0.66rem var(--font-num);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.nav-count.has-items { color: var(--on-gold); border-color: var(--gold); background: var(--gold-light); }

/* ── Main area ── */
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 24px;
  background: rgba(20,16,12, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  color: var(--muted); cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.icon-btn:hover { color: var(--gold-light); border-color: var(--gold); }

.search-box {
  flex: 1; max-width: 520px;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 14px;
}
.search-box .icon { color: var(--muted); display: flex; }
.search-box input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-family: inherit; font-size: 0.9rem;
}
.search-box input::placeholder { color: var(--faint); }

.avatar {
  margin-left: auto;
  width: 38px; height: 38px; border-radius: 50%;
  /* circulo escuro com borda dourada: o monograma BP dourado por dentro
     precisa de fundo escuro pra ter contraste (dourado sobre dourado some) */
  background: radial-gradient(circle at 50% 30%, var(--bg-card3), var(--bg-deep));
  border: 1.5px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 26px; height: 26px; display: block; }

/* ── Dashboard main ── */
.dashboard-main { flex: 1; padding: 0 32px 24px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ── Hero ── */
.hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  margin: 24px 0 48px;
  padding: 64px 40px;
  min-height: 320px;
  display: flex;
  align-items: center;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(11,8,5,0.95) 0%, rgba(11,8,5,0.75) 45%, rgba(11,8,5,0.35) 100%);
}
.hero-content { position: relative; z-index: 1; max-width: 620px; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.1;
}
.hero h1 em { font-style: normal; color: var(--gold-light); }
.hero-subtitle { color: var(--muted); font-size: 1rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 18px; }
.hero-desc { color: var(--text); font-size: 1.05rem; max-width: 480px; margin-bottom: 28px; opacity: 0.9; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px;
  background: var(--gold-grad); color: var(--on-gold);
  font-family: var(--font-num); font-weight: 800; font-size: 0.95rem;
  border-radius: 10px; transition: transform 0.15s ease;
}
.btn-primary:hover { transform: translateY(-2px); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  background: rgba(255,255,255,0.05); color: var(--text);
  font-weight: 700; font-size: 0.95rem;
  border: 1px solid rgba(255,255,255,0.2); border-radius: 10px;
  transition: background 0.15s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-ghost .icon svg { width: 18px; height: 18px; }

/* ── Carousel sections ── */
.carousel-section { margin-bottom: 48px; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 20px; gap: 16px;
}
.section-tag {
  display: inline-block;
  background: rgba(212, 164, 55, 0.12);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  border-radius: 8px;
  padding: 3px 12px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 3vw, 26px);
}
.carousel-nav { display: flex; gap: 8px; flex-shrink: 0; }
.carousel-nav .icon-btn { font-size: 1.2rem; }

.carousel-viewport { overflow: hidden; }
.carousel-track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.carousel-track::-webkit-scrollbar { display: none; }

/* Favoritos: aparece bajo demanda desde el menú lateral. */
.favorites-section {
  scroll-margin-top: 92px;
  padding: 24px;
  border: 1px solid rgba(212,164,55,0.28);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 0%, rgba(212,164,55,0.12), transparent 32%),
    linear-gradient(145deg, rgba(37,29,22,0.88), rgba(20,16,12,0.9));
}
.favorites-section[hidden] { display: none; }
.favorites-intro { margin-top: 4px; color: var(--muted); font-size: 0.82rem; }
.favorites-empty {
  min-height: 132px; padding: 24px;
  display: flex; align-items: center; gap: 18px;
  border: 1px dashed rgba(212,164,55,0.35); border-radius: 14px;
  background: rgba(11,8,5,0.35);
}
.favorites-empty[hidden] { display: none; }
.favorites-empty-icon {
  width: 48px; height: 48px; flex: 0 0 48px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(212,164,55,0.5); border-radius: 50%; color: var(--gold-light);
}
.favorites-empty-icon svg { width: 22px; height: 22px; }
.favorites-empty strong { font-family: var(--font-display); font-size: 1.05rem; }
.favorites-empty p { margin-top: 3px; color: var(--muted); font-size: 0.8rem; }
.favorite-entry { position: relative; flex: 0 0 260px; scroll-snap-align: start; }
.favorite-entry > .tool-card { width: 100%; height: 100%; }
.favorite-remove {
  position: absolute; top: 10px; left: 10px; z-index: 5;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--gold); border-radius: 10px;
  background: rgba(20,16,12,0.88); color: var(--gold-light); cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.favorite-remove:hover { transform: scale(1.06); background: var(--bg-card2); }
.favorite-remove svg { width: 17px; height: 17px; fill: currentColor; }
.favorite-entry .tool-icon-badge { display: none; }

/* ── Tool card ── */
.tool-card {
  flex: 0 0 260px;
  scroll-snap-align: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: block;
  transition: transform 0.2s, border-color 0.2s;
}
.tool-card:hover { transform: translateY(-4px); border-color: var(--gold); }

.tool-cover { position: relative; aspect-ratio: 1; overflow: hidden; }
.tool-cover img { width: 100%; height: 100%; object-fit: cover; }
.tool-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(20,16,12,0.65) 100%);
}

.tool-icon-badge {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(20,16,12,0.7); backdrop-filter: blur(4px);
  border: 1px solid rgba(212,164,55,0.4);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-light);
}
/* icone decorativo do canto some nos cards liberados; nos bloqueados ele
   e o cadeado que sinaliza acesso, entao permanece */
.tool-card:not(.locked-card) .tool-icon-badge { display: none; }
.tool-icon-badge svg { width: 17px; height: 17px; }

.tool-badge {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  background: var(--gold-grad);
  color: var(--on-gold);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.tool-body { padding: 16px 18px; }
.tool-title { font-family: var(--font-display); font-size: 1.02rem; font-weight: 700; color: var(--text); margin-bottom: 6px; line-height: 1.3; }
.tool-short { font-size: 0.82rem; color: var(--muted); line-height: 1.45; }

/* Seminario y estados de acceso */
.seminario-head-actions { display: flex; align-items: flex-end; gap: 18px; }
.seminario-progress { width: 190px; }
.seminario-progress-copy { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 0.76rem; color: var(--muted); }
.seminario-progress-copy strong { color: var(--gold-light); font-family: var(--font-num); }
.seminario-progress-bar { height: 5px; background: var(--border); border-radius: 999px; overflow: hidden; }
.seminario-progress-bar span { display: block; width: 0; height: 100%; background: var(--gold-grad); border-radius: inherit; transition: width 0.5s ease; }

.seminar-card { position: relative; }
.seminar-cover {
  isolation: isolate;
  padding: 24px 20px;
  background:
    radial-gradient(circle at 82% 18%, rgba(240,201,106,0.2), transparent 30%),
    repeating-linear-gradient(135deg, transparent 0 18px, rgba(255,255,255,0.018) 18px 19px),
    linear-gradient(155deg, var(--bg-card3) 0%, var(--bg-card) 58%, var(--bg-sidebar) 100%);
}
.seminar-cover > img { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; }
.seminar-cover::before { content: ''; position: absolute; inset: 13px; border: 1px solid rgba(212,164,55,0.42); border-radius: 10px; z-index: 2; pointer-events: none; }
.seminar-cover::after { z-index: 1; background: linear-gradient(180deg, rgba(5,5,6,0.12) 28%, rgba(5,5,6,0.94) 100%); }
.seminar-cover .tool-badge, .seminar-cover .tool-icon-badge { z-index: 3; }
.seminar-kicker { position: absolute; left: 20px; top: 58px; z-index: 3; color: var(--gold-light); font-size: 9px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; text-shadow: 0 1px 8px #000; }
.seminar-number { position: absolute; right: 20px; bottom: 2px; z-index: 2; font-family: var(--font-num); font-size: 6.5rem; line-height: 1; font-weight: 800; color: rgba(240,201,106,0.13); }
.seminar-cover-title { position: absolute; left: 20px; bottom: 24px; z-index: 3; max-width: 165px; font-family: var(--font-display); font-size: 1.7rem; line-height: 0.98; color: var(--text); text-shadow: 0 2px 14px #000; }

.locked-card .tool-cover img { filter: grayscale(0.85) brightness(0.42); }
.locked-card .seminar-cover { filter: saturate(0.55); }
.locked-card .tool-icon-badge { color: var(--text); border-color: rgba(255,255,255,0.2); }
.card-unlock, .card-status { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; color: var(--gold-light); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.card-status { color: var(--green, var(--green)); }
.card-status svg { width: 14px; height: 14px; }
.seminar-card.is-complete { border-color: rgba(61,220,132,0.42); }
.seminar-card.is-complete .tool-icon-badge { color: var(--green, var(--green)); border-color: rgba(61,220,132,0.45); }

.certificate-card[aria-disabled="true"] { cursor: not-allowed; }
.certificate-cover {
  padding: 24px 20px;
  background: linear-gradient(145deg, var(--text) 0%, #e7dcc4 100%);
  color: var(--bg-card);
}
.certificate-cover::before { content: ''; position: absolute; inset: 13px; border: 2px solid #a97c1f; box-shadow: inset 0 0 0 4px var(--text), inset 0 0 0 5px rgba(169,124,31,0.38); }
.certificate-cover::after { background: none; }
.certificate-initials { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border: 1px solid #a97c1f; border-radius: 50%; font-family: var(--font-display); font-size: 1.15rem; color: #7b5713; }
.certificate-cover-title { position: absolute; left: 20px; right: 20px; bottom: 28px; z-index: 1; text-align: center; font-family: var(--font-display); font-size: 1.55rem; line-height: 1.05; }
.certificate-card .tool-icon-badge { background: rgba(255,255,255,0.72); color: #7b5713; border-color: rgba(169,124,31,0.45); }
.certificate-locked .certificate-cover { filter: grayscale(0.8) brightness(0.62); }
.access-refresh-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 9px; padding: 0; background: none; border: 0;
  color: var(--muted); cursor: pointer; font: 700 0.72rem var(--font-body);
  text-decoration: underline; text-decoration-color: rgba(212,164,55,0.5); text-underline-offset: 3px;
}
.access-refresh-btn:hover { color: var(--gold-light); }
.access-refresh-btn:disabled { cursor: progress; opacity: 0.65; }
.access-refresh-btn svg { width: 13px; height: 13px; }
.access-refresh-message { display: block; max-width: 420px; margin-top: 5px; color: var(--red); font-size: 0.72rem; line-height: 1.35; }

/* ── Footer ── */
.dashboard-footer {
  padding: 24px 32px 40px;
  text-align: center;
  color: var(--faint);
  font-size: 12.5px;
  border-top: 1px solid var(--border);
}
.dashboard-footer a {
  color: var(--faint);
  text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  /* no mobile a sidebar é um drawer: FECHADA por padrão (sem flicker,
     é CSS puro), abre com .mobile-open e escurece o fundo */
  .sidebar { position: fixed; z-index: 210; margin-left: calc(var(--sidebar-w) * -1); box-shadow: none; }
  .sidebar.mobile-open { margin-left: 0; box-shadow: 20px 0 40px rgba(0,0,0,0.5); }
  body.menu-open::before { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 205; }
  :root { --sidebar-w: 240px; }
}

@media (max-width: 860px) {
  .dashboard-main { padding: 0 20px 20px; }
  .hero { padding: 40px 24px; min-height: 260px; }
  .tool-card { flex-basis: 220px; }
}

@media (max-width: 560px) {
  .topbar { padding: 12px 16px; gap: 10px; }
  /* a search-box com flex:1 nao encolhe abaixo do conteudo e empurra o
     avatar pra fora da viewport; min-width:0 deixa o flex encolher */
  .search-box { min-width: 0; }
  .search-box input { min-width: 0; }
  .search-box input::placeholder { font-size: 0.82rem; }
  .hero { margin: 16px 0 36px; padding: 32px 20px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .tool-card { flex-basis: 190px; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .seminario-head-actions { width: 100%; align-items: flex-end; justify-content: space-between; }
  .seminario-progress { flex: 1; max-width: 220px; }
  .avatar { width: 34px; height: 34px; font-size: 0.72rem; }
}

/* ============================================================
   Páginas internas: tool.html (formulario + generación) y
   ebook.html (lector de capítulos)
   ============================================================ */

.inner-header {
  display: flex; align-items: center; padding: 16px 24px;
  background: rgba(20,16,12, 0.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
}

.tool-page { max-width: 760px; margin: 0 auto; padding: 40px 24px 60px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }
.back-link:hover { color: var(--gold-light); }
.tool-page-header { margin-bottom: 28px; }
.tool-page-header h1 { font-family: var(--font-display); font-size: clamp(22px,4vw,28px); margin-bottom: 8px; }
.tool-page-header p { color: var(--muted); font-size: 0.95rem; }

.tool-form-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 26px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.form-group label .req { color: var(--gold); }
.field-hint { display: block; margin-top: 5px; font-size: 0.78rem; color: var(--faint); line-height: 1.4; }
.form-group input, .form-group select {
  width: 100%; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-family: inherit; font-size: 1rem;
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--gold); }

.btn-generate {
  width: 100%; padding: 15px 20px; background: var(--gold-grad); color: var(--on-gold);
  font-family: var(--font-num); font-weight: 800; font-size: 0.95rem;
  text-transform: uppercase; letter-spacing: 0.03em; border: none; border-radius: 10px;
  cursor: pointer; transition: transform 0.15s ease;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-generate:hover:not(:disabled) { transform: translateY(-2px); }
.btn-generate:disabled { opacity: 0.85; cursor: progress; }

/* spinner dentro del botón mientras genera */
.btn-spinner {
  width: 16px; height: 16px; flex-shrink: 0;
  border: 2.5px solid rgba(22,16,1,0.25);
  border-top-color: var(--on-gold);
  border-radius: 50%;
  animation: ct-spin 0.7s linear infinite;
}
@keyframes ct-spin { to { transform: rotate(360deg); } }

/* cursor parpadeante al final del texto durante el streaming */
.stream-caret {
  display: inline-block; width: 3px; height: 1em;
  background: var(--gold-light); border-radius: 2px;
  vertical-align: text-bottom; margin-left: 2px;
  animation: ct-blink 0.9s steps(2, start) infinite;
}
@keyframes ct-blink { to { visibility: hidden; } }

.result-box {
  margin-top: 24px; padding: 26px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; font-size: 0.95rem; color: var(--text); line-height: 1.7; display: none;
}
.result-box.active { display: block; }
.result-box h2 { font-family: var(--font-display); color: var(--gold-light); font-size: 1.2rem; margin: 20px 0 10px; }
.result-box h2:first-child { margin-top: 0; }
.result-box h3 { color: var(--text); font-size: 1.02rem; margin: 14px 0 8px; }
.result-box p { margin-bottom: 10px; }
.result-box ul, .result-box ol { margin: 0 0 10px 22px; }
.result-box li { margin-bottom: 4px; }
.result-box blockquote { border-left: 3px solid var(--gold); padding-left: 14px; color: var(--muted); font-style: italic; margin: 12px 0; }
.result-box strong { color: var(--gold-light); }
.tool-print-header { display: none; }
.result-actions {
  display: none; align-items: center; justify-content: space-between; gap: 18px;
  margin-top: 14px; padding: 15px 16px;
  background: linear-gradient(135deg, rgba(212,164,55,0.11), rgba(212,164,55,0.035));
  border: 1px solid rgba(212,164,55,0.34); border-radius: 12px;
}
.result-actions.active { display: flex; }
.result-actions-copy { display: flex; flex-direction: column; gap: 2px; }
.result-actions-copy strong { color: var(--text); font-size: 0.88rem; }
.result-actions-copy span { color: var(--muted); font-size: 0.76rem; line-height: 1.35; }
.btn-save-pdf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-shrink: 0;
  padding: 12px 17px; background: var(--gold-grad); color: var(--on-gold);
  border: 0; border-radius: 9px; cursor: pointer;
  font-family: var(--font-num); font-size: 0.78rem; font-weight: 800;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn-save-pdf:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn-save-pdf svg { width: 17px; height: 17px; }
.result-actions-btns { display: flex; gap: 10px; flex-shrink: 0; }
.btn-copy-all {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-shrink: 0;
  padding: 12px 17px; background: transparent; color: var(--gold-light);
  border: 1px solid rgba(212,164,55,0.55); border-radius: 9px; cursor: pointer;
  font-family: var(--font-num); font-size: 0.78rem; font-weight: 800;
  transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-copy-all:hover { transform: translateY(-1px); border-color: var(--gold); }
.btn-copy-all svg { width: 17px; height: 17px; }
.btn-copy-all.copied { color: var(--green); border-color: var(--green); }

/* ── Ebook reader ── */
.ebook-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; max-width: 1080px; margin: 0 auto; padding: 32px 24px 60px; }
.ebook-sidebar { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 22px; align-self: start; position: sticky; top: 84px; }
.ebook-tag { color: var(--gold-light); font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.ebook-sidebar h1 { font-family: var(--font-display); font-size: 1.3rem; margin: 8px 0 20px; line-height: 1.3; }
.ebook-index { list-style: none; }
.ebook-index-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; font-weight: 700; }
.ebook-index li { margin-bottom: 2px; }
.ebook-index a {
  display: flex; align-items: baseline; gap: 10px;
  padding: 9px 10px; border-radius: 8px; font-size: 0.88rem; color: var(--muted); transition: background 0.15s, color 0.15s;
}
.ebook-index a:hover { background: var(--bg-card2); color: var(--text); }
.ebook-index a.active { background: rgba(212,164,55,0.12); color: var(--gold-light); }
.ebook-index .num { font-family: var(--font-num); font-size: 0.75rem; opacity: 0.7; flex-shrink: 0; }

.ebook-content { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 32px; min-width: 0; }
.ebook-content-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ebook-chapter-label { color: var(--muted); font-size: 0.85rem; }
.ebook-tools { display: flex; align-items: center; gap: 8px; }
.ebook-tools .icon-btn { width: 32px; height: 32px; }
.font-size-display { font-size: 0.8rem; color: var(--muted); min-width: 34px; text-align: center; }

.ebook-body { font-size: var(--reader-fs, 17px); line-height: 1.75; }
.ebook-body h1 { font-family: var(--font-display); color: var(--gold-light); font-size: 1.5em; margin-bottom: 16px; }
.ebook-body h2 { font-family: var(--font-display); color: var(--gold-light); font-size: 1.3em; margin: 20px 0 10px; }
.ebook-body h3 { font-size: 1.05em; margin: 16px 0 8px; }
.ebook-body p { margin-bottom: 12px; }
.ebook-body ul, .ebook-body ol { margin: 0 0 12px 22px; }
.ebook-body li { margin-bottom: 6px; }
.ebook-body blockquote { border-left: 3px solid var(--gold); padding: 4px 0 4px 16px; margin: 16px 0; background: rgba(212,164,55,0.06); border-radius: 0 8px 8px 0; }
.ebook-body blockquote p { margin: 0; color: var(--text); font-style: italic; }
.ebook-body blockquote cite { display: block; margin-top: 6px; color: var(--gold-light); font-style: normal; font-size: 0.85em; }
.ebook-body strong { color: var(--gold-light); }

/* Figuras (mapas, cronologías, infografías del Pack Visual) */
.reader-figure { margin: 22px 0 28px; max-width: 100%; min-width: 0; }
.reader-figure-frame { border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: #f7f1e3; cursor: zoom-in; box-shadow: 0 10px 30px rgba(0,0,0,0.25); max-width: 100%; }
.reader-figure-frame svg { display: block; width: 100%; max-width: 100%; height: auto; }
.ebook-body { min-width: 0; overflow-wrap: anywhere; }
.reader-figure figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.reader-figure-caption { font-size: 0.82em; color: var(--muted); font-style: italic; }
.reader-figure-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.reader-figure-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.78rem; font-weight: 700; color: var(--text); cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.reader-figure-btn:hover { border-color: var(--gold); color: var(--gold-light); }
.reader-figure-btn:disabled { opacity: 0.6; cursor: wait; }
.reader-figure-btn svg { width: 15px; height: 15px; }

/* Vista ampliada */
body.figure-zoom-open { overflow: hidden; }
.figure-zoom { position: fixed; inset: 0; z-index: 1000; background: rgba(10,7,4,0.94); display: flex; flex-direction: column; padding: 14px; }
.figure-zoom-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 4px 6px 12px; }
.figure-zoom-title { font-family: var(--font-display); font-size: 1rem; color: var(--gold-light); }
.figure-zoom-actions { display: flex; gap: 8px; }
.figure-zoom-close { font-size: 1rem; padding: 7px 11px; }
.figure-zoom-stage { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: flex-start; justify-content: center; touch-action: pan-x pan-y pinch-zoom; }
.figure-zoom-stage svg { display: block; width: min(100%, 1400px); height: auto; border-radius: 12px; background: #f7f1e3; }
.figure-zoom-hint { margin: 8px 0 0; text-align: center; font-size: 0.75rem; color: var(--muted); }
@media (max-width: 640px) {
  .figure-zoom { padding: 8px; }
  .figure-zoom-title { font-size: 0.85rem; }
  .figure-zoom-stage svg { width: 100%; }
}

.ebook-footer-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.ebook-nav-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  font-size: 0.88rem; font-weight: 700; color: var(--text); transition: border-color 0.15s;
}
.ebook-nav-btn:hover { border-color: var(--gold); }
.ebook-nav-btn.primary { background: var(--gold-grad); color: var(--on-gold); border: none; }
.ebook-nav-btn.disabled { opacity: 0.35; pointer-events: none; }
.ebook-nav-current { color: var(--muted); font-size: 0.85rem; }
#favorite-btn.active-fav,
#bookmark-btn.active-mark { color: var(--gold-light); border-color: var(--gold); background: rgba(212,164,55,0.12); }
#favorite-btn.active-fav svg,
#bookmark-btn.active-mark svg { fill: currentColor; }
.reader-feedback {
  min-height: 0; margin: -10px 0 14px; color: var(--muted);
  font-size: 0.78rem; text-align: right;
}
.reader-feedback:empty { display: none; }
.reader-feedback a { color: var(--gold-light); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.module-complete-panel {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  margin-top: 24px; padding: 22px;
  background: linear-gradient(135deg, rgba(212,164,55,0.12), rgba(212,164,55,0.035));
  border: 1px solid rgba(212,164,55,0.38); border-radius: 14px;
}
.module-complete-panel.completed { background: linear-gradient(135deg, rgba(61,220,132,0.1), rgba(61,220,132,0.025)); border-color: rgba(61,220,132,0.35); }
.module-complete-icon { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold-light); }
.module-complete-panel.completed .module-complete-icon { color: var(--green); border-color: var(--green); }
.module-complete-eyebrow { display: block; margin-bottom: 3px; color: var(--gold-light); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.module-complete-panel h2 { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.2; }
.module-complete-panel p { margin-top: 4px; color: var(--muted); font-size: 0.82rem; }
.module-complete-panel .ebook-nav-btn { cursor: pointer; text-align: center; justify-content: center; }

@media (max-width: 860px) {
  .ebook-layout { grid-template-columns: 1fr; }
  .ebook-sidebar { position: static; }
}
@media (max-width: 560px) {
  .ebook-layout { padding: 20px 16px 40px; }
  .ebook-content { padding: 22px 18px; }
  .tool-page { padding: 28px 18px 40px; }
  .module-complete-panel { grid-template-columns: auto 1fr; }
  .module-complete-panel .ebook-nav-btn { grid-column: 1 / -1; width: 100%; }
  .result-actions { align-items: stretch; flex-direction: column; }
  .result-actions-btns { flex-direction: column; }
  .btn-save-pdf { width: 100%; min-height: 48px; }
  .btn-copy-all { width: 100%; min-height: 48px; }
}

/* ── Menú de usuario (topbar) ── */
.user-menu { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user-email { font-size: 0.82rem; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 9px;
  color: var(--muted); font-size: 0.82rem; font-weight: 600; padding: 8px 14px; cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.logout-btn:hover { color: var(--gold-light); border-color: var(--gold); }
@media (max-width: 620px) { .user-email { display: none; } }

/* ── Página de login ── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; min-height: 100svh; padding: 24px; }
.login-body::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(212,164,55,0.14), transparent 60%);
}
.login-wrap { width: 100%; max-width: 400px; }
.login-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px; }
.login-logo { justify-content: center; margin-bottom: 24px; }
.login-logo .title { font-size: 1.05rem; }
.login-logo .subtitle { font-size: 0.62rem; }
.login-title { font-family: var(--font-display); font-size: 1.35rem; text-align: center; margin-bottom: 6px; }
.login-sub { color: var(--muted); text-align: center; font-size: 0.88rem; margin-bottom: 24px; }
.login-form .form-group { margin-bottom: 14px; }
.login-body .form-group label { font-size: 0.82rem; margin-bottom: 7px; }
.login-body .btn-generate { padding: 13px 16px; font-size: 0.9rem; border-radius: 8px; }
.login-msg { margin-top: 12px; font-size: 0.85rem; text-align: center; }
.login-msg:empty { display: none; }
.login-msg.error { color: var(--red); }
.login-msg.error a { color: var(--gold-light); font-weight: 700; text-decoration: underline; }
.login-secure { text-align: center; color: var(--faint); font-size: 0.76rem; margin-top: 18px; }
.login-help { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 18px; }
.login-help a { color: var(--gold-light); font-weight: 600; }
.login-help a:hover { text-decoration: underline; }
.login-alert {
  margin-top: 20px; padding: 11px 16px;
  border: 1px solid rgba(210,102,76,0.45); border-radius: 10px;
  background: rgba(210,102,76,0.08);
  text-align: center; color: #e5a08e; font-size: 0.78rem; line-height: 1.6;
  text-wrap: balance;
}
.login-alert a { color: var(--gold-light); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 560px) {
  .login-body { padding: 16px 14px; align-items: flex-start; padding-top: max(28px, env(safe-area-inset-top)); }
  .login-card { padding: 26px 20px; }
}

/* Certificado nominal */
.certificate-loading { visibility: hidden; }
.certificate-body { min-height: 100vh; background: var(--bg); }
.certificate-main { max-width: 1240px; margin: 0 auto; padding: 32px 28px 72px; }
.certificate-back { margin-bottom: 18px; }
.certificate-controls { display: grid; grid-template-columns: minmax(260px, 0.72fr) minmax(440px, 1.28fr); gap: 40px; align-items: end; margin-bottom: 28px; }
.certificate-controls h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.05; margin-bottom: 8px; }
.certificate-controls > div > p { color: var(--muted); font-size: 0.92rem; }
.certificate-form label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.certificate-form-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; gap: 9px; }
.certificate-form input { min-width: 0; padding: 11px 13px; color: var(--text); background: var(--bg-card); border: 1px solid var(--border); border-radius: 9px; font: inherit; }
.certificate-form input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,164,55,0.1); }
.certificate-form .ebook-nav-btn { cursor: pointer; justify-content: center; white-space: nowrap; }
.certificate-form-message { min-height: 1.2em; margin-top: 7px; color: var(--green); font-size: 0.78rem; }

.certificate-shell { padding: 18px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg-deep); box-shadow: 0 32px 90px rgba(0,0,0,0.38); }
.certificate-page { position: relative; aspect-ratio: 297 / 210; overflow: hidden; background: var(--text); color: var(--bg-card2); }
.certificate-page::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 35%, rgba(212,164,55,0.08), transparent 43%), repeating-linear-gradient(45deg, rgba(99,74,20,0.018) 0 1px, transparent 1px 9px); }
.certificate-border { position: absolute; pointer-events: none; }
.certificate-border-outer { inset: 2.2%; border: 2px solid #a97c1f; }
.certificate-border-inner { inset: 3.15%; border: 1px solid rgba(169,124,31,0.5); }
.certificate-corner { position: absolute; width: 9%; aspect-ratio: 1; border-color: #a97c1f; z-index: 2; }
.corner-top-left { top: 4.2%; left: 4.2%; border-top: 5px solid; border-left: 5px solid; }
.corner-top-right { top: 4.2%; right: 4.2%; border-top: 5px solid; border-right: 5px solid; }
.corner-bottom-left { bottom: 4.2%; left: 4.2%; border-bottom: 5px solid; border-left: 5px solid; }
.corner-bottom-right { bottom: 4.2%; right: 4.2%; border-bottom: 5px solid; border-right: 5px solid; }
.certificate-mark { position: absolute; left: 50%; top: 49%; width: 38%; transform: translate(-50%, -50%); color: rgba(169,124,31,0.045); }
.certificate-content { position: absolute; inset: 6.5% 8%; z-index: 3; display: flex; flex-direction: column; align-items: center; text-align: center; }
.certificate-brand { color: #7c5a18; font-family: var(--font-num); font-size: clamp(0.55rem, 1.2vw, 0.9rem); font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.certificate-kicker { margin-top: 2.2%; color: var(--faint); font-size: clamp(0.5rem, 1vw, 0.74rem); font-weight: 700; letter-spacing: 0.17em; text-transform: uppercase; }
.certificate-content h1 { margin-top: 0.4%; font-family: var(--font-display); font-size: clamp(1.8rem, 4.6vw, 3.8rem); line-height: 1; font-weight: 400; color: var(--bg-card); }
.certificate-lead { margin-top: 1%; color: var(--faint); font-family: var(--font-display); font-style: italic; font-size: clamp(0.65rem, 1.2vw, 0.95rem); }
.certificate-student { width: 76%; min-height: 1.2em; margin-top: 0.25%; overflow: hidden; color: #9a6b12; font-family: var(--font-display); font-size: clamp(1.5rem, 4.2vw, 3.5rem); line-height: 1.12; white-space: nowrap; text-overflow: ellipsis; }
.certificate-name-line { width: 72%; height: 1px; margin-top: 0.5%; background: linear-gradient(90deg, transparent, #a97c1f 14%, #a97c1f 86%, transparent); }
.certificate-copy { margin-top: 1.5%; color: var(--border); font-size: clamp(0.52rem, 1.15vw, 0.88rem); }
.certificate-content h2 { margin-top: 0.15%; color: var(--bg-card); font-family: var(--font-num); font-size: clamp(0.9rem, 2.1vw, 1.65rem); font-weight: 800; letter-spacing: 0.035em; }
.certificate-description { margin-top: 0.45%; color: var(--faint); font-size: clamp(0.45rem, 0.95vw, 0.72rem); }
.certificate-footer-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 5%; width: 72%; margin-top: auto; }
.certificate-signature { display: flex; flex-direction: column; align-items: center; color: var(--border); font-family: var(--font-display); font-size: clamp(0.55rem, 1.15vw, 0.9rem); }
.certificate-signature i { width: 100%; height: 1px; margin: 3% 0 2%; background: var(--muted); }
.certificate-signature small { color: var(--faint); font-family: var(--font-body); font-size: clamp(0.35rem, 0.7vw, 0.55rem); text-transform: uppercase; letter-spacing: 0.08em; }
.certificate-seal { display: flex; flex-direction: column; align-items: center; justify-content: center; width: clamp(48px, 8vw, 82px); aspect-ratio: 1; border: 2px solid #a97c1f; outline: 1px solid rgba(169,124,31,0.52); outline-offset: 4px; border-radius: 50%; color: #7c5a18; }
.certificate-seal span { font-family: var(--font-display); font-size: clamp(0.75rem, 1.8vw, 1.4rem); line-height: 1; }
.certificate-seal small { margin-top: 4%; font-size: clamp(0.25rem, 0.55vw, 0.42rem); font-weight: 800; line-height: 1.15; letter-spacing: 0.08em; text-transform: uppercase; }
.certificate-disclaimer { margin-top: 1.6%; color: var(--muted); font-size: clamp(0.34rem, 0.65vw, 0.5rem); letter-spacing: 0.06em; text-transform: uppercase; }

@media (max-width: 900px) {
  .certificate-controls { grid-template-columns: 1fr; gap: 20px; }
  .certificate-form-row { grid-template-columns: 1fr 1fr; }
  .certificate-form input { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .certificate-main { padding: 22px 14px 44px; }
  .certificate-form-row { grid-template-columns: 1fr; }
  .certificate-form input { grid-column: auto; }
  .certificate-shell { padding: 6px; border-radius: 10px; overflow-x: auto; }
  .certificate-page { min-width: 700px; }
}

@page certificate-output { size: A4 landscape; margin: 0; }
@page tool-output { size: A4 portrait; margin: 15mm; }
@media print {
  /* Vista ampliada de una figura: imprime solo la imagen, apaisada. */
  body.figure-zoom-open { background: #fff !important; }
  body.figure-zoom-open > *:not(.figure-zoom) { display: none !important; }
  body.figure-zoom-open .figure-zoom { position: static; background: #fff; padding: 0; display: block; }
  body.figure-zoom-open .figure-zoom-bar, body.figure-zoom-open .figure-zoom-hint { display: none !important; }
  body.figure-zoom-open .figure-zoom-stage { overflow: visible; display: block; }
  body.figure-zoom-open .figure-zoom-stage svg { width: 100%; height: auto; border-radius: 0; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  @page figure-output { size: landscape; margin: 8mm; }
  body.figure-zoom-open .figure-zoom { page: figure-output; }

  body.certificate-body { page: certificate-output; width: 297mm; height: 210mm; background: #fff !important; }
  body.certificate-body .certificate-site-header,
  body.certificate-body .certificate-back,
  body.certificate-body .certificate-controls { display: none !important; }
  body.certificate-body .certificate-main { width: 297mm; height: 210mm; max-width: none; margin: 0; padding: 0; }
  body.certificate-body .certificate-shell { width: 297mm; height: 210mm; padding: 10mm; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
  body.certificate-body .certificate-page { width: 277mm; height: 190mm; min-width: 0; aspect-ratio: auto; background: #fff !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  body.certificate-body .certificate-page::before { background: none; }

  body.tool-body-page { page: tool-output; display: block; background: #fff !important; color: var(--bg-card); font-family: Georgia, 'Times New Roman', serif; }
  body.tool-body-page .inner-header,
  body.tool-body-page .back-link,
  body.tool-body-page .tool-page-header,
  body.tool-body-page #tool-form,
  body.tool-body-page .btn-generate,
  body.tool-body-page .result-actions { display: none !important; }
  body.tool-body-page .tool-page { max-width: none; margin: 0; padding: 0; }
  body.tool-body-page .tool-form-card { padding: 0; background: #fff; border: 0; }
  body.tool-body-page .tool-print-document { page: tool-output; }
  body.tool-body-page .tool-print-header { display: block; margin-bottom: 10mm; padding-bottom: 5mm; border-bottom: 1px solid #a97c1f; }
  body.tool-body-page .tool-print-header span { color: #8b6518; font: 800 9pt var(--font-num); letter-spacing: 0.12em; text-transform: uppercase; }
  body.tool-body-page .tool-print-header h1 { margin: 2mm 0 1mm; color: var(--bg-card); font: 400 24pt 'Lora', Georgia, serif; line-height: 1.1; }
  body.tool-body-page .tool-print-header p { color: var(--muted); font: 9pt var(--font-body); }
  body.tool-body-page .result-box,
  body.tool-body-page .result-box.active { display: block; margin: 0; padding: 0; background: #fff; border: 0; border-radius: 0; color: var(--bg-card); font-size: 11pt; line-height: 1.55; }
  body.tool-body-page .result-box h2 { break-after: avoid; color: var(--bg-card); font: 400 17pt 'Lora', Georgia, serif; margin: 7mm 0 2.5mm; }
  body.tool-body-page .result-box h3 { break-after: avoid; color: var(--bg-card); font-size: 12pt; margin: 5mm 0 2mm; }
  body.tool-body-page .result-box p,
  body.tool-body-page .result-box li { orphans: 3; widows: 3; }
  body.tool-body-page .result-box blockquote { break-inside: avoid; color: var(--faint); background: var(--text); border-left: 2px solid #a97c1f; }
  body.tool-body-page .result-box strong { color: var(--bg-card); }
}

/* ── Marca (logo BP) ── */
.brand-mark { width: 34px; height: auto; display: block; flex: none; }
.sidebar-logo .brand-mark { width: 32px; }

/* ── Panel de control de accesos ── */
.admin-kicker { color: var(--muted); font-size: 0.8rem; font-weight: 400; margin: 2px 0 0; }
.admin-main { padding-top: 24px; }
.admin-help {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; color: var(--muted); font-size: 0.92rem; margin-bottom: 18px;
}
.admin-help strong { color: var(--gold-light); }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.admin-search {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px;
}
.admin-search input { flex: 1; background: none; border: 0; outline: none; color: var(--text); font: inherit; }
.admin-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-chip {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--muted);
  border-radius: 999px; padding: 7px 12px; font-weight: 600; cursor: pointer;
}
.admin-chip.is-on { border-color: var(--gold); color: var(--gold-light); background: rgba(212,164,55,0.12); }
.admin-status, .admin-empty { color: var(--muted); font-size: 0.88rem; margin-bottom: 14px; }
.admin-section-title { font-family: var(--font-display); font-size: 1.05rem; margin: 4px 0 8px; }
.admin-mail { margin-bottom: 22px; }
.admin-mail .admin-list { padding-bottom: 0; }
.admin-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 48px; }
.admin-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px;
}
.admin-card.risk-medium { border-color: #c4923a; }
.admin-card.risk-high, .admin-card.risk-banned { border-color: var(--red); }
.admin-card header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.admin-card h2 { font-size: 1.02rem; line-height: 1.3; word-break: break-all; }
.admin-card header p { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
.admin-meta { color: var(--faint); font-size: 0.8rem; margin-top: 8px; }
.admin-devices { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 0.8rem; }
.admin-devices span { color: var(--faint); }
.admin-action {
  background: var(--bg-card2); border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 8px 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.admin-action.danger { border-color: var(--red); color: #f0b4a6; }
.admin-action:hover { border-color: var(--gold); color: var(--gold-light); }
@media (max-width: 720px) {
  .admin-card header { flex-direction: column; }
  .admin-action { width: 100%; }
}
