:root {
  --bg: #e9e1cd; --card: #fffcf2; --txt: #2b2620; --mut: #7d7364; --line: #e6dcc2;
  --acc: #0f766e; --acc2: #dcefe9; --red: #c8352b; --redbg: #fbe6df; --yel: #fff3c4; --sombra: 0 2px 6px rgba(80,60,20,.14);
  --serif: Georgia, "Palatino Linotype", "Book Antiqua", serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1c1914; --card: #26221b; --txt: #efe8d8; --mut: #a39a86; --line: #3a3528; --acc: #2bb3a5; --acc2: #153b37; --redbg: #3b1f1c; --yel: #3a3417; --sombra: none; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--txt); font: 16px/1.4 -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
main { max-width: 760px; margin: 0 auto; padding: calc(10px + env(safe-area-inset-top)) 14px 20px; }
h1 { font-size: 22px; margin: 6px 0 10px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); margin: 18px 4px 6px; font-weight: 700; }
.mut { color: var(--mut); }
.vacio { text-align: center; color: var(--mut); padding: 28px 10px; }

/* captura rápida */
.captura { display: flex; gap: 8px; background: var(--card); border-radius: 16px; padding: 6px 6px 6px 14px; box-shadow: var(--sombra); border: 1px solid var(--line); }
.captura input { flex: 1; border: 0; background: none; outline: none; min-width: 0; padding: 8px 0; }
.captura button { width: 40px; height: 40px; border-radius: 12px; background: var(--acc2); font-size: 18px; }
.captura button.go { background: var(--acc); color: #fff; }
.previa { margin: 8px 4px 0; font-size: 14px; color: var(--acc); min-height: 20px; }

/* tipos rápidos */
.tipos { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 4px; scrollbar-width: none; }
.tipos::-webkit-scrollbar { display: none; }
.tipo-btn { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 66px; padding: 8px 6px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 12px; }
.tipo-btn span { font-size: 24px; line-height: 1.1; }
.tipo-btn.sel { border-color: var(--acc); background: var(--acc2); }

/* semana */
.semana-cab { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 4px; }
.semana-cab b { font-size: 17px; }
.nav button { width: 38px; height: 38px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 18px; margin-left: 6px; }
.nav button.hoy { width: auto; padding: 0 12px; font-size: 14px; }
.dia { background: var(--card); border: 1px solid var(--line); border-radius: 16px; margin-top: 10px; overflow: hidden; box-shadow: var(--sombra); }
.dia.es-hoy { border-color: var(--acc); }
.dia.pasado { opacity: .72; }
.dia-cab { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; }
.dia-cab b { font-size: 15px; }
.dia.es-hoy .dia-cab b { color: var(--acc); }
.dia-cab .mas { width: 30px; height: 30px; border-radius: 10px; background: var(--acc2); color: var(--acc); font-size: 20px; line-height: 1; }
.fila { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.fila .ico { font-size: 20px; width: 26px; text-align: center; flex: 0 0 auto; }
.fila .cuerpo { flex: 1; min-width: 0; }
.fila .tit { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila .sub { font-size: 13px; color: var(--mut); }
.fila.hecho .tit { text-decoration: line-through; color: var(--mut); }
.fila.prio { background: var(--redbg); }
.fila .hora { font-size: 13px; color: var(--acc); font-weight: 600; min-width: 42px; }
.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--mut); flex: 0 0 auto; display: grid; place-items: center; color: #fff; font-size: 14px; }
.check.on { background: var(--acc); border-color: var(--acc); }
.sin-nada { padding: 9px 12px; color: var(--mut); font-size: 14px; border-top: 1px solid var(--line); }

/* pizarra (estilo Blink: todo a la vista) */
.pizarra { column-count: 2; column-gap: 10px; }
@media (min-width: 640px) { .pizarra { column-count: 3; } }
.nota { break-inside: avoid; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; cursor: pointer; box-shadow: var(--sombra); overflow-wrap: anywhere; }
.nota.prio { background: var(--redbg); border-color: var(--red); }
.nota .t { font-weight: 600; }
.nota .n { font-size: 14px; color: var(--mut); white-space: pre-wrap; max-height: 7.5em; overflow: hidden; }
.nota .f { font-size: 12px; color: var(--acc); margin-top: 4px; }
.nota.prio .f { color: var(--red); }

/* buscador */
.respuesta { background: var(--acc2); border: 1px solid var(--acc); border-radius: 16px; padding: 14px; margin: 12px 0; }
.respuesta .grande { font-size: 20px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.chip.on { background: var(--acc); color: #fff; border-color: var(--acc); }
.chip.rojo.on { background: var(--red); border-color: var(--red); }

/* barra inferior */
.barra { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 5; }
.barra button { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--mut); padding: 4px 12px; min-width: 62px; }
.barra button span { font-size: 22px; line-height: 1.2; }
.barra button.on { color: var(--acc); font-weight: 700; }
.fab { position: fixed; right: 16px; bottom: calc(82px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; background: var(--acc); color: #fff; font-size: 30px; line-height: 1; box-shadow: 0 4px 12px rgba(0,0,0,.25); z-index: 6; }

/* hoja de edición */
.velo { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.hoja { background: var(--bg); width: 100%; max-width: 640px; max-height: 94vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
.hoja h3 { margin: 0 0 10px; font-size: 18px; }
.campo { margin-top: 12px; }
.campo label { display: block; font-size: 12px; color: var(--mut); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; font-weight: 700; }
.campo input, .campo select, .campo textarea { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.campo textarea { min-height: 90px; resize: vertical; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acciones { display: flex; gap: 8px; margin-top: 18px; }
.btn { padding: 12px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-weight: 600; }
.btn.pri { background: var(--acc); color: #fff; border-color: var(--acc); flex: 1; }
.btn.peli { color: var(--red); }
.emojis { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-top: 6px; }
.emojis button { font-size: 22px; padding: 5px 0; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.emojis button.sel { border-color: var(--acc); background: var(--acc2); }

/* login y ajustes */
.login { max-width: 320px; margin: 18vh auto 0; text-align: center; padding: 0 20px; }
.login .logo { font-size: 54px; }
.login input { width: 100%; text-align: center; font-size: 28px; letter-spacing: .4em; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); margin: 14px 0; }
.caja { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-top: 10px; }
.caja p { margin: 4px 0 8px; }
.tipo-fila { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; }
.tipo-fila:first-of-type { border-top: 0; }
.tipo-fila .i { font-size: 24px; width: 32px; text-align: center; }
#toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: #222; color: #fff; padding: 10px 16px; border-radius: 12px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: 90%; text-align: center; }
#toast.ver { opacity: 1; transform: translateX(-50%); }
#toast button { color: #8de2d8; margin-left: 10px; font-weight: 700; pointer-events: auto; }

/* ---- agenda de papel ---- */
h1, h2, .mes-nom, .pag-cab b, .semana-cab b { font-family: var(--serif); }
.papel { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 6px 6px 14px 14px; box-shadow: var(--sombra); margin-top: 14px; padding: 4px 12px 10px; }
.papel::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; border-radius: 0 0 14px 14px; background: var(--line); opacity: .7; z-index: -1; }
.anillas { height: 18px; margin: -10px -4px 2px; background: radial-gradient(circle at 10px 9px, #8a8272 0 3px, transparent 3.5px) 0 0 / 28px 18px repeat-x; }
.mes-cab { display: flex; align-items: center; justify-content: space-between; padding: 2px 0 8px; }
.mes-cab button { width: 40px; height: 40px; font-size: 22px; border-radius: 50%; color: var(--acc); }
.mes-nom { font-size: 22px; text-transform: capitalize; letter-spacing: .02em; }
.mes-nom b { font-weight: 700; }
.sem-nom, .rejilla { display: grid; grid-template-columns: repeat(7, 1fr); }
.sem-nom span { text-align: center; font-size: 12px; font-weight: 700; color: var(--mut); padding: 4px 0; }
.sem-nom span:nth-child(n+6) { color: var(--red); }
.cel { position: relative; height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 5px; gap: 2px; border-top: 1px dashed var(--line); border-radius: 0; }
.cel .num { width: 30px; height: 30px; line-height: 30px; border-radius: 50%; text-align: center; font-family: var(--serif); font-size: 16px; }
.cel.fuera .num { color: var(--mut); opacity: .45; }
.cel.hoy .num { border: 2px solid var(--acc); color: var(--acc); font-weight: 700; line-height: 26px; }
.cel.sel .num { background: var(--acc); color: #fff; border-color: var(--acc); }
.puntos { display: flex; gap: 3px; height: 6px; margin-top: -1px; }
.puntos .p { width: 5px; height: 5px; border-radius: 50%; background: var(--acc); display: block; }
.puntos .p.r { background: var(--red); }
.mes-pie { text-align: center; padding-top: 4px; }
.hoy-btn { font-size: 13px; color: var(--acc); padding: 4px 12px; }
.pagina { padding: 10px 0 4px; background-image: linear-gradient(to right, transparent 34px, rgba(200,53,43,.35) 34px, rgba(200,53,43,.35) 35px, transparent 35px); }
.pag-cab { display: flex; align-items: center; gap: 12px; padding: 0 12px 8px 12px; }
.pag-num { font-family: var(--serif); font-size: 42px; line-height: 1; color: var(--acc); min-width: 52px; text-align: center; }
.pag-cab b { font-size: 18px; }
.pag-cab > div:nth-child(2) { flex: 1; min-width: 0; }
.pag-cab .mas { width: 40px; height: 40px; border-radius: 50%; background: var(--acc); color: #fff; font-size: 26px; line-height: 1; }
.pagina .fila { border-top: 1px solid var(--line); padding-left: 12px; }
.pagina .sin-nada { padding: 14px 12px; font-family: var(--serif); font-style: italic; }
.dia, .caja, .nota, .captura, .tipo-btn, .hoja { font-family: inherit; }
.nota { box-shadow: 2px 3px 6px rgba(80,60,20,.18); border-radius: 3px 3px 10px 3px; background: var(--card); }
.barra button span { font-size: 21px; }

/* ---- adjuntos y dibujo ---- */
.adjs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 8px; }
.adjs:empty { display: none; }
.adj { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.adj img, .adj-ico { width: 100%; height: 78px; object-fit: cover; display: grid; place-items: center; font-size: 34px; background: var(--acc2); }
.adj-n { font-size: 11px; padding: 3px 6px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mut); }
.adj-x { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; }
.visor { z-index: 40; align-items: center; background: rgba(0,0,0,.8); }
.visor-in { background: var(--bg); border-radius: 18px; padding: 12px; max-width: 94vw; max-height: 94vh; overflow: auto; text-align: center; }
.visor-in img { max-width: 100%; max-height: 70vh; border-radius: 10px; }
.visor-in iframe { width: min(90vw, 640px); height: 70vh; border: 0; border-radius: 10px; background: #fff; }
.visor-in .btn { text-decoration: none; display: inline-block; text-align: center; color: var(--txt); }
#lienzo { background: #fffdf6; border: 1px solid var(--line); border-radius: 12px; touch-action: none; display: block; margin: 8px auto 0; }
.herr { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; }
.herr .col { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line); }
.herr .col.sel { box-shadow: 0 0 0 3px var(--acc); }
.herr .gro { min-width: 36px; height: 36px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; font-size: 18px; }
.herr .gro i { display: block; border-radius: 50%; background: var(--txt); }
.herr .gro.sel { border-color: var(--acc); background: var(--acc2); }

/* botones del calendario */
.mes-acc { display: flex; gap: 8px; padding: 8px 0 2px; }
.acc-btn { position: relative; flex: 1; text-align: center; padding: 10px 6px; border-radius: 12px; background: var(--acc2); color: var(--acc); font-weight: 700; font-size: 14px; border: 1px solid var(--line); overflow: hidden; cursor: pointer; }
.acc-btn.pri { background: var(--acc); color: #fff; border-color: var(--acc); }
.acc-btn input[type=date] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

/* qué hay ese día / esa semana al poner una fecha */
.choque { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 14px; display: grid; gap: 6px; }
.choque .mal { background: var(--redbg); color: var(--red); padding: 6px 8px; border-radius: 8px; font-weight: 700; }
.choque .aviso { background: var(--yel); padding: 6px 8px; border-radius: 8px; }
.choque .bien { color: var(--acc); font-weight: 700; }
.choque .sem { color: var(--mut); }

/* micrófono flotante: dictar un apunte y que se guarde solo */
.fab-mic { position: fixed; right: 22px; bottom: calc(148px + env(safe-area-inset-bottom)); width: 44px; height: 44px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); font-size: 22px; box-shadow: var(--sombra); z-index: 6; }
body.grabando .fab-mic { background: var(--red); animation: late 1s infinite; }
@keyframes late { 50% { transform: scale(1.18); } }

/* ---- ficha: título en negrita y bloques ---- */
.h-tit { width: 100%; font-family: var(--serif); font-size: 22px; font-weight: 700; padding: 8px 2px; border: 0; border-bottom: 2px solid var(--line); background: none; outline: none; margin-top: 6px; }
.h-tit:focus { border-bottom-color: var(--acc); }
.bloque { margin-top: 12px; padding: 10px 12px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.b-tit { font-size: 13px; font-weight: 700; color: var(--acc); margin-bottom: 6px; }
.bloque input, .bloque select, .bloque textarea { width: 100%; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.bloque textarea { min-height: 80px; resize: vertical; }
.bloque .campo { margin-top: 8px; }
.bloque .campo:first-of-type { margin-top: 0; }
.chip { text-decoration: none; color: var(--txt); display: inline-block; }
a.chip.off { opacity: .4; pointer-events: none; }
.fila .tit { font-weight: 700; }

/* ---- calendario compacto en el móvil: que quepa el calendario y la lista del día ---- */
.cel { height: 38px; padding-top: 2px; gap: 0; }
.cel .num { width: 26px; height: 26px; line-height: 26px; font-size: 14px; }
.cel.hoy .num { line-height: 22px; }
.puntos { height: 5px; }
.mes-cab { padding: 0 0 2px; }
.mes-cab button { width: 34px; height: 34px; }
.mes-nom { font-size: 19px; }
.sem-nom span { padding: 2px 0; font-size: 11px; }
.papel { margin-top: 8px; padding: 2px 10px 8px; }
.anillas { margin-bottom: 0; }
.mes-acc { padding: 6px 0 0; }
.acc-btn { padding: 7px 4px; font-size: 13px; }
.pag-cab { padding-bottom: 4px; }
.pag-num { font-size: 34px; min-width: 44px; }
.fila { padding: 7px 12px; }

/* ---- ordenador: menú a la izquierda, calendario y día lado a lado, semana en 7 columnas ---- */
@media (min-width: 900px) {
  body { padding-bottom: 0; padding-left: 190px; }
  main { max-width: 1280px; padding: 18px 28px 40px; }
  .barra { top: 0; bottom: auto; right: auto; left: 0; width: 190px; height: 100vh; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 20px 10px; border-top: 0; border-right: 1px solid var(--line); }
  .barra button { flex-direction: row; gap: 12px; font-size: 15px; padding: 11px 14px; border-radius: 12px; min-width: 0; width: 100%; justify-content: flex-start; }
  .barra button.on { background: var(--acc2); }
  .barra button span { font-size: 20px; }
  .fab { right: 28px; bottom: 28px; }
  .fab-mic { right: 34px; bottom: 96px; }
  .mes-grid { display: grid; grid-template-columns: minmax(380px, 460px) 1fr; gap: 22px; align-items: start; }
  .col-dia { position: sticky; top: 14px; }
  .cel { height: 62px; padding-top: 6px; }
  .cel .num { width: 32px; height: 32px; line-height: 32px; font-size: 17px; }
  .cel.hoy .num { line-height: 28px; }
  .puntos { height: 6px; }
  .mes-nom { font-size: 24px; }
  .acc-btn { padding: 10px 6px; font-size: 14px; }
  .pag-num { font-size: 52px; min-width: 64px; }
  .pagina .fila { padding: 11px 14px; }
  .sem-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: start; }
  .sem-grid .dia { margin-top: 10px; }
  .sem-grid .fila { flex-wrap: wrap; }
  .pizarra { column-count: 4; }
  .velo { align-items: center; }
  .hoja { border-radius: 22px; max-height: 90vh; }
  #toast { bottom: 30px; }
}
@media (min-width: 1500px) { .pizarra { column-count: 5; } }
.mes-grid > *, .col-cal, .col-dia { min-width: 0; }
.col-dia .tipos { max-width: 100%; }
html, body { overflow-x: hidden; }

/* Agenda: móvil = calendario, día, escribir; ordenador = calendario + escribir/tipos a la izquierda y el listado entero a la derecha */
.mes-grid { display: flex; flex-direction: column; }
.col-cal { order: 1; } .col-dia { order: 2; } .col-cap { order: 3; }
@media (min-width: 900px) {
  .mes-grid { display: grid; grid-template-columns: minmax(380px, 460px) 1fr; grid-template-rows: auto 1fr; grid-template-areas: "cal dia" "cap dia"; gap: 4px 22px; align-items: start; }
  .col-cal { grid-area: cal; } .col-cap { grid-area: cap; } .col-dia { grid-area: dia; position: static; align-self: stretch; }
  .col-dia .pagina { min-height: calc(100vh - 56px); margin-top: 8px; }
  .col-cap .tipos { flex-wrap: wrap; overflow: visible; }
  .col-cap .tipo-btn { min-width: 0; flex: 1 0 22%; }
}

/* ---- vista de ordenador estilo Outlook 2007 (>=1100 px): mes pequeño | semana por horas | lista de tareas ---- */
main.ancho { max-width: none; padding: 8px 10px 10px; }
.ol { display: grid; grid-template-columns: 236px minmax(0, 1fr) 270px; height: calc(100vh - 20px); border: 1px solid #8db2e3; border-radius: 6px; overflow: hidden; background: var(--card); }
.ol-ph { background: linear-gradient(#e6effa, #c7daf2); border-bottom: 1px solid #8db2e3; border-top: 1px solid #fff; padding: 5px 10px; font-weight: 700; font-size: 13px; color: #15428b; }
@media (prefers-color-scheme: dark) { .ol { border-color: #2f4766; } .ol-ph { background: linear-gradient(#27405f, #1d3250); border-color: #2f4766; color: #bcd3f2; } }
.ol-izq { border-right: 1px solid #8db2e3; overflow-y: auto; background: var(--bg); }
.ol-der { border-left: 1px solid #8db2e3; display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.ol-cen { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.m-cab { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 2px; font-weight: 700; text-transform: capitalize; }
.m-cab button { width: 26px; height: 26px; border-radius: 6px; color: #15428b; font-size: 18px; }
.m-sem, .m-rej { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 6px; text-align: center; }
.m-sem span { font-size: 11px; color: var(--mut); padding: 2px 0; font-weight: 700; }
.m-cel { height: 26px; font-size: 12px; border-radius: 3px; position: relative; }
.m-cel.fuera { color: var(--mut); opacity: .55; }
.m-cel.tiene { font-weight: 800; }
.m-cel.tiene::after { content: ""; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--acc); }
.m-cel.en-sem { background: #dbe8f8; }
.m-cel.hoy { outline: 1px solid #e0a31d; background: #fde9b0; color: #5b3d00; }
.m-cel.sel { background: #3b78c6; color: #fff; }
.ol-capt { padding: 6px 8px 8px; }
.ol-capt .tipos { flex-wrap: wrap; overflow: visible; padding-top: 6px; }
.ol-capt .tipo-btn { min-width: 0; flex: 1 0 28%; padding: 4px 2px; font-size: 11px; }
.ol-capt .tipo-btn span { font-size: 18px; }
.ol-capt .previa { font-size: 12px; }
.ol-cals { padding: 6px 10px 12px; display: grid; gap: 4px; }
.cal-it { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.cal-it i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.ol-bar { display: flex; align-items: center; gap: 12px; padding: 6px 10px; background: linear-gradient(#f4f8fd, #dce8f7); border-bottom: 1px solid #8db2e3; }
@media (prefers-color-scheme: dark) { .ol-bar { background: linear-gradient(#27405f, #1d3250); border-color: #2f4766; } }
.ol-modos { display: flex; gap: 0; border: 1px solid #8db2e3; border-radius: 5px; overflow: hidden; }
.ol-modos button { padding: 5px 12px; font-size: 13px; background: var(--card); border-right: 1px solid #8db2e3; }
.ol-modos button:last-child { border-right: 0; }
.ol-modos button.on { background: #fde9b0; font-weight: 700; color: #5b3d00; }
.ol-nav { display: flex; gap: 4px; margin-left: auto; }
.ol-nav button { min-width: 32px; height: 28px; padding: 0 8px; border: 1px solid #8db2e3; border-radius: 5px; background: var(--card); }
.ol-tit { font-family: var(--serif); font-size: 20px; padding: 6px 12px 4px; color: #15428b; text-transform: capitalize; }
@media (prefers-color-scheme: dark) { .ol-tit { color: #bcd3f2; } }
.ol-sem { display: flex; flex-direction: column; flex: 1; min-height: 0; --w: 48px; }
.ol-dh, .ol-td { display: grid; grid-template-columns: var(--w) repeat(var(--n), minmax(0, 1fr)); }
.ol-dh div { text-align: center; font-weight: 700; font-size: 13px; padding: 4px 0; border-left: 1px solid #b9cfe9; background: linear-gradient(#f4f8fd, #dce8f7); cursor: pointer; text-transform: capitalize; }
.ol-dh div.es-hoy { background: #fde9b0; color: #5b3d00; }
@media (prefers-color-scheme: dark) { .ol-dh div { background: #223a58; border-color: #2f4766; } .ol-dh div.es-hoy { background: #5a4a14; color: #ffe9a8; } }
.ol-td > div { border-left: 1px solid var(--line); min-height: 6px; padding: 1px 2px; }
.ol-td-it { font-size: 12px; padding: 1px 5px; margin: 1px 0; border-radius: 3px; background: color-mix(in srgb, var(--c) 18%, var(--card)); border-left: 3px solid var(--c); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-scroll { flex: 1; overflow-y: auto; min-height: 0; border-top: 1px solid #b9cfe9; }
.ol-cuerpo { display: grid; grid-template-columns: var(--w) repeat(var(--n), minmax(0, 1fr)); position: relative; }
.ol-horas { position: relative; }
.ol-hr { position: absolute; right: 6px; transform: translateY(-7px); font-size: 11px; color: var(--mut); }
.ol-col { position: relative; border-left: 1px solid #b9cfe9; cursor: cell;
  background-image: linear-gradient(to bottom, #d7e3f3 1px, transparent 1px), linear-gradient(to bottom, transparent 22px, #edf2f9 22px, #edf2f9 23px, transparent 23px);
  background-size: 100% 46px, 100% 46px; }
@media (prefers-color-scheme: dark) { .ol-col { background-image: linear-gradient(to bottom, #30445f 1px, transparent 1px), linear-gradient(to bottom, transparent 22px, #263850 22px, #263850 23px, transparent 23px); border-color: #2f4766; } }
.ol-col.es-hoy { background-color: color-mix(in srgb, #fde9b0 28%, transparent); }
.ev { position: absolute; padding: 2px 5px; font-size: 12px; line-height: 1.25; border-radius: 4px; background: color-mix(in srgb, var(--c) 20%, var(--card)); border: 1px solid var(--c); border-left-width: 4px; overflow: hidden; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.ev small { display: block; opacity: .75; }
.ev.hecho { opacity: .5; text-decoration: line-through; }
.ahora { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--red); z-index: 3; pointer-events: none; }
.ol-mes { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ol-mes-cab { display: grid; grid-template-columns: repeat(7, 1fr); }
.ol-mes-cab span { text-align: center; font-weight: 700; font-size: 12px; padding: 3px 0; background: linear-gradient(#f4f8fd, #dce8f7); border-left: 1px solid #b9cfe9; text-transform: capitalize; }
.ol-mes-rej { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 1fr; flex: 1; min-height: 0; }
.mc { border-left: 1px solid #b9cfe9; border-top: 1px solid #d7e3f3; padding: 2px 3px; overflow: hidden; cursor: pointer; min-width: 0; }
.mc.fuera { background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--mut); }
.mc.hoy { background: #fff3cf; }
.mc-n { font-size: 12px; font-weight: 700; text-align: right; }
.mini-ev { font-size: 11px; padding: 0 4px; margin-top: 1px; border-radius: 3px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 18%, var(--card)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mas-n { font-size: 11px; color: var(--mut); }
.td-nueva { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.td-nueva input { width: 100%; padding: 6px 8px; border: 1px solid #8db2e3; border-radius: 4px; background: var(--card); font-size: 13px; }
.td-lista { overflow-y: auto; flex: 1; padding-bottom: 12px; }
.td-g { background: #e8f0fa; padding: 3px 10px; font-weight: 700; font-size: 12px; color: #15428b; border-top: 1px solid #c7daf2; margin-top: 4px; }
.td-g span { font-weight: 400; color: var(--mut); }
@media (prefers-color-scheme: dark) { .td-g { background: #223a58; color: #bcd3f2; border-color: #2f4766; } }
.td-it { display: flex; gap: 8px; align-items: flex-start; padding: 5px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.td-it .check { width: 17px; height: 17px; border-radius: 3px; border-width: 1.5px; margin-top: 2px; }
.td-t { min-width: 0; font-size: 13px; }
.td-t small { display: block; color: var(--mut); font-size: 11px; }
.ol-der .sin-nada { padding: 14px; }
@media (max-width: 1099px) { .ol { display: none; } }
.ol-tit { text-transform: none; }
body:has(main.ancho) .fab { display: none; }
body:has(main.ancho) .fab-mic { bottom: 20px; right: 292px; }

/* ---- correo: buzón unificado con colores por grupo ---- */
.barra button { min-width: 0; padding: 4px 6px; }
.co { display: grid; grid-template-columns: 1fr; gap: 10px; }
.co-izq { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; align-items: center; scrollbar-width: none; }
.co-izq .co-gr { display: contents; }
.co-amb { flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; cursor: pointer; white-space: nowrap; }
.co-amb.on { background: var(--acc); color: #fff; border-color: var(--acc); }
.co-amb.gr { font-weight: 700; border-color: var(--g); }
.co-amb.gr i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--g); margin-right: 6px; }
.co-amb.sub { border-left: 4px solid var(--g, var(--line)); border-radius: 8px; }
.co-gr .co-amb.sub { border-left-color: var(--g); }
.co-amb.off { opacity: .55; }
.co-amb b { background: var(--red); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.co-nuevo { flex: 0 0 auto; }
.co-bar { display: flex; gap: 6px; }
.co-bar input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.co-filtros { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 8px 0; }
.co-filtros .chip { padding: 4px 10px; font-size: 12px; }
.co-filtros .sep { width: 1px; height: 18px; background: var(--line); margin: 0 3px; }
.co-filtros select { padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-size: 12px; margin-left: auto; }
.co-aviso { background: var(--yel); border-radius: 10px; padding: 8px 10px; font-size: 13px; margin-bottom: 8px; }
.co-err { background: var(--redbg); color: var(--red); border-radius: 10px; padding: 8px 10px; font-size: 12px; margin-bottom: 8px; }
.co-fila { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--g); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; cursor: pointer; min-width: 0; }
.co-fila.sel { outline: 2px solid var(--acc); }
.co-fila.nuevo .co-de, .co-fila.nuevo .co-as { font-weight: 700; }
.co-de { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.co-f { color: var(--mut); font-size: 12px; font-weight: 400; flex: 0 0 auto; }
.co-as { font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.co-cu { font-size: 11px; color: var(--g); font-weight: 700; margin-top: 2px; }
.co-lector { display: none; }
.co.leyendo .co-lista, .co.leyendo .co-izq { display: none; }
.co.leyendo .co-lector { display: block; }
.co-cab { background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--g); border-radius: 12px; padding: 10px 12px; }
.co-cab h2 { margin: 6px 0; font-size: 18px; text-transform: none; letter-spacing: 0; color: var(--txt); font-family: var(--serif); }
.co-meta { font-size: 12px; color: var(--mut); overflow-wrap: anywhere; }
.co-tag { color: var(--g); font-weight: 700; }
.co-acc, .co-adj { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.co-acc .chip, .co-adj .chip { padding: 5px 10px; font-size: 13px; }
.co-iframe { width: 100%; height: 62vh; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-top: 8px; }
@media (min-width: 900px) {
  .co { grid-template-columns: 230px minmax(320px, 400px) minmax(0, 1fr); height: calc(100vh - 20px); gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
  .co-izq { flex-direction: column; align-items: stretch; overflow-y: auto; padding: 10px; border-right: 1px solid var(--line); gap: 3px; }
  .co-izq .co-gr { display: block; margin-top: 8px; }
  .co-amb { border-radius: 8px; overflow: hidden; text-overflow: ellipsis; }
  .co-amb.sub { margin: 2px 0 0 10px; font-size: 12px; }
  .co-lista { overflow-y: auto; padding: 10px; border-right: 1px solid var(--line); min-height: 0; }
  .co-lector { display: block; overflow-y: auto; padding: 10px; min-height: 0; }
  .co.leyendo .co-lista, .co.leyendo .co-izq { display: block; }
  .co.leyendo .co-izq { display: flex; flex-direction: column; }
  .co-atras { display: none; }
  .co-iframe { height: calc(100vh - 250px); }
}
.pos-op { display: grid; gap: 6px; margin-top: 4px; }
.pos-op .btn { text-align: left; }
.co-vuelven { margin-bottom: 8px; padding: 6px; border-radius: 12px; background: var(--yel); }
.co-vt { font-weight: 700; font-size: 12px; margin: 0 0 6px 4px; }
.pw { position: relative; }
.pw input { padding-right: 46px !important; }
.ojo { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; font-size: 18px; border-radius: 8px; opacity: .75; }
.login .pw .ojo { top: 50%; }
.cu-fila { border-left: 5px solid var(--g); background: var(--bg); border-radius: 10px; padding: 8px 10px; margin-top: 8px; }
.cu-t { min-width: 0; }
.cu-t b { display: block; overflow-wrap: anywhere; font-size: 15px; }
.cu-t .mut { font-size: 12px; }
.cu-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cu-btns .chip { padding: 6px 12px; font-size: 13px; white-space: nowrap; }

/* ---- lector de correo compacto (como Gmail/Outlook en el móvil): iconos arriba, el mensaje ocupa casi toda la pantalla, respuestas abajo ---- */
.co.leyendo .co-lector { display: flex; flex-direction: column; height: calc(100dvh - 96px); min-height: 320px; }
.co-cab { padding: 4px 10px 8px; border-top-width: 4px; border-radius: 12px; position: relative; }
.co-barra { display: flex; align-items: center; gap: 2px; position: relative; }
.co-ic { width: 38px; height: 38px; border-radius: 50%; font-size: 19px; flex: 0 0 auto; }
.co-ic:active { background: var(--acc2); }
.co-atras { font-size: 30px; line-height: 1; color: var(--acc); }
.co-cta { flex: 1; min-width: 0; font-size: 11px; color: var(--g); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 2px; }
.co-asu { font-family: var(--serif); font-size: 16px; font-weight: 700; line-height: 1.25; margin: 0 2px 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.co-rem { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 2px; cursor: pointer; }
.co-rem b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.co-rem span { color: var(--mut); white-space: nowrap; font-size: 12px; }
.co-meta { font-size: 12px; color: var(--mut); margin: 4px 2px 0; overflow-wrap: anywhere; }
.co-adj { display: flex; gap: 6px; overflow-x: auto; margin-top: 6px; padding-bottom: 2px; scrollbar-width: none; }
.co-adj .chip { flex: 0 0 auto; }
.co-img { font-size: 12px; background: var(--yel); border-radius: 8px; padding: 4px 8px; margin-top: 6px; display: flex; justify-content: space-between; align-items: center; }
.co-img button { color: var(--acc); font-weight: 700; padding: 2px 8px; }
.co-iframe { flex: 1; min-height: 0; height: auto !important; margin-top: 6px; }
.co-resp { display: flex; gap: 6px; padding-top: 6px; }
.co-resp button { flex: 1; padding: 11px 4px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: 13px; }
.co-menu { position: absolute; right: 2px; top: 40px; z-index: 12; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.28); padding: 4px; min-width: 220px; }
.co-mi { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.co-mi:active { background: var(--acc2); }
body:has(.co.leyendo) .fab, body:has(.co.leyendo) .fab-mic { display: none; }
@media (min-width: 900px) {
  .co-lector { display: flex !important; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
  .co.leyendo .co-lector { height: 100%; }
  .co-atras { display: none; }
  .co-cab { margin: 0; }
  body:has(.co) .fab-mic { display: none; }
}

/* correo guardado: indicador de actualización y botón ↻ */
.co-est { font-size: 11px; color: var(--mut); margin: -2px 2px 6px; min-height: 14px; }
.co-ref.girando { animation: gira 1s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
