/* ==========================================================================
   Tablero del equipo (Inicio). El marco es Liquid Glass como el resto de la
   app (blur real solo en el panel y en la ventana, nunca por nota); las notas
   son PAPEL: post-it de color con letra a mano, un poco torcidas, con cinta o
   chincheta, esquina levantada y sombra de papel. Lo pinta
   js/modules/tablero-notas.js en #tablero-notas-sec y #modal-tablero-nota.
   ========================================================================== */

#tablero-notas-sec,
#modal-tablero-nota {
    --tn-spring: cubic-bezier(.22, 1, .36, 1);
    --tn-mano: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;
    /* Papel de cada tipo (base, borde de abajo más oscuro, tinta) */
    --tn-urgente-papel: #ffd6dc; --tn-urgente-fondo: #ffb8c3; --tn-urgente-tinta: #9f1239;
    --tn-aviso-papel: #dbe8ff;   --tn-aviso-fondo: #bfd5ff;   --tn-aviso-tinta: #1e3a8a;
    --tn-recordatorio-papel: #fff4a3; --tn-recordatorio-fondo: #ffe873; --tn-recordatorio-tinta: #713f12;
    --tn-celebracion-papel: #c8f5dc;  --tn-celebracion-fondo: #a5ecc5;  --tn-celebracion-tinta: #065f46;
}

/* ── Marco del tablero (vidrio) ─────────────────────────────────────────── */
#tablero-notas-sec {
    position: relative;
    margin: 22px 0 8px;
    padding: 22px 22px 28px;
    border-radius: 28px;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(155deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, .4));
    backdrop-filter: blur(26px) saturate(1.7);
    -webkit-backdrop-filter: blur(26px) saturate(1.7);
    border: 1px solid rgba(255, 255, 255, .7);
    box-shadow:
        inset 0 1.5px 0 rgba(255, 255, 255, .95),
        0 30px 60px -30px rgba(15, 23, 42, .35),
        0 10px 24px -16px rgba(15, 23, 42, .2);
}
#tablero-notas-sec:empty { display: none; }
#tablero-notas-sec::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(45% 60% at 4% 0%, color-mix(in srgb, var(--glass-primary, #6366f1) 30%, transparent), transparent 70%),
        radial-gradient(40% 55% at 100% 10%, rgba(56, 189, 248, .26), transparent 70%),
        radial-gradient(45% 60% at 60% 120%, rgba(251, 191, 36, .2), transparent 70%);
}
#tablero-notas-sec::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .45) 46%, transparent 62%);
    mix-blend-mode: screen;
    opacity: .5;
}

.tn-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.tn-titulo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tn-titulo h3 { margin: 0; font-size: 1.15rem; font-weight: 900; color: #0f172a; letter-spacing: -.01em; }
.tn-titulo small { display: block; margin-top: 2px; font-size: .8rem; color: #64748b; }
.tn-alerta { color: #e11d48; font-weight: 800; }
.tn-titulo-ico {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px;
    font-size: 1.35rem; color: #713f12; flex-shrink: 0;
    background: linear-gradient(160deg, #fff7b8, #ffe873);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 8px 16px -8px rgba(113, 63, 18, .45);
    transform: rotate(-4deg);
}

/* "Pegar nota": también es un post-it (amarillo, letra a mano, un poco torcido) */
.tn-agregar {
    position: relative;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 13px 6px 10px;
    border: none; cursor: pointer; white-space: nowrap;
    font-family: var(--tn-mano); font-size: 1.12rem; font-weight: 700; line-height: 1;
    color: var(--tn-recordatorio-tinta);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .5), transparent 40%),
        linear-gradient(180deg, var(--tn-recordatorio-papel), var(--tn-recordatorio-fondo));
    border-radius: 3px 3px 3px 16px / 3px 3px 3px 7px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .06), 0 10px 16px -10px rgba(113, 63, 18, .55);
    transform: rotate(-2deg);
    transition: transform .35s var(--tn-spring), box-shadow .35s var(--tn-spring);
}
.tn-agregar::before {
    content: "";
    position: absolute; top: -7px; left: 50%; width: 46px; height: 14px;
    transform: translateX(-50%) rotate(3deg);
    background: linear-gradient(180deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, .5));
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
    clip-path: polygon(3% 0, 97% 6%, 100% 40%, 96% 100%, 4% 94%, 0 55%);
}
.tn-agregar:hover {
    transform: rotate(0deg) translateY(-3px) scale(1.04);
    box-shadow: 0 1px 1px rgba(0, 0, 0, .06), 0 16px 22px -12px rgba(113, 63, 18, .6);
}
.tn-agregar .material-symbols-outlined { font-size: 1.05rem; }

/* Botón principal de la ventana: tinta café sobre papel, no el color del tema */
.tn-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px;
    border: none; border-radius: 14px; cursor: pointer; white-space: nowrap;
    font-weight: 800; font-size: .88rem;
    color: #fff7c2;
    background: linear-gradient(160deg, #8a5a1c, #5c3a0f);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 12px 22px -12px rgba(92, 58, 15, .7);
    transition: transform .25s var(--tn-spring), box-shadow .25s var(--tn-spring);
}
.tn-btn:hover { transform: translateY(-2px); }
.tn-btn .material-symbols-outlined { font-size: 1.15rem; }
.tn-btn:disabled { opacity: .6; cursor: wait; transform: none; }

/* El "corcho": cuadrícula de puntos tenue donde se pegan las notas */
.tn-corcho {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 26px 20px;
    padding: 12px 6px 4px;
    border-radius: 20px;
    background-image: radial-gradient(rgba(15, 23, 42, .09) 1px, transparent 1.2px);
    background-size: 18px 18px;
}

/* ── La nota de papel ───────────────────────────────────────────────────── */
.tn-nota {
    --tn-papel: var(--tn-aviso-papel);
    --tn-fondo: var(--tn-aviso-fondo);
    --tn-tinta: var(--tn-aviso-tinta);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 190px;
    padding: 22px 18px 14px;
    color: var(--tn-tinta);
    /* Papel: brillo arriba, color, y el borde de abajo un poco más oscuro */
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .45), transparent 28%),
        linear-gradient(180deg, var(--tn-papel) 0%, var(--tn-papel) 72%, var(--tn-fondo) 100%);
    border-radius: 3px 3px 3px 28px / 3px 3px 3px 10px;
    box-shadow:
        0 1px 1px rgba(0, 0, 0, .06),
        0 6px 10px -4px rgba(0, 0, 0, .12),
        0 22px 26px -18px rgba(0, 0, 0, .35);
    transform: rotate(var(--tn-rot, 0deg));
    transform-origin: 50% 0;
    transition: transform .4s var(--tn-spring), box-shadow .4s var(--tn-spring);
}
/* Esquina inferior levantada */
.tn-nota::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--tn-fondo) 0%, color-mix(in srgb, var(--tn-fondo) 70%, #000 8%) 48%, transparent 50%);
    border-radius: 0 0 3px 0;
    box-shadow: -3px -3px 6px -4px rgba(0, 0, 0, .25);
    clip-path: polygon(0 100%, 100% 0, 100% 100%);
    transform: scale(-1, -1);
    opacity: .9;
}
.tn-nota:hover {
    transform: rotate(0deg) translateY(-6px) scale(1.02);
    box-shadow:
        0 1px 1px rgba(0, 0, 0, .06),
        0 12px 18px -6px rgba(0, 0, 0, .14),
        0 34px 34px -22px rgba(0, 0, 0, .4);
    z-index: 2;
}
.tn-nota.tn-urgente { --tn-papel: var(--tn-urgente-papel); --tn-fondo: var(--tn-urgente-fondo); --tn-tinta: var(--tn-urgente-tinta); }
.tn-nota.tn-recordatorio { --tn-papel: var(--tn-recordatorio-papel); --tn-fondo: var(--tn-recordatorio-fondo); --tn-tinta: var(--tn-recordatorio-tinta); }
.tn-nota.tn-celebracion { --tn-papel: var(--tn-celebracion-papel); --tn-fondo: var(--tn-celebracion-fondo); --tn-tinta: var(--tn-celebracion-tinta); }

/* Cinta adhesiva arriba (translúcida, con bordes rasgados) */
.tn-cinta {
    position: absolute;
    top: -11px;
    left: 50%;
    width: 86px;
    height: 24px;
    transform: translateX(-50%) rotate(calc(var(--tn-rot, 0deg) * -1.6 - 2deg));
    background: linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, .45));
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
    clip-path: polygon(3% 0, 97% 4%, 100% 30%, 96% 55%, 100% 100%, 4% 96%, 0 70%, 3% 45%, 0 15%);
    backdrop-filter: blur(1px);
}
/* Chincheta para las fijadas */
.tn-chincheta {
    position: absolute;
    top: -9px;
    left: 50%;
    width: 22px;
    height: 22px;
    margin-left: -11px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fecaca, #ef4444 45%, #991b1b);
    box-shadow: 0 3px 4px rgba(0, 0, 0, .35), inset 0 -2px 3px rgba(0, 0, 0, .25);
    z-index: 3;
}
.tn-chincheta::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 18px;
    width: 2px;
    height: 7px;
    margin-left: -1px;
    background: linear-gradient(#94a3b8, transparent);
}

.tn-nota-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 26px; }
.tn-tipo {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    color: var(--tn-tinta); opacity: .75;
}
.tn-tipo .material-symbols-outlined { font-size: 1rem; }
.tn-acciones { display: inline-flex; gap: 2px; opacity: 0; transition: opacity .2s ease; }
.tn-nota:hover .tn-acciones, .tn-nota:focus-within .tn-acciones { opacity: 1; }
.tn-acciones button {
    display: grid; place-items: center; width: 26px; height: 26px;
    border: none; border-radius: 8px; background: rgba(255, 255, 255, .45);
    color: var(--tn-tinta); cursor: pointer;
}
.tn-acciones button:hover { background: rgba(255, 255, 255, .85); }
.tn-acciones .material-symbols-outlined { font-size: 1rem; }
@media (hover: none) { .tn-acciones { opacity: 1; } }

/* El texto, escrito a mano */
.tn-texto {
    margin: 0;
    flex: 1;
    font-family: var(--tn-mano);
    font-size: 1.55rem;
    font-weight: 600;
    line-height: 1.12;
    color: var(--tn-tinta);
    white-space: pre-wrap;
    word-break: break-word;
}
.tn-placeholder { opacity: .4; }

.tn-nota-pie { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 4px; }
.tn-firma { display: flex; align-items: center; gap: 7px; min-width: 0; }
.tn-avatar {
    display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
    font-size: .66rem; font-weight: 900; color: var(--tn-papel); background: var(--tn-tinta);
    flex-shrink: 0; opacity: .85;
}
.tn-firma > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.tn-firma b { font-size: .74rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-firma small { font-size: .68rem; opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Botón de la interacción de cada tipo */
.tn-accion {
    display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
    padding: 6px 10px; border-radius: 999px; border: none; cursor: pointer;
    font-size: .74rem; font-weight: 800; color: var(--tn-tinta);
    background: rgba(255, 255, 255, .55);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
    transition: transform .25s var(--tn-spring), background .2s ease;
}
.tn-accion:hover { transform: scale(1.06); background: rgba(255, 255, 255, .85); }
.tn-accion:active { transform: scale(.94); }
.tn-accion .material-symbols-outlined { font-size: 1rem; }
.tn-accion.is-hecho { background: color-mix(in srgb, var(--tn-tinta) 14%, transparent); }
.tn-emoji { font-size: 1rem; line-height: 1; }
.tn-aplauso:active .tn-emoji { animation: tn-pop .4s var(--tn-spring); }
@keyframes tn-pop { 50% { transform: scale(1.6) rotate(-12deg); } }

/* Urgente sin leer: late hasta que la persona dice "Entendido" */
.tn-nota.is-pendiente { animation: tn-meneo 2.8s ease-in-out infinite; }
@keyframes tn-meneo {
    0%, 88%, 100% { transform: rotate(var(--tn-rot, 0deg)); }
    91% { transform: rotate(calc(var(--tn-rot, 0deg) + 2deg)); }
    94% { transform: rotate(calc(var(--tn-rot, 0deg) - 2deg)); }
    97% { transform: rotate(calc(var(--tn-rot, 0deg) + 1deg)); }
}
.tn-nota.is-pendiente:hover { animation: none; }
.tn-latido { background: var(--tn-tinta); color: var(--tn-papel); animation: tn-latido 1.6s ease-in-out infinite; }
.tn-latido:hover { background: var(--tn-tinta); }
@keyframes tn-latido {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tn-tinta) 45%, transparent); }
    50% { box-shadow: 0 0 0 7px transparent; }
}

/* Recordatorio hecho: tachado y sello */
.tn-nota.is-hecha .tn-texto { text-decoration: line-through; text-decoration-thickness: 2px; opacity: .55; }
.tn-nota.is-hecha { filter: saturate(.7); }
.tn-sello {
    position: absolute;
    right: 16px;
    top: 44%;
    padding: 2px 10px;
    border: 3px solid currentColor;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: color-mix(in srgb, #059669 85%, transparent);
    transform: rotate(-14deg);
    opacity: .8;
    animation: tn-sellar .45s var(--tn-spring) both;
    pointer-events: none;
}
@keyframes tn-sellar { from { opacity: 0; transform: rotate(-14deg) scale(1.8); } }

/* Nota que llega de otro computador: cae y se pega */
.tn-nota.is-nueva { animation: tn-pegar .7s var(--tn-spring) both; }
@keyframes tn-pegar {
    0% { opacity: 0; transform: translateY(-26px) rotate(calc(var(--tn-rot, 0deg) - 8deg)) scale(1.08); }
    100% { opacity: 1; transform: rotate(var(--tn-rot, 0deg)); }
}
.tn-nota.is-saliendo { transition: transform .35s ease-in, opacity .35s ease-in; transform: translateY(40px) rotate(12deg); opacity: 0; }

/* Confeti de los aplausos */
.tn-confeti {
    position: fixed;
    z-index: 10060;
    width: 8px;
    height: 12px;
    border-radius: 2px;
    pointer-events: none;
    animation: tn-confeti 1s cubic-bezier(.2, .7, .4, 1) forwards;
}
@keyframes tn-confeti {
    to { transform: translate(var(--x), calc(var(--y) + 160px)) rotate(var(--r)); opacity: 0; }
}

/* Tablero vacío: una nota en blanco invitando a escribir */
.tn-vacio {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    grid-column: 1 / -1; padding: 22px 18px; border: none; background: none;
    color: #475569; text-align: center; cursor: pointer; font: inherit;
}
.tn-vacio-nota {
    display: grid; place-items: center; width: 92px; height: 92px; margin-bottom: 6px;
    font-family: var(--tn-mano); font-size: 3rem; color: #a16207;
    background: linear-gradient(180deg, #fff9c4, #ffef85);
    border-radius: 3px 3px 3px 18px / 3px 3px 3px 8px;
    box-shadow: 0 14px 20px -12px rgba(0, 0, 0, .35);
    transform: rotate(-4deg);
    transition: transform .4s var(--tn-spring);
}
.tn-vacio:hover .tn-vacio-nota { transform: rotate(2deg) scale(1.06); }
.tn-vacio b { color: #0f172a; font-size: 1rem; }
.tn-vacio span:last-child { font-size: .84rem; max-width: 440px; }

/* ── Ventana para escribir (vidrio) con la nota en vivo ─────────────────── */
#modal-tablero-nota.tn-overlay {
    position: fixed; inset: 0; z-index: 10050;
    display: grid; place-items: center; padding: 16px;
    background: rgba(10, 15, 30, .55);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    animation: tn-fade .2s ease both;
}
@keyframes tn-fade { from { opacity: 0; } }
.tn-modal {
    position: relative;
    width: min(640px, 100%);
    max-height: calc(100dvh - 32px);
    overflow: auto;
    border-radius: 26px;
    isolation: isolate;
    background: linear-gradient(155deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .62));
    backdrop-filter: blur(28px) saturate(1.8);
    -webkit-backdrop-filter: blur(28px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, .7);
    box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .95), 0 36px 70px -26px rgba(10, 15, 40, .5);
    animation: tn-sube .35s var(--tn-spring) both;
}
@keyframes tn-sube { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.tn-modal::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(55% 45% at 8% 0%, color-mix(in srgb, var(--glass-primary, #6366f1) 28%, transparent), transparent 70%),
        radial-gradient(48% 40% at 100% 6%, rgba(251, 191, 36, .26), transparent 70%);
}
.tn-modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px 2px; }
.tn-modal-head h2 { margin: 0; font-size: 1.08rem; font-weight: 900; color: #0f172a; }
.tn-modal-head p { margin: 2px 0 0; font-size: .82rem; color: #64748b; }
.tn-x {
    margin-left: auto; display: grid; place-items: center; width: 36px; height: 36px;
    border: none; border-radius: 12px; background: rgba(255, 255, 255, .55); color: #475569; cursor: pointer;
}
.tn-modal-cuerpo { display: grid; grid-template-columns: 190px 1fr; gap: 18px; padding: 6px 18px 0; align-items: start; }
.tn-vista { padding: 16px 6px 6px; position: sticky; top: 0; }
.tn-vista .tn-nota { min-height: 150px; padding: 18px 14px 12px; font-size: .9em; transition: background .35s ease, color .35s ease, transform .4s var(--tn-spring); }
.tn-form { display: flex; flex-direction: column; gap: 11px; }
.tn-campo { display: flex; flex-direction: column; gap: 7px; }
.tn-campo > span { font-size: .74rem; font-weight: 800; color: #475569; text-transform: uppercase; letter-spacing: .04em; }
.tn-campo > span small { text-transform: none; letter-spacing: 0; font-weight: 600; color: #94a3b8; }
.tn-form textarea {
    width: 100%; box-sizing: border-box; min-height: 70px; max-height: 140px; resize: vertical;
    border-radius: 14px; border: 1px solid rgba(148, 163, 184, .45);
    background: rgba(255, 255, 255, .6); color: #0f172a;
    font: inherit; font-size: .98rem; padding: 12px 14px; outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.tn-form textarea:focus {
    border-color: color-mix(in srgb, var(--glass-primary, #6366f1) 70%, transparent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--glass-primary, #6366f1) 16%, transparent);
}
.tn-emojis { display: flex; align-items: center; gap: 4px; margin-top: -6px; flex-wrap: wrap; }
.tn-emojis button {
    width: 30px; height: 30px; border: none; border-radius: 10px; cursor: pointer;
    background: rgba(255, 255, 255, .5); font-size: 1.1rem;
    transition: transform .25s var(--tn-spring), background .2s ease;
}
.tn-emojis button:hover { transform: translateY(-2px) scale(1.12); background: rgba(255, 255, 255, .9); }
.tn-contador { margin-left: auto; font-size: .72rem; color: #94a3b8; }
.tn-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tn-chip {
    --tn-tinta: var(--tn-aviso-tinta); --tn-papel: var(--tn-aviso-papel);
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px 5px 8px; border-radius: 999px; cursor: pointer;
    border: 1px solid rgba(148, 163, 184, .4); background: rgba(255, 255, 255, .5);
    font: inherit; font-size: .78rem; font-weight: 700; color: #334155;
    transition: transform .25s var(--tn-spring), background .2s ease, border-color .2s ease;
}
.tn-chip.tn-urgente { --tn-tinta: var(--tn-urgente-tinta); --tn-papel: var(--tn-urgente-papel); }
.tn-chip.tn-recordatorio { --tn-tinta: var(--tn-recordatorio-tinta); --tn-papel: var(--tn-recordatorio-papel); }
.tn-chip.tn-celebracion { --tn-tinta: var(--tn-celebracion-tinta); --tn-papel: var(--tn-celebracion-papel); }
.tn-chip .material-symbols-outlined { font-size: 1.05rem; color: var(--tn-tinta); }
.tn-chip.is-activo { background: var(--tn-papel); border-color: color-mix(in srgb, var(--tn-tinta) 45%, transparent); color: var(--tn-tinta); transform: translateY(-1px); }
.tn-chip-suave.is-activo {
    background: color-mix(in srgb, var(--glass-primary, #6366f1) 14%, rgba(255, 255, 255, .7));
    border-color: color-mix(in srgb, var(--glass-primary, #6366f1) 50%, transparent);
    color: color-mix(in srgb, var(--glass-primary, #6366f1) 90%, #000);
}
.tn-interruptor {
    display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
    padding: 6px 4px; border: none; background: none; cursor: pointer;
    font: inherit; font-size: .88rem; font-weight: 700; color: #334155;
}
.tn-perilla {
    position: relative; width: 40px; height: 24px; border-radius: 999px;
    background: rgba(148, 163, 184, .5); transition: background .25s ease;
}
.tn-perilla::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .3s var(--tn-spring);
}
.tn-interruptor.is-activo .tn-perilla { background: #ef4444; }
.tn-interruptor.is-activo .tn-perilla::after { transform: translateX(16px); }
.tn-modal-pie { display: flex; justify-content: flex-end; gap: 10px; padding: 10px 18px 16px; }
.tn-btn-sec {
    padding: 10px 16px; border-radius: 14px; border: 1px solid rgba(148, 163, 184, .45);
    background: rgba(255, 255, 255, .55); color: #334155; font-weight: 700; cursor: pointer;
}

/* ── Foto pegada en la nota (como polaroid con cinta) ───────────────────── */
.tn-foto {
    position: relative;
    display: block;
    width: calc(100% - 8px);
    margin: 6px auto 4px;
    padding: 6px 6px 14px;
    border: none;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .14), 0 10px 18px -12px rgba(0, 0, 0, .35);
    transform: rotate(calc(var(--tn-rot, 0deg) * -1.4));
    cursor: zoom-in;
    transition: transform .35s var(--tn-spring);
}
.tn-foto::before {
    content: "";
    position: absolute;
    top: -8px;
    right: 14px;
    width: 46px;
    height: 16px;
    transform: rotate(14deg);
    background: linear-gradient(180deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, .5));
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
    clip-path: polygon(4% 0, 96% 6%, 100% 50%, 95% 100%, 3% 94%, 0 50%);
}
.tn-foto:hover { transform: rotate(0deg) scale(1.03); }
.tn-foto img {
    display: block;
    width: 100%;
    max-height: 190px;
    object-fit: cover;
    border-radius: 1px;
    background: #f1f5f9;
}
.tn-nota.con-foto .tn-texto { font-size: 1.35rem; }
.tn-vista .tn-foto { cursor: default; }

/* ── "Leída por" ────────────────────────────────────────────────────────── */
.tn-lectores-zona { margin-top: 2px; }
.tn-lectores-fila { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tn-lectores {
    display: inline-flex; align-items: center; gap: 6px; min-width: 0;
    padding: 3px 8px 3px 3px; border: none; border-radius: 999px; cursor: pointer;
    background: transparent; color: var(--tn-tinta);
    font: inherit; font-size: .7rem; font-weight: 700; opacity: .8;
    transition: background .2s ease, opacity .2s ease;
}
.tn-lectores:hover, .tn-lectores[aria-expanded="true"] { background: rgba(255, 255, 255, .5); opacity: 1; }
.tn-lectores > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-lectores.is-vacio { padding-left: 6px; opacity: .55; }
.tn-lectores.is-vacio .material-symbols-outlined { font-size: .95rem; }
.tn-caritas { display: inline-flex; flex-shrink: 0; }
.tn-carita {
    display: grid; place-items: center; overflow: hidden;
    width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
    font-size: .58rem; font-weight: 900; color: var(--tn-papel); background: var(--tn-tinta);
    box-shadow: 0 0 0 2px var(--tn-papel);
}
.tn-caritas .tn-carita + .tn-carita { margin-left: -7px; }
.tn-carita img, .tn-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tn-avatar { overflow: hidden; }
.tn-lo-lei {
    display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0;
    padding: 4px 9px; border-radius: 999px; border: 1.5px dashed color-mix(in srgb, var(--tn-tinta) 45%, transparent);
    background: transparent; color: var(--tn-tinta); cursor: pointer;
    font: inherit; font-size: .7rem; font-weight: 800;
    transition: background .2s ease, transform .25s var(--tn-spring);
}
.tn-lo-lei:hover { background: rgba(255, 255, 255, .6); transform: scale(1.05); }
.tn-lo-lei .material-symbols-outlined { font-size: .95rem; }
.tn-lectores-lista {
    display: flex; flex-direction: column; gap: 4px;
    margin-top: 6px; padding: 7px 8px; border-radius: 10px;
    background: rgba(255, 255, 255, .55);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tn-tinta) 12%, transparent);
    max-height: 150px; overflow: auto;
    animation: tn-despliega .3s var(--tn-spring) both;
}
@keyframes tn-despliega { from { opacity: 0; transform: translateY(-4px); } }
.tn-lector { display: flex; align-items: center; gap: 7px; font-size: .74rem; color: var(--tn-tinta); }
.tn-lector b { font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-lector small { opacity: .65; font-size: .68rem; white-space: nowrap; }
.tn-lector-vacio { font-size: .72rem; color: var(--tn-tinta); opacity: .7; }

/* ── Elegir foto en la ventana ──────────────────────────────────────────── */
.tn-fila-final { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tn-fila-final .tn-interruptor { margin-left: auto; }
.tn-vista .tn-foto img { max-height: 90px; }
.tn-vista .tn-texto { font-size: 1.25rem; }
.tn-foto-elegir, .tn-foto-quitar {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px; border-radius: 12px; cursor: pointer;
    font: inherit; font-size: .84rem; font-weight: 700;
    transition: transform .25s var(--tn-spring), background .2s ease;
}
.tn-foto-elegir {
    border: 1.5px dashed color-mix(in srgb, var(--glass-primary, #6366f1) 55%, transparent);
    background: color-mix(in srgb, var(--glass-primary, #6366f1) 8%, rgba(255, 255, 255, .55));
    color: color-mix(in srgb, var(--glass-primary, #6366f1) 85%, #000);
}
.tn-foto-elegir:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--glass-primary, #6366f1) 14%, rgba(255, 255, 255, .7)); }
.tn-foto-quitar { padding: 7px 9px; border: 1px solid rgba(148, 163, 184, .45); background: rgba(255, 255, 255, .5); color: #b91c1c; }
.tn-foto-quitar[hidden] { display: none; }
.tn-foto-elegir .material-symbols-outlined, .tn-foto-quitar .material-symbols-outlined { font-size: 1.1rem; }

/* ── Foto en grande ─────────────────────────────────────────────────────── */
.tn-lupa {
    position: fixed; inset: 0; z-index: 10060;
    display: grid; place-items: center; padding: 24px;
    background: rgba(10, 15, 30, .78);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    animation: tn-fade .2s ease both;
    cursor: zoom-out;
}
.tn-lupa figure {
    margin: 0; padding: 10px 10px 16px; max-width: min(900px, 100%);
    background: #fff; border-radius: 4px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
    animation: tn-sube .35s cubic-bezier(.22, 1, .36, 1) both; cursor: default;
}
.tn-lupa img { display: block; max-width: 100%; max-height: calc(100vh - 150px); margin: 0 auto; object-fit: contain; }
.tn-lupa figcaption { margin-top: 10px; font-family: 'Caveat', cursive; font-size: 1.5rem; font-weight: 600; color: #334155; text-align: center; }
.tn-lupa .tn-x { position: fixed; top: 16px; right: 16px; background: rgba(255, 255, 255, .9); }

/* ── Notas del sistema: papel verde agua, letra impresa (no a mano) ─────── */
.tn-nota.tn-sistema {
    --tn-papel: #e2f7f1; --tn-fondo: #c3ece0; --tn-tinta: #134e4a;
    min-height: 0;
    background-image:
        repeating-linear-gradient(180deg, transparent 0 23px, color-mix(in srgb, var(--tn-tinta) 7%, transparent) 23px 24px),
        linear-gradient(180deg, var(--tn-papel), var(--tn-fondo));
}
.tn-nota.tn-sistema.is-alerta { --tn-papel: #ffedd5; --tn-fondo: #fed7aa; --tn-tinta: #7c2d12; }
.tn-sistema .tn-texto {
    font-family: inherit; font-size: .95rem; font-weight: 650; line-height: 1.4;
}
.tn-sistema .tn-avatar .material-symbols-outlined { font-size: .95rem; }
.tn-sistema .tn-accion .material-symbols-outlined { font-size: .95rem; }

/* ── Aviso de notas nuevas junto al saludo del Inicio ───────────────────── */
.tn-aviso-slot:empty { display: none; }
.tn-aviso-slot { margin-top: 6px; }
.tn-aviso {
    display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
    padding: 4px 5px 4px 10px; border-radius: 999px; cursor: pointer;
    border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
    background: color-mix(in srgb, currentColor 6%, rgba(255, 255, 255, .35));
    color: inherit; font: inherit; font-size: .72rem; font-weight: 700;
    animation: tn-aviso-entra .5s cubic-bezier(.22, 1, .36, 1) both;
    transition: transform .25s cubic-bezier(.22, 1, .36, 1), background .2s ease;
}
.tn-aviso:hover { transform: translateY(-1px); background: color-mix(in srgb, currentColor 10%, rgba(255, 255, 255, .5)); }
@keyframes tn-aviso-entra { from { opacity: 0; transform: translateY(4px); } }
.tn-aviso-punto {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
    background: #f59e0b; box-shadow: 0 0 0 0 rgba(245, 158, 11, .5);
    animation: tn-aviso-pulso 2s ease-in-out infinite;
}
.tn-aviso.is-urgente .tn-aviso-punto { background: #ef4444; box-shadow: 0 0 0 0 rgba(239, 68, 68, .5); }
@keyframes tn-aviso-pulso { 50% { box-shadow: 0 0 0 5px transparent; } }
.tn-aviso-texto { opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-aviso b {
    padding: 2px 9px; border-radius: 999px; font-weight: 800;
    color: #fff; background: color-mix(in srgb, var(--glass-primary, #6366f1) 88%, transparent);
}
/* Al llegar desde el aviso, las notas nuevas brillan un momento */
.tn-nota.is-resaltada { animation: tn-resalta 2.4s ease both; }
@keyframes tn-resalta {
    0%, 60% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--glass-primary, #6366f1) 45%, transparent), 0 18px 30px -16px rgba(0, 0, 0, .35); }
}

/* ── Celular ────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .tn-modal-cuerpo { grid-template-columns: 1fr; gap: 6px; }
    .tn-vista { position: static; width: min(200px, 100%); margin: 0 auto; }
    .tn-vista .tn-nota { min-height: 120px; }
}
@media (max-width: 640px) {
    #tablero-notas-sec { padding: 18px 14px 22px; border-radius: 22px; }
    .tn-head { flex-wrap: wrap; }
    .tn-agregar { margin-left: auto; }
    .tn-corcho { grid-template-columns: 1fr; gap: 24px; }
}

/* ── Modo oscuro: el marco se oscurece; las notas siguen siendo papel ────── */
[data-theme="dark"] #tablero-notas-sec {
    background: linear-gradient(155deg, rgba(30, 41, 59, .72), rgba(15, 23, 42, .62));
    border-color: rgba(255, 255, 255, .12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 30px 60px -30px rgba(0, 0, 0, .6);
}
[data-theme="dark"] #tablero-notas-sec::after { opacity: .12; }
[data-theme="dark"] .tn-corcho { background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.2px); }
[data-theme="dark"] .tn-nota { filter: brightness(.94) saturate(.95); }
[data-theme="dark"] .tn-titulo h3,
[data-theme="dark"] .tn-vacio b,
[data-theme="dark"] .tn-modal-head h2 { color: #f1f5f9; }
[data-theme="dark"] .tn-titulo small,
[data-theme="dark"] .tn-modal-head p,
[data-theme="dark"] .tn-vacio { color: #94a3b8; }
[data-theme="dark"] .tn-modal { background: linear-gradient(155deg, rgba(30, 41, 59, .92), rgba(15, 23, 42, .86)); border-color: rgba(255, 255, 255, .12); }
[data-theme="dark"] .tn-form textarea,
[data-theme="dark"] .tn-chip:not(.is-activo),
[data-theme="dark"] .tn-emojis button,
[data-theme="dark"] .tn-btn-sec,
[data-theme="dark"] .tn-x { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); color: #e2e8f0; }
[data-theme="dark"] .tn-interruptor { color: #e2e8f0; }
[data-theme="dark"] .tn-foto-quitar { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); color: #fca5a5; }
[data-theme="dark"] .tn-foto-elegir { color: #e2e8f0; }

/* ── Menos movimiento ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    #tablero-notas-sec,
    .tn-modal,
    #modal-tablero-nota.tn-overlay,
    .tn-lupa { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
    #tablero-notas-sec *,
    #modal-tablero-nota *,
    .tn-aviso, .tn-aviso *,
    .tn-lupa, .tn-lupa * { transition: none !important; animation: none !important; }
}
