/* ESM 1.5 design (inspirado en mockups del cliente) */
:root{
  --bg:#faf9f6;
  --card:#ffffff;
  --muted:#7a7a7a;
  --text:#1f1f1f;
  --brand:#d4af37;
  --brand2:#f0e2a6;
  --shadow:0 8px 28px rgba(0,0,0,.06);
  --radius:22px;
}
*{box-sizing:border-box}
/* Container + hero (libro) */
.container{max-width:1100px;margin:0 auto;padding:24px}
.hero{background:linear-gradient(135deg,var(--brand2),#fff);border:1px solid rgba(212,175,55,.32);border-radius:var(--radius);padding:34px 20px;text-align:center;box-shadow:var(--shadow);margin-bottom:22px}
.hero .subtitle{display:block;font-size:15px;font-weight:300;color:#856b08;margin-bottom:6px}
.hero .person{display:block;font-size:clamp(24px,4vw,34px);font-weight:300;color:#6e5b09}

/* Feed (libro) */
.feed{display:grid;gap:16px}
.card{background:var(--card);border:1px solid rgba(212,175,55,.26);border-radius:18px;padding:18px;box-shadow:var(--shadow)}
.meta{display:flex;justify-content:space-between;gap:12px;color:var(--muted);font-size:13px;margin-bottom:6px}
.author{font-weight:700;color:#6e5b09}
.text{font-size:16px;line-height:1.6}

/* CTA fijo (botón abrir popup) */
.cta-fixed{position:sticky;bottom:18px;display:flex;justify-content:center;margin-top:18px}
.btn-cta{border:none;border-radius:999px;padding:14px 22px;background:linear-gradient(135deg,var(--brand),var(--brand2));color:#2f2500;font-weight:800;box-shadow:0 12px 24px rgba(212,175,55,.35);cursor:pointer}
.btn-cta.btn-small{padding:8px 14px}

/* Modal bottom sheet */
.modal{position:fixed;inset:0;background:rgba(0,0,0,.35);display:none;align-items:flex-end;z-index:50}
.modal.open{display:flex}
.sheet{width:100%;background:#fff;border-radius:18px 18px 0 0;max-height:90vh;overflow:auto;border:1px solid rgba(212,175,55,.3);box-shadow:0 -10px 30px rgba(0,0,0,.08)}
.sheet header{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid rgba(212,175,55,.22)}
.sheet h3{margin:0;color:#6e5b09}
.sheet .content{padding:16px}

/* Form grid */
.grid-form{display:grid;grid-template-columns:1fr 1fr;gap:16px}
@media(max-width:640px){.grid-form{grid-template-columns:1fr}}
label{font-size:13px;font-weight:700;color:#7b6210;margin-bottom:6px;display:block}
input,select,textarea{width:100%;padding:12px;border-radius:12px;border:1px solid rgba(212,175,55,.35);background:#fff;font-size:14px;color:var(--text)}
textarea{min-height:120px;resize:vertical}
.btn-submit{margin-top:10px;width:100%;background:linear-gradient(135deg,var(--brand),var(--brand2));color:#2f2500;font-weight:800;padding:14px;border:none;border-radius:14px;cursor:pointer;font-size:15px}
.counter{font-size:12px;color:var(--muted);text-align:right}

/* Panel (header / stats / cards) */
.header{position:relative;background:linear-gradient(135deg, rgba(233,211,155,.55), rgba(201,167,75,.50));border:1px solid rgba(201,167,75,.25);border-radius:18px;padding:24px;box-shadow:0 10px 25px rgba(17,24,39,.08)}
.title{display:flex;gap:14px;align-items:center;flex-wrap:wrap}
.logo{width:52px;height:52px;border-radius:14px;display:grid;place-items:center;background:linear-gradient(145deg,#fff,#f6efe0);border:1px solid rgba(201,167,75,.35);box-shadow: inset 0 1px 1px rgba(255,255,255,.65);color:#b68d2a}
.title h1{margin:0;font-size:clamp(20px,3.2vw,28px)}
.subtitle{color:#6b7280;margin-top:6px}
.stats{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}
.chip{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:40px;font-weight:600;font-size:14px;border:1px solid rgba(201,167,75,.25);background:rgba(255,255,255,.65);backdrop-filter: blur(4px)}
.chip.ok{color:#15803d;border-color:rgba(22,163,74,.2)}
.chip.wait{color:#b91c1c;border-color:rgba(220,38,38,.2)}
.grid{display:grid;grid-template-columns: 1.2fr 1fr;gap:18px;margin-top:18px}
@media (max-width:980px){ .grid{grid-template-columns: 1fr} }
.row{display:flex;gap:12px;flex-wrap:wrap;align-items:center}
.btn{appearance:none;border:none;cursor:pointer;border-radius:14px;padding:10px 14px;font-weight:700;color:#4a3a07;background:#fff;transition:.18s transform ease, .18s box-shadow ease;display:inline-flex;align-items:center;gap:10px;border:1px solid rgba(201,167,75,.25)}
.btn:hover{transform:translateY(-1px);box-shadow:0 8px 18px rgba(17,24,39,.08)}
.btn-ghost{background:transparent;color:#1a1f2b;border:1px solid rgba(201,167,75,.35)}
.btn-primary{background:linear-gradient(135deg, #c9a74b, #e9d39b);color:#3a2b00}
.section-title{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.qr-wrap{display:grid;grid-template-columns: 140px 1fr;gap:16px;align-items:center}
@media (max-width:640px){ .qr-wrap{grid-template-columns: 1fr} }
.input{display:flex;gap:10px;align-items:center}
.input input{flex:1;min-width:0;background:#ffffff;color:#1a1f2b;border-radius:12px;border:1px solid rgba(201,167,75,.28);padding:12px 14px;font-size:14px}
.pill{display:inline-flex;padding:6px 10px;border-radius:999px;background:rgba(233,211,155,.25);border:1px solid rgba(201,167,75,.28);color:#816b20;font-size:12px}
.badge{display:inline-flex;align-items:center;gap:8px;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:700;color:#4a3a07;background:#fff3cc;border:1px solid rgba(201,167,75,.35)}
.badge.gold{background:#fff3cc}

/* Toast */
.toast{position:fixed;right:20px;bottom:20px;background:#1f2937;color:#f9fafb;border:1px solid rgba(255,255,255,.12);padding:10px 14px;border-radius:12px;opacity:0;transform: translateY(8px);transition:.25s;box-shadow:0 10px 25px rgba(17, 24, 39, .08)}
.toast.show{opacity:1; transform: translateY(0)}

/* === APPENDED OVERRIDES === */

/* ===== Eterni: overrides visuales 2025-09 (libro + panel) ===== */
:root{ --bg:#faf9f6; --card:#fff; --text:#1f1f2b; --brand:#d4af37; --brand-2:#f8e79c; }
.eterni-hero,.book-hero,.panel-hero{
  background:linear-gradient(135deg,var(--brand-2),#fff);
  border:1px solid rgba(212,175,55,.32);
  border-radius:22px; padding:34px 20px; text-align:center;
  box-shadow:0 10px 25px rgba(17,24,39,.08); margin-bottom:22px
}
.eterni-subtitle,.book-hero .subtitle{font-size:15px;font-weight:300;color:#856b08;margin-bottom:6px;display:block}
.eterni-person,.book-hero .person{font-size:clamp(24px,4vw,34px);font-weight:300;color:#6e5b09;display:block}
/* Cards */
.eterni-card,.panel-card,.book-card{background:#fff;border:1px solid rgba(201,167,75,.16);border-radius:18px;padding:22px;box-shadow:0 10px 25px rgba(17,24,39,.08)}
.eterni-meta,.book-meta{display:flex;justify-content:space-between;gap:12px;color:#7a7a7a;font-size:13px;margin-bottom:6px}
.eterni-author,.book-author{font-weight:700;color:#6e5b09}
/* CTA */
.eterni-cta-fixed{position:sticky;bottom:18px;display:flex;justify-content:center;margin-top:18px}
.eterni-btn-cta{border:none;border-radius:999px;padding:16px 26px;min-height:48px;background:linear-gradient(135deg,var(--brand),var(--brand-2));color:#2f2500;font-weight:800;letter-spacing:.2px;box-shadow:0 12px 24px rgba(212,175,55,.35);cursor:pointer}
/* Modal sizing + header spacing */
.sheet, .eterni-sheet { width:min(92vw,640px); max-height:90vh; }
.sheet .header h3, .eterni-sheet-header h3 { margin:0; padding:0 8px; text-align:center; color:#6e5b09; }
.btn-close, .eterni-btn-close { margin-left:auto }
.eterni-checkwrap{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.eterni-checkwrap input[type="checkbox"]{width:22px;height:22px;margin:0}
label[for="eterniTerms"]{white-space:nowrap}
.eterni-btn-termlink{border:1px solid rgba(212,175,55,.35);background:#fff;color:#4a3a07;border-radius:12px;padding:8px 12px;font-weight:700;cursor:pointer}


/* === Patch 2025-09-20: Panel header one-line with logo, smaller titles, compact modal form === */

/* 1) Header topbar: single row + brand logo sizing */
.eterni-header{ border-radius:28px; padding:14px 18px }
.eterni-topbar{ display:flex; align-items:center; justify-content:flex-start; gap:16px; flex-wrap:nowrap }
.eterni-brand{ display:flex; align-items:center; gap:10px }
.eterni-brand img{ height:32px; width:auto; display:block }
.eterni-stats{ margin-left:12px }
.eterni-toolbar{ margin-left:auto }

/* 2) Smaller section titles inside cards */
.eterni-card h2,
.panel-card h2,
.book-card h2{
  font-size:18px; line-height:1.25; font-weight:700; margin:0 0 10px;
}

/* 3) Modal form not full width + mobile compact spacing */
.eterni-modal .eterni-sheet,
.sheet{ width:min(92vw,640px); max-height:90vh; }
.eterni-sheet-content{ padding:16px }
.eterni-grid-form{ gap:12px }
.eterni-grid-form input,
.eterni-grid-form select,
.eterni-grid-form textarea{ padding:12px 12px; border-radius:12px }
.eterni-btn-submit{ padding:14px 18px; min-height:44px }
.eterni-checkwrap{ gap:8px }
label[for="eterniTerms"]{ white-space:nowrap }

/* Mobile tweaks */
@media (max-width:480px){
  .eterni-container{ padding:16px }
  .eterni-brand img{ height:28px }
  .eterni-stats{ gap:8px }
  .eterni-chip{ padding:6px 10px; font-size:13px }
  .eterni-btn{ padding:8px 12px }
  .eterni-card{ padding:16px }
  .eterni-grid-form{ gap:10px }
  .eterni-grid-form textarea{ min-height:110px }
}


/* === Patch 2025-09-20 (v1.5.7): header one-line + smaller titles + modal compact === */
.header{display:flex;align-items:center;gap:16px;justify-content:space-between}
.header .title{display:flex;align-items:center;gap:14px;flex-wrap:nowrap}
.header .title > div{display:flex;align-items:center;gap:14px}
.header .row{margin-top:0;margin-left:auto;display:flex;gap:10px;flex-wrap:nowrap}
.logo{background:none;box-shadow:none;width:auto;height:auto;padding:0}
.logo img{height:32px;width:auto;display:block}
.stats{margin-top:0}
.section-title h2{font-size:18px;line-height:1.25}
.modal.open .sheet{width:min(92vw,640px) !important;max-height:90vh}
.sheet .content{padding:16px}
.grid-form{gap:12px}
@media (max-width:480px){
  .container{padding:16px}
  .logo img{height:28px}
  .chip{padding:6px 10px;font-size:13px}
  .btn{padding:8px 12px}
  .card{padding:16px}
  .grid-form{gap:10px}
  .grid-form textarea{min-height:110px}
}


/* === Patch 2025-09-20b === */

/* Logo smaller */
.logo img{height:26px !important}

/* Titles spacing normal */
.section-title h2, h2{letter-spacing:normal !important}

/* Center form submit */
.esm-form .btn-submit{display:block;margin:20px auto !important;float:none}


/* === Patch 2025-09-20-b === */
/* Header: one line, smaller logo, without h1/subtitle */
.header{display:flex;align-items:center;gap:16px;justify-content:space-between}
.header .title{display:flex;align-items:center;gap:14px;flex-wrap:nowrap}
.logo{background:none;box-shadow:none;width:auto;height:auto;padding:0}
.logo img{height:26px;width:auto;display:block}
/* Titles more readable (not cramped) */
.section-title h2,
.card h2{letter-spacing:.2px; font-kerning:normal; font-size:18px; line-height:1.28}
/* Center modal (popup) and keep compact width */
.modal{align-items:center; justify-content:center}
.sheet{border-radius:22px; width:min(92vw, 640px); max-height:90vh}
/* Button row under list removed: ensure no leftover spacing */
.card .row:empty{display:none}


/* === Patch 2025-09-20-c === */
/* Modal form: centered, wider inputs, compact gaps */
.modal{display:flex;align-items:center;justify-content:center}
.sheet{width:min(92vw,680px);max-height:90vh;border-radius:22px}
.sheet header h3{font-size:28px;margin:6px 0}
.grid-form{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.grid-form > div:nth-of-type(4){grid-column:1/-1} /* textarea block full width */
.grid-form input, .grid-form select, .grid-form textarea{
  width:100%;padding:14px 14px;border-radius:12px;font-size:16px
}
/* Terms one-line with larger checkbox */
.grid-form .terms{grid-column:1/-1;display:flex;align-items:center;gap:10px;flex-wrap:nowrap}
.grid-form .terms label{display:flex;align-items:center;gap:10px;margin:0}
.grid-form .terms input[type="checkbox"]{width:22px;height:22px;margin:0;flex:0 0 22px}
/* Candle icon in feed */
.ic-candle{display:inline-flex;align-items:center;justify-content:center;margin-right:8px;opacity:.9;font-size:14px}
/* Panel name after logo */
.panel-name{font-weight:700;margin-left:8px}
/* Section titles comfortable spacing */
.section-title h2, .card h2{letter-spacing:.2px;line-height:1.3}

/* === Final modal visibility fix === */
.modal{display:none!important;align-items:center;justify-content:center}
.modal.open{display:flex!important;align-items:center;justify-content:center}
/* Terms line tighter */
.terms-line{white-space:nowrap;font-weight:600}
.terms-line input[type="checkbox"]{width:22px;height:22px;margin-right:8px;vertical-align:middle}


/* === Patch 2025-09-20-d: Mobile panel stacking + modal overflow fix === */

/* Base: ensure no horizontal scroll when modal open */
html, body{overflow-x:hidden}

/* Mobile layout for panel header */
@media (max-width: 640px){
  .header{flex-direction:column; align-items:center; text-align:center; gap:10px}
  .header .title{justify-content:center; width:100%}
  .logo img{height:26px}
  .stats{margin:6px 0 4px; display:flex; gap:8px; justify-content:center; width:100%}
  .header .row{margin:0; width:100%; display:flex; justify-content:center; gap:10px; flex-wrap:wrap}
  /* Buttons: update + logout (icon only) */
  .btn-logout{position:relative; width:44px; height:44px; padding:0 0; border-radius:999px; overflow:hidden; text-indent:-9999px}
  .btn-logout::before{content:"⎋"; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; text-indent:0; font-size:18px}
}

/* Modal: prevent lateral scroll and fit viewport on mobile */
.modal{display:none!important; padding:12px}
.modal.open{display:flex!important; align-items:center; justify-content:center}
.sheet{width:min(92vw, 640px); max-height:90vh; box-sizing:border-box}
@media (max-width:640px){
  .sheet{width:calc(100vw - 24px); margin:0 12px; border-radius:20px}
  .sheet .content{padding:12px}
  .grid-form{grid-template-columns:1fr; gap:12px}
  .grid-form textarea{min-height:120px}
}


/* === ESM Login Redesign (scoped) === */
.esm-login .header{display:none;}
.esm-login{padding:28px 16px;display:block}
.esm-login-card{width:100%;max-width:720px;margin:16px auto;background:#eaf3fb;border-radius:18px;box-shadow:var(--shadow);padding:32px 28px;text-align:center}
@media (max-width:640px){.esm-login-card{max-width:420px;border-radius:20px;padding:28px 22px}}
.esm-login-brand img{max-width:240px;height:auto;margin-bottom:12px}
.esm-login-title{margin:0 0 18px;font-size:20px;font-weight:700}
.esm-login-form{display:flex;flex-direction:column;gap:12px;align-items:center}
.esm-login-form input[type="text"],.esm-login-form input[type="password"]{width:100%;max-width:380px;height:38px;border:1px solid rgba(0,0,0,.08);border-radius:9px;background:#fff;padding:8px 12px;outline:none;font-size:14px}
.esm-login-forgot{display:block;font-size:11px;color:#6a6a6a;text-decoration:none;margin-top:-4px;margin-bottom:6px}
.esm-login-forgot:hover{text-decoration:underline}
.esm-login-btn{display:inline-block;border:none;border-radius:9px;padding:10px 18px;font-weight:700;cursor:pointer;background:#2f6fb1;color:#fff;transition:.06s transform ease,.2s opacity ease}
.esm-login-btn:hover{opacity:.95}.esm-login-btn:active{transform:translateY(1px)}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}


/* === ESM Panel Redesign (compact + mobile fixes) === */
.container.esm-panel{padding:18px 10px}
@media (max-width:640px){.container.esm-panel{padding:10px 8px}}
.esm-panel .header{background:#fff;border:1px solid rgba(201,167,75,.25);border-radius:22px;box-shadow:0 10px 24px rgba(0,0,0,.06);padding:12px 18px;margin-bottom:14px;display:flex;align-items:center;justify-content:space-between}
.esm-panel .header .title{display:flex;align-items:center;gap:12px}
.esm-panel .header .logo{background:transparent;border:none;box-shadow:none;padding:0}
.esm-panel .header .logo img{max-width:180px;height:auto;display:block}
.esm-panel .header .row{display:flex;gap:12px}
.esm-panel .btn{border-radius:999px;padding:8px 14px;font-size:14px}
.esm-panel .btn-primary,.esm-panel .btn-ghost{background:#fff;border:1px solid rgba(29,78,137,.28);color:#1e2a3b}
.esm-panel .panel-stats{display:flex;gap:10px;margin:10px 0 6px}
.esm-panel .chip{display:inline-block;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:700;border:1px solid transparent}
.esm-panel .chip.ok{background:#e7f6ec;border-color:#c5e8d0;color:#206a3a}
.esm-panel .chip.wait{background:#fff0f1;border-color:#f3c7cc;color:#a83b3b}
.esm-panel .card{border-radius:18px}
.esm-panel .section-title{margin-bottom:8px}
.esm-panel .lead{margin:0 0 8px;color:#4b5563}
.esm-panel .list>.row{padding:8px 10px!important}
@media (max-width:640px){.esm-panel .header{flex-direction:column;gap:8px}.esm-panel .header .row{justify-content:center}.esm-panel .header .logo img{max-width:148px}.esm-panel .btn-update{display:inline-flex}.esm-panel .list,.esm-panel .grid,.esm-panel .grid-2{gap:12px}}
/* Remove stray empty button row under list */
.esm-panel article.card>.list+.row{display:none}


/* === Timeline Feature v2: redesigned + reveal animation === */
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;700&family=Playfair+Display:wght@400;700&family=Merriweather:wght@400;700&family=Libre+Baskerville:wght@400;700&display=swap');
.esm-timeline{--tl-accent:#c9a74b; --tl-font:lora}
.esm-timeline[style*="--tl-font:lora"]{font-family:'Lora', Georgia, 'Times New Roman', serif}
.esm-timeline[style*="--tl-font:playfair"]{font-family:'Playfair Display', Georgia, serif}
.esm-timeline[style*="--tl-font:merriweather"]{font-family:'Merriweather', Georgia, serif}
.esm-timeline[style*="--tl-font:librebaskerville"]{font-family:'Libre Baskerville', Georgia, serif}
.esm-timeline .section-title h2{color:#1f1f1f;font-weight:800}
.esm-timeline .tline{list-style:none;margin:0;padding:0;position:relative}
.esm-timeline .tline::before{content:'';position:absolute;left:24px;top:0;bottom:0;width:2px;background:rgba(201,167,75,.45)}
.esm-timeline .tli{position:relative;padding-left:68px;margin:18px 0;opacity:0;transform:translateY(10px);transition:opacity .5s ease,transform .5s ease}
.esm-timeline .tli.revealed{opacity:1;transform:none}
.esm-timeline .tli::before{content:'';position:absolute;left:16px;top:8px;width:16px;height:16px;border-radius:999px;background:#fff;border:2px solid var(--tl-accent);box-shadow:0 2px 6px rgba(0,0,0,.06),inset 0 0 0 6px #fff}
.esm-timeline .tli-year{position:absolute;left:0;top:0;transform:translateY(-6px);font-weight:800;color:#4a3a0f;background:#fff;padding:2px 8px;border-radius:10px;border:1px solid rgba(201,167,75,.35)}
.esm-timeline .tli-card{background:#fff;border:1px solid rgba(201,167,75,.3);border-radius:14px;padding:12px;box-shadow:0 10px 24px rgba(0,0,0,.06)}
.esm-timeline .tli-title{font-weight:700;margin-bottom:6px;color:#1f2937}
.esm-timeline .tli-desc{color:#374151}
.esm-timeline .tli-photo{max-width:100%;height:auto;border-radius:12px;margin-top:8px;border:1px solid rgba(201,167,75,.25)}
@media(max-width:640px){.esm-timeline .tline::before{left:18px}.esm-timeline .tli{padding-left:56px}.esm-timeline .tli::before{left:10px}}
/* Admin timeline list */
.esm-panel .timeline-admin .tl-list{list-style:none;margin:0;padding:0;display:grid;gap:12px}
.esm-panel .timeline-admin .tl-item{display:grid;grid-template-columns:80px 1fr;gap:12px;border:1px dashed rgba(201,167,75,.35);border-radius:14px;padding:12px}
.esm-panel .timeline-admin .tl-year{font-weight:800;color:#6e5b09;font-size:18px}
.esm-panel .timeline-admin .tl-title{font-weight:700;margin-bottom:4px}
.esm-panel .timeline-admin .tl-photo{max-width:220px;height:auto;border-radius:12px;margin-top:8px;border:1px solid rgba(201,167,75,.25)}
.esm-panel .timeline-admin .tl-form .btn{margin-top:10px}
@media(max-width:640px){.esm-panel .timeline-admin .tl-item{grid-template-columns:60px 1fr}.esm-panel .timeline-admin .tl-photo{max-width:100%}}

/* === Timeline Feature v3 (progress line) === */
.esm-timeline{--tl-accent:#c9a74b; --tl-font:lora; --progress:0px}
.esm-timeline .section-title h2{color:#1a1a1a; font-weight:800}
.esm-timeline .tline{list-style:none;margin:0;padding:0;position:relative}
.esm-timeline .tline::before{content:'';position:absolute;left:24px;top:0;width:2px;height:var(--progress);background:rgba(201,167,75,.85);transition:height .5s ease}
.esm-timeline .tli{position:relative;padding-left:68px;margin:20px 0;opacity:0;transform:translateY(8px);transition:opacity .45s ease, transform .45s ease}
.esm-timeline .tli.revealed{opacity:1;transform:none}
.esm-timeline .tli::before{content:'';position:absolute;left:16px;top:8px;width:16px;height:16px;border-radius:999px;background:#fff;border:2px solid var(--tl-accent);box-shadow:0 2px 6px rgba(0,0,0,.06), inset 0 0 0 6px #fff}
.esm-timeline .tli-year{position:absolute;left:0;top:0;transform:translateY(-6px);font-weight:800;color:#4a3a0f;background:#fff;padding:2px 8px;border-radius:10px;border:1px solid rgba(201,167,75,.35)}
.esm-timeline .tli-card{background:#fff;border:1px solid rgba(201,167,75,.26);border-radius:14px;padding:12px;box-shadow:0 8px 20px rgba(0,0,0,.05)}
.esm-timeline .tli-title{font-weight:700;margin-bottom:6px;color:#242424}
.esm-timeline .tli-desc{color:#444}
.esm-timeline .tli-photo{max-width:100%;height:auto;border-radius:12px;margin-top:8px;border:1px solid rgba(201,167,75,.25)}
/* Font families via CSS var */
.esm-timeline[style*="--tl-font:lora"]{font-family:'Lora', Georgia, serif}
.esm-timeline[style*="--tl-font:playfair"]{font-family:'Playfair Display', Georgia, serif}
.esm-timeline[style*="--tl-font:merriweather"]{font-family:'Merriweather', Georgia, serif}
.esm-timeline[style*="--tl-font:librebaskerville"]{font-family:'Libre Baskerville', Georgia, serif}
@media(max-width:640px){
  .esm-timeline .tline::before{left:18px}
  .esm-timeline .tli{padding-left:56px}
  .esm-timeline .tli::before{left:10px}
}


/* === Timeline v4: headings/font+text-color vars, icons, and edit details === */
.esm-timeline{ color: var(--tl-text-color, #111) }
.esm-timeline .section-title h2,
.esm-timeline .tli-title{ font-family: inherit; color: var(--tl-text-color, #111) }
/* Icons inside the dot */
.esm-timeline .tli{ position:relative }
.esm-timeline .tli .tli-dot{ position:absolute; left:8px; top:4px; width:28px; height:28px; border-radius:999px; background:#fff; border:2px solid var(--tl-accent); display:flex; align-items:center; justify-content:center; box-shadow:0 2px 6px rgba(0,0,0,.06) }
.esm-timeline .tli .tli-ico{ font-size:14px; line-height:1 }
.esm-panel details.tl-edit summary{display:inline-block; cursor:pointer}
.esm-panel details.tl-edit[open]{padding-top:6px}


/* === Timeline v5: font & color variables === */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&family=Inter:wght@400;700&family=Merriweather:wght@400;700&family=Cormorant+Garamond:wght@400;700&family=Dancing+Script:wght@600&display=swap');
.esm-timeline[style*="--tl-font:system"]{font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif}
.esm-timeline[style*="--tl-font:poppins"]{font-family: "Poppins", -apple-system, "Segoe UI", Arial, sans-serif}
.esm-timeline[style*="--tl-font:inter"]{font-family: "Inter", -apple-system, "Segoe UI", Arial, sans-serif}
.esm-timeline[style*="--tl-font:merriweather"]{font-family: "Merriweather", Georgia, serif}
.esm-timeline[style*="--tl-font:cormorant"]{font-family: "Cormorant Garamond", Georgia, serif}
.esm-timeline[style*="--tl-font:dancingscript"]{font-family: "Dancing Script", cursive}

.esm-timeline .section-title h2{ color: var(--tl-title-color, #111) }
.esm-timeline .tli-title{ color: var(--tl-title-color, #111) }
.esm-timeline .tli-desc{ color: var(--tl-desc-color, #111) }
.esm-timeline .tli-year{ color: var(--tl-year-color, #111) }

/* v6: remove dot/circle next to the year */
.esm-timeline .tli::before{display:none !important}
.esm-timeline .tli .tli-dot{display:none !important}

/* v6 font map */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&family=Inter:wght@400;700&family=Merriweather:wght@400;700&family=Cormorant+Garamond:wght@400;700&display=swap');
.esm-timeline[style*="--tl-font:system"]{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,Helvetica,sans-serif}
.esm-timeline[style*="--tl-font:poppins"]{font-family:"Poppins",-apple-system,"Segoe UI",Arial,sans-serif}
.esm-timeline[style*="--tl-font:inter"]{font-family:"Inter",-apple-system,"Segoe UI",Arial,sans-serif}
.esm-timeline[style*="--tl-font:merriweather"]{font-family:"Merriweather",Georgia,serif}
.esm-timeline[style*="--tl-font:cormorant"]{font-family:"Cormorant Garamond",Georgia,serif}
.esm-timeline .section-title h2{color:var(--tl-title-color,#111);font-weight:800}
.esm-timeline .tli-title{color:var(--tl-title-color,#111)}
.esm-timeline .tli-desc{color:var(--tl-desc-color,#111)}
.esm-timeline .tli-year{color:var(--tl-year-color,#111)}


/* === v7: Font classes + spacing + active highlight === */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&family=Inter:wght@400;700&family=Merriweather:wght@400;700&family=Cormorant+Garamond:wght@400;700&display=swap');
.tl-font-system{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,Helvetica,sans-serif}
.tl-font-poppins{font-family:"Poppins",-apple-system,"Segoe UI",Arial,sans-serif}
.tl-font-inter{font-family:"Inter",-apple-system,"Segoe UI",Arial,sans-serif}
.tl-font-merriweather{font-family:"Merriweather",Georgia,serif}
.tl-font-cormorant{font-family:"Cormorant Garamond",Georgia,serif}

/* Panel spacing: web + mobile */
.container.esm-panel{padding:18px 12px}
.esm-panel .grid, .esm-panel .grid-2{gap:18px}
.esm-panel section, .esm-panel article.card{margin-bottom:18px}
.esm-panel .section-title{margin-bottom:10px}
@media(max-width:640px){
  .container.esm-panel{padding:12px 10px}
  .esm-panel section, .esm-panel article.card{margin-bottom:16px}
  .esm-panel .grid, .esm-panel .grid-2{gap:14px}
}

/* Timeline active highlight */
.esm-timeline .tli .tli-card{transition:border-color .25s ease, box-shadow .25s ease, transform .25s ease}
@media (prefers-reduced-motion:no-preference){
  .esm-timeline .tli.active .tli-card{transform:translateY(-2px) scale(1.005)}
}
.esm-timeline .tli.active .tli-card{border-color:var(--tl-accent); box-shadow:0 10px 26px rgba(0,0,0,.08)}


/* v8: counter styling & hide header chips if any slipped in */
.esm-panel .tl-count-badge{padding:6px 10px;border-radius:999px;background:#f5f7fb;border:1px solid rgba(0,0,0,.06)}
.esm-panel .header .chip.ok, .esm-panel .header .chip.wait{display:none!important}


/* === Patch 2025-09-21: Mobile logout button full width label === */
@media (max-width:640px){
  .esm-panel .btn-logout{
    width:auto; 
    height:auto; 
    padding:10px 14px; 
    text-indent:0; 
    overflow:visible;
  }
  .esm-panel .btn-logout::before{ display:none; }
}

/* === Patch 2025-09-22: Panel cliente móvil - logo sin deformación === */
@media (max-width:640px){
  .esm-panel .header .logo img{width:auto !important;height:auto !important;max-width:70vw;max-height:36px;object-fit:contain;}
}

/* === Biografía (pública + panel) — 2025-09-22 === */
.esm-bio-public{margin:18px 0}
.esm-bio-public .bio-box{
  background:#fff; border:1px solid rgba(201,167,75,.28);
  border-radius:22px; padding:18px; box-shadow:var(--shadow);
  color:#1a1a1a; line-height:1.6;
}
.esm-bio-public .bio-box p{margin:0 0 10px}
.bio-sans{font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;}
.bio-serif{font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;}
.bio-script{font-family: "Segoe Script", "Snell Roundhand", "Brush Script MT", cursive;}
.bio-card textarea{width:100%; background:#fff; border:1px solid rgba(201,167,75,.28); border-radius:12px; padding:12px; font-size:14px}
.bio-card select{width:100%; background:#fff; border:1px solid rgba(201,167,75,.28); border-radius:12px; padding:10px; font-size:14px}


/* === Patch 2025-09-22-b: Titles centered & light === */
.esm-timeline .section-title h2,
.esm-bio-public .section-title h2{
  text-align:center;
  font-weight:400;
}

/* Bio public: gold gradient background + larger text */
.esm-bio-public .bio-box{
  background: linear-gradient(135deg, #fff7d0, #f3e1a1);
  border:1px solid rgba(201,167,75,.38);
  font-size: 17px;
}

/* Panel: reduce whitespace under compartir/QR section */
.esm-panel .card .input + .row{ margin-top:8px !important; }
.esm-panel section.grid-2 + section.grid-2{ margin-top:10px !important; }

/* === Biografía (mockup) === */
.eterni-bio-title{text-align:center;font-weight:600;margin:0 0 1rem}
.eterni-bio-card{background:linear-gradient(180deg,#fff8ea 0%,#fff9ef 40%,#fff 100%);border:1px solid #e7d9b7;border-radius:18px;padding:28px 32px;box-shadow:0 2px 20px rgba(196,164,88,.15)}
.eterni-bio-content{color:#3a2f1f;font-size:clamp(16px,2vw,18px);line-height:1.9;text-align:justify;margin-bottom:18px}
.eterni-bio-quote{
  margin:24px auto 0;
  padding:28px 36px;
  background:#fffaf1;
  border:1px solid #e9ddc4;
  border-radius:14px;
  max-width:980px;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
}
.eterni-bio-quote blockquote{
  margin:0 auto;
  font-style:italic;
  font-size:clamp(20px,2.3vw,28px);
  line-height:1.6;
  text-align:center;
  color:#3f2f1f;
  font-family: "Georgia","Times New Roman",serif;
  font-weight:500;
}
.eterni-bio-quote .eterni-open,.eterni-bio-quote .eterni-close{font-size:1.2em;vertical-align:baseline}
@media (max-width:640px){.eterni-bio-card{padding:18px;border-radius:14px}.eterni-bio-content{text-align:left}.eterni-bio-quote{
  margin:24px auto 0;
  padding:28px 36px;
  background:#fffaf1;
  border:1px solid #e9ddc4;
  border-radius:14px;
  max-width:980px;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
}}


/* Timeline header (public) */
.tl-header{text-align:center;margin:0 auto 20px auto}
.tl-header .tl-desc{font-size:16px;font-style:italic;color:#53452a;margin-bottom:6px}
.tl-header .tl-title{font-size:clamp(24px,3vw,36px);font-weight:700;color:#3a2b00;margin:0}


/* Timeline responsive padding */
@media (max-width:640px){
  .esm-timeline, .eterni-timeline, .timeline-public {
    padding-left:12px;
    padding-right:12px;
  }
}


/* v12 adjustments: center and black for homage text */
.text{ text-align:center !important; color:#000 !important; }


/* v12 mobile width improvements for homage cards */
@media (max-width: 768px){
  .feed{ grid-template-columns: 1fr !important; }
  .card{ width: 100% !important; }
  .container{ padding-left: 14px; padding-right: 14px; }
}


/* v12.1: restore panel section titles */
.esm-panel section::before{
  content: attr(data-title);
  display:block;
  font-size:15px;
  font-weight:600;
  color:#000;
  margin-bottom:8px;
}


/* v12.2: section titles in client panel */
.esm-panel h2.section-title{
  font-size:15px;
  font-weight:600;
  color:#000;
  margin-bottom:8px;
}


/* v13.3 Lugar de descanso (solo botón, sin mapa) */
.rest-card{background:var(--card);border:1px solid rgba(212,175,55,.26);border-radius:18px;padding:18px;box-shadow:var(--shadow);position:relative}
.rest-title{font-weight:700;font-size:18px;color:#6e5b09;margin-bottom:6px}
.rest-addr,.rest-dirs{color:var(--text);font-size:15px;margin-top:4px}
.rest-actions{margin:10px 0}


/* v13.4: Lugar de descanso - centrado + icono en botón */
.rest-card{ text-align:center; }
.rest-actions{ margin:15px 0; text-align:center; }
.rest-actions .btn{ display:inline-flex; align-items:center; gap:6px; }
.rest-actions .btn::before{ content:"\1F4CD"; font-size:16px; line-height:1; }


/* v14.0 Apertura con Música */
#esm-music-bubble{
  position: fixed; right: 16px; bottom: 16px;
  background: #2b2b2b; color:#fff; border:none; border-radius:999px;
  padding: 10px 14px; box-shadow:0 8px 24px rgba(0,0,0,.18);
  display:flex; align-items:center; gap:8px; z-index: 9999; cursor:pointer;
}
#esm-music-bubble .icon{ font-size:16px; line-height:1; }
#esm-music-bubble .lbl{ font-size:14px; }

.esm-modal{
  position: fixed; inset:0; background: rgba(0,0,0,.45);
  display:flex; align-items:center; justify-content:center; z-index:9998;
}
.esm-modal__content{
  background:#fff; color:#222; border-radius:16px; padding:24px;
  width: min(92vw, 520px); text-align:center; box-shadow:0 10px 32px rgba(0,0,0,.2);
}
.esm-modal__text{ margin-bottom:14px; font-size:16px; }
.esm-modal__input{ width:100%; border:1px solid #e5e7eb; border-radius:12px; padding:10px 12px; margin-top:6px; outline: none; }
.esm-modal__error{ color:#b91c1c; font-size:13px; margin-top:6px; min-height:18px; }
.esm-modal__btn{ margin-top:14px; }


/* v14.1 UI polish */

/* Scroll lock while modal open */
html.esm-no-scroll, html.esm-no-scroll body { overflow: hidden; }

/* Glass morph play/pause bubble (icon-only) */
#esm-music-bubble{
  position: fixed; right: 18px; bottom: 18px;
  width: 58px; height: 58px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  display:flex; align-items:center; justify-content:center;
  z-index: 9999; cursor:pointer;
  transition: transform .15s ease, background .2s ease;
}
#esm-music-bubble:hover{ transform: translateY(-2px); background: rgba(255,255,255,0.22); }
#esm-music-bubble .icon{
  width: 16px; height: 16px; position: relative; display:block;
}
/* Play (triangle) when NOT playing */
#esm-music-bubble .icon::before{
  content:'';
  position:absolute; left:4px; top:2px;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent #111;
  opacity: .9;
}
/* Pause (two bars) when playing */
#esm-music-bubble.is-playing .icon::before{
  content:''; width: 14px; height:14px;
  position:absolute; left:2px; top:1px;
  background:
    linear-gradient(#111,#111) left center/4px 14px no-repeat,
    linear-gradient(#111,#111) right center/4px 14px no-repeat;
  border:none;
}

/* Fullscreen modal with nicer card */
.esm-modal{
  position: fixed; inset: 0;
  background: rgba(12,12,12,.55);
  display:flex; align-items:center; justify-content:center;
  z-index: 9998;
  backdrop-filter: blur(2px);
}
.esm-modal__content{
  background: radial-gradient(1200px 300px at 50% -200px, rgba(255,255,255,.8), rgba(255,255,255,.95) 60%);
  color:#1f2937; border-radius: 18px; padding: 28px;
  width: min(92vw, 560px); text-align:center;
  box-shadow: 0 16px 40px rgba(0,0,0,.25);
  transform: translateY(10px) scale(.98); opacity: 0;
  animation: esmCardIn .38s ease forwards;
  position: relative;
  overflow: hidden;
}
/* Decorative top fold / sheen */
.esm-modal__content::before{
  content:''; position:absolute; inset:0 0 auto 0; height: 28px;
  background: linear-gradient(to bottom, rgba(255,255,255,.7), rgba(255,255,255,0));
}
/* Subtle inner border */
.esm-modal__content::after{
  content:''; position:absolute; inset:0;
  border-radius:18px; border:1px solid rgba(17,24,39,.06); pointer-events:none;
}
@keyframes esmCardIn {
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.esm-modal__text{ margin-bottom:16px; font-size:17px; line-height:1.45; }
.esm-modal__input{
  width:100%; border:1px solid #e5e7eb; border-radius:12px;
  padding:10px 12px; margin-top:8px; outline: none;
}
.esm-modal__error{ color:#b91c1c; font-size:13px; margin-top:6px; min-height:18px; }
.esm-modal__btn{ margin-top:16px; }


/* v14.2 Mobile centering & safe areas */
.esm-modal{
  padding: max(env(safe-area-inset-top),16px) max(env(safe-area-inset-right),16px) max(env(safe-area-inset-bottom),16px) max(env(safe-area-inset-left),16px);
  min-height: 100dvh; /* iOS/Android modern viewport unit */
}
@media (max-width: 480px){
  .esm-modal__content{ width: 100%; border-radius:16px; padding:22px; }
  .esm-modal__text{ font-size:18px; }
}
