* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root {
  --bg: #0b0f19;
  --panel: #111927;
  --panel-2: #161c2a;
  --border: rgba(255,255,255,.08);
  --accent: #00d9d9;
  --accent-ink: #06222a;
  --text: #f5f7fb;
  --text-soft: #a6b0c3;
  --green: #10b981;
  --amber: #ffca28;
  --widget: #00d9d9;
}
html, body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; margin: 0; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; border-bottom: 1px solid var(--border); }
.back-link { color: var(--text-soft); text-decoration: none; font-size: .85rem; }
.back-link:hover { color: var(--accent); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; }
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

main { max-width: 1180px; margin: 0 auto; padding: 40px 24px 80px; }

.intro { max-width: 720px; margin: 0 auto 40px; text-align: center; }
.intro-eyebrow { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.intro h1 { font-size: 1.9rem; margin: 0 0 14px; line-height: 1.25; }
.intro p { color: var(--text-soft); line-height: 1.6; font-size: .96rem; }
.intro-actions { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 24px; flex-wrap: wrap; }

.btn-play { background: linear-gradient(135deg, var(--accent), #00b8b8); color: var(--accent-ink); border: none; border-radius: 10px; padding: 13px 26px; font-weight: 700; font-size: .95rem; cursor: pointer; transition: transform .15s ease, opacity .15s ease; }
.btn-play:hover { transform: translateY(-1px); }
.btn-play:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.subtitle-toggle { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text-soft); cursor: pointer; }
.subtitle-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }

.mode-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.mode-btn { background: var(--panel-2); border: 1px solid var(--border); color: var(--text-soft); border-radius: 8px; padding: 8px 14px; font-size: .82rem; font-weight: 600; cursor: pointer; transition: color .15s ease, border-color .15s ease; }
.mode-btn:hover { color: var(--text); }
.mode-btn.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.mode-btn-fullscreen { background: var(--panel-2); border: 1px solid var(--border); color: var(--text-soft); border-radius: 8px; padding: 8px 14px; font-size: .82rem; cursor: pointer; }
.mode-btn-fullscreen:hover { color: var(--accent); border-color: var(--accent); }

.stage-wrap { max-width: 1080px; margin: 0 auto; }
.stage-wrap.pseudo-fullscreen { position: fixed; inset: 0; z-index: 9999; max-width: none; overflow: auto; background: var(--bg); display: flex; flex-direction: column; justify-content: center; padding: 24px; }
body.pseudo-fullscreen-lock { overflow: hidden; }

.stage { display: grid; grid-template-columns: 1.15fr 1fr; gap: 2px; background: var(--border); border-radius: 16px; overflow: hidden; border: 1px solid var(--border); min-height: 600px; }
@media (max-width: 860px) { .stage:not([data-mode="mobile"]) { grid-template-columns: 1fr; } }

/* ---------- Modo mobile: un solo marco de teléfono; la configuración y el sitio del
   cliente (con el widget) son "pantallas" secuenciales dentro del mismo marco (una visible
   a la vez). script.js alterna la clase .mob-screen-active entre ambas. ---------- */
.stage[data-mode="mobile"] {
  display: block;
  position: relative;
  width: 320px; height: 640px;
  margin: 0 auto;
  background: #05070c;
  border: 10px solid #1c2536;
  border-radius: 42px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 1px var(--border);
  overflow: hidden;
  min-height: 0;
}
.stage[data-mode="mobile"]::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 120px; height: 22px; background: #1c2536; border-radius: 0 0 14px 14px; z-index: 5;
}
.stage[data-mode="mobile"] .stage-half {
  position: absolute; inset: 0;
  padding-top: 22px; /* despeja el notch del marco de teléfono */
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(16px);
  transition: opacity .28s ease, transform .28s ease, visibility .28s;
}
.stage[data-mode="mobile"] .stage-half.mob-screen-active {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(0); z-index: 2;
}
@media (max-width: 480px) {
  #btnModeDesktop { display: none; }
  .stage[data-mode="mobile"] { width: 100%; max-width: 100%; height: 78vh; border-radius: 0; border-width: 6px; }
}

.stage-half { position: relative; background: var(--panel); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.device-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); padding: 10px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }

/* ---------- Panel de configuración ---------- */
.config-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.config-tabs { display: flex; gap: 4px; padding: 8px 10px; background: var(--panel-2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.config-tab { padding: 7px 11px; border-radius: 8px; font-size: .72rem; font-weight: 600; color: var(--text-soft); white-space: nowrap; }
.config-tab.active { color: var(--accent-ink); background: var(--accent); }
.config-body { flex: 1; overflow-y: auto; padding: 16px; }

/* Horarios */
.tz-select { width: 100%; background: #0b0f19; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--text); font-size: .78rem; margin-bottom: 14px; }
.dias-tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.dia-tab { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); font-size: .72rem; color: var(--text-soft); display: flex; align-items: center; justify-content: center; }
.dia-tab.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.dia-tab.con-franja::after { content: ""; }
.franja-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #0f1522; border-radius: 8px; margin-bottom: 6px; font-size: .8rem; animation: msgIn .2s ease; }
.franja-row span { flex: 1; }
.franja-row .franja-icon { color: var(--accent); }
.btn-add-franja { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px dashed var(--border); color: var(--text-soft); border-radius: 8px; padding: 8px 12px; font-size: .76rem; width: 100%; justify-content: center; margin-top: 4px; }

/* Respuestas rápidas / FAQ */
.macro-row, .faq-row { padding: 9px 10px; background: #0f1522; border-radius: 8px; margin-bottom: 6px; animation: msgIn .2s ease; }
.macro-shortcut { font-size: .74rem; font-weight: 700; color: var(--accent); }
.macro-text, .faq-answer { font-size: .74rem; color: var(--text-soft); margin-top: 2px; }
.faq-question { font-size: .8rem; font-weight: 600; }

/* Tema */
.theme-row { display: flex; gap: 8px; margin-bottom: 14px; }
.theme-card { flex: 1; border: 1px solid var(--border); border-radius: 9px; padding: 10px; text-align: center; font-size: .7rem; color: var(--text-soft); }
.theme-card .swatch { width: 100%; height: 36px; border-radius: 7px; margin-bottom: 6px; }
.theme-card.active { border-color: var(--accent); color: var(--accent); }
.color-picker-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.color-picker-row .dot { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); transition: background .3s ease; }
.color-picker-row span:not(.dot):not(.hex) { flex: 1; font-size: .78rem; color: var(--text-soft); }
.color-picker-row .hex { font-size: .72rem; font-family: monospace; }

/* ---------- Sitio del cliente + widget ---------- */
.stage-client { position: relative; }
.client-viewport { position: relative; flex: 1; background: #05070c; overflow: hidden; }
.mock-site-topbar { height: 34px; background: #10151f; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 12px; gap: 6px; }
.mock-site-dot { width: 8px; height: 8px; border-radius: 50%; background: #333; }
.mock-site-body { padding: 20px; }
.mock-site-line { height: 12px; background: rgba(255,255,255,.06); border-radius: 4px; margin-bottom: 10px; }
.mock-site-line.w60 { width: 60%; }
.mock-site-line.w80 { width: 80%; }
.mock-site-line.w40 { width: 40%; }

.chat-bubble { position: absolute; right: 20px; bottom: 20px; width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--accent-ink); box-shadow: 0 8px 24px rgba(0,217,217,.35); transition: background .3s ease, transform .2s ease, opacity .2s ease; background: var(--widget); }
.chat-bubble svg { width: 26px; height: 26px; }
.chat-bubble.hidden-bubble { opacity: 0; transform: scale(.5); pointer-events: none; }

.chat-status-pill { position: absolute; right: 20px; bottom: 82px; font-size: .66rem; padding: 4px 9px; border-radius: 999px; background: rgba(16,185,129,.15); color: var(--green); border: 1px solid rgba(16,185,129,.3); transition: all .3s ease; }
.chat-status-pill.fuera-horario { background: rgba(255,202,40,.15); color: var(--amber); border-color: rgba(255,202,40,.3); }

.chat-window { position: absolute; right: 20px; bottom: 20px; width: 280px; height: 400px; background: #0f1522; border: 1px solid var(--border); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.4); animation: popIn .25s ease; }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.chat-window-head { padding: 12px 14px; background: var(--widget); color: var(--accent-ink); font-weight: 700; font-size: .84rem; transition: background .3s ease; }
.chat-window-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 85%; padding: 8px 11px; border-radius: 11px; font-size: .8rem; line-height: 1.4; animation: msgIn .2s ease; }
.msg-in { align-self: flex-start; background: #1b2333; color: var(--text); border-bottom-left-radius: 3px; }
.faq-chip { align-self: flex-start; font-size: .74rem; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--widget); color: var(--widget); transition: color .3s ease, border-color .3s ease; }
.chat-window-input { border-top: 1px solid var(--border); padding: 8px; font-size: .74rem; color: var(--text-soft); }

.stage-half, .config-body { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.stage-half::-webkit-scrollbar, .config-body::-webkit-scrollbar { width: 8px; }
.stage-half::-webkit-scrollbar-thumb, .config-body::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,.25); border-radius: 8px; }

@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.subtitle-bar { position: fixed; left: 50%; top: 38vh; transform: translateX(-50%); z-index: 500; max-width: min(560px, 88vw); text-align: center; font-size: .9rem; line-height: 1.5; color: var(--text); background: rgba(10, 14, 22, .88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 14px 20px; box-shadow: 0 12px 40px rgba(0,0,0,.5); animation: subtitleIn .2s ease; }
@keyframes subtitleIn { from { opacity: 0; transform: translateX(-50%) translateY(6px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

.replay-wrap { text-align: center; margin-top: 24px; }
.btn-replay { background: transparent; border: 1px solid var(--accent); color: var(--accent); }

.footnote { max-width: 720px; margin: 40px auto 0; text-align: center; }
.footnote p { color: var(--text-soft); font-size: .78rem; line-height: 1.6; }
