: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: minmax(0, 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); } }

/* ---- correo: selección múltiple y gestos de deslizar ---- */
.co-sw { position: relative; margin-bottom: 6px; border-radius: 10px; overflow: hidden; }
.co-sw .co-fila { margin-bottom: 0; touch-action: pan-y pinch-zoom; position: relative; z-index: 1; user-select: none; -webkit-user-select: none; transition: transform .18s; }
.co-sw-bg { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13px; color: #fff; }
.co-sw-bg span { flex: 1; padding: 0 16px; height: 100%; display: flex; align-items: center; opacity: 0; }
.co-sw-bg .izq { background: #3b78c6; }
.co-sw-bg .der { background: var(--red); justify-content: flex-end; }
.co-sw.va-izq .co-sw-bg .izq, .co-sw.va-der .co-sw-bg .der { opacity: .7; }
.co-sw.va-izq.listo .co-sw-bg .izq, .co-sw.va-der.listo .co-sw-bg .der { opacity: 1; }
.co-chk { display: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--mut); flex: 0 0 auto; align-items: center; justify-content: center; font-size: 13px; color: #fff; float: left; margin: 2px 8px 0 0; }
.co.seleccion .co-chk { display: inline-flex; }
.co-fila.marcado { background: var(--acc2); }
.co-fila.marcado .co-chk { background: var(--acc); border-color: var(--acc); }
.co-selbar { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; gap: 6px; background: var(--acc); color: #fff; border-radius: 12px; padding: 6px 8px; margin-bottom: 8px; flex-wrap: wrap; }
.co-selbar button { color: #fff; padding: 6px 9px; border-radius: 8px; background: rgba(255,255,255,.18); font-size: 13px; font-weight: 700; }
.co-selbar .mut { color: rgba(255,255,255,.8); font-size: 12px; }
.co-selbar .sp { flex: 1; }
@media (min-width: 900px) {
  .co-chk { display: inline-flex; opacity: .35; }
  .co-fila:hover .co-chk, .co.seleccion .co-chk { opacity: 1; }
}
.co-ff { width: 100%; padding: 8px 12px; margin-top: 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 13px; }

/* carpetas del correo */
.co-carp { display: contents; }
.co-cb { flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.co-cb.on { background: var(--acc); color: #fff; border-color: var(--acc); font-weight: 700; }
@media (min-width: 900px) {
  .co-carp { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
  .co-cb { text-align: left; border-radius: 8px; border: 0; background: none; }
  .co-cb.on { background: var(--acc2); color: var(--acc); }
}

/* barra de selección del correo: siempre visible (fija encima del menú en el móvil) */
html, body { overflow-x: clip; }
@media (max-width: 899px) {
  .co-selbar { position: fixed; left: 8px; right: 8px; top: auto; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 40; box-shadow: 0 6px 20px rgba(0,0,0,.35); margin: 0; padding: 8px; justify-content: space-between; }
  .co-selbar button { flex: 0 0 auto; padding: 9px 11px; font-size: 14px; }
  .co-selbar .mut { display: none; }
  .co.seleccion .co-lista { padding-bottom: 90px; }
}

/* ================= optimización para el móvil (≤ 899 px) ================= */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overscroll-behavior-y: contain; -webkit-touch-callout: none; }
button, .chip, .tipo-btn, .cel, .barra button, .fab, .fab-mic, .co-amb, .co-cb { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
@media (max-width: 899px) {
  /* campos de 16 px: el móvil no hace zoom solo al tocarlos */
  input, select, textarea { font-size: 16px !important; }
  main { padding-left: 10px; padding-right: 10px; }

  /* barra inferior: 6 pestañas repartidas por igual y respetando el borde del móvil */
  .barra { padding: 3px 2px calc(3px + env(safe-area-inset-bottom)); gap: 0; }
  .barra button { flex: 1 1 0; min-width: 0; padding: 5px 0 3px; font-size: 10.5px; line-height: 1.1; }
  .barra button span { font-size: 21px; line-height: 1.15; }
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }

  /* botones y filas fáciles de pulsar con el dedo */
  .chip { min-height: 38px; display: inline-flex; align-items: center; }
  .btn { min-height: 44px; }
  .fila { min-height: 50px; }
  .co-fila { padding: 10px 12px; }
  .co-cb, .co-amb { min-height: 36px; display: inline-flex; align-items: center; }
  .dia-cab .mas, .mes-cab button, .nav button { min-width: 42px; min-height: 42px; }
  .tipo-btn { min-width: 62px; min-height: 58px; }
  .cel { min-height: 40px; }

  /* botones flotantes más pequeños y sin tapar el contenido */
  .fab { width: 52px; height: 52px; right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); font-size: 28px; }
  .fab-mic { width: 42px; height: 42px; right: 19px; bottom: calc(134px + env(safe-area-inset-bottom)); }
  main { padding-bottom: 96px; }

  /* fichas y ventanas: ocupan casi toda la pantalla, con el título y los botones Guardar/Cancelar siempre a la vista */
  .velo { overscroll-behavior: contain; }
  .hoja { max-height: 96dvh; border-radius: 20px 20px 0 0; padding: 0 14px; }
  .hoja h3 { position: sticky; top: 0; z-index: 6; margin: 0; padding: 14px 0 8px; background: var(--bg); }
  .hoja .acciones { position: sticky; bottom: 0; z-index: 6; margin: 14px -14px 0; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); background: var(--bg); box-shadow: 0 -8px 14px -10px rgba(0, 0, 0, .35); }
  .hoja .tipos { padding-top: 2px; }
  .velo.visor { align-items: center; }
  .visor-in { max-width: 98vw; }

  /* correo: lista y lector aprovechan toda la altura */
  .co.leyendo .co-lector { height: calc(100dvh - 82px - env(safe-area-inset-bottom)); }
  .co-iframe { border-radius: 10px; }

  /* con el teclado abierto se esconden la barra de pestañas y los botones flotantes */
  body.teclado .barra, body.teclado .fab, body.teclado .fab-mic { display: none; }
  body.teclado { padding-bottom: 0; }

  /* semana y pizarra */
  .pizarra { column-count: 2; column-gap: 8px; }
  .nota { margin-bottom: 8px; }
  h1 { font-size: 20px; }
}
@media (max-width: 380px) {
  .barra button { font-size: 9.5px; }
  .barra button span { font-size: 19px; }
  .co-selbar button { padding: 8px 8px; font-size: 13px; }
}

/* lector de correo en móvil: sin barra de pestañas debajo y con la barra de responder más baja */
@media (max-width: 899px) {
  body:has(.co.leyendo) .barra { display: none; }
  body:has(.co.leyendo) { padding-bottom: 0; }
  body:has(.co.leyendo) main { padding-bottom: 0; }
  .co.leyendo .co-lector { height: calc(100dvh - 20px - env(safe-area-inset-top)); }
  .co-resp { gap: 6px; padding: 5px 0 calc(4px + env(safe-area-inset-bottom)); }
  .co-resp button { padding: 7px 4px; min-height: 36px; font-size: 13px; border-radius: 10px; }
}

/* barra de responder con su propio color, para que se distinga del fondo del correo */
.co-resp { background: var(--acc); border-radius: 14px; padding: 6px; margin-top: 6px; box-shadow: 0 -2px 8px rgba(0, 0, 0, .18); }
.co-resp button { background: rgba(255, 255, 255, .2); border: 0; color: #fff; font-weight: 700; }
.co-resp button:active { background: rgba(255, 255, 255, .35); }
@media (max-width: 899px) { .co-resp { padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); } }

/* repetición «cada N …» */
.rep-fila { display: flex; align-items: center; gap: 8px; }
.rep-fila input { width: 76px !important; flex: 0 0 auto; text-align: center; }
.rep-fila select { flex: 1; }
.rep-info { font-size: 13px; color: var(--acc); margin-top: 6px; font-weight: 600; }
#h-sig { display: block; margin-top: 8px; text-align: left; white-space: normal; line-height: 1.3; background: var(--acc2); border-color: var(--acc); color: var(--acc); font-weight: 700; }
#h-sig[hidden] { display: none; }

/* barras de día en la lista de correo */
.co-dia { position: sticky; top: 0; z-index: 3; margin: 10px -2px 6px; padding: 5px 10px; border-radius: 8px; background: var(--acc2); color: var(--acc); font-weight: 800; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.co-lista > .co-dia:first-of-type { margin-top: 2px; }

/* lista de correo limpia: filas de dos líneas con avatar (como Gmail / Outlook / Spark) */
.co-lista .co-fila { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-left: 0; border-radius: 12px; background: var(--card); margin-bottom: 4px; }
.co-lista .co-sw .co-fila { margin-bottom: 0; }
.co-av { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 17px; color: #fff; background: var(--g, var(--acc)); }
.co-cx { flex: 1; min-width: 0; }
.co-lista .co-de { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: 15px; }
.co-nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-lista .co-f { flex: 0 0 auto; font-size: 12px; color: var(--mut); }
.co-lista .co-as { font-size: 13.5px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.co-fila.nuevo .co-nom, .co-fila.nuevo .co-as { font-weight: 700; color: var(--txt); }
.co-fila.nuevo .co-f { color: var(--acc); font-weight: 700; }
.co-pt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--acc); margin-right: 6px; vertical-align: 1px; }
.co-lista .co-cu { display: none; }
.co-lista .co-chk { margin: 0; float: none; flex: 0 0 auto; }
.co.seleccion .co-lista .co-av { display: none; }
.co-lista .co-fila.marcado { background: var(--acc2); }
.co-vermas { display: block; width: calc(100% - 4px); margin: 10px 2px 24px; padding: 13px; border-radius: 12px; background: var(--card); border: 1px solid var(--acc); color: var(--acc); font-weight: 800; font-size: 14px; }
.co-vermas small { font-weight: 400; color: var(--mut); }
.co-f2 { margin-top: -2px; }
@media (min-width: 900px) { .co-lista .co-chk { display: inline-flex; } .co-lista .co-av { width: 34px; height: 34px; font-size: 14px; } }

/* ---------- Inicio ---------- */
.in-cab { margin: 4px 2px 8px; }
.in-saludo { font: 700 26px/1.15 var(--serif); }
.in-busca { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 2px 12px; box-shadow: var(--sombra); }
.in-busca input { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 10px 0; }
.in-pills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.in-pill { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 9px 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sombra); }
.in-pill b { font-size: 17px; }
.in-pill span { font-size: 11px; color: var(--mut); }
.in-pill.rojo { background: var(--redbg); border-color: var(--red); }
.in-sig { margin-top: 12px; background: linear-gradient(135deg, var(--acc), #14917f); color: #fff; border-radius: 18px; padding: 14px 16px; box-shadow: 0 4px 12px rgba(15,118,110,.3); cursor: pointer; }
.in-sig.vacia { background: var(--card); color: var(--txt); border: 1px dashed var(--line); box-shadow: none; cursor: default; }
.in-sig-t { font-size: 11px; letter-spacing: .08em; font-weight: 700; opacity: .85; }
.in-sig-n { font: 700 20px/1.25 var(--serif); margin: 3px 0 2px; }
.in-sig-s { font-size: 14px; opacity: .92; }
.in-sig-b { display: flex; gap: 8px; margin-top: 10px; }
.in-sig-b .chip { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.4); color: #fff; }
.in-sem { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.in-d { display: flex; flex-direction: column; align-items: center; padding: 6px 0 4px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.in-d small { font-size: 11px; color: var(--mut); text-transform: uppercase; }
.in-d b { font-size: 17px; }
.in-d span { height: 8px; display: flex; gap: 2px; align-items: center; }
.in-d i.p { width: 5px; height: 5px; border-radius: 50%; background: var(--acc); }
.in-d i.p.r { background: var(--red); }
.in-d.hoy { background: var(--acc); border-color: var(--acc); color: #fff; }
.in-d.hoy small { color: #fff; opacity: .85; }
.in-d.hoy i.p { background: #fff; }
.in-mas { display: block; width: 100%; padding: 10px; border-top: 1px solid var(--line); color: var(--acc); font-weight: 600; font-size: 14px; }
.in-mail { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.in-mail:first-child { border-top: 0; }
.in-mail .co-av { flex: 0 0 auto; }
.in-mx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.in-mx b, .in-mx span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.in-mx span { font-size: 13px; color: var(--mut); }
.in-mail small { color: var(--mut); font-size: 12px; flex: 0 0 auto; }
.in-pd { display: flex; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.in-pd:first-child { border-top: 0; }
.in-pd > b { flex: 0 0 76px; color: var(--acc); font-size: 13px; }
.in-pd > div { display: flex; flex-direction: column; min-width: 0; }
.in-pd span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 900px) {
  main:has(.in-cab) { max-width: 1000px; }
  .in-pills { grid-template-columns: repeat(4, 140px); }
}
.co-est { display: flex; align-items: center; gap: 8px; }
.co-hist { margin-left: auto; order: 2; display: flex; gap: 6px; }
.co-hist button { padding: 3px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 12px; color: var(--acc); font-weight: 600; }
.co-hist button:disabled { opacity: .35; }
.r-sug { margin-top: 6px; }
.r-sug:empty { display: none; }
.r-acc { flex-wrap: wrap; }
.r-acc .btn { flex: 1 1 auto; }
.r-prog { margin: 8px 0; }
.co-cb small { background: var(--acc); color: #fff; border-radius: 999px; padding: 0 6px; margin-left: 4px; font-size: 11px; }
[data-bor-abrir] .co-ic { flex: 0 0 auto; }

/* ---------- subtareas y vista Próximos ---------- */
.sub-fila { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.sub-fila .sub-t { flex: 1; min-width: 0; border: 0; border-bottom: 1px dashed var(--line); background: none; padding: 6px 2px; outline: none; }
.sub-fila.hecha .sub-t { text-decoration: line-through; color: var(--mut); }
.sub-fila .check { width: 26px; height: 26px; flex: 0 0 auto; border: 2px solid var(--mut); border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; }
.sub-fila .check.on { background: var(--acc); border-color: var(--acc); }
.sub-x { color: var(--mut); padding: 4px 8px; }
.sub-add { display: flex; gap: 8px; margin-top: 6px; }
.sub-add input { flex: 1; min-width: 0; }
.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; margin: 4px 0 10px; }
.seg button { flex: 1; padding: 7px 4px; border-radius: 9px; font-size: 14px; color: var(--mut); }
.seg button.on { background: var(--acc); color: #fff; font-weight: 700; }
.prox-filtros { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; align-items: center; }
.prox-filtros .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.prox-mes { margin: 18px 4px 4px; font: 700 18px var(--serif); color: var(--acc); border-bottom: 2px solid var(--acc2); }
.prox-cab { display: flex; align-items: center; justify-content: space-between; margin: 14px 4px 0; }
.prox-cab b { font-size: 14px; color: var(--mut); text-transform: uppercase; letter-spacing: .04em; }
.prox-dia.hoy .prox-cab b { color: var(--acc); }
.prox-cab .mas { width: 28px; height: 28px; border-radius: 50%; background: var(--acc2); color: var(--acc); font-size: 18px; }
.in-link { float: right; color: var(--acc); font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 600; }
@media (min-width: 1100px) { .seg { max-width: 420px; } }

/* semana de la ficha: una línea por día */
.sd-tit { margin: 10px 0 4px; font-size: 12px; color: var(--mut); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.sd-lista { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); margin-bottom: 8px; }
.sd { display: flex; gap: 10px; padding: 7px 10px; border-top: 1px solid var(--line); }
.sd:first-child { border-top: 0; }
.sd.sel { background: var(--acc2); }
.sd.hoy .sd-d b { color: var(--acc); }
.sd-d { flex: 0 0 52px; font-size: 14px; }
.sd-d b { text-transform: capitalize; }
.sd-c { flex: 1; min-width: 0; font-size: 14px; }
.sd-it { display: flex; gap: 8px; padding: 1px 0; }
.sd-h { flex: 0 0 40px; color: var(--acc); font-weight: 600; font-size: 13px; }
.sd-t { flex: 1; min-width: 0; }
.sd-libre { color: var(--mut); font-style: italic; }
.choque-btn { width: 100%; text-align: left; margin: 6px 0; font-size: 13px; color: var(--mut); }

/* iconos de tipos: en filas, todos a la vista (sin deslizar de lado) */
.tipos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; overflow: visible; padding: 10px 0 4px; }
.tipo-btn { min-width: 0; padding: 6px 2px; font-size: 11px; line-height: 1.15; }
.tipo-btn span { font-size: 22px; }

/* Próximos estilo «Programación» de Google */
.px-sem { margin: 14px 4px 2px; font-size: 12px; color: var(--mut); letter-spacing: .04em; }
.px-dia { display: flex; gap: 10px; padding: 6px 0; align-items: flex-start; }
.px-f { flex: 0 0 46px; text-align: center; cursor: pointer; line-height: 1.1; }
.px-f small { display: block; font-size: 12px; color: var(--mut); text-transform: capitalize; }
.px-f b { font-size: 22px; }
.px-dia.hoy .px-f b { background: var(--acc); color: #fff; border-radius: 50%; display: inline-block; width: 34px; height: 34px; line-height: 34px; font-size: 18px; }
.px-dia.hoy .px-f small { color: var(--acc); font-weight: 700; }
.px-l { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.px-p { display: flex; align-items: center; gap: 8px; background: var(--c); color: #fff; border-radius: 12px; padding: 9px 12px; cursor: pointer; }
.px-p.hecho { opacity: .55; text-decoration: line-through; }
.px-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.px-h { flex: 0 0 auto; font-size: 12px; opacity: .92; }
.px-ck { flex: 0 0 auto; width: 22px; height: 22px; border: 2px solid #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.px-ck.on { background: #fff; color: var(--c); }

/* Mes en cuadrícula estilo Google Calendar */
.mg-cab { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.mg-cab b { flex: 1; font: 700 20px var(--serif); }
.mg-cab button:not(.chip) { width: 38px; height: 38px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 18px; }
.mg-sem { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; color: var(--mut); margin-bottom: 3px; }
.mg { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.mg-c { min-height: 92px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px 2px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; overflow: hidden; }
.mg-c.fuera { opacity: .5; }
.mg-n { font-size: 13px; font-weight: 700; text-align: center; }
.mg-c.hoy .mg-n { background: var(--acc); color: #fff; border-radius: 999px; width: 22px; margin: 0 auto; }
.mg-e { display: block; background: var(--c); color: #fff; border-radius: 5px; padding: 1px 3px; font-size: 10.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-mas { font-size: 10px; color: var(--mut); text-align: center; }
@media (min-width: 900px) { .mg-c { min-height: 120px; } .mg-e { font-size: 12px; } main:has(.mg) { max-width: 1100px; } }

/* enviar con deshacer y plantillas */
#envio-bar { position: fixed; left: 12px; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 30; display: flex; flex-direction: column; gap: 6px; }
.envio-fila { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #2b2620; color: #fff; border-radius: 14px; padding: 10px 14px; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.envio-fila span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.envio-fila button { color: #7ee0d3; font-weight: 700; padding: 4px 8px; }
@media (min-width: 900px) { #envio-bar { left: 210px; right: auto; width: 360px; bottom: 24px; } }
.plan-lista { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.plan-fila { display: inline-flex; align-items: center; }

/* menú del ＋ y vista previa del correo */
.hoja-baja { max-height: none; }
.tipos-menu { grid-template-columns: repeat(5, 1fr); margin-bottom: 8px; }
.menu-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 10px; }
.menu-extra .btn { text-align: left; font-size: 14px; padding: 12px; }
.co-pv { color: var(--mut); font-weight: 400; }

/* traducir correo, vista anual */
.co-trad { margin: 6px 0 2px; font-size: 13px; color: var(--mut); }
.co-trad button { background: var(--acc2); color: var(--acc); font-weight: 600; border-radius: 999px; padding: 5px 12px; }
.an { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.an-mes { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 8px 6px; }
.an-t { font: 700 15px var(--serif); color: var(--acc); margin-bottom: 4px; text-align: left; width: 100%; }
.an-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; text-align: center; }
.an-d { font-size: 11px; padding: 3px 0; border-radius: 6px; color: var(--txt); position: relative; }
.an-d.ocu1 { background: var(--acc2); font-weight: 700; }
.an-d.ocu2 { background: var(--acc); color: #fff; font-weight: 700; }
.an-d.rojo { box-shadow: inset 0 -2px 0 var(--red); }
.an-d.hoy { outline: 2px solid var(--yel); background: #f2c230; color: #2b2620; }
@media (min-width: 700px) { .an { grid-template-columns: repeat(3, 1fr); } .an-d { font-size: 12px; } }
@media (min-width: 1100px) { main:has(.an) { max-width: 1100px; } .an { grid-template-columns: repeat(4, 1fr); } }

/* menú de carpetas y cuentas del correo: desplegable en el móvil */
.co-movil { display: none; }
.co-cont { display: contents; }
@media (max-width: 899.98px) {
  .co-izq { display: block; overflow: visible; padding-bottom: 6px; }
  .co-movil { display: flex; gap: 8px; align-items: stretch; }
  .co-sel { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; padding: 10px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-weight: 700; }
  .co-sel span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .co-sel small { font-weight: 400; color: var(--mut); }
  .co-sel b { display: flex; align-items: center; gap: 6px; color: var(--mut); }
  .co-sel em { font-style: normal; background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; }
  .co-cont { display: none; margin-top: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; max-height: 62vh; overflow-y: auto; }
  .co-izq.abierto .co-cont { display: block; }
  .co-cont .co-nuevo { display: none; }
  .co-carp { display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
  .co-cb { display: block; width: 100%; text-align: left; border-radius: 8px; border: 0; background: none; padding: 10px 10px; font-size: 15px; }
  .co-cb.on { background: var(--acc2); color: var(--acc); }
  .co-izq .co-gr { display: block; margin-top: 8px; }
  .co-amb { display: block; width: 100%; border-radius: 8px; padding: 9px 10px; font-size: 14px; background: none; border: 0; white-space: normal; }
  .co-amb.on { background: var(--acc2); color: var(--acc); }
  .co-amb.gr { border-left: 4px solid var(--g); border-radius: 8px; }
  .co-amb.sub { margin: 2px 0 0 12px; width: calc(100% - 12px); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
}
@media (min-width: 900px) { .co-movil { display: none; } .co-cont { display: contents; } }

/* insignias del menú de abajo, confirmación de lectura y arrastre de citas */
.barra button span { position: relative; display: inline-block; }
.barra .nb { position: absolute; top: -3px; right: -12px; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font: 700 11px/18px sans-serif; font-style: normal; text-align: center; box-shadow: 0 0 0 2px var(--card); }
.co-recibo { margin: 6px 0; padding: 8px 10px; background: var(--yel); border-radius: 10px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.co-recibo button { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-weight: 600; }
.ev { cursor: grab; }
.ev.arrastrando { opacity: .85; z-index: 50; box-shadow: 0 6px 16px rgba(0,0,0,.3); cursor: grabbing; pointer-events: none; transition: none; }
.ol-col.destino { background: var(--acc2); }

/* hilos y editor de contactos */
.co-hilo { display: inline-block; min-width: 18px; padding: 0 5px; margin-right: 6px; border-radius: 999px; background: var(--acc2); color: var(--acc); font-size: 11px; font-weight: 700; text-align: center; }
.con-lista { margin-top: 8px; max-height: 320px; overflow-y: auto; }
.con-fila { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.con-t { flex: 1; min-width: 0; display: flex; flex-direction: column; cursor: pointer; }
.con-t b, .con-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* resumen con IA */
.co-resumen { margin: 8px 0; padding: 10px 12px; background: var(--acc2); border-radius: 12px; font-size: 14px; line-height: 1.45; }
.co-resumen b { color: var(--acc); }
.co-resumen button { margin-top: 6px; color: var(--mut); font-size: 12px; }

/* ajuste de ancho: nada se sale por la derecha (las columnas «1fr» crecían con el texto y se cortaban) */
.tipos, .tipos-menu { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tipo-btn { min-width: 0; overflow: hidden; font-size: 10.5px; }
.tipo-btn { white-space: nowrap; text-overflow: ellipsis; }
.tipo-btn span { display: block; }
.menu-extra { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.menu-extra .btn { white-space: normal; min-width: 0; line-height: 1.25; }
.in-pills { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.in-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.seg button { min-width: 0; padding: 7px 2px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-sem, .an-g { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.an { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hoja { overflow-x: hidden; }
.hoja .acciones { flex-wrap: wrap; }
.hoja .acciones .btn { min-width: 0; }

/* firma visible en el mensaje nuevo */
.r-firma { margin: 4px 0 10px; font-size: 13px; }
.firma-vista { margin: 4px 0 0; padding: 8px 10px; background: var(--acc2); border-radius: 10px; white-space: pre-wrap; font: 13px/1.35 inherit; color: var(--txt); max-height: 110px; overflow: auto; }
.firma-vista { font-family: inherit; font-size: 14px; line-height: 1.4; }

/* títulos largos: las barras de «todo el día» se ven en dos líneas (y con el ratón encima sale el título entero) */
.ol-td-it { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; word-break: break-word; }

/* ---- Correo: burbujas fijas, cuentas por colores, tarjetas con logo y bloqueos (11/10/2026) ---- */
.co-burb { display: flex; justify-content: space-between; gap: 4px; padding: 2px 0 8px; }
.co-bub { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0; font-size: 10.5px; color: var(--mut); cursor: pointer; }
.co-bub i { position: relative; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 21px; border: 2px solid transparent; }
.co-bub span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-bub.on { color: var(--txt); font-weight: 700; }
.co-bub.on i { border-color: var(--txt); }
.co-bub.b-in i { background: #F5C4B3; } .co-bub.b-fac i { background: #9FE1CB; } .co-bub.b-imp i { background: #FAC775; }
.co-bub.b-nol i { background: #B5D4F4; } .co-bub.b-spam i { background: #F7C1C1; } .co-bub.b-bloq i { background: #D3D1C7; }
.co-bub em { position: absolute; top: -4px; right: -4px; min-width: 18px; padding: 1px 5px; border-radius: 999px; background: #444441; color: #fff; font-size: 10px; font-style: normal; font-weight: 700; line-height: 1.3; }
.co-bub em.rojo { background: var(--red, #E24B4A); }
.co-cuentas { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 8px; }
.co-gch { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--txt); font-size: 12px; font-weight: 700; cursor: pointer; }
.co-gch[style] { border-color: var(--g); color: var(--g); }
.co-gch.on { background: var(--txt); color: var(--card); border-color: var(--txt); }
.co-gch[style].on { background: var(--g); color: #fff; border-color: var(--g); }
/* la tarjeta toma el color de su cuenta */
.co-lista .co-sw .co-fila, .co-lista > .co-fila { background: color-mix(in srgb, var(--g) 15%, var(--card)); border: 1px solid color-mix(in srgb, var(--g) 28%, var(--card)); border-radius: 14px; }
.co-lista .co-fila.marcado { background: var(--acc2); }
.co-tag-cta { display: inline-block; margin-top: 3px; padding: 0 8px; border-radius: 999px; background: color-mix(in srgb, var(--g) 22%, var(--card)); color: var(--g); font-size: 10px; font-weight: 700; }
.co-lista .co-sw { margin-bottom: 6px; }
.co-av { position: relative; overflow: hidden; }
.co-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 7px; background: #fff; }
/* hoja de bloqueo y lista de bloqueados */
.bl-op { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.bl-op .btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.bl-op .btn small { font-weight: 400; color: var(--mut); }
.bl-chk { display: flex; gap: 8px; align-items: center; font-size: 13px; margin: 6px 0 10px; }
.bl-fila { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin-bottom: 4px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.bl-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #F7C1C1; font-size: 17px; flex: none; }
.bl-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bl-tx b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-tx span { font-size: 12px; color: var(--mut); }

/* ---- Facturas: total del mes y proveedores (11/10/2026) ---- */
.fa-tot { background: var(--yel); color: var(--txt); border-radius: 16px; padding: 12px 14px; margin: 2px 0 8px; }
.fa-fila { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.fa-fila select { padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--txt); font-size: 12px; font-weight: 700; }
.fa-cifra { font-size: 30px; font-weight: 800; line-height: 1.2; margin: 2px 0; }
.fa-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--card); margin: 6px 0; }
.fa-bar span { display: block; height: 100%; }
.fa-ley { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; margin-bottom: 4px; }
.fa-ley i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.fa-tot small { color: var(--mut); }
.fa-prov { background: color-mix(in srgb, var(--g) 15%, var(--card)); border: 1px solid color-mix(in srgb, var(--g) 28%, var(--card)); border-radius: 14px; margin-bottom: 6px; overflow: hidden; }
.fa-cab { display: flex; align-items: center; gap: 10px; padding: 9px 10px; cursor: pointer; }
.fa-cab .co-cx small { color: var(--mut); font-size: 11px; }
.fa-imp { font-weight: 800; font-size: 15px; white-space: nowrap; }
.fa-det { border-top: 1px solid color-mix(in srgb, var(--g) 28%, var(--card)); }
.fa-inv { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid color-mix(in srgb, var(--g) 18%, var(--card)); }
.fa-inv:last-child { border-bottom: 0; }
.fa-inv .co-cx small { color: var(--mut); font-size: 11px; }
.fa-inv.nuevo .co-as { font-weight: 700; }
.fa-inv b { white-space: nowrap; }
.fa-csv { display: block; width: 100%; margin: 10px 0; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--txt); font-weight: 700; cursor: pointer; text-align: left; }
.co-lista, .co-lector, .co-burb, .co-cuentas { min-width: 0; max-width: 100%; }

/* ---- Correo móvil más compacto: arriba lo mínimo y más sitio para los correos (11/10/2026) ---- */
.co-tag-cta { margin-top: 0; flex: none; }
.co-gchs { display: contents; }
@media (max-width: 899.98px) {
  .co-movil { align-items: center; }
  .co-sel { padding: 7px 12px; font-size: 14px; }
  .co-ic2 { flex: none; width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border-radius: 12px; font-size: 16px; }
  .co-movil .co-nuevo { flex: none; width: 44px; height: 38px; padding: 0; font-size: 16px; }
  .co-burb { padding: 0 0 4px; }
  .co-bub { gap: 0; }
  .co-bub i { width: 38px; height: 38px; font-size: 18px; }
  .co-bub span { display: none; }
  .co-bub.on span { display: block; font-size: 10px; margin-top: 2px; }
  .co-cuentas { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
  .co-filtros.co-unica { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 2px 0 6px; padding-bottom: 2px; }
  .co-filtros.co-unica::-webkit-scrollbar, .co-cuentas::-webkit-scrollbar { display: none; }
  .co-filtros.co-unica .chip, .co-gch { flex: none; white-space: nowrap; padding: 3px 10px; font-size: 12px; }
  .co-bar.plegable { display: none; margin-bottom: 6px; }
  .co-bar.plegable.abierta { display: flex; }
  .co-bar .co-ref { display: none; }
  .co-est { display: none; }
  .co-lista .co-fila { padding: 6px 10px; }
  .co-lista .co-av { width: 36px; height: 36px; font-size: 15px; }
  .co-lista .co-sw { margin-bottom: 4px; }
  .co-dia { margin: 6px -2px 4px; padding: 3px 10px; }
}
@media (min-width: 900px) { .co-ic2 { display: none; } }

/* ---- Barra al mantener pulsado un correo: una sola fila, botones iguales con icono y nombre (11/10/2026) ---- */
.co-selbar { flex-wrap: nowrap; gap: 4px; padding: 6px; }
.co-selbar > button[data-co-masivo="x"] { flex: none; width: 36px; height: 40px; padding: 0; font-size: 16px; }
.co-selbar > b { flex: none; min-width: 22px; font-size: 18px; text-align: center; margin-right: 2px; }
.co-selbar .sp { flex: 1 1 0; min-width: 0; }
.co-selbar .sb { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 5px 2px; max-width: 70px; }
.co-selbar .sb i { font-style: normal; font-size: 18px; line-height: 1.1; }
.co-selbar .sb small { font-size: 10px; font-weight: 600; line-height: 1.1; }
.co-selbar .sb.pel { background: rgba(255,255,255,.28); }
@media (max-width: 899.98px) {
  .co-selbar { justify-content: flex-start; }
  .co-selbar .sp { display: none; }
  .co-selbar .sb { padding: 5px 2px; font-size: 12px; max-width: none; }
}

/* ---- Filtros del correo en un desplegable (11/10/2026) ---- */
.co-fdesp { font-weight: 700; max-width: 52vw; overflow: hidden; text-overflow: ellipsis; }
.co-fpanel { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; margin: 0 0 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sombra); }
.co-fpanel .chip { padding: 5px 12px; font-size: 13px; }
.co-fpanel .chip small { opacity: .75; margin-left: 2px; }
.co-fpanel .fp-t { flex: 0 0 100%; margin-top: 4px; font-size: 11px; font-weight: 700; color: var(--mut); text-transform: uppercase; letter-spacing: .04em; }
.co-fpanel select, .co-fpanel .co-ff { flex: 0 0 100%; width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--txt); font-size: 13px; }

/* Facturas en el móvil: al abrir una factura el correo sale en un panel lateral y la lista de facturas sigue detrás */
@media (max-width: 899.98px) {
  .co.fac.leyendo .co-lista { display: block; }
  .co.fac.leyendo .co-izq { display: flex; flex-direction: column; }
  .co.fac.leyendo::after { content: ""; position: fixed; inset: 0; background: rgba(20, 15, 40, .45); z-index: 40; pointer-events: none; }
  .co.fac.leyendo .co-lector { position: fixed; top: 0; right: 0; bottom: 0; width: min(94vw, 520px); height: auto; min-height: 0; z-index: 41; background: var(--bg); box-shadow: -8px 0 24px rgba(0, 0, 0, .35); border-radius: 16px 0 0 16px; padding: calc(8px + env(safe-area-inset-top)) 8px 0; overflow: hidden; animation: faDesliza .2s ease-out; }
  body:has(.co.fac.leyendo) { overflow: hidden; }
}
@keyframes faDesliza { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ⭐ favoritos del correo */
.co-star { flex: 0 0 auto; align-self: center; background: none; border: 0; font-size: 22px; line-height: 1; padding: 6px 4px 6px 8px; color: var(--mut); cursor: pointer; }
.co-star.on, .co-estrella.on { color: #f5b301; }
.co-estrella { font-size: 20px; }
.co-hist button[data-co-todoleido] { font-weight: 700; }
.co-bub.b-nol i svg { color: #185FA5; display: block; }

/* ---- Ordenador: el menú (Inicio, Agenda, Semana…) arriba en horizontal en vez de columna a la izquierda (12/10/2026) ---- */
@media (min-width: 900px) {
  body { padding-left: 0; padding-top: 52px; }
  .barra { top: 0; left: 0; right: 0; bottom: auto; width: auto; height: 52px; flex-direction: row; justify-content: center; align-items: center; gap: 4px; padding: 0 12px; border-right: 0; border-bottom: 1px solid var(--line); box-shadow: 0 1px 6px rgba(0,0,0,.06); z-index: 15; }
  .barra button { width: auto; flex: none; gap: 8px; font-size: 14px; padding: 7px 14px; border-radius: 10px; }
  .barra button span { font-size: 18px; }
  .ol, .co { height: calc(100vh - 72px); }
  .col-dia { top: 66px; }
  .col-dia .pagina { min-height: calc(100vh - 108px); }
  #envio-bar { left: 24px; }
}

/* ---- Correo en ordenador: fuera la fila de filtros (Bandeja/Todo/Personales/…), ya está en la columna de la izquierda; los filtros pasan al botón ☰ junto a la búsqueda (12/10/2026) ---- */
.co-fbtn { position: relative; }
.co-fbtn.on { background: var(--acc); color: #fff; }
.co-fbtn em { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font: 700 10px/16px system-ui, sans-serif; font-style: normal; }
@media (min-width: 900px) { .co-filtros.co-unica { display: none; } .co-fpanel { margin-top: 8px; } }
@media (max-width: 899.98px) { .co-fbtn { display: none; } }

/* ---- Correo: grupos de cuentas plegables y columna izquierda con barra de desplazamiento (12/10/2026) ---- */
.co-amb.gr { display: flex; align-items: center; gap: 0; }
.co-amb.gr .co-flecha { margin-left: auto; padding-left: 8px; font-size: 12px; opacity: .6; }
.co-amb.gr b { margin-left: 6px; }
@media (min-width: 900px) {
  .co-izq { scrollbar-width: thin; scrollbar-color: var(--line) transparent; min-height: 0; }
  .co-izq::-webkit-scrollbar { width: 8px; }
  .co-izq::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
}

/* Barra del día con botón «Marcar todo» (12/10/2026) */
.co-dia { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.co-dia-sel { flex: 0 0 auto; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--acc); background: transparent; border: 1.5px solid var(--acc); border-radius: 999px; padding: 2px 9px; cursor: pointer; line-height: 1.4; }
.co-dia-sel small { opacity: .7; font-weight: 600; margin-left: 2px; }
.co-dia-sel.on { background: var(--acc); color: #fff; }
.co-dia-sel.on small { opacity: .85; }

/* Barra de herramientas de la lista: tamaño de letra, todo leído, vaciar papelera/spam */
.co-herr { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 8px; }
.co-zoom { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.co-zoom button { border: 0; background: none; padding: 7px 14px; font-weight: 800; font-size: 15px; color: var(--txt); }
.co-zoom button + button { border-left: 1px solid var(--line); }
.co-zoom button:disabled { opacity: .35; }
.co-hb { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 13px; color: var(--txt); }
.co-hb.peligro { border-color: var(--red); color: var(--red); }
/* con la letra muy grande, el remitente y el asunto pasan a varias líneas en vez de cortarse */
.co-grande .co-as, .co-grande .co-nom { white-space: normal; overflow: visible; text-overflow: clip; }
.co-grande .co-de { flex-wrap: wrap; }

/* Cartel de la carpeta en la que estás, para no confundir la papelera con la bandeja de entrada */
.co-donde { margin: 2px 0 8px; padding: 8px 12px; border-radius: 10px; font-size: 14px; background: #e9e1cd; color: var(--txt); border-left: 6px solid var(--mut); }
.co-donde.d-PAPELERA { background: #f8d9d4; border-left-color: #c8352b; color: #7a1d14; }
.co-donde.d-SPAM { background: #fde8c8; border-left-color: #e08a2c; color: #7a4a0c; }
@media (prefers-color-scheme: dark) { .co-donde.d-PAPELERA { background: #4a211c; color: #f6c7c0; } .co-donde.d-SPAM { background: #4a3417; color: #f6dcb0; } .co-donde { background: #2c2820; } }
.co-lista { touch-action: pan-y pinch-zoom; }   /* el pellizco es el zoom del móvil */
body.zoomeado .co-lista, body.zoomeado .co-sw .co-fila { touch-action: auto; }

/* Grabar un recordatorio desde el icono: pantalla grande con el micrófono */
.grabar-velo { position: fixed; inset: 0; z-index: 200; background: rgba(30, 20, 60, .92); display: grid; place-items: center; padding: 24px; }
.gv-c { width: min(420px, 100%); text-align: center; color: #fff; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.gv-mic { width: 120px; height: 120px; border-radius: 50%; border: 0; background: var(--red, #c8352b); font-size: 56px; line-height: 1; animation: late 1s infinite; }
.gv-t { font-size: 22px; font-weight: 700; min-height: 60px; overflow-wrap: anywhere; }
.gv-s { font-size: 13px; opacity: .75; }
.gv-b { display: flex; gap: 10px; margin-top: 6px; }
.gv-b .btn { padding: 12px 20px; font-size: 16px; }

/* ---- redactar / responder correo: compacta, el mensaje ocupa todo el hueco y Enviar siempre a la vista (sin scroll) ---- */
.hoja.hoja-correo { display: flex; flex-direction: column; height: 96dvh; max-height: 96dvh; overflow: hidden; padding: 0 14px; max-width: 760px; }
.hoja-correo h3 { position: static; margin: 0; padding: 10px 0 4px; font-size: 16px; flex: none; }
.hoja-correo .rc-cuerpo { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; padding-bottom: 4px; }
.hoja-correo .campo { margin: 0; display: flex; align-items: center; gap: 8px; }
.hoja-correo .campo > label { width: 48px; flex: none; margin: 0; font-size: 11px; }
.hoja-correo .campo input, .hoja-correo .campo select { padding: 6px 10px; border-radius: 9px; font-size: 15px; min-width: 0; }
.hoja-correo .rc-fila { display: flex; gap: 8px; }
.hoja-correo .rc-fila .campo { flex: 1; min-width: 0; }
.hoja-correo .rc-fila .campo:last-child > label { width: auto; }
.hoja-correo .campo.rc-msg { flex: 1 1 auto; min-height: 150px; align-items: stretch; }
.hoja-correo .campo.rc-msg textarea { flex: 1; height: 100%; min-height: 150px; resize: none; padding: 9px 11px; font-size: 15px; line-height: 1.4; }
.hoja-correo .rc-herr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; }
.hoja-correo .rc-herr .chip { padding: 4px 10px; font-size: 13px; }
.hoja-correo .rc-herr .cal-it { margin: 0; font-size: 13px; }
.hoja-correo .r-firma { margin: 0; font-size: 13px; }
.hoja-correo .rc-seg select { width: auto; padding: 3px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-size: 13px; }
.hoja-correo #r-lista:empty, .hoja-correo #r-menu:empty { display: none; }
.hoja-correo .co-aviso, .hoja-correo .co-err { margin: 0; padding: 6px 10px; font-size: 13px; }
.hoja.hoja-correo .acciones { position: static; flex: none; margin: 6px -14px 0; padding: 8px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); box-shadow: 0 -8px 14px -10px rgba(0, 0, 0, .35); flex-wrap: nowrap; gap: 6px; }
.hoja.hoja-correo .acciones .btn { padding-top: 9px; padding-bottom: 9px; }
@media (max-width: 420px) {
  .hoja-correo .rc-fila { flex-direction: column; gap: 5px; }
  .hoja-correo .rc-fila .campo:last-child > label { width: 48px; }
  .hoja.hoja-correo .acciones .btn { font-size: 13px; padding-left: 6px; padding-right: 6px; }
}
@media (min-width: 900px) { .hoja.hoja-correo { height: 92vh; max-height: 92vh; border-radius: 22px; } }
