/* generador.css — el generador de souvenirs como página estática (reemplaza a src/app.py + src/interface.css de Streamlit).
   Las medidas vienen de medir la pantalla de Streamlit (alturas, paddings, tipografías): el objetivo es que se vea igual. */

/* Tipografías de la marca, locales (antes venían de Google Fonts). Mismos pesos que usaba la interfaz. */
@font-face { font-family: 'Syne'; font-weight: 400; font-style: normal; font-display: swap; src: url('recursos/fonts/Syne/static/Syne-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Syne'; font-weight: 700; font-style: normal; font-display: swap; src: url('recursos/fonts/Syne/static/Syne-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Syne'; font-weight: 800; font-style: normal; font-display: swap; src: url('recursos/fonts/Syne/static/Syne-ExtraBold.ttf') format('truetype'); }
@font-face { font-family: 'Space Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url('recursos/fonts/Space_Mono/SpaceMono-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Space Mono'; font-weight: 700; font-style: normal; font-display: swap; src: url('recursos/fonts/Space_Mono/SpaceMono-Bold.ttf') format('truetype'); }

:root {
  --bm-bg: #080810;
  --bm-card: #0F0F1A;
  --bm-texto: #F0EEFF;
  --bm-apagado: #7A7A9A;
  --bm-claro: #C9C8DE;
  --bm-rosa: #FF2D78;
  --bm-violeta: #B44BFF;
  --bm-cyan: #00F5FF;
  --bm-st-oscuro: #0e1117;           /* fondo de los campos de selección (el azul oscuro de Streamlit) */
  --bm-borde-campo: rgba(255, 255, 255, 0.25);
  --bm-gradiente: linear-gradient(135deg, #FF2D78, #B44BFF);
  --bm-panel: 400px;
  --bm-header: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Space Mono', monospace; font-size: 16px; line-height: 1.6; color: var(--bm-apagado);
  background: var(--bm-bg); overflow: hidden; -webkit-font-smoothing: antialiased;
}
p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: 'Syne', sans-serif; color: var(--bm-texto); font-weight: 800; letter-spacing: -1px; margin: 0; }
h2 { font-size: clamp(22px, 4.5vw, 32px); line-height: 1.2; }
h3 { font-size: clamp(16px, 2.5vw, 20px); line-height: 1.2; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; white-space: nowrap; }

/* ---------- Fondo animado (BG-001, el mismo del generador de siempre) ---------- */
.bm-gooey-wrapper {
  --bm-color-bg1: 8, 8, 16; --bm-color-bg2: 15, 15, 26;
  --bm-color1: 255, 45, 120; --bm-color2: 0, 245, 255; --bm-color3: 180, 75, 255; --bm-color4: 255, 45, 120; --bm-color5: 0, 245, 255;
  --bm-color-interactive: 180, 75, 255; --bm-blending: soft-light; --bm-circle-size: 80%;
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
}
.bm-gradient-bg { position: absolute; inset: 0; background: linear-gradient(40deg, rgb(var(--bm-color-bg1)), rgb(var(--bm-color-bg2))); overflow: hidden; }
.bm-goo-svg-defs { width: 0; height: 0; position: absolute; }
.bm-gradients-container { width: 100%; height: 100%; filter: url('#bm-goo') blur(40px); }
.bm-gradients-container > div { position: absolute; mix-blend-mode: var(--bm-blending); }
.bm-g1 { width: var(--bm-circle-size); height: var(--bm-circle-size); top: calc(50% - var(--bm-circle-size) / 2); left: calc(50% - var(--bm-circle-size) / 2);
  background: radial-gradient(circle at center, rgba(var(--bm-color1), 0.5) 0, rgba(var(--bm-color1), 0) 50%) no-repeat; opacity: 0.35; transform-origin: center center; animation: bmGooeyMoveVertical 30s ease infinite; }
.bm-g2 { width: var(--bm-circle-size); height: var(--bm-circle-size); top: calc(50% - var(--bm-circle-size) / 2); left: calc(50% - var(--bm-circle-size) / 2);
  background: radial-gradient(circle at center, rgba(var(--bm-color2), 0.5) 0, rgba(var(--bm-color2), 0) 50%) no-repeat; opacity: 0.35; transform-origin: calc(50% - 400px); animation: bmGooeyMoveInCircle 20s ease infinite reverse; }
.bm-g3 { width: var(--bm-circle-size); height: var(--bm-circle-size); top: calc(50% - var(--bm-circle-size) / 2 + 200px); left: calc(50% - var(--bm-circle-size) / 2 - 500px);
  background: radial-gradient(circle at center, rgba(var(--bm-color3), 0.5) 0, rgba(var(--bm-color3), 0) 50%) no-repeat; opacity: 0.3; transform-origin: calc(50% + 400px); animation: bmGooeyMoveInCircle 40s linear infinite; }
.bm-g4 { width: var(--bm-circle-size); height: var(--bm-circle-size); top: calc(50% - var(--bm-circle-size) / 2); left: calc(50% - var(--bm-circle-size) / 2);
  background: radial-gradient(circle at center, rgba(var(--bm-color4), 0.5) 0, rgba(var(--bm-color4), 0) 50%) no-repeat; opacity: 0.2; transform-origin: calc(50% - 200px); animation: bmGooeyMoveHorizontal 40s ease infinite; }
.bm-g5 { width: calc(var(--bm-circle-size) * 2); height: calc(var(--bm-circle-size) * 2); top: calc(50% - var(--bm-circle-size)); left: calc(50% - var(--bm-circle-size));
  background: radial-gradient(circle at center, rgba(var(--bm-color5), 0.5) 0, rgba(var(--bm-color5), 0) 50%) no-repeat; opacity: 0.3; transform-origin: calc(50% - 800px), calc(50% + 200px); animation: bmGooeyMoveInCircle 20s ease infinite; }
.bm-interactive { width: 100%; height: 100%; top: -50%; left: -50%;
  background: radial-gradient(circle at center, rgba(var(--bm-color-interactive), 0.6) 0, rgba(var(--bm-color-interactive), 0) 50%) no-repeat; opacity: 0.3; }
@keyframes bmGooeyMoveVertical { 0% { transform: translateY(-50%); } 50% { transform: translateY(50%); } 100% { transform: translateY(-50%); } }
@keyframes bmGooeyMoveInCircle { 0% { transform: rotate(0deg); } 50% { transform: rotate(180deg); } 100% { transform: rotate(360deg); } }
@keyframes bmGooeyMoveHorizontal { 0% { transform: translateX(-50%) translateY(-10%); } 50% { transform: translateX(50%) translateY(10%); } 100% { transform: translateX(-50%) translateY(-10%); } }

/* ---------- Header ---------- */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--bm-header); display: flex; align-items: center; padding: 0 24px;
  background: rgba(8, 8, 16, 0.5); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(180, 75, 255, 0.13); z-index: 1000000;
}
.app-header .logo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 20px; line-height: 32px; letter-spacing: -0.5px; color: var(--bm-texto); }
.app-header .logo .p { background: linear-gradient(90deg, #FF2D78, #B44BFF); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Abrir el panel (solo cuando está colapsado, en celulares) */
.btn-expandir {
  position: fixed; top: 8px; right: 12px; z-index: 1000002; width: 40px; height: 40px; padding: 0; cursor: pointer; border: none; border-radius: 10px;
  background: var(--bm-gradiente); box-shadow: 0 2px 10px rgba(180, 75, 255, 0.4); color: #FFFFFF; display: none; align-items: center; justify-content: center;
}
.btn-expandir svg { width: 22px; height: 22px; fill: currentColor; }

/* ---------- Layout ---------- */
.app-layout { position: fixed; top: var(--bm-header); left: 0; right: 0; bottom: 0; display: flex; }
.sidebar {
  position: relative; flex: 0 0 var(--bm-panel); width: var(--bm-panel); height: 100%; overflow: hidden;
  background-color: rgba(8, 8, 16, 0.55); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-right: 1px solid rgba(180, 75, 255, 0.15);
}
/* El que scrollea es el interior; la barra de abajo (Crear Souvenir) queda pegada al fondo con sticky: sigue a la vista mientras se scrollea y
   al final del recorrido cae en su lugar natural. */
.sidebar-scroll { position: relative; height: 100%; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; scrollbar-width: none; overscroll-behavior: contain; }
.sidebar-scroll::-webkit-scrollbar, .main::-webkit-scrollbar { display: none; width: 0; height: 0; }
.main { flex: 1 1 auto; min-width: 0; height: 100%; overflow-y: auto; scrollbar-width: none; }
.main-bloque { width: 100%; max-width: 736px; margin: 0 auto; padding: calc(24px + var(--bm-fantasma, 82px)) 16px 24px; display: flex; flex-direction: column; gap: 16px; }
.btn-colapsar { display: none; }

.sidebar-contenido { flex: 1 0 auto; display: flex; flex-direction: column; padding: 16px 31px 14px 31px; }
.titulo-panel {
  font-size: clamp(22px, 4.5vw, 32px); line-height: 1.2; font-weight: 800; letter-spacing: -1px; margin: 16px 0 8px; padding: 16px 0;
  background: linear-gradient(90deg, #FF2D78, #B44BFF, #00F5FF); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ---------- Bloques (tarjetas) ---------- */
.bloque {
  position: relative; display: flex; flex-direction: column; gap: 16px; margin-bottom: 14px; padding: 15px;
  background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(180, 75, 255, 0.15); border-radius: 10px;
}
.bloque + .bloque { margin-top: 16px; }
.bloque h3 { color: var(--bm-cyan); margin: 0 0 -8px; padding: 0 0 16px; }
.field-tag {
  position: absolute; top: -1px; right: 20px; transform: translateY(-50%); margin: 0; padding: 2px 10px; background: #0a0a15; text-align: right; white-space: nowrap; z-index: 2;
  display: inline-block; font-family: 'Space Mono', monospace; font-size: 0.6rem; line-height: 1.2; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; border-radius: 10px;
}
.field-tag.required { color: var(--bm-rosa); border: 1px solid rgba(255, 45, 120, 0.4); }
.field-tag.optional { color: var(--bm-apagado); border: 1px solid rgba(122, 122, 154, 0.4); }

/* ---------- Campos ---------- */
.campo { display: block; margin: 0; }
.campo-etiqueta { display: flex; align-items: center; min-height: 24px; margin: 0 0 4px; font-size: 14px; line-height: 22.4px; color: var(--bm-apagado); font-weight: 400; }
.campo-texto { border: 1px solid transparent; border-radius: 8px; min-height: 40px; height: auto; display: block; overflow: visible; }
.campo-texto input {
  display: block; width: 100%; margin: 0; padding: 8px 8px 8px 12px; font: 400 14px/1.4 'Space Mono', monospace; color: var(--bm-texto); outline: none;
  background-color: rgba(255, 255, 255, 0.12); border: 1px solid var(--bm-borde-campo); border-radius: 8px;
}
.campo-texto input::placeholder { color: var(--bm-apagado); opacity: 1; }
.campo-texto input:focus { border-color: var(--bm-cyan); box-shadow: 0 0 5px rgba(0, 245, 255, 0.4); background-color: rgba(255, 255, 255, 0.16); }
input:focus::placeholder { color: transparent; }

/* Fecha: caja oscura de Streamlit con el <input> de siempre adentro (de ahí el doble borde) */
.campo-fecha { position: relative; }
.fecha-caja { display: flex; min-height: 39.6px; padding: 0 4px 0 0; background: var(--bm-st-oscuro); border: 1px solid var(--bm-borde-campo); border-radius: 8px; }
.fecha-caja input {
  display: block; flex: 1 1 auto; min-width: 0; margin: 0; padding: 8px 8px 8px 13px; font: 400 14px/1.4 'Space Mono', monospace; color: var(--bm-texto); outline: none;
  background-color: rgba(255, 255, 255, 0.12); border: 1px solid var(--bm-borde-campo); border-radius: 8px;
}
.fecha-caja:focus-within { border-color: var(--bm-cyan); box-shadow: 0 0 5px rgba(0, 245, 255, 0.4); }

/* Horas y selector de temas: la caja oscura con borde */
.horas { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.select { position: relative; }
.select-caja {
  position: relative; display: flex; align-items: stretch; height: 40px; background: var(--bm-st-oscuro); border: 1px solid var(--bm-borde-campo); border-radius: 8px; cursor: pointer;
}
.select-caja:focus-within, .select.abierto .select-caja { border-color: var(--bm-cyan); box-shadow: 0 0 5px rgba(0, 245, 255, 0.4); }
.select-valor { position: relative; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; padding: 8px 8px 8px 5px; font: 400 14px/19.6px 'Space Mono', monospace; color: var(--bm-apagado); }
.select-valor .texto { position: absolute; left: 5px; right: 0; top: 50%; transform: translateY(-50%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 0; pointer-events: none; }
.select-valor input {
  position: relative; width: 100%; margin: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--bm-apagado); font: 400 14px/22.4px 'Space Mono', monospace; caret-color: var(--bm-texto);
}
.select--horas .select-valor { padding-left: 13px; }
.select--horas .select-valor .texto { left: 13px; }
.select--temas .select-valor { padding: 0 0 0 8px; }
.select--temas .select-valor .texto { left: 8px; }
.select-valor .placeholder { color: var(--bm-apagado); }
.select-limpiar {
  position: absolute; right: 36px; top: 5.5px; width: 24px; height: 26px; padding: 0; border: 0; background: transparent; color: var(--bm-apagado); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.select-limpiar svg { width: 24px; height: 24px; fill: currentColor; padding: 2px; }
.select-flecha { flex: 0 0 auto; display: flex; align-items: center; padding: 0 8px 0 4px; width: 32px; color: var(--bm-texto); pointer-events: none; }
.select-flecha svg { width: 20px; height: 20px; fill: currentColor; }
.select--horas .select-flecha { width: 28px; padding: 0 8px 0 0; }
.select-lista {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 1000100; max-height: 300px; overflow-y: auto; margin: 0; padding: 4px 0 0; list-style: none;
  background: #1a1c24; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.select-lista.arriba { top: auto; bottom: calc(100% + 4px); }
.select-lista li { display: flex; align-items: center; min-height: 28px; padding: 0 8px; margin: 0 5px 12px; border-radius: 6px; font: 400 14px/20px 'Space Mono', monospace; color: var(--bm-apagado); cursor: pointer; }
.select-lista li.activo, .select-lista li:hover { background: rgba(255, 255, 255, 0.08); }
.select-lista li[aria-selected="true"] { color: var(--bm-texto); }
.select-lista li.vacio { cursor: default; color: var(--bm-apagado); }

/* Badge de agüita (valor del selector y filas de la lista) */
.theme-pro-badge {
  display: inline-block; background: transparent; color: var(--bm-cyan); border: 1px solid var(--bm-cyan); font-family: 'Space Mono', monospace; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.5px; padding: 2px 9px; border-radius: 999px; margin-left: 6px; vertical-align: middle; line-height: 1.2;
}
.select-lista li .theme-pro-badge { margin-left: auto; }
.select-caja .theme-pro-badge { position: absolute; right: 38px; top: 50%; transform: translateY(-50%); pointer-events: none; margin: 0; }

/* Caption (texto de apoyo, 14px) */
.caption { font-size: 14px; line-height: 22.4px; color: var(--bm-apagado); margin: 0 0 -16px; padding: 0 0 16px; }
#bloque_tema .caption { color: #B4B3CC; margin: 0; padding: 0; }
.caption-auto { margin: 0 0 -16px; }

/* Alertas (warning) */
.alerta { padding: 16px; border-radius: 8px; font-size: 16px; line-height: 24px; color: var(--bm-apagado); }
.alerta--warning { background: rgba(255, 255, 18, 0.2); }
.alerta--error { background: rgba(255, 108, 108, 0.2); }

/* ---------- Uploader ---------- */
.uploader { padding: 15px; background: rgba(255, 255, 255, 0.06); border: 1px dashed rgba(180, 75, 255, 0.4); border-radius: 8px; }
.uploader.arrastrando { border-color: var(--bm-cyan); }
.dropzone { display: flex; flex-direction: column; gap: 12px; padding: 12px; min-height: 68px; background: var(--bm-st-oscuro); border-radius: 8px; }
.dz-subir {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px; cursor: pointer; font-weight: 700;
  background-color: rgba(0, 245, 255, 0.16); border: 1px solid rgba(0, 245, 255, 0.6); border-radius: 8px; color: var(--bm-cyan);
}
.dz-subir svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.dz-subir span { font: 400 0.95rem/24.3px 'Space Mono', monospace; }
.dz-vacio, #seccionFechas { display: contents; }
.dz-ayuda { font-size: 14px; line-height: 22.4px; color: var(--bm-apagado); white-space: normal; }
.dz-chip { display: inline-flex; align-items: flex-start; gap: 8px; padding: 4px; background: #262730; border-radius: 8px; font-size: 16px; line-height: 20px; width: 100%; position: relative; }
.chip-icono { width: 32px; height: 32px; flex: none; display: flex; align-items: center; justify-content: center; background: #fafafa; border-radius: 6px; color: #7d7f8c; }
.chip-icono svg { width: 20px; height: 20px; fill: currentColor; }
.chip-textos { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; padding-top: 0; }
.chip-nombre { font-size: 14px; line-height: 17.5px; color: var(--bm-apagado); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-tam { font-size: 12px; line-height: 15px; color: var(--bm-apagado); }
.chip-x { flex: none; width: 14.4px; height: 14.4px; padding: 0; margin: 0; border: 0; border-radius: 50%; background: transparent; color: var(--bm-apagado); cursor: pointer; display: flex; }
.chip-x svg { width: 14.4px; height: 14.4px; fill: currentColor; }
.uploader-error { font-size: 14px; line-height: 22.4px; color: #ff6c6c; margin-top: 8px; }

.step-export-link { display: block; width: auto; margin: 10px 0 0; font-family: 'Space Mono', monospace; font-size: 11.5px; line-height: 1.5; color: var(--bm-cyan); text-decoration: underline; cursor: pointer; }
.step-export-link:hover { color: var(--bm-texto); }
.escuchando { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 22.4px; color: var(--bm-apagado); }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.25); border-top-color: var(--bm-cyan); border-radius: 50%; animation: giro 0.8s linear infinite; flex: none; }
@keyframes giro { to { transform: rotate(360deg); } }

/* ---------- Line-up (grilla editable) ---------- */
.lineup { position: relative; background-color: rgba(255, 255, 255, 0.12); border: 1px solid var(--bm-borde-campo); border-radius: 8px; overflow: hidden; margin: 0 -2px 7.6px 0; }
.lineup-tabla { width: 100%; border-collapse: collapse; table-layout: fixed; font: 400 13px/18px 'Inter', 'Source Sans Pro', system-ui, sans-serif; color: var(--bm-texto); }
.lineup-tabla th, .lineup-tabla td { padding: 0; height: 35.4px; border-right: 1px solid rgba(255, 255, 255, 0.12); border-bottom: 1px solid rgba(255, 255, 255, 0.12); text-align: left; }
.lineup-tabla th { background: #1b1d27; font-weight: 600; color: var(--bm-texto); padding: 0 8px; white-space: nowrap; }
.lineup-tabla th svg { width: 16px; height: 16px; fill: var(--bm-apagado); vertical-align: -3px; margin-right: 6px; }
.lineup-tabla th:first-child, .lineup-tabla td:first-child { width: 33px; background: #1b1d27; cursor: pointer; }
.lineup-tabla th:last-child, .lineup-tabla td:last-child { border-right: 0; }
.lineup-tabla tr:last-child td { border-bottom: 0; }
.lineup-tabla td input { width: 100%; height: 34px; padding: 0 8px; margin: 0; border: 0; outline: 0; background: transparent; color: var(--bm-texto); font: inherit; }
.lineup-tabla td.num input { text-align: right; -moz-appearance: textfield; }
.lineup-tabla td.num input::-webkit-outer-spin-button, .lineup-tabla td.num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.lineup-tabla tbody tr.seleccionada td { background: rgba(255, 45, 120, 0.18); }
.lineup-tabla tbody tr.nueva td { background: rgba(255, 255, 255, 0.03); }
.lineup-tabla td:first-child .marca { display: flex; align-items: center; justify-content: center; height: 34px; }
.lineup-tabla td:first-child .marca i { width: 14px; height: 14px; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 3px; display: none; }
.lineup-tabla tbody tr:hover td:first-child .marca i, .lineup-tabla tbody tr.seleccionada td:first-child .marca i { display: block; }
.lineup-tabla tbody tr.seleccionada td:first-child .marca i { background: var(--bm-rosa); border-color: var(--bm-rosa); }
.lineup-wrap { position: relative; }
/* Barra de herramientas flotante (como la del editor de tablas de Streamlit): aparece al pasar el mouse por la grilla y siempre en pantallas táctiles */
.lineup-barra {
  position: absolute; right: 2px; top: -40px; z-index: 3; display: flex; align-items: center; gap: 2px; height: 30px; padding: 0 6px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.05); opacity: 0; pointer-events: none; transition: opacity .15s;
}
.lineup-wrap:hover .lineup-barra, .lineup-wrap:focus-within .lineup-barra, .lineup-barra.con-seleccion { opacity: 1; pointer-events: auto; }
@media (hover: none) { .lineup-barra { opacity: 1; pointer-events: auto; } }
.lineup-barra button { display: flex; align-items: center; justify-content: center; width: 28px; height: 26px; padding: 0; color: var(--bm-apagado); background: transparent; border: 0; border-radius: 6px; cursor: pointer; }
.lineup-barra button:hover { color: var(--bm-texto); background: rgba(255, 255, 255, 0.08); }
.lineup-barra button svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- Tema: paleta ---------- */
.theme-preview { display: flex; align-items: center; gap: 12px; margin: -6px 0 -16px; padding: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 8px; }
.theme-swatches { display: flex; gap: 8px; }
.theme-swatches .swatch { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.25); display: inline-block; }

/* ---------- Barra fija de abajo: Crear Souvenir + Limpiar campos ---------- */
.barra-cta {
  position: sticky; bottom: 0; flex: none; padding: 16px 20px 8px; display: flex; flex-direction: column; gap: 4px; z-index: 99999;
  background-color: rgba(8, 8, 16, 0.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid rgba(180, 75, 255, 0.2);
}
.btn-primario {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; padding: 12px 20px; cursor: pointer; border: none; border-radius: 8px; text-decoration: none;
  background: var(--bm-gradiente); box-shadow: 0 4px 15px rgba(180, 75, 255, 0.3); color: #FFFFFF; font: 800 0.95rem/1.6 'Space Mono', monospace;
}
.btn-primario:disabled { background: rgba(255, 255, 255, 0.08); box-shadow: none; cursor: not-allowed; color: var(--bm-apagado); }
.btn-primario:disabled * { color: var(--bm-apagado); }
.btn-terciario {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 40px; padding: 0; cursor: pointer; background: transparent; border: none; box-shadow: none;
  color: var(--bm-cyan); font: 700 0.8rem/1.6 'Space Mono', monospace; text-decoration: underline; text-underline-offset: 4px;
}
.btn-terciario:disabled { color: var(--bm-apagado); text-decoration: none; cursor: not-allowed; }
.btn-terciario:hover:not(:disabled) { background: rgba(0, 245, 255, 0.08); }
.btn-secundario {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; padding: 12px 16px; cursor: pointer; background: transparent;
  border: 1px solid rgba(0, 245, 255, 0.55); border-radius: 8px; color: var(--bm-cyan); font: 700 1rem/1.6 'Space Mono', monospace;
}
.btn-secundario:hover { background: rgba(0, 245, 255, 0.08); }
.resultado-columna .btn-link { margin-top: 17px; }
.btn-link {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; padding: 4px 12px; text-decoration: none; cursor: pointer;
  border: 1px solid var(--bm-cyan); border-radius: 8px; background: rgba(0, 245, 255, 0.06); color: var(--bm-cyan); font: 800 1rem/1.6 'Space Mono', monospace;
}
.btn-link:hover { background: rgba(0, 245, 255, 0.15); }

/* ---------- Pantalla principal ---------- */
.estado-vacio { display: flex; flex-direction: column; text-align: center; padding: 32px 40px 28px; background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; }
.empty-onda svg { width: min(520px, 100%); height: auto; display: block; margin: 0 auto 20px; overflow: visible; filter: drop-shadow(0 0 10px rgba(180, 75, 255, .45)); }
.bm-onda-linea { stroke-dasharray: 1; stroke-dashoffset: 1; animation: bmOndaDibujar 3.6s ease-in-out infinite; }
@keyframes bmOndaDibujar { 0% { stroke-dashoffset: 1; opacity: 1; } 65% { stroke-dashoffset: 0; opacity: 1; } 90% { stroke-dashoffset: 0; opacity: 0; } 100% { stroke-dashoffset: 1; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bm-onda-linea { animation: none; stroke-dashoffset: 0; } }
.empty-state h2 { text-wrap: pretty; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.2; padding: 16px 0; margin: 0; }
@media (min-width: 769px) { .empty-state h2 { margin-bottom: 10px; } }
.empty-state p { margin: 0 0 16px; font-size: 16px; line-height: 25.6px; color: var(--bm-apagado); }
.estado-vacio .btn-secundario { max-width: 420px; margin: 20px auto 0; }

/* Mientras se genera / error: el "status" de siempre (un <details>) */
.status { border: 1px solid rgba(250, 250, 250, 0.2); border-radius: 8px; }
.status summary { display: flex; align-items: center; gap: 8px; padding: 4px 12px; min-height: 38px; list-style: none; cursor: pointer; font-size: 14px; line-height: 22.4px; color: var(--bm-apagado); }
.status summary::-webkit-details-marker { display: none; }
.status summary svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.status-cuerpo { padding: 16px; border-top: 1px solid rgba(250, 250, 250, 0.2); }

/* Resultado */
.resultado { display: flex; flex-direction: column; gap: 16px; }
.resultado-columna { width: calc(50% - 10.7px); margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.souvenir-marco { position: relative; container-type: inline-size; line-height: 0; }
.souvenir-marco img { display: block; width: 100%; height: auto; border-radius: 0; }
.souvenir-marco.ejemplo::after {
  content: "Ejemplo"; position: absolute; top: 2.4%; right: 5.9%; padding: 1.1cqw 2.2cqw 1.1cqw 5.6cqw; font: 700 2.1cqw/1 'Space Mono', monospace; letter-spacing: 0.22em; text-transform: uppercase;
  color: #FF2D78; background: radial-gradient(circle at 2.9cqw 50%, #FF2D78 0 0.75cqw, transparent 0.8cqw), rgba(15, 15, 26, 0.72); border: 1px solid rgba(255, 45, 120, 0.35); pointer-events: none;
}
.souvenir-marco { position: relative; }
.btn-completo {
  position: absolute; top: -34px; right: 0; width: 28px; height: 28px; padding: 0; display: flex; align-items: center; justify-content: center; line-height: 1;
  color: var(--bm-apagado); background: rgba(255, 255, 255, 0.06); border: 0; border-radius: 6px; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.btn-completo svg { width: 18px; height: 18px; fill: currentColor; }
.resultado-columna:hover .btn-completo, .btn-completo:focus-visible { opacity: 1; }
@media (hover: none) { .btn-completo { opacity: 1; } }
.bm-lightbox { position: fixed; inset: 0; z-index: 6000000; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.92); cursor: zoom-out; }
.bm-lightbox img { max-width: 100vw; max-height: 100vh; width: auto; height: auto; object-fit: contain; }
.bm-lightbox button { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; font-size: 18px; color: var(--bm-texto); background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; cursor: pointer; }
.acciones { display: flex; flex-direction: column; gap: 12px; }
.bm-share-ig { width: 100%; height: 44px; margin: 0; padding: 0 16px; cursor: pointer; display: block; background: var(--bm-gradiente); border: none; border-radius: 8px; color: #FFFFFF; font: 800 0.95rem 'Space Mono', monospace; box-shadow: 0 4px 15px rgba(180, 75, 255, 0.3); }
.bm-share-ig:disabled { opacity: .5; cursor: default; }
html.bm-share-activo .acciones .btn-primario--descarga, html.bm-share-activo .acciones .bm-gracias { display: none !important; }
.bm-descarga-discreta { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; background: transparent; border: none; cursor: pointer; color: var(--bm-apagado); font: 400 0.85rem/1.4 'Space Mono', monospace; text-decoration: underline; text-underline-offset: 4px; }
.bm-gracias { height: 44px; margin: 0; display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 700; color: var(--bm-texto); }
.btn-reintento { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; background: transparent; border: none; cursor: pointer; color: var(--bm-cyan); font: 700 1rem/1.6 'Space Mono', monospace; text-decoration: underline; text-underline-offset: 4px; }
.btn-reintento:hover { background: rgba(0, 245, 255, 0.08); }
hr.sep { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.1); margin: 7.5px 0 0; }
.bm-compartir { text-align: center; margin: -0.5px 0 18px; }
.bm-compartir p { margin: 0; font-size: 15px; line-height: 1.7; color: var(--bm-claro); }
.bm-compartir p.bm-compartir-tag { color: var(--bm-cyan); font-weight: 700; }
.bm-compartir .bm-compartir-sep { color: var(--bm-apagado); font-weight: 400; margin: 0 2px; }
.bm-footer { border-top: 1px solid rgba(255, 255, 255, .07); margin-top: 41px; padding-top: 20px; }
.bm-footer p { font-family: 'Space Mono', monospace; font-size: 11px; color: var(--bm-apagado); text-align: center; margin: 0; }
a.bm-footer-link { color: var(--bm-cyan); text-decoration: none; }
a.bm-footer-link:hover { color: var(--bm-texto); }
.bm-footer .bm-footer-sep { color: var(--bm-apagado); margin: 0 4px; }

/* ---------- Calendario ---------- */
.calendario {
  position: absolute; left: 0; top: calc(100% + 4px); z-index: 1000100; width: 307px; padding: 0 0 8px; background: #262730; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); user-select: none;
}
.calendario-cab { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 12px; color: var(--bm-apagado); font: 400 14px/20px 'Space Mono', monospace; }
.calendario-cab .nav { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: transparent; border: 0; color: var(--bm-texto); cursor: pointer; border-radius: 6px; }
.calendario-cab .nav svg { width: 20px; height: 20px; fill: currentColor; }
.calendario-cab .titulo { display: flex; gap: 30px; align-items: center; color: var(--bm-apagado); }
.calendario-cab .titulo span { display: inline-flex; align-items: center; gap: 4px; }
.calendario-cab .titulo svg { width: 14px; height: 14px; fill: currentColor; }
.calendario-semana, .calendario-grilla { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 6px; }
.calendario-semana { background: #1c1d25; height: 32px; padding-top: 0; padding-bottom: 0; color: var(--bm-apagado); font: 400 14px/32px 'Space Mono', monospace; text-align: center; }
.calendario-grilla { padding-top: 4px; }
.calendario-lista { grid-template-columns: repeat(3, 1fr); }
.calendario-lista button { height: 36px; line-height: 36px; font-size: 13px; }
.calendario-grilla button {
  height: 42px; padding: 0; background: transparent; border: 0; cursor: pointer; color: var(--bm-apagado); font: 400 14px/42px 'Space Mono', monospace; text-align: center; position: relative;
}
.calendario-grilla button:hover { color: var(--bm-texto); }
.calendario-grilla button.elegido::before { content: ""; position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; transform: translate(-50%, -50%); border-radius: 50%; background: #FF4B4B; z-index: 0; }
.calendario-grilla button.elegido span { position: relative; z-index: 1; color: var(--bm-texto); }

/* ---------- Paneles laterales (guía de exportación + privacidad) ---------- */
.bm-panel-overlay { position: fixed; inset: 0; z-index: 5000000; background: rgba(8, 8, 16, .6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease; }
.bm-panel-overlay.open { opacity: 1; visibility: visible; }
.bm-side-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 5000001; width: min(480px, 92vw); background: #0F0F1A; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, .07); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 0 0 1px rgba(255,255,255,.05), -24px 0 70px rgba(0,0,0,.5);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .35s cubic-bezier(.25,.7,.35,1);
}
.bm-side-panel.open { transform: translateX(0); }
.bm-side-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 24px 28px; border-bottom: 1px solid rgba(255, 255, 255, .08); flex-shrink: 0; }
.bm-side-panel-close { width: 36px; height: 36px; background: transparent; border: 1px solid rgba(255, 255, 255, .15); border-radius: 8px; color: #F0EEFF; font-size: 15px; cursor: pointer; transition: all .2s; }
.bm-side-panel-close:hover { border-color: rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .05); }
.bm-side-panel-body { padding: 8px 28px 40px; overflow-y: auto; line-height: 1.7; }
.bm-side-panel-body p, .bm-side-panel-body li { font-size: 15px; line-height: 1.65; color: #C9C8DE; }
.bm-side-panel-body p { margin-bottom: 14px; }
.bm-side-panel-body li { margin-bottom: 10px; }
.bm-side-panel-body strong { color: #F0EEFF; font-weight: 700; }
.bm-side-panel-body h3 { font-size: 17px; font-weight: 800; letter-spacing: -.2px; margin: 28px 0 10px; color: #F0EEFF; }
.bm-side-panel-body h3:first-of-type { margin-top: 20px; }
.bm-panel-label { display: block; font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: #FF2D78; margin-bottom: 18px; }
.bm-panel-callout { background: #0F0F1A; border: 1px solid rgba(180, 75, 255, .2); border-radius: 12px; padding: 16px 18px 4px; margin-bottom: 24px; }
.bm-panel-callout li { color: #F0EEFF; }
.bm-brand-guide { border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.bm-brand-guide summary { padding: 16px 18px; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 16px; color: #F0EEFF; transition: background .2s; }
.bm-brand-guide summary::-webkit-details-marker { display: none; }
.bm-brand-guide summary:hover { background: rgba(255, 255, 255, .03); }
.bm-brand-guide summary .bm-brand-icon { font-size: 20px; }
.bm-brand-guide summary::after { content: '+'; margin-left: auto; font-size: 18px; color: #7A7A9A; transition: transform .2s; }
.bm-brand-guide[open] summary::after { content: '−'; }
.bm-brand-guide-body { padding: 0 18px 18px; }
.bm-brand-guide-body ol { padding-left: 20px; margin: 0 0 10px; }
.bm-brand-guide-body .bm-brand-opt { font-family: 'Space Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #FF2D78; margin: 22px 0 10px; }
.bm-side-panel-body .bm-brand-note { font-size: 15px; line-height: 1.65; color: #C9C8DE; background: rgba(255, 255, 255, .05); border-radius: 8px; padding: 12px 14px; margin-top: 8px; }
.bm-brand-guide-body a { color: #00F5FF; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.bm-brand-guide-body code { font-family: 'Space Mono', monospace; font-size: 13px; background: rgba(255, 255, 255, .06); padding: 1px 6px; border-radius: 4px; color: #00F5FF; }

/* ---------- Mobile ---------- */
.bm-scrim { position: fixed; inset: 0; z-index: 5000000; background: rgba(0, 0, 0, 0.55); }
.select-lista.hoja {
  position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 5000001; width: 100vw; max-height: 70vh; margin: 0; padding: 0 0 env(safe-area-inset-bottom, 0); border: 0;
  border-radius: 16px 16px 0 0; background: #12121C; box-shadow: 0 -12px 40px rgba(0, 0, 0, .6); overscroll-behavior: contain;
}
.select-lista.hoja.hoja-horas { background: #262730; max-height: min(70vh, 330px); }
.select-lista.hoja li { min-height: 48px; margin: 0; padding: 0 20px; border-radius: 0; font-size: 18px; color: var(--bm-texto); }
.select-lista.hoja li[aria-selected="true"] { background: rgba(255, 45, 120, .18); }
.select-lista.hoja li .theme-pro-badge { font-size: 0.68rem; color: var(--bm-cyan); }

@media (min-width: 769px) {
  .estado-vacio { padding: 32px 40px 28px; }
}
@media (max-width: 768px) {
  :root { --bm-panel: 100vw; }
  .sidebar { position: fixed; top: var(--bm-header); left: 0; width: 100vw; height: calc(100dvh - var(--bm-header)); max-height: calc(100dvh - var(--bm-header)); z-index: 99998; }
  .sidebar[aria-expanded="false"] { transform: translateX(-100%); }
  .sidebar-contenido { padding: 32px 31px 14px 31px; }
  .main { width: 100%; }
  .btn-expandir.visible { display: flex; }
  .btn-colapsar {
    display: flex; position: absolute; top: 12px; right: 12px; z-index: 10; width: 36px; height: 36px; padding: 0; align-items: center; justify-content: center; cursor: pointer;
    background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 8px; color: var(--bm-texto);
  }
  .btn-colapsar svg { width: 20px; height: 20px; fill: currentColor; }
  .campo-texto input, .fecha-caja input, .select-valor input { font-size: 16px; }
  .barra-cta { padding: 14px 31px 6px; background-color: rgba(8, 8, 16, 0.94); }
  .resultado-columna { width: 100%; }
  .main-bloque { padding-top: calc(24px + var(--bm-fantasma, 43px)); }
  .resultado-columna { margin: 16px 0; }
  .horas { grid-template-columns: 1fr; }
  .estado-vacio { padding: 44px 32px 32px; }
}

/* ---------- Dentro de la app de Android (WebView): hoja para elegir la sesión del reloj ---------- */
html.bm-app .step-export-link { display: none; }
.bm-hoja-velo { position: fixed; inset: 0; z-index: 7000000; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0.65); }
.bm-hoja-velo[hidden] { display: none; }
.bm-hoja { width: 100%; max-width: 560px; max-height: 88%; display: flex; flex-direction: column; background: var(--bm-card); border: 1px solid rgba(180, 75, 255, 0.4); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px)); }
.bm-hoja-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 6px; }
.bm-hoja-cab h3 { font-size: 1.35rem; }
.bm-hoja-x { width: 40px; height: 40px; flex: none; color: var(--bm-texto); background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 8px; font-size: 16px; cursor: pointer; }
.bm-hoja-cuerpo { overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; }
.bm-hoja-texto { margin: 8px 0 14px; font-size: 0.9rem; color: var(--bm-claro); }
.bm-hoja-sub { margin: 4px 0 10px; font-size: 0.85rem; }
.bm-hoja-pie { margin: 16px 0 4px; text-align: center; font-size: 0.75rem; }
.bm-hoja-botones { display: flex; flex-direction: column; gap: 10px; }
.bm-hoja-botones button { width: 100%; height: 44px; }
.bm-sesiones { display: flex; flex-direction: column; gap: 10px; }
.bm-sesiones-semana { margin-top: 10px; font: 700 0.7rem 'Space Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--bm-apagado); }
.bm-sesion { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; padding: 14px 16px; text-align: left; cursor: pointer; background: var(--bm-bg); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 12px; color: var(--bm-claro); font: 400 0.8rem/1.4 'Space Mono', monospace; }
.bm-sesion.fiesta { border-color: rgba(180, 75, 255, 0.7); }
.bm-sesion-dia { grid-column: 1; font: 800 1.1rem 'Syne', sans-serif; color: var(--bm-texto); }
.bm-sesion-fiesta { grid-column: 2; grid-row: 1; align-self: center; font-size: 0.7rem; color: var(--bm-cyan); }
.bm-sesion-hora, .bm-sesion-origen { grid-column: 1 / -1; }
.bm-sesion-origen { font-size: 0.72rem; color: var(--bm-apagado); }
