*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:system-ui,-apple-system,Segoe UI,sans-serif;background:#f4f7fb;color:#15233b}
:root{--nav:#0d2b4d;--line:#dce5ef;--muted:#71809a;--violet:#7445d8;--green:#23986d;--cyan:#1889a1;--orange:#d47b14;--blue:#2c6adf;--red:#cb3d4b}
button,input,textarea,select{font:inherit}button{cursor:pointer}
#app{min-height:100vh;display:grid;grid-template-columns:240px 1fr}#sidebar{position:fixed;inset:0 auto 0 0;width:240px;background:var(--nav);color:white;padding:24px 18px;overflow:auto}
.brand{display:flex;gap:12px;align-items:center;margin-bottom:22px}.brand img{width:48px;height:48px;border-radius:14px}.brand b,.brand span{display:block}.brand span{font-size:13px;opacity:.8}
#nav{display:grid;gap:6px}.nav-btn{border:0;background:transparent;color:#dce7f5;text-align:left;padding:12px 14px;border-radius:12px;font-weight:700}.nav-btn.active{background:#294662;color:white}.nav-btn .ico{display:inline-block;width:26px}.sync-badge{margin-top:18px;font-size:12px;padding:10px;border-radius:10px;background:#183957}
#main{grid-column:2;padding:28px;min-width:0}header{display:flex;justify-content:space-between;gap:20px;align-items:center;margin-bottom:24px}header h1{margin:0;font-size:30px}header p{margin:5px 0 0;color:var(--muted)}header input{width:min(340px,42vw);padding:13px 16px;border:1px solid var(--line);border-radius:14px;background:white}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.card,.item{background:white;border:1px solid var(--line);border-radius:20px;padding:20px;box-shadow:0 8px 24px rgba(16,42,75,.05)}.wide{grid-column:1/-1}.accent-blue{border-left:6px solid var(--blue)}.accent-violet{border-left:6px solid var(--violet)}.accent-green{border-left:6px solid var(--green)}.accent-cyan{border-left:6px solid var(--cyan)}.accent-orange{border-left:6px solid var(--orange)}
.quick{display:grid;grid-template-columns:1fr 1fr;gap:12px}.quick button,.primary,.secondary,.danger{border-radius:14px;padding:14px 16px;font-weight:800}.quick button,.primary{border:0}.quick .v{background:#f0eaff;color:#5b37af}.quick .g{background:#e8f6f1;color:#167454}.quick .c{background:#e7f5f8;color:#116f80}.quick .o{background:#fff1df;color:#a65f0d}.primary{background:var(--nav);color:white}.secondary{background:white;border:1px solid var(--line);color:#15233b}.danger{background:#fff0f1;color:var(--red);border:1px solid #f4c8cd}
.toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-bottom:16px}.toolbar input{flex:1;min-width:180px;padding:12px 14px;border:1px solid var(--line);border-radius:13px;background:white}.list{display:grid;gap:14px}.item h3{margin:0 0 8px}.item p{white-space:pre-wrap}.meta{font-size:13px;color:var(--muted)}.actions{display:flex;gap:8px;margin-top:14px;flex-wrap:wrap}.chip{display:inline-block;padding:5px 9px;border-radius:999px;background:#eef3fa;color:#38516f;font-size:12px;font-weight:800}.empty{padding:28px;text-align:center;color:var(--muted);border:2px dashed #d6e0eb;border-radius:18px;background:#fbfdff}
.overlay{position:fixed;inset:0;background:rgba(10,25,44,.42);display:grid;place-items:center;padding:18px;z-index:50}.hidden{display:none!important}.modal{width:min(760px,96vw);max-height:90vh;overflow:auto;background:white;border-radius:24px;box-shadow:0 30px 80px rgba(0,0,0,.22)}.modal-head{display:flex;justify-content:space-between;align-items:center;padding:20px 22px;border-bottom:1px solid var(--line)}.modal-head h2{margin:0}.icon-btn{border:0;background:#edf2f7;width:40px;height:40px;border-radius:12px;font-size:25px}
.form{padding:22px;display:grid;grid-template-columns:1fr 1fr;gap:16px}.field{display:grid;gap:7px}.field.full{grid-column:1/-1}.field label{font-weight:800}.field input,.field textarea,.field select{width:100%;padding:13px 14px;border:1px solid #cfdbe8;border-radius:12px;background:white}.field textarea{min-height:180px}.form-actions{grid-column:1/-1;display:flex;justify-content:flex-end;gap:10px;border-top:1px solid var(--line);padding-top:16px}.error{color:var(--red);font-size:13px;font-weight:700}.auth-wrap{min-height:70vh;display:grid;place-items:center}.auth{width:min(500px,100%)}.auth input{width:100%;margin:7px 0 12px;padding:13px;border:1px solid var(--line);border-radius:12px}.auth-actions{display:flex;gap:10px}
@media(max-width:850px){#app{display:block}#sidebar{top:auto;bottom:0;width:100%;height:82px;padding:8px 10px;overflow:hidden;z-index:20}.brand,.sync-badge{display:none}#nav{grid-template-columns:repeat(5,1fr);gap:4px}.nav-btn{text-align:center;font-size:12px;padding:8px 4px}.nav-btn .ico{display:block;width:auto;font-size:18px}#main{padding:22px 18px 105px}header{align-items:flex-start;flex-direction:column}header input{width:100%}.grid{grid-template-columns:1fr}.form{grid-template-columns:1fr}.field.full{grid-column:1}.modal{width:100%;max-height:94vh}}

.home-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.home-links button{display:flex;align-items:center;gap:12px;text-align:left;border:1px solid var(--line);background:#fbfdff;border-radius:14px;padding:14px;color:#15233b;font-size:20px}.home-links span{display:grid;gap:2px}.home-links b{font-size:15px}.home-links small{font-size:12px;color:var(--muted);font-weight:600}@media(max-width:850px){header h1{font-size:28px;line-height:1.08}.home-links{grid-template-columns:1fr}.home-menu{display:block}}


/* Biblia LBLA */
.bible-shell{display:grid;gap:18px}.bible-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}.bible-head h3{margin:0}.bible-controls{display:grid;grid-template-columns:minmax(180px,1fr) minmax(140px,.6fr) auto;gap:12px;align-items:end}.bible-controls>div{display:grid;gap:7px}.bible-controls label{font-weight:800}.bible-controls select,.bible-key-row input{width:100%;padding:13px 14px;border:1px solid #cfdbe8;border-radius:12px;background:white}.bible-status{padding:10px 12px;background:#f7f9fd;border-radius:12px}.bible-reader{border-top:1px solid var(--line);padding-top:18px}.bible-reader-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.bible-reader-head h2{margin:0}.bible-text{margin-top:14px;padding:22px;background:#fffdf8;border:1px solid #eadfca;border-radius:16px;white-space:pre-wrap;line-height:1.9;font-family:Georgia,'Times New Roman',serif;font-size:19px;user-select:text;-webkit-user-select:text;cursor:text}.bible-text::selection{background:#dbe8ff}.bible-key-row{display:flex;gap:10px;align-items:center}.bible-key-row input{flex:1;min-width:220px}.bible-setup{max-width:760px}.accent-violet{border-left:6px solid var(--violet)}
@media(max-width:850px){.bible-controls{grid-template-columns:1fr}.bible-head,.bible-reader-head,.bible-key-row{align-items:stretch;flex-direction:column}.bible-text{font-size:18px;padding:17px;line-height:1.85}.bible-reader-head .actions{margin-top:0}.bible-key-row input{min-width:0}}

/* Editor de prédicas v12 */
.sermon-form{padding-bottom:18px}.sermon-editor-field{gap:9px}.editor-label-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.editor-expand{padding:8px 12px;border-radius:10px}.rich-toolbar{display:flex;flex-wrap:wrap;gap:6px;padding:8px;background:#f7f9fc;border:1px solid #cfdbe8;border-bottom:0;border-radius:12px 12px 0 0;position:sticky;top:0;z-index:2}.rich-toolbar button{min-width:38px;min-height:36px;padding:7px 10px;border:1px solid #d7e0ea;border-radius:9px;background:white;color:#15233b;font-weight:700}.rich-toolbar button:active{background:#eaf0f7}.rich-editor{width:100%;min-height:420px;max-height:none;padding:18px;border:1px solid #cfdbe8;border-radius:0 0 12px 12px;background:white;line-height:1.65;font-size:17px;overflow:auto;resize:vertical;outline:none;white-space:pre-wrap;overflow-wrap:anywhere}.rich-editor:focus{border-color:#8ca8ce;box-shadow:0 0 0 3px rgba(44,106,223,.10)}.rich-editor h1,.rich-editor h2,.rich-editor h3{line-height:1.25}.editor-help{font-size:12px;color:var(--muted)}.modal.editor-fullscreen{width:calc(100vw - 28px);height:calc(100vh - 28px);max-height:none;border-radius:18px;display:flex;flex-direction:column}.modal.editor-fullscreen #modalBody{flex:1;min-height:0;overflow:auto}.modal.editor-fullscreen .sermon-form{min-height:100%;grid-template-rows:auto auto 1fr auto auto}.modal.editor-fullscreen .sermon-editor-field{min-height:0}.modal.editor-fullscreen .rich-editor{min-height:55vh;height:100%;resize:none}.modal.editor-fullscreen .form-actions{position:sticky;bottom:0;background:white;padding-bottom:4px}
@media(max-width:850px){.rich-editor{min-height:360px;font-size:16px;padding:14px}.rich-toolbar{position:static}.rich-toolbar button{min-height:40px}.modal.editor-fullscreen{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.modal.editor-fullscreen .rich-editor{min-height:52vh}}

/* V13: edición enfocada y modo lectura */
.modal.editor-focus .sermon-form>.field:not(.sermon-editor-field){display:none}
.modal.editor-focus .editor-help{display:none}
.modal.editor-focus .sermon-form{grid-template-rows:1fr auto}
.modal.editor-focus .sermon-editor-field{grid-column:1/-1;display:flex;flex-direction:column;height:100%}
.modal.editor-focus .rich-editor{flex:1;min-height:0;height:auto}
.modal.reading-fullscreen{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;padding:0;display:flex;flex-direction:column;background:#f7f4ee}
.modal.reading-fullscreen>.modal-head{display:none}
.modal.reading-fullscreen #modalBody{padding:0;overflow:auto;flex:1}
.sermon-reader{min-height:100%;background:#f7f4ee}
.reader-top{position:sticky;top:0;z-index:5;display:flex;justify-content:flex-end;padding:12px 18px;background:rgba(247,244,238,.94);backdrop-filter:blur(8px)}
.reader-page{max-width:920px;margin:0 auto;padding:28px 42px 70px;background:#fff;min-height:100vh;box-shadow:0 0 30px rgba(0,0,0,.06)}
.reader-page h1{font-size:34px;line-height:1.2;margin:0 0 10px}.reader-verse{font-size:20px;font-weight:700;color:#344765}.reader-date{font-size:14px;color:var(--muted);margin:5px 0 28px}.reader-content{font-size:22px;line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere}.reader-content h1,.reader-content h2,.reader-content h3{line-height:1.3;margin-top:1.4em}.reader-content p{margin:0 0 1em}
@media(max-width:850px){.reader-page{padding:22px 20px 60px;box-shadow:none}.reader-page h1{font-size:28px}.reader-content{font-size:20px;line-height:1.7}.reader-top{padding:10px}}
