:root {
    /* Tema verde — idéntico a Synapsis 1.0 (default = Q1) */
    --sidebar-bg: #142e28;
    --sidebar-text: #d6ebe4;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: #198754;
    --content-bg: #f4f5f7;
    --text-color: #172b4d;
    --primary-color: #157347;
    --card-border: #dfe1e6;
    --pillar-border-left: #0f5132;

    /* Status — mismos colores que Synapsis 1.0 */
    --status-completed: #198754;
    --status-on-track:  #98e1ff; /* Azul más claro para In Progress */
    --status-at-risk:   #ffc107;
    --status-delayed:   #dc3545;
    --status-overdue:   #dc3545;
    --status-pending:   #adb5bd;
    --status-waiting:   #fd7e14;

    /* ── Mobile-responsive foundations (feature/ac/mobile-responsive) ──
       Breakpoint convention = Bootstrap 5 (sm 576 · md 768 · lg 992 · xl 1200).
       "Mobile" real se ataca por debajo de md (768px). Las custom properties NO
       funcionan dentro de condiciones @media, así que los breakpoints son
       convención documental; lo que SÍ se tokeniza aquí es el spacing de layout,
       que se reduce en móvil vía var() para ganar pantalla. Defaults = valores
       de escritorio actuales → cero cambio visual en escritorio.
       FOLD-SPLIT (2026-11-16): /todo tiene además un nivel «partido táctil»
       600–768px (dos columnas con ergonomía de móvil); ver su bloque. */
    --layout-content-pad: 1.5rem;   /* .content-body padding */
    --layout-topbar-pad-y: 0.6rem;  /* .topbar padding vertical */
    --layout-topbar-pad-x: 1.5rem;  /* .topbar padding horizontal */

    /* ── GTD-MIRRORS: color por lista GTD de /todo (sidebar + pills work).
       following/waiting/notthisweek fijados por Andreu (verde/naranja/rosa);
       cantstart (azul pizarra) y someday (morado) propuestos. Contraste AA
       sobre fondo claro. MANTENER EN SYNC con GTD_VIEW_COLORS (models.py). */
    --gtd-following: #1a7f37;      /* verde */
    --gtd-waiting: #b45309;        /* naranja */
    --gtd-notthisweek: #c2255c;    /* rosa */
    --gtd-cantstart: #475569;      /* azul pizarra */
    --gtd-someday: #6741d9;        /* morado */
    --gtd-goals: #0b7285;          /* cian oscuro (GOALS, no es carril) */
}

/* FIX-16: paleta del sidebar por cuatrimestre.
   Cíclica anual (2026Q1 y 2027Q1 mismo color). Se aplica independientemente
   del state (active/draft/closed) — la señalización de read-only sigue siendo
   el banner amarillo + el badge del topbar. */
body[data-quarter-q="2"] {
    --sidebar-bg: #5a1a1a;        /* granate */
    --sidebar-active-bg: #8b2a2a; /* granate más claro para el item activo */
    --pillar-border-left: #5a1a1a;
}
body[data-quarter-q="3"] {
    --sidebar-bg: #1a3a52;        /* azul petróleo */
    --sidebar-active-bg: #2a5a7a; /* azul petróleo más claro */
    --pillar-border-left: #1a3a52;
}

/* ── Layout ── */
body {
    background-color: var(--content-bg);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
#sidebar {
    width: 240px;
    min-width: 240px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease;
    overflow-x: hidden;
    overflow-y: auto;
    position: sticky;
    top: 0;
    height: 100vh;
}

#sidebar.collapsed {
    width: 56px;
    min-width: 56px;
}

#sidebar .sidebar-brand {
    padding: 1.2rem 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    white-space: nowrap;
    overflow: hidden;
}

#sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
    border-radius: 4px;
    margin: 1px 6px;
    font-size: 0.9rem;
    transition: background 0.15s;
}

#sidebar .nav-link:hover {
    color: var(--sidebar-text-hover);
    background-color: rgba(255,255,255,0.1);
}

#sidebar .nav-link.active {
    background-color: var(--sidebar-active-bg);
    color: #fff;
}

#sidebar .nav-link i {
    font-size: 1rem;
    min-width: 20px;
    text-align: center;
}

#sidebar.collapsed .nav-link span,
#sidebar.collapsed .sidebar-brand span {
    display: none;
}

#sidebar .sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 0.5rem 0;
}

.sidebar-user-footer {
    color: rgba(255,255,255,0.85);
    transition: background 0.15s;
    border-radius: 6px;
    margin: 0 0.5rem;
}
.sidebar-user-footer:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
#sidebar.collapsed .sidebar-user-info {
    display: none;
}

.sidebar-divider {
    border-color: rgba(255,255,255,0.1);
    margin: 0.25rem 1rem;
}

/* Botón extra pequeño para tablas de admin */
.btn-xs {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    line-height: 1.4;
    border-radius: 4px;
}

/* ── Main content ── */
.main-content {
    flex: 1;
    /* `clip` recorta el desbordamiento horizontal SIN convertir a .main-content
       en contenedor de scroll (a diferencia de `hidden`, que fuerza overflow-y a
       `auto`). Así el sticky de .topbar se ancla al scroll del viewport y no a un
       scroller intermedio que nunca llega a desplazarse. */
    overflow-x: clip;
    /* min-width:0 es OBLIGATORIO junto a `clip`: sin scroll container, el mínimo
       automático de este flex-item vuelve a ser `min-content` y .main-content se
       estira al ancho del contenido (p.ej. los controles de ancho fijo del Planner
       en móvil → scroll horizontal del documento). Con min-width:0 el item encoge a
       la línea flex y `clip` recorta el resto (regresión que caza
       tests/e2e/test_planner_mobile_overflow.py). `hidden` no lo necesitaba: un
       scroll container ya tiene mínimo automático 0. */
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.main-content .topbar {
    background: #fff;
    border-bottom: 1px solid var(--card-border);
    padding: var(--layout-topbar-pad-y) var(--layout-topbar-pad-x);
    display: flex;
    align-items: center;
    gap: 1rem;
    /* Fija la barra de supervisor arriba al scrollear. z 1030: por debajo de la
       bottom-nav móvil (1083), del sidebar offcanvas (1045) y su backdrop (1040)
       —que deben seguir tapándola— y del .ts-dropdown (1060). Se oculta entera en
       /todo, en modo present (logbook.css) y bajo el offcanvas móvil. */
    position: sticky;
    top: 0;
    z-index: 1030;
}

.main-content .content-body {
    padding: var(--layout-content-pad);
    flex: 1;
}

/* ── PC-1 — /todo full-width mode ────────────────────────────────────────
   The full-width toggle (topbar, only on /todo) adds `todo-fullwidth` to
   <body>. It hides the whole Synapsis nav rail and drops the content padding so
   the personal lens (.todo-app) spans the entire window like the Todoist app.
   The lens keeps its OWN project sidebar (.todo-nav). This is independent from
   the icon-collapse of #sidebar (`.collapsed`): here the sidebar is hidden
   outright, so neither state interferes with the other. */
body.todo-fullwidth #sidebar,
body.todo-fullwidth .sidebar-backdrop {
    display: none;
}
body.todo-fullwidth .content-body {
    padding: 0;
}
/* The .todo-app already fills the .content-body width; with padding removed it
   now reaches the window edges. Squeeze the topbar a touch so the toggle row
   doesn't feel detached from the edge-to-edge lens. */
body.todo-fullwidth .todo-app {
    border-radius: 0;
    border-left: none;
    border-right: none;
}
/* FIX dead-band: in normal mode .todo-app uses a fixed `height: calc(100vh -
   120px)` calibrated for the topbar + .content-body vertical padding (1.5rem
   top+bottom). Full-width drops that padding, so the fixed 120px over-subtracts
   and the lens ends short of the window bottom, leaving a big empty strip. We
   stop relying on the magic number HERE ONLY: make the
   .main-content → .content-body → .todo-app chain a flex column that fills the
   remaining height under the (already short) topbar. `min-height:0` lets the
   flex child shrink so .todo-main keeps its own internal scroll (no double
   scrollbar). Normal mode is untouched — these overrides are scoped to
   body.todo-fullwidth. */
body.todo-fullwidth .main-content { display: flex; flex-direction: column; }
body.todo-fullwidth .content-body { flex: 1; min-height: 0; }
body.todo-fullwidth .todo-app { height: 100%; min-height: 0; }

/* ── Planner — Pillar header ── */
.pillar-header {
    border-left: 5px solid var(--pillar-border-left);
    background: #fff;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.pillar-header:hover {
    background: #f8f9fa;
}

/* ── Planner — Challenge card ── */
.challenge-card {
    border: 1px solid var(--card-border);
    border-radius: 6px;
    background: #fff;
    margin-bottom: 1rem;
}

.challenge-card .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid var(--card-border);
    padding: 0.6rem 0.9rem;
    cursor: pointer;
}

/* ── Utility: Clickable elements ── */
.cursor-pointer { cursor: pointer !important; }
.hover-bg-light:hover { background-color: rgba(0,0,0,0.03) !important; transition: background 0.15s; }
.hover-shadow-sm:hover { box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075) !important; transition: box-shadow 0.15s; }

/* ── Milestone row ── */
.milestone-item {
...    cursor: pointer;
    background-color: #fafbfc;
    border-bottom: 1px solid #f0f0f0;
    padding: 0.45rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    transition: background 0.1s;
}

/* PLANNER-MS-NAME (2026-10-29): en el escritorio, las columnas estrechas del
   Planner (vista All, tres columnas de ~390px) dejaban el NOMBRE del milestone a
   0px: los controles de ancho fijo (código, fecha 88px, carril 118px, caras,
   botón) se comían la fila y el único elemento flexible era el nombre. Ahora la
   fila puede partirse y el nombre pide 140px: si caben, todo sigue en UNA línea
   como antes; si no, fecha/carril/caras bajan a una segunda línea. Es la misma
   regla que ya tenía el móvil (PLANNER-MOBILE, abajo), con un mínimo fijo. */
.milestone-item {
    flex-wrap: wrap;
    row-gap: 0.15rem;
}
.milestone-item .milestone-name {
    flex: 1 1 140px;
    min-width: 140px;
}

.milestone-item:hover {
    background-color: #f0f4ff;
}

.milestone-item:last-child {
    border-bottom: none;
    border-radius: 0 0 4px 4px;
}

/* ── Milestone row — colores suaves por status ── */
.milestone-item[data-status="Completed"] {
    background-color: #f0fdf4;
}
.milestone-item[data-status="Overdue"] {
    background-color: #fff1f2;
}
.milestone-item[data-status="Waiting"] {
    background-color: #fff7ed;
}
.milestone-item[data-status="In Progress"] {
    background-color: #f0f9ff;
}

/* Tachado en milestones completados */
.milestone-item[data-status="Completed"] .milestone-name {
    text-decoration: line-through;
    color: #6c757d;
}

/* Hover: mantener una ligera oscurización sobre el color de status */
.milestone-item[data-status="Completed"]:hover  { background-color: #dcfce7; }
.milestone-item[data-status="Overdue"]:hover    { background-color: #ffe4e6; }
.milestone-item[data-status="Waiting"]:hover    { background-color: #ffedd5; }
.milestone-item[data-status="In Progress"]:hover { background-color: #e0f2fe; }

.milestone-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Status colors */
.status-completed  { background-color: var(--status-completed); }
.status-on-track   { background-color: var(--status-on-track); }
.status-at-risk    { background-color: var(--status-at-risk); }
.status-delayed    { background-color: var(--status-delayed); }
.status-overdue    { background-color: var(--status-overdue); }
.status-pending    { background-color: var(--status-pending); }
.status-waiting    { background-color: var(--status-waiting); }

/* Status badges */
.badge-completed  { background-color: var(--status-completed) !important; }
.badge-on-track   { background-color: var(--status-on-track) !important; color: #000 !important; }
.badge-at-risk    { background-color: var(--status-at-risk) !important; color: #000 !important; }
.badge-delayed    { background-color: var(--status-delayed) !important; }
.badge-overdue    { background-color: var(--status-overdue) !important; }
.badge-pending    { background-color: var(--status-pending) !important; color: #000 !important; }
.badge-waiting    { background-color: var(--status-waiting) !important; color: #000 !important; }

/* Manual closure (Achieved / Backlog / Abandoned) — overrides computed status */
.badge-achieved   { background-color: #16a34a !important; color: #fff !important; }
.badge-backlog    { background-color: #38bdf8 !important; color: #fff !important; }
.badge-abandoned  { background-color: #6c757d !important; color: #fff !important; }

/* New "Ready" status: all children done, awaiting human decision (achieved/abandoned/backlog). */
.badge-ready      { background-color: #0d6efd !important; color: #fff !important; }

/* Faded look for items closed manually */
[data-closure="achieved"] .entity-name,
[data-closure="backlog"] .entity-name,
[data-closure="abandoned"] .entity-name { opacity: 0.65; }
[data-closure="abandoned"] .entity-name { text-decoration: line-through; }

/* ── Hierarchical code ── */
.hierarchical-code {
    font-family: monospace;
    background: rgba(0,0,0,0.05);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.72em;
    color: #555;
}

/* ── Date badge ── */
.date-badge {
    font-size: 0.72rem;
    background: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid #ebecf0;
    white-space: nowrap;
}

/* ── Avatar / role badge ── */
.role-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: bold;
    flex-shrink: 0;
}

.bg-leader   { background-color: #142e28; }
.bg-executor { background-color: #198754; }
/* LEADER-UNIFY (CORE-4c): .bg-acounter eliminado — el rol accountable usa
   .bg-leader en todos los niveles. */

/* ── Progress bar dual ── */
.progress-dual {
    position: relative;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: visible;
}

.progress-dual .progress-total {
    height: 100%;
    border-radius: 3px;
    background: var(--primary-color);
    transition: width 0.3s;
}

.progress-dual .progress-expected-marker {
    position: absolute;
    top: -2px;
    width: 2px;
    height: 10px;
    background: #dc3545;
    border-radius: 1px;
}

/* ── Flash messages ── */
.flash-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    width: 340px;
    max-width: calc(100vw - 2rem); /* en móvil no desborda el viewport */
}

/* ── Forms ── */
.form-card {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 700px;
}

/* ── Breadcrumb ── */
.breadcrumb-sm {
    font-size: 0.8rem;
    margin-bottom: 0;
}

.breadcrumb-sm .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
}

/* ── Kanban GTD (KAN-1c) ── */
.kanban-page { padding-bottom: 2rem; }

.kanban-toolbar {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.kanban-board {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    min-height: 65vh;
}

/* KAN-HSCROLL: scrollbar horizontal "proxy" encima de las columnas.
   El inner se estira a board.scrollWidth (vía JS) para que aparezca la
   barra nativa; kanban.js sincroniza scrollLeft con el board. Oculta por
   defecto (display:none) — JS la muestra solo si el board desborda en un
   puntero fino (desktop). En móvil/táctil hay swipe + scroll-snap (F7). */
.kanban-scroll-top {
    display: none;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 0.35rem;
}
.kanban-scroll-top-inner {
    height: 1px;
}
@media (pointer: coarse) {
    .kanban-scroll-top { display: none !important; }
}

/* Scrollbar fina y gris claro (estilo Todoist, igual que en /todo) tanto en la
   barra proxy de arriba como en la nativa del board. Firefox: scrollbar-width/
   color; WebKit/Chromium: ::-webkit-scrollbar. */
.kanban-scroll-top,
.kanban-board {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.16) transparent;
}
.kanban-scroll-top::-webkit-scrollbar,
.kanban-board::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.kanban-scroll-top::-webkit-scrollbar-track,
.kanban-board::-webkit-scrollbar-track {
    background: transparent;
}
.kanban-scroll-top::-webkit-scrollbar-thumb,
.kanban-board::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.16);
    border-radius: 8px;
    border: 2px solid transparent;       /* borde transparente → thumb más fino y "flotando" */
    background-clip: padding-box;
}
.kanban-scroll-top::-webkit-scrollbar-thumb:hover,
.kanban-board::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.28);
    background-clip: padding-box;
}

/* Pan con arrastre (botón derecho en cualquier sitio; botón izquierdo en el
   fondo vacío). kanban.js añade .kanban-panning mientras se arrastra. */
.kanban-board.kanban-panning {
    cursor: grabbing;
    user-select: none;
}
.kanban-board.kanban-panning .kanban-card {
    cursor: grabbing;
}

.kanban-column {
    flex: 0 0 290px;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    min-height: 350px;
    transition: background-color 0.15s ease;
}
.kanban-column[data-lane="deferred"] { background: #f3f1f7; }
.kanban-column[data-lane="backlog"]  { background: #f0f7fa; }
.kanban-column[data-lane="next"]     { background: #f5f5f5; }
.kanban-column[data-lane="doing"]    { background: #fff8e6; }
.kanban-column[data-lane="waiting"]  { background: #fef0e6; }
.kanban-column[data-lane="ready"]    { background: #e6f4ff; }
.kanban-column[data-lane="done"]     { background: #e7f7e7; }

.kanban-column.sortable-drag-over {
    background-color: #d6efd6;
    outline: 2px dashed #4caf50;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem 0.5rem;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 0.5rem;
}
.kanban-collapse-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 0 0.2rem;
    font-size: 0.85rem;
    line-height: 1;
}
.kanban-collapse-btn:hover { color: #333; }
.kanban-column-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    flex: 1 1 auto;
}
.kanban-column-count {
    font-size: 0.75rem;
}

/* Hidden-column chip (in the toolbar) */
#kanban-hidden-columns {
    border-top: 1px dashed #d0d0d0;
    padding-top: 0.4rem;
}
.kanban-hidden-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #ececec;
    border: 1px solid #d8d8d8;
    border-radius: 14px;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    color: #444;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.kanban-hidden-chip:hover {
    background: #d9e9ff;
    border-color: #0d6efd;
    color: #0d6efd;
}
.kanban-hidden-chip-count {
    background: white;
    border-radius: 9px;
    padding: 0 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
}

.kanban-cards {
    flex: 1 1 auto;
    min-height: 30px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.kanban-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    cursor: grab;
    transition: box-shadow 0.15s ease, transform 0.05s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    font-size: 0.85rem;
}
.kanban-card:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}
/* KAN-A11Y: clear keyboard-focus ring (cards are focusable, role=button). */
.kanban-card:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
    box-shadow: 0 3px 10px rgba(13,110,253,0.25);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card[data-closure="backlog"] { opacity: 0.7; }
.kanban-card[data-status="Completed"] .kanban-card-body,
.kanban-card[data-closure="achieved"] .kanban-card-body {
    text-decoration: line-through;
    color: #6c757d;
}
.kanban-card[data-kind="milestone"] { border-left: 3px solid #16a34a; }
.kanban-card[data-kind="task"][data-is-loose="1"] { border-left: 3px solid #0dcaf0; }
.kanban-card[data-kind="task"][data-is-loose="0"] { border-left: 3px solid #0d6efd; }

.kanban-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}
.kanban-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}
.kanban-chip {
    display: inline-block;
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    background: #e9ecef;
    color: #495057;
    line-height: 1.4;
}
.kanban-chip.chip-milestone   { background: #d1f3e0; color: #155724; }
.kanban-chip.chip-objective   { background: #e7d5f5; color: #4c2882; }
.kanban-chip.chip-loose       { background: #cff4fc; color: #055160; }
.kanban-chip.chip-personal    { background: #fde2e1; color: #842029; }
.kanban-chip.chip-git         { background: #fff3cd; color: #664d03; }
.kanban-chip.chip-challenge   { background: #e9ecef; color: #495057; font-family: monospace; }
/* KAN-ALLQ: chip del cuatrimestre de la card. Solo se pinta cuando NO es el que
   se esta mirando (con el interruptor "All quarters" encendido), asi que tiene
   que destacar sobre el gris del codigo de challenge. */
.kanban-chip.chip-quarter     { background: #ffe5d0; color: #8a4b08; font-family: monospace; }
.kanban-card-code             { font-size: 0.7rem; font-family: monospace; }
.kanban-card-body { font-weight: 500; color: #212529; word-break: break-word; }
.kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.4rem;
    gap: 0.3rem;
}
.kanban-card-assignee {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}
.kanban-card-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #0d6efd;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
}
.kanban-card-team {
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    background: #6c757d;
    color: white;
}
.kanban-card-team.team-only {
    background: #0d6efd;
    font-weight: 600;
}
.kanban-card.team-only {
    border-left: 3px solid #0d6efd;
}
/* KAN-1f.4: privacidad visible en la card. Borde y chip en granate
   apagado para que el usuario distinga de un vistazo qué items son
   privados, sin ser tan llamativo como un rojo de error. */
.kanban-card-team.team-private {
    background: #8b2a4a;
    font-weight: 600;
}
.kanban-card.team-private {
    border-left: 3px solid #8b2a4a;
}
/* Si la card es team-only Y team-private, el borde privado gana
   (vertical-align del lock pequeño). */
.kanban-card.team-only.team-private {
    border-left: 3px solid #8b2a4a;
}
/* task-privacy-individual: privacidad PERSONAL. Color distinto al granate
   del team-private (un índigo) para que el usuario distinga "privado por
   team" de "privado por persona" de un vistazo. */
.kanban-card.personal-private {
    border-left: 3px solid #5b3fa0;
}
.kanban-card-personal-private {
    font-size: 0.75rem;
    color: #5b3fa0;
    margin-left: 0.25rem;
}
.kanban-card-due { font-size: 0.75rem; }
/* SUBTASK-DEPTH: contador de subtareas (done/total) en la card del Kanban. */
.kanban-card-subtasks {
    font-size: 0.72rem;
    color: #6c757d;
    margin-left: 0.4rem;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}
.kanban-card-subtasks.all-done { color: #2e7d32; }

.kanban-quickadd-btn {
    margin-bottom: 0.5rem;
    background: transparent;
    border: 1px dashed #b8b8b8;
    color: #6c757d;
    border-radius: 6px;
    padding: 0.35rem 0.55rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.kanban-quickadd-btn:hover {
    background: white;
    border-color: #6c757d;
    color: #333;
}
.kanban-quickadd-form {
    margin-bottom: 0.5rem;
    padding: 0.4rem;
    background: white;
    border: 1px solid #0d6efd;
    border-radius: 6px;
}
.kanban-card[data-kind="objective"] { border-left: 3px solid #6f42c1; }
.kanban-card[data-is-readonly="1"] {
    cursor: default;
    background: #fafafa;
}

.kanban-card-ghost { opacity: 0.4; background: #f0f8ff !important; }
.kanban-card-drag  { transform: rotate(2deg); }

/* SortableJS ghost — generic fallback */
.sortable-ghost {
    opacity: 0.4;
    background: #c8f7c5;
}

/* ── SortableJS ghost ── */
.sortable-ghost {
    opacity: 0.4;
    background: #c8f7c5;
}

/* ── Drag handle — visible on hover ── */
.milestone-item .drag-handle {
    opacity: 0;
    transition: opacity 0.15s;
}
.milestone-item:hover .drag-handle {
    opacity: 0.5;
}
/* En dispositivos táctiles no hay :hover → los drag-handles quedarían invisibles
   (F6, presentación pura). Los hacemos siempre visibles cuando el puntero no
   soporta hover, para que el arrastre sea descubrible en móvil. NO toca el JS de
   DnD. *(Hasta 2026-10-06 habia debajo un bloque que los escondia en un
   cuatrimestre cerrado; QTR-NOFREEZE lo retiro con el resto del candado.)* */
@media (hover: none) {
    .milestone-item .drag-handle,
    .drag-handle,
    .challenge-drag-handle,
    .objective-drag-handle {
        opacity: 0.5;
    }

    /* A (todo-mobile): afordancias táctiles de /todo. En pantallas sin hover
       las acciones inline y el drag-handle ya no dependen de :hover (de lo
       contrario son invisibles al tacto). En móvil la densidad oculta las
       acciones inline (ver bloque @media max-width:768px); aquí solo se cubren
       tablets/táctiles anchos donde el board todavía las muestra. */
    .todo-row .todo-row-actions { opacity: 1; pointer-events: auto; }
    /* Drag handle: oculto en reposo, visible solo en hover de la fila
       (.todo-row:hover .todo-drag). En táctil sin hover no se fuerza visible
       para no añadir ruido visual; el swipe móvil cubre el reordenamiento. */
}

/* ── Quick-add row ── */
.milestone-quickadd-row {
    border-radius: 4px;
    transition: background-color 0.15s;
}
.milestone-quickadd-row:hover {
    background-color: rgba(25,135,84,0.06);
}

/* ── Inline edit: contenteditable focus ── */
[contenteditable]:focus {
    outline: 2px solid var(--primary-color);
    border-radius: 3px;
    background: #fff;
    padding: 0 2px;
}

/* ── Planner person filter ── */
[data-filtered-hidden="true"] { display: none !important; }

/* ── Planner challenge layout toggle (UX-6) ── */
#planner-content[data-challenge-layout="list"] .pillar-body .row.g-2 > [data-planner-item="challenge"] {
    flex: 0 0 100%;
    max-width: 100%;
}

/* ── Objective header (collapsible) ── */
.obj-header {
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.1s;
}
.obj-header:hover {
    background: #f0f4ff;
}

/* ── Tom Select overrides (keep compact) ── */
.ts-wrapper.multi .ts-control {
    min-height: 30px;
    padding: 2px 6px;
    font-size: 0.85rem;
}
.ts-wrapper.multi .ts-control input {
    font-size: 0.85rem;
}
/* K2 fix: el dropdown de Tom Select (p.ej. "Linked milestone" del panel) se
   ancla a <body> (dropdownParent) para no recortarse; sin un z-index alto queda
   POR DETRÁS del offcanvas de detalle (z-index 1045) y parece que no funciona.
   1060 lo deja sobre offcanvas y modales (1055), bajo popover/tooltip (1070+). */
.ts-dropdown { z-index: 1060; }

/* ── Offcanvas details panel ── */
.offcanvas-body .breadcrumb {
    font-size: 0.75rem;
}

/* ── Timeline / Gantt chart ── */
.timeline-legend-box {
    width: 13px;
    height: 13px;
    border-radius: 3px;
    margin-right: 5px;
    flex-shrink: 0;
}
.timeline-legend-text { font-size: 0.78rem; white-space: nowrap; }
.timeline-wrapper {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    overflow-x: auto;
    overflow-y: visible;
    min-height: 200px;
}
.gantt-container { min-width: 100%; }
#gantt-chart { min-width: 100%; display: block; }

/* Colores de barras por custom_class */
.bar-wrapper.gantt-pillar    .bar { fill: #0f5132 !important; }
.bar-wrapper.gantt-challenge .bar { fill: #157347 !important; }
.bar-wrapper.gantt-objective .bar { fill: #20c997 !important; }
.bar-wrapper.gantt-completed .bar { fill: #198754 !important; }
.bar-wrapper.gantt-overdue   .bar { fill: #dc3545 !important; }
.bar-wrapper.gantt-urgent    .bar { fill: #fd7e14 !important; }
.bar-wrapper.gantt-active    .bar { fill: #0d6efd !important; }
.bar-wrapper.gantt-future    .bar { fill: #6f42c1 !important; }
.bar-wrapper.gantt-no-date   .bar { fill: #adb5bd !important; opacity: 0.55; }

/* ── Select2 integration ── */
.select2-container--default .select2-selection--multiple {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    min-height: 38px;
    padding: 2px 4px;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(21,115,71,0.2);
    outline: none;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--primary-color);
    border: none;
    color: #fff;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 0.78rem;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: rgba(255,255,255,0.75);
    margin-right: 4px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #fff;
    background: transparent;
}
.select2-dropdown {
    border-color: #ced4da;
    border-radius: 0.375rem;
    z-index: 9999;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color);
}
/* Select2 inside offcanvas needs higher z-index */
.offcanvas .select2-container { width: 100% !important; }

/* Panel lateral: min-width de escritorio (antes inline en base.html; F2 lo movió
   a CSS para poder relajarlo en móvil sin tocar el escritorio). */
#details-offcanvas {
    min-width: 480px;
}

/* Panel lateral expandido */
#details-offcanvas.panel-expanded {
    width: calc(100vw - 58px) !important;
}

/* En móvil el panel ocupa casi todo el ancho y suelta el min-width de 480px
   (rompía a 375px). */
@media (max-width: 768px) {
    /* SynapsisPanel (#details-offcanvas) a PANTALLA COMPLETA en móvil para TODOS los
       usuarios y desde cualquier vista (Planner, Kanban, /todo…) → homogeneidad y más
       espacio para editar milestones/tareas en el móvil. GLOBAL (no solo /todo). */
    #details-offcanvas,
    #details-offcanvas.panel-expanded {
        min-width: 0;
        width: 100vw !important;
        max-width: 100vw;
    }
    /* En /todo, oculta la bottom-nav y el FAB mientras el panel está abierto (z-index
       1083/1086) para que no se solapen sobre el offcanvas (1045). Esos elementos solo
       existen en /todo, así que esta regla no afecta a Kanban/Planner. */
    body:has(#details-offcanvas.show) .todo-bottomnav,
    body:has(#details-offcanvas.show) .todo-fab {
        display: none;
    }
}

/* ── Responsive sidebar: offcanvas deslizante en móvil (F2) ── */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        z-index: 1045;   /* sobre el contenido y el backdrop (1040) */
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 2px 0 14px rgba(0, 0, 0, 0.28);
    }
    #sidebar.show {
        transform: translateX(0);
    }
    /* El colapso de escritorio (rail de 56px) no aplica en móvil: el sidebar es
       un panel deslizante a ancho completo. Revertimos el override por si la
       clase quedó puesta desde una sesión de escritorio. */
    #sidebar.collapsed {
        width: 240px;
        min-width: 240px;
    }
    #sidebar.collapsed .nav-link span,
    #sidebar.collapsed .sidebar-brand span {
        display: inline;
    }
    #sidebar.collapsed .sidebar-user-info {
        display: block;
    }
    /* R6.3: cuando el sidebar se abre desde la lente (botón "Synapsis" de la
       bottom-nav), se muestra a pantalla completa (no el rail de 240px), como
       un menú de navegación móvil de toda la app. */
    #sidebar.synapsis-fullnav {
        width: 100vw;
        min-width: 100vw;
        max-width: 100vw;
        /* La barra inferior (.app-bottomnav / .todo-bottomnav, z 1083) queda VISIBLE
           sobre el menú full-screen; reservamos su alto (56px) para que los últimos
           items del menú no queden ocultos tras ella. */
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }
}

/* Backdrop del sidebar móvil (F2): atenúa el contenido cuando el sidebar está
   abierto; un click sobre él lo cierra (wiring en base.html). */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(0, 0, 0, 0.45);
}
.sidebar-backdrop.show {
    display: block;
}

/* ════════════════════════════════════════════════════════════════════════
   Shell móvil — Fase 1 (base.html, TODA la app)
   Barra inferior fija + botón X de cierre del menú full-screen.
   TODO capado a móvil (<=768px). En escritorio (>=769px) NADA aparece y el
   layout queda byte-equivalente.
   ════════════════════════════════════════════════════════════════════════ */

/* Por defecto (incluido escritorio) la barra inferior global NO existe. */
.app-bottomnav { display: none; }

/* X de cierre del menú full-screen: solo visible en móvil (ver @media). */
@media (max-width: 768px) {
    /* G1: en móvil el menú full-screen ocupa toda la pantalla bajo la status
       bar y el notch → reservamos el área segura ARRIBA y a la IZQUIERDA para
       que "Synapsis" no quede cortado. Flex + gap alinea icono y texto. Solo
       dentro del @media móvil (PC byte-igual: el header del rail de escritorio
       no se ve afectado). La X de cierre se eliminó: el menú se cierra al pulsar
       cualquier botón de la barra inferior. */
    #sidebar .sidebar-brand {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding-top: calc(1.2rem + env(safe-area-inset-top, 0px));
        padding-left: calc(1rem + env(safe-area-inset-left, 0px));
    }

    /* Barra inferior fija de navegación rápida (mobile-only). Mismo lenguaje
       visual que la bottom-nav de la lente (.todo-bottomnav) para coherencia. */
    .app-bottomnav {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        z-index: 1083;   /* sobre sidebar (1045) y backdrop (1040): la barra inferior
                            sigue VISIBLE aunque el menú full-screen esté abierto
                            (mismo z que .todo-bottomnav, coherencia). */
        display: flex;
        align-items: stretch;
        height: 56px;
        background: #fff;
        border-top: 1px solid #e6e6e6;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    }
    .app-bottomnav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-height: 44px;
        border: none;
        background: transparent;
        color: var(--td-text-2, #808080);
        cursor: pointer;
        padding: 6px 1px;   /* laterales finos para que quepan 6 items a 360-390px */
        min-width: 0;
        text-decoration: none;
    }
    .app-bottomnav-item.active { color: var(--td-red, #db4035); }
    .app-bottomnav-icon { font-size: 1.2rem; line-height: 1; }
    .app-bottomnav-label {
        font-size: 0.62rem; line-height: 1;
        max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }

    /* Toggle de los 4 contextuales por `data-mode` en la barra. El botón [Synapsis]
       fija data-mode=synapsis (los 4 → áreas de Synapsis). El set "todo" (enlaces a
       las vistas de la lente) solo se ve si data-mode=todo. Por defecto la barra
       arranca en modo synapsis (atributo en el markup). */
    .app-bottomnav[data-mode="synapsis"] .app-bottomnav-td { display: none; }
    .app-bottomnav[data-mode="todo"] .app-bottomnav-syn { display: none; }

    /* No tapar el final del contenido con la barra fija: reservamos su alto
       (56px) + safe-area en el cuerpo. Solo en móvil. */
    .main-content .content-body {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }
}

/* Escritorio (cinturón-y-tirantes): la barra inferior nunca aparece. */
@media (min-width: 769px) {
    .app-bottomnav { display: none; }
}

/* ── Mobile-responsive foundations: layout spacing (F1) ──
   Por debajo de md (768px) se reduce el padding del topbar y del cuerpo para
   ganar pantalla en móvil. Solo afecta a los tokens var(); no toca componentes
   concretos (eso lo hacen F2/F4). */
@media (max-width: 768px) {
    :root {
        --layout-content-pad: 1rem;
        --layout-topbar-pad-x: 1rem;
    }
}

/* ── Mobile-responsive: vistas con dolor real en móvil (F5) ──
   Presentación pura, todo dentro de <768px → cero cambio en escritorio.
   Afecta a tres vistas: /oneonone index, /timeline (solo header), /search.
   No toca lógica ni JS; los hooks de clase viven en los templates respectivos. */
@media (max-width: 768px) {

    /* /oneonone index — cabecera: título arriba, controles abajo a ancho completo */
    .oneonone-index-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .oneonone-index-header > div {
        width: 100%;
    }
    /* Form "New session": los 3 controles dejan de tener ancho fijo y se apilan
       a ancho completo (el style="max-width" inline se neutraliza aquí). */
    .oneonone-new-form {
        flex-wrap: wrap;
        width: 100%;
    }
    .oneonone-new-form > .form-select,
    .oneonone-new-form > .btn {
        flex: 1 1 100%;
        max-width: none !important;
    }

    /* Session cards: título arriba, meta de badges envuelta debajo */
    .oneonone-session-card {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
    .oneonone-session-meta {
        flex-wrap: wrap;
        width: 100%;
    }

    /* /timeline — solo el header (título + botones view-mode). El Gantt no se toca. */
    .timeline-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }
    .timeline-header .btn-group {
        width: 100%;
    }

    /* /search — barra de búsqueda: el input ocupa toda la fila; toggle + botón
       envuelven debajo en lugar de comprimir el input. */
    .search-bar-form {
        flex-wrap: wrap;
    }
    .search-bar-form > .form-control {
        flex: 1 1 100%;
    }
}

/* ── Mobile-responsive: tablas densas + afinados de fundaciones (F6) ──
   Presentación pura, todo dentro de <768px → cero cambio en escritorio.
   - Topbar search: encoge su max-width para no empujar al quarter selector.
   - Tablas densas (research / directory / dashboard) → cards apiladas.
   La tabla completa se conserva en escritorio (≥768px). */
@media (max-width: 768px) {

    /* Topbar search: el max-width:340px inline empuja fuera al quarter selector
       en pantallas estrechas. Lo reducimos para que el topbar respire. */
    .topbar-search {
        max-width: 180px !important;
    }

    /* ── Tablas → cards apiladas (research index + team directory + dashboard) ──
       Patrón: cada <tr> se vuelve un bloque tipo tarjeta; cada <td> una fila
       label:valor (la etiqueta viene de data-label via ::before). El <thead>
       se oculta. Solo aplica a tablas marcadas con .table-stack-mobile. */
    table.table-stack-mobile thead {
        display: none;
    }
    table.table-stack-mobile,
    table.table-stack-mobile tbody,
    table.table-stack-mobile tr,
    table.table-stack-mobile td {
        display: block;
        width: 100%;
    }
    table.table-stack-mobile tr {
        border: 1px solid var(--card-border, #e5e7eb);
        border-radius: 8px;
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.75rem;
        background: #fff;
    }
    table.table-stack-mobile td {
        border: none;
        padding: 0.2rem 0;
        text-align: left !important;
        max-width: none !important;
        white-space: normal !important;
    }
    /* Etiqueta de campo, tomada de data-label, antes del valor */
    table.table-stack-mobile td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.65rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: #8a8f98;
        font-weight: 600;
        margin-bottom: 0.1rem;
    }
    /* La primera celda (título) actúa de cabecera de la card: sin etiqueta y
       algo más destacada. */
    table.table-stack-mobile td.stack-title {
        font-size: 1rem;
        font-weight: 600;
        padding-top: 0;
        border-bottom: 1px solid var(--card-border, #eee);
        padding-bottom: 0.4rem;
        margin-bottom: 0.3rem;
    }
    /* El título no muestra la etiqueta data-label (::before): es la cabecera limpia */
    table.table-stack-mobile td.stack-title[data-label]::before {
        display: none;
    }
    /* Checkbox + nombre en la MISMA línea como cabecera de la card.
       La celda del checkbox flota a la izquierda (no ocupa fila completa) y
       el título (.stack-title) fluye a su lado; el resto de celdas siguen
       debajo como filas label:valor. Solo en directory (.stack-check). */
    table.table-stack-mobile td.stack-check {
        float: left;
        width: auto;
        padding: 0;
        margin-right: 0.5rem;
        margin-top: 0.15rem;
    }
    /* El título queda junto al checkbox y conserva su borde de cabecera. */
    table.table-stack-mobile td.stack-check + td.stack-title {
        overflow: hidden; /* crea contexto de bloque junto al float */
    }
    /* La celda siguiente al título limpia el float para volver a apilar. */
    table.table-stack-mobile td.stack-title ~ td {
        clear: both;
    }
    /* Las acciones se alinean a la izquierda en la card */
    table.table-stack-mobile td.stack-actions .d-flex {
        justify-content: flex-start !important;
    }
}

/* ── Mobile-responsive: Kanban scroll-snap (F7) ──
   Presentación pura, todo dentro de <768px → cero cambio en escritorio.
   En escritorio las 7 columnas (GTD lanes) se ven en fila con scroll-x si no
   caben (flex: 0 0 290px sobre .kanban-board ya con overflow-x:auto). En móvil
   ese ancho fijo aprieta/desborda mal, así que aquí cada columna pasa a ocupar
   ~88% del viewport y el contenedor "engancha" (scroll-snap) en cada columna al
   hacer swipe. El padding-right deja ver un pelín de la siguiente columna para
   invitar al desplazamiento. No toca JS ni la estructura del board. */
@media (max-width: 768px) {
    .kanban-board {
        /* Snap horizontal mandatorio: el swipe se detiene alineado a una columna.
           El gap entre columnas se reduce un poco para ganar pantalla. */
        scroll-snap-type: x mandatory;
        gap: 0.5rem;
        /* Padding lateral: el primer/último snap respira y la siguiente columna
           asoma por el borde derecho. -webkit-overflow-scrolling para inercia iOS. */
        padding-right: 12vw;
        -webkit-overflow-scrolling: touch;
        /* scroll-padding alinea el snap dejando un pequeño margen a la izquierda. */
        scroll-padding-left: 0.25rem;
    }
    .kanban-column {
        /* Cada columna ~88% del ancho del viewport → se ve el borde de la
           siguiente como pista de swipe. Suelta el flex-basis fijo de 290px. */
        flex: 0 0 88vw;
        max-width: 88vw;
        /* El borde izquierdo de la columna es el punto de enganche del snap. */
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }
}

/* ── Toast UI Editor — offcanvas panel ── */
.toast-editor-mount .toastui-editor-defaultUI {
    border: 1px solid #dee2e6;
    border-radius: 4px;
}
.toastui-editor-contents,
.toastui-editor-contents p {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.875rem;
}

/* ── Edit page — two-column layout ── */
.form-card-wide {
    max-width: none;
}
.edit-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    align-items: start;
}
.edit-grid-editor {
    position: sticky;
    top: 1rem;
}
@media (max-width: 860px) {
    .edit-grid { grid-template-columns: 1fr; }
    .edit-grid-editor { position: static; }
}

/* ─── MAIL-1: mentions ──────────────────────────────────────────────── */
.mention-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    background-color: #e7f1ff;
    color: #0a58ca;
    font-weight: 600;
    text-decoration: none;
}
.mention-dropdown {
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 0;
    margin: 0;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.mention-dropdown li.mention-item {
    padding: 5px 12px;
    cursor: pointer;
}
.mention-dropdown li.mention-item.highlighted,
.mention-dropdown li.mention-item:hover {
    background-color: #e7f1ff;
}
.mention-dropdown li.mention-empty {
    padding: 5px 12px;
    color: #888;
    font-style: italic;
    cursor: default;
}

/* Deep-link highlight: aplicado por details_panel.js cuando el usuario aterriza
   desde un email de @mention. La clase se añade 3s y luego se quita: el bg
   amarillo dura 2s plenos y los últimos 1s se desvanece. */
.comment-highlight {
    background-color: #fff3cd;
    transition: background-color 1s ease-out 2s;
    border-radius: 4px;
}

/* B2: auto-grow de los textarea del editor one-on-one (oneonone_autogrow.js).
   La altura la gestiona el JS; aquí solo permitimos resize manual vertical y
   una transición suave al crecer. */
#form-objectives textarea,
#form-values textarea {
    resize: vertical;
    transition: height 0.08s ease-out;
}

/* ─────────────────────────────────────────────
   PTS-3 — Vista Todoist personal (/todo)
   Layout de dos paneles calcado al "tacto" de Todoist.
   ───────────────────────────────────────────── */
.todo-app {
    display: flex;
    gap: 0;
    height: calc(100vh - 120px);
    min-height: 480px;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    overflow: hidden;
    /* NV-1: anchura de la columna izquierda de proyectos. El divisor arrastrable
       (.todo-nav-resizer) actualiza esta custom property; JS la restaura desde
       localStorage ('todoNavWidth') en init() con el mismo clamp. */
    --todo-nav-w: 240px;
}

/* SCROLL-1: en /todo (escritorio) la app llena EXACTO el alto del viewport bajo
   el topbar, para que la columna de proyectos y la de tareas scrolleen
   INDEPENDIENTES (cada una con su overflow-y) en vez de scrollear el contenedor
   externo arrastrando ambas. Sustituye el `height: calc(100vh - 120px)` + `min-
   height:480px` mágicos de .todo-app (que descuadraban con banner de quarter o
   ventanas cortas → overflow externo). La cadena flex ya existe (.main-content es
   flex column, .content-body flex:1); solo faltaba acotar la altura y que .todo-app
   rellene. Scope: solo /todo (body:has(.todo-app)); el móvil tiene su propio bloque
   (@media max-width:768px), así que esto va en @media min-width:769px. También
   arregla SCROLL-2: sin el outer scroll, el panel de detalle (absolute top:0) abre
   arriba y no "a media altura". */
@media (min-width: 769px) {
    body:has(.todo-app) .app-layout { height: 100vh; }
    body:has(.todo-app) .main-content { min-height: 0; }
    body:has(.todo-app) .content-body { min-height: 0; overflow: hidden; }
    body:has(.todo-app) .todo-app { height: 100%; min-height: 0; }
}

/* SCROLLBARS (estilo Todoist): finos y gris claro en las zonas scrolleables de
   /todo (columna de proyectos, lista de tareas, panel de detalle). Más elegantes
   que el scrollbar grueso por defecto de Windows. Scope: solo /todo. Firefox usa
   scrollbar-width/color; WebKit/Chromium usa ::-webkit-scrollbar. */
.todo-nav, .todo-main, .todo-panel {
    scrollbar-width: thin;                          /* Firefox: barra fina */
    scrollbar-color: rgba(0, 0, 0, 0.16) transparent;  /* thumb gris claro / track transparente */
}
.todo-nav::-webkit-scrollbar,
.todo-main::-webkit-scrollbar,
.todo-panel::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.todo-nav::-webkit-scrollbar-track,
.todo-main::-webkit-scrollbar-track,
.todo-panel::-webkit-scrollbar-track {
    background: transparent;
}
.todo-nav::-webkit-scrollbar-thumb,
.todo-main::-webkit-scrollbar-thumb,
.todo-panel::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.16);
    border-radius: 8px;
    /* Borde transparente con background-clip → el thumb se ve aún más fino y
       "flota" separado del borde, como en Todoist. */
    border: 2px solid transparent;
    background-clip: padding-box;
}
.todo-nav::-webkit-scrollbar-thumb:hover,
.todo-main::-webkit-scrollbar-thumb:hover,
.todo-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.28);
    background-clip: padding-box;
}

/* Sidebar de vistas */
.todo-nav {
    width: var(--todo-nav-w, 240px);
    flex-shrink: 0;
    background: #fafafa;
    border-right: 1px solid #eee;
    padding: 16px 10px;
    overflow-y: auto;
    /* Sin scroll horizontal: los nombres largos se truncan (como Todoist). */
    overflow-x: hidden;
    /* NV-1: ancla del divisor absoluto del borde derecho. */
    position: relative;
}

/* NV-1: divisor arrastrable entre .todo-nav y .todo-main. Tira estrecha pegada
   al borde derecho del sidebar; se ilumina sutilmente al hover/arrastrar. Solo
   escritorio: el bloque @media (max-width:768px) lo oculta (drawer full-screen). */
.todo-nav-resizer {
    position: absolute;
    top: 0;
    right: -3px;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 5;
    background: transparent;
    /* La línea visible que se ilumina al hover/arrastrar. */
    transition: background 0.12s ease;
    touch-action: none;       /* permite drag con Pointer Events sin scroll */
}
.todo-nav-resizer:hover,
.todo-nav-resizer.active {
    background: rgba(219, 64, 53, 0.35);
}
/* Mientras se arrastra: sin selección de texto ni cursor de texto en toda la app. */
body.todo-resizing,
body.todo-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}
/* .todo-nav-synapsis: "back to Synapsis" entry. It's a MOBILE-ONLY affordance
   (equivalent to the bottom-nav [Synapsis] button); the desktop /todo already
   sits inside the global Synapsis shell (base.html), so it's redundant here and
   was leaking in unstyled. Hidden on desktop; the @media (max-width:768px) block
   below re-shows it (display:flex) on mobile. */
.todo-nav-synapsis { display: none; }
/* PTS-3i — botón "Add task" del sidebar (rojo, calcado a Todoist) */
.todo-addtask-btn {
    display: flex; align-items: center; gap: 8px; width: 100%;
    border: none; background: transparent; cursor: pointer;
    padding: 6px 8px; margin-bottom: 10px; border-radius: 6px;
    color: #db4035; font-size: 0.92rem; font-weight: 600; text-align: left;
}
.todo-addtask-btn:hover { background: #fff0ee; }
.todo-addtask-plus { font-size: 1.15rem; line-height: 1; display: flex; }

/* PTS-3w — botón Search del sidebar + command palette */
.todo-search-btn {
    display: flex; align-items: center; gap: 8px; width: 100%;
    border: none; background: transparent; cursor: pointer;
    padding: 6px 8px; margin-bottom: 12px; border-radius: 6px;
    color: #666; font-size: 0.88rem; text-align: left;
}
.todo-search-btn:hover { background: #f0f0f0; }
.todo-search-kbd {
    margin-left: auto; font-size: 0.68rem; color: #aaa;
    border: 1px solid #e0e0e0; border-radius: 4px; padding: 0 5px; background: #fafafa;
}
.todo-search-backdrop {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.28); z-index: 1190;
}
.todo-search-modal {
    position: fixed; top: 12vh; left: 50%; transform: translateX(-50%);
    width: min(560px, 92vw); background: #fff; border-radius: 12px; z-index: 1191;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28); overflow: hidden;
}
.todo-search-inputwrap {
    display: flex; align-items: center; gap: 10px; padding: 14px 16px;
    border-bottom: 1px solid #eee;
}
.todo-search-inputwrap .bi { color: #999; font-size: 1rem; }
.todo-search-input {
    flex: 1; border: none; outline: none; font-size: 1rem; color: #222; background: transparent;
}
.todo-search-results { max-height: 56vh; overflow-y: auto; padding: 6px; }
.todo-search-empty { color: #aaa; font-size: 0.86rem; padding: 16px; text-align: center; }
.todo-search-grouplabel {
    font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.04em;
    color: #aaa; font-weight: 600; padding: 8px 10px 4px;
}
.todo-search-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    border: none; background: transparent; cursor: pointer; text-align: left;
    padding: 8px 10px; border-radius: 7px; font-size: 0.88rem; color: #333;
}
.todo-search-item:hover, .todo-search-item.sel { background: #f0f4ff; }
.todo-search-item .bi { color: #888; font-size: 0.9rem; flex-shrink: 0; }
.todo-search-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-search-ctx { font-size: 0.72rem; color: #aaa; flex-shrink: 0; }

.todo-nav-section { margin-bottom: 18px; }
.todo-nav-heading {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
    padding: 6px 10px;
    font-weight: 600;
}
.todo-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 5px 10px;
    border-radius: 6px;
    color: #333;
    font-size: 13px;
    cursor: pointer;
}
.todo-nav-item:hover { background: #efefef; }
.todo-nav-item.active { background: #ffefe9; color: #d1453b; font-weight: 600; }
.todo-nav-item i { font-size: 1rem; width: 18px; text-align: center; }
.todo-newlist input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 7px 10px;
    font-size: 0.9rem;
    color: #666;
}
.todo-newlist input:focus { outline: none; background: #efefef; border-radius: 6px; }

/* PTS-3o/3p — botón "+ Add filter" + modal de filtro */
.todo-addrow-btn {
    display: flex; align-items: center; gap: 8px; width: 100%;
    border: none; background: transparent; cursor: pointer;
    padding: 6px 10px; border-radius: 6px; color: #888; font-size: 0.85rem;
}
.todo-addrow-btn:hover { background: #efefef; color: #db4035; }
.todo-addrow-btn .bi { color: #db4035; }
.todo-filter-match { display: flex; align-items: center; gap: 6px; margin: 10px 0; }
.todo-filter-match > span { font-size: 0.78rem; color: #888; margin-right: 4px; }
.todo-filter-match button {
    border: 1px solid #ddd; background: #fafafa; border-radius: 6px;
    padding: 3px 12px; font-size: 0.8rem; cursor: pointer; color: #444;
}
.todo-filter-match button.sel {
    border-color: #db4035; background: #ffefe9; color: #db4035; font-weight: 600;
}
.todo-filter-labels { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.todo-filter-chip {
    display: inline-flex; align-items: center; gap: 5px;
    border: 1px solid #e0e0e0; background: #fff; border-radius: 14px;
    padding: 3px 10px; font-size: 0.8rem; color: #555; cursor: pointer;
}
.todo-filter-chip .bi { font-size: 0.7rem; }
.todo-filter-chip.sel { font-weight: 600; }

/* PTS-3e — proyectos gestionables (menú ···, color, favorito, rename) */
.todo-project-item { position: relative; display: flex; align-items: center; }
/* DRAG-NEST (rehecho 2026-09-13) — un arrastre de proyecto tiene DOS respuestas
   posibles y cada una tiene su forma:

     ENTRE dos filas (reordenar) → el hueco del fantasma se ve como un HUECO:
       borde discontinuo gris y el nombre atenuado, a la altura donde va a caer.
     DENTRO de una fila (anidar) → el hueco se corre una sangría a la derecha,
       se pinta en el color de acento con su codo de "cuelga de aquí", y la fila
       de arriba —el futuro padre— se enmarca.

   Hasta esta fecha solo existía la segunda mitad (el recuadro de la fila
   destino) y era inalcanzable: se disparaba al pasar por el tercio central
   vertical de la fila, franja que el propio fantasma de SortableJS ocupa antes
   de que el puntero llegue. Medido: 11 px de banda en escritorio, 15 en móvil, y
   1 acierto en 114 intentos con el ratón. Ahora lo decide el gesto lateral. */

/* El hueco, en modo REORDENAR. La regla global `.sortable-ghost` (verde, opacidad
   .4) es del Kanban; aquí se sobrescribe SOLO dentro del árbol de proyectos. */
.todo-project-tree .sortable-ghost {
    opacity: 1;
    background: #f6f6f6;
    outline: 2px dashed #c4c4c4;
    outline-offset: -2px;
    border-radius: 6px;
}
.todo-project-tree .sortable-ghost .todo-nav-item,
.todo-project-tree .sortable-ghost .todo-project-btn {
    background: transparent;
    opacity: 0.5;
}
/* El mismo hueco, en modo ANIDAR: sangrado un nivel (14px, el escalón del árbol),
   en el color de acento, con el codo que dice "cuelgo de la fila de arriba". */
.todo-project-tree .sortable-ghost.todo-ghost-nesting {
    margin-left: 14px;
    background: #ffefe9;
    outline: 2px solid #d1453b;
}
.todo-project-tree .sortable-ghost.todo-ghost-nesting .todo-nav-item,
.todo-project-tree .sortable-ghost.todo-ghost-nesting .todo-project-btn {
    opacity: 1;
    color: #d1453b;
    font-weight: 600;
}
.todo-project-tree .sortable-ghost.todo-ghost-nesting::before {
    content: '';
    position: absolute;
    left: -11px;
    top: -8px;
    bottom: 50%;
    width: 9px;
    border-left: 2px solid #d1453b;
    border-bottom: 2px solid #d1453b;
    border-bottom-left-radius: 6px;
    pointer-events: none;
}

/* La fila que va a RECIBIR al proyecto (el futuro padre). */
.todo-project-item.todo-drop-into {
    outline: 2px solid #d1453b;
    outline-offset: -2px;
    border-radius: 6px;
    background: #ffefe9;
}
.todo-project-item.todo-drop-into > .todo-project-btn,
.todo-project-item.todo-drop-into .todo-nav-item {
    background: transparent;
}
/* DRAG-ORDER — mismo feedback "soltar SOBRE" (anidar) para las FILAS de tarea
   de la vista de proyecto. El reorder entre filas usa la animación nativa de
   SortableJS; el modo "into" se distingue con el recuadro resaltado. */
.todo-item.todo-drop-into > .todo-row {
    outline: 2px solid #d1453b;
    outline-offset: -2px;
    border-radius: 6px;
    background: #ffefe9;
}

/* DRAG-NEST de TAREAS (2026-09-17) — el HUECO también avisa, como en el sidebar.
   Hasta esta fecha la fila de tarea solo tenía la mitad del aviso (el recuadro
   del destino, arriba) y el hueco lo pintaba la regla GLOBAL `.sortable-ghost`
   (verde, opacidad .4, herencia del Kanban): mientras arrastrabas no había forma
   de saber si la tarea iba a caer ENTRE dos filas o DENTRO de la de arriba —
   que son dos resultados distintos, y uno de ellos cambia de padre. */
.todo-rows .sortable-ghost {
    opacity: 1;
    background: #f6f6f6;
    outline: 2px dashed #c4c4c4;
    outline-offset: -2px;
    border-radius: 6px;
}
.todo-rows .sortable-ghost .todo-row {
    background: transparent;
    opacity: 0.5;
    border-bottom-color: transparent;
}
/* El mismo hueco, en modo ANIDAR: sangrado UN nivel del árbol de subtareas
   (26 px, el mismo escalón que `.todo-row-nested`), en el color de acento y con
   el codo que dice "cuelgo de la fila de arriba". */
.todo-rows .sortable-ghost.todo-ghost-nesting {
    position: relative;
    margin-left: 26px;
    background: #ffefe9;
    outline: 2px solid #d1453b;
}
.todo-rows .sortable-ghost.todo-ghost-nesting .todo-row {
    opacity: 1;
    color: #d1453b;
    font-weight: 600;
}
.todo-rows .sortable-ghost.todo-ghost-nesting::before {
    content: '';
    position: absolute;
    left: -15px;
    top: -8px;
    bottom: 50%;
    width: 13px;
    border-left: 2px solid #d1453b;
    border-bottom: 2px solid #d1453b;
    border-bottom-left-radius: 6px;
    pointer-events: none;
}
/* PTS-3s — árbol de proyectos: caret de plegar + indent */
.todo-tree-caret {
    border: none; background: transparent; cursor: pointer; color: #aaa;
    width: 16px; flex-shrink: 0; padding: 0; font-size: 0.7rem;
}
.todo-tree-caret:hover { color: #555; }
.todo-tree-spacer { width: 16px; flex-shrink: 0; }
.todo-proj-move { padding: 6px 8px; border-top: 1px solid #f0f0f0; margin-top: 4px; }
.todo-proj-move label {
    display: block; font-size: 0.66rem; text-transform: uppercase;
    color: #aaa; margin-bottom: 3px; font-weight: 600;
}
.todo-proj-move select {
    width: 100%; border: 1px solid #ddd; border-radius: 5px;
    padding: 3px 6px; font-size: 0.8rem; color: #444;
}
.todo-project-item.active .todo-project-btn {
    background: #ffefe9; color: #d1453b; font-weight: 600;
}
.todo-project-btn { flex: 1; min-width: 0; }
/* Truncar nombres largos con ellipsis (evita el scroll horizontal del sidebar). */
.todo-nav-item { min-width: 0; }
.todo-nav-item > span:not(.todo-count) {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.todo-project-btn .todo-fav { color: #f9c000; font-size: 0.72rem; margin-left: 4px; flex-shrink: 0; }
/* PTS-3g: contadores del sidebar (estilo Todoist, a la derecha). */
.todo-count {
    margin-left: auto; font-size: 0.74rem; color: #999;
    padding: 0 2px; min-width: 18px; text-align: right;
}
.todo-nav-item.active .todo-count { color: #d1453b; }
.todo-proj-menu-btn {
    opacity: 0; border: none; background: transparent; color: #999;
    cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.todo-project-item:hover .todo-proj-menu-btn { opacity: 1; }
.todo-proj-menu-btn:hover { background: #e6e6e6; }
.todo-proj-menu {
    position: absolute; right: 4px; top: 30px; z-index: 30; background: #fff;
    border: 1px solid #e0e0e0; border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); padding: 6px; min-width: 184px;
}
.todo-proj-menu-sep {
    height: 1px; background: #ececeb; margin: 5px 2px;
}
.todo-proj-menu > button {
    display: flex; align-items: center; gap: 8px; width: 100%; border: none;
    background: transparent; text-align: left; padding: 6px 8px;
    border-radius: 5px; font-size: 0.85rem; color: #333; cursor: pointer;
}
.todo-proj-menu > button:hover { background: #f0f0f0; }
.todo-proj-menu .todo-danger { color: #d1453b; }
.todo-color-row { display: flex; gap: 5px; padding: 6px 8px; }
.todo-color-dot {
    width: 16px; height: 16px; border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1); cursor: pointer; padding: 0;
}
.todo-rename-input {
    flex: 1; border: 1px solid #d1453b; border-radius: 6px;
    padding: 5px 8px; font-size: 0.9rem;
}

/* Panel principal */
/* PC-2: `scrollbar-gutter: stable` reserva el ancho del scrollbar vertical SIEMPRE,
   tenga o no la lista overflow. Así el contenido (header + filas) no "baila"
   horizontalmente al aparecer/desaparecer la barra, y el header queda alineado
   con las filas en todo momento. */
.todo-main {
    flex: 1; padding: 24px 32px; overflow-y: auto; background: #fcfaf8;
    scrollbar-gutter: stable;
}
/* PC-2: el título a la izquierda y el grupo de acciones (scope + Pool + Display)
   pegado a la derecha vía `margin-left:auto`. Se sustituye el antiguo
   `justify-content:space-between` (que repartía el sobrante entre cada control
   suelto y dejaba un hueco muerto entre el título y "Display"). El header comparte
   el mismo inset lateral que .todo-list/.todo-row (ambos hijos de .todo-main), así
   que título y Display caen exactamente sobre los bordes de las filas. */
.todo-header {
    margin-bottom: 16px; display: flex; align-items: center; gap: 12px;
}
.todo-header-actions {
    display: flex; align-items: center; gap: 12px; margin-left: auto;
}
.todo-title { font-size: 26px; line-height: 35px; font-weight: 700; color: #202020; margin: 0; }
/* PTS-3u — botón + popover "Display" (orden) */
.todo-display-btn {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid transparent; background: transparent; cursor: pointer;
    padding: 5px 10px; border-radius: 6px; font-size: 0.82rem; color: #666;
}
.todo-display-btn:hover { background: #f1f1f1; }
.todo-display-btn.set { color: #db4035; }
.todo-display-pop {
    position: absolute; right: 0; top: 100%; z-index: 10; margin-top: 6px;
    width: 200px; background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16); padding: 6px;
}
.todo-display-label {
    font-size: 0.66rem; text-transform: uppercase; color: #aaa;
    font-weight: 600; padding: 4px 8px;
}
.todo-display-item {
    display: flex; align-items: center; gap: 8px; width: 100%;
    border: none; background: transparent; text-align: left; cursor: pointer;
    padding: 6px 8px; border-radius: 6px; font-size: 0.85rem; color: #333;
}
.todo-display-item .bi { width: 14px; color: #db4035; }
.todo-display-item:hover { background: #f3f3f3; }
.todo-display-item.sel { font-weight: 600; }
/* SORT-CREATED-MODIFIED: qué hace "Default" + sentido de Created/Last modified.
   El popover creció: en pantallas bajas hace scroll en vez de salirse. */
.todo-display-pop { width: 224px; max-height: calc(100vh - 140px); overflow-y: auto; }
.todo-display-hint { font-size: 0.72rem; color: #888; padding: 0 8px 4px 30px; line-height: 1.3; }
.todo-display-dir { display: flex; gap: 4px; padding: 2px 8px 4px 30px; }
.todo-display-dir button {
    flex: 1; border: 1px solid #e0e0e0; background: #fff; border-radius: 6px;
    font-size: 0.74rem; padding: 3px 4px; color: #555; cursor: pointer; white-space: nowrap;
}
.todo-display-dir button.sel { border-color: #db4035; color: #db4035; font-weight: 600; }
/* INCREMENT C — separador + toggle "Show completed" en el popover Display. */
.todo-display-sep { height: 1px; background: #ececec; margin: 5px 4px; }
.todo-display-toggle .bi { color: #666; }
.todo-display-toggle.sel .bi { color: #db4035; }

/* PTS-3u (K2) — tira semanal de Upcoming */
.todo-weekstrip { display: flex; gap: 6px; margin-bottom: 16px; }
.todo-weekday {
    position: relative; flex: 1; display: flex; flex-direction: column;
    align-items: center; gap: 2px; border: 1px solid #eee; background: #fff;
    border-radius: 8px; padding: 6px 0; cursor: pointer;
}
.todo-weekday:hover { background: #fafafa; border-color: #e0e0e0; }
.todo-weekday.today { border-color: #db4035; }
.todo-weekday-wd { font-size: 0.66rem; text-transform: uppercase; color: #999; }
.todo-weekday-num { font-size: 0.95rem; font-weight: 600; color: #333; }
.todo-weekday.today .todo-weekday-num { color: #db4035; }
.todo-weekday-dot {
    width: 5px; height: 5px; border-radius: 50%; background: #db4035;
    position: absolute; bottom: 4px;
}

/* PTS-3y — toast con Undo */
.todo-toast {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
    z-index: 1100; display: flex; align-items: center; gap: 14px;
    background: #2e2e2e; color: #fff; border-radius: 8px;
    padding: 10px 16px; font-size: 0.86rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.todo-toast button {
    border: none; background: transparent; color: #ff8c8c; cursor: pointer;
    font-weight: 600; font-size: 0.86rem; padding: 0;
}
.todo-toast button:hover { text-decoration: underline; }
/* SERVER-SAYS-SO — la variante de AVISO del servidor (422/403/404 con su
   frase). Mismo toast, borde rojo, para que se distinga de un "Deshecho". */
.todo-toast.is-error {
    background: #5a1a1a; border-left: 4px solid #e06a6a;
}

.todo-quickadd {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 18px;
    transition: border-color 0.15s;
}
.todo-quickadd:focus-within { border-color: #d1453b; }
.todo-quickadd i { color: #d1453b; font-size: 1.1rem; }
.todo-quickadd input { flex: 1; border: none; outline: none; font-size: 0.95rem; }
.todo-add-btn {
    border: none; background: #d1453b; color: #fff; border-radius: 6px;
    padding: 5px 14px; font-size: 0.85rem; cursor: pointer;
}
.todo-add-btn:hover { background: #b03a31; }
.todo-quickadd-hint { font-size: 0.78rem; color: #999; margin: -10px 0 16px 4px; }
.todo-quickadd-hint kbd {
    background: #eee; border-radius: 3px; padding: 1px 5px;
    font-size: 0.72rem; color: #555;
}
.todo-quickadd-hint em { font-style: normal; color: #777; }
.todo-quickadd-tokens { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 10px 4px; }
.todo-token {
    font-size: 0.74rem; border-radius: 10px; padding: 1px 9px;
    background: #eef; color: #446;
}
.todo-token.tok-project { background: #e7f1ff; color: #246fe0; }
.todo-token.tok-label { background: #f1f1f1; color: #777; }
.todo-token.tok-priority { background: #ffefe9; color: #d1453b; }

.todo-error {
    background: #fdecea; color: #b3261e; border: 1px solid #f5c6c2;
    border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; font-size: 0.88rem;
}
/* OFFLINE-SYNC F2b: minimal, unobtrusive sync-status pill. Neutral/muted so it
   reads as ambient status, not an error (the error banner above is red).
   RENDER-FLICKER R3b: OUT of the document flow — as an in-flow block its
   appear/disappear (e.g. "Syncing…" on tab focus) pushed the task list ~30px
   down and back up. Now it floats fixed at the bottom-right corner (ambient,
   Todoist-style), so toggling it never displaces the list. z-index 1035: above
   the list content, below the offcanvas backdrop/panel (1040/1045) and the
   mobile bottom-nav/FAB (1083/1086; the ≤768px block moves it above the
   bottom-nav, bottom-left, clear of the FAB). */
.todo-sync-status {
    position: fixed;
    bottom: 16px;
    right: 20px;
    z-index: 1035;
    background: #f1f3f5; color: #5f6b76; border: 1px solid #e2e6ea;
    border-radius: 6px; padding: 4px 10px; font-size: 0.8rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
/* OFFLINE-SYNC F3: error state of the sync pill (a flush failed; will retry). */
.todo-sync-status.is-error {
    background: #fff4f3; color: #b23b30; border-color: #f3c9c4;
}
/* OFFLINE-SYNC F3: transient notice (rejected change reverted / storage full). */
.todo-sync-notice {
    display: block;
    background: #fff8e6; color: #7a5c00; border: 1px solid #f0e0a8;
    border-radius: 6px; padding: 6px 10px; margin-bottom: 12px; font-size: 0.8rem;
}
/* POISON-OUTBOX: PERSISTENT dead-letter notice — N changes didn't sync, with
   Retry / Dismiss. Amber like the transient notice but stays until resolved. */
.todo-sync-quarantine {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    background: #fff8e6; color: #7a5c00; border: 1px solid #f0e0a8;
    border-radius: 6px; padding: 6px 10px; margin-bottom: 12px; font-size: 0.8rem;
}
.todo-sync-quarantine-btn,
.todo-sync-quarantine-dismiss {
    background: transparent; border: 1px solid #d8c98e; color: #7a5c00;
    border-radius: 5px; padding: 2px 10px; font-size: 0.78rem; cursor: pointer;
}
.todo-sync-quarantine-btn { background: #f6e8b8; font-weight: 600; }
.todo-sync-quarantine-btn:disabled { opacity: 0.6; cursor: default; }
.todo-sync-quarantine-dismiss { border-color: transparent; text-decoration: underline; }
/* OFFLINE-SYNC Fix 3: soft offline notice for views/scopes that need a
   connection (Company/Pool GTD, strategic tree, saved filters). Calm/blue, NOT
   an error alert — the personal views render from the store and never show it. */
.todo-conn-notice {
    display: block;
    background: #eef4fb; color: #3a5a78; border: 1px solid #cfe0f0;
    border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; font-size: 0.85rem;
}

/* PERMALINK — aviso de un enlace ?task=<uuid> que no se pudo abrir (no existe /
   no lo puedes ver / sin conexion). Tono de aviso, NO de error rojo: el enlace
   puede ser perfectamente legitimo y el problema estar en el lector. */
.todo-permalink-notice {
    display: flex; align-items: flex-start; gap: 8px;
    background: #fdf6e3; color: #7a5c1e; border: 1px solid #eedfae;
    border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; font-size: 0.85rem;
}
.todo-permalink-notice > span { flex: 1 1 auto; }
.todo-permalink-notice-act {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
    background: #fff; border: 1px solid #e0cf95; border-radius: 4px;
    color: #7a5c1e; text-decoration: none; cursor: pointer;
    padding: 2px 8px; font-size: 0.8rem; white-space: nowrap;
}
.todo-permalink-notice-act:hover { background: #fbf1d8; color: #5e4715; }
.todo-permalink-notice-x {
    flex: 0 0 auto; background: none; border: 0; color: inherit;
    opacity: 0.65; cursor: pointer; padding: 0 2px; line-height: 1;
}
.todo-permalink-notice-x:hover { opacity: 1; }

/* ── PTS-3h — Filas de tarea calcadas a Todoist (tema claro) ──────────
   Tokens de prioridad y fecha tomados de las guías de estilo reales
   (Docs … todoist_ui_reference.md §16). Acento Todoist #db4035. */
.todo-app {
    --td-red: #db4035;
    --td-p1: #db4035;
    --td-p2: #ff9933;
    --td-p3: #4073ff;
    --td-p4: #808080;
    --td-overdue: #db4035;
    --td-today: #058527;
    --td-tomorrow: #e08000;
    --td-future: #808080;
    --td-text: #202020;
    --td-text-2: #666666;
}
.todo-list { display: flex; flex-direction: column; }
.todo-group { display: flex; flex-direction: column; margin-bottom: 6px; }
/* DRAG-ORDER: contenedor ordenable de filas (SortableJS). Conserva el apilado
   vertical que antes daban los .todo-item como hijos directos de .todo-group. */
.todo-rows { display: flex; flex-direction: column; }
.todo-group-header {
    font-size: 14px; font-weight: 700; color: #202020;
    padding: 14px 4px 6px; border-bottom: 1px solid #eee;
}
/* INLINE-SECTIONS: cabecera de sección inline (estilo Todoist). Fila con el
   toggle de plegado (chevron + nombre + contador) y un "+ Add task" que aparece
   al pasar el ratón. Reusa el peso/color de .todo-group-header. */
.todo-section-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 16px 4px 4px; border-bottom: 1px solid #eee;
}
.todo-section-toggle {
    display: flex; align-items: center; gap: 6px;
    background: none; border: 0; cursor: pointer;
    font-size: 14px; font-weight: 700; color: #202020;
    padding: 2px 4px; border-radius: 4px; flex: 1 1 auto; text-align: left;
}
.todo-section-toggle:hover { background: rgba(0, 0, 0, 0.04); }
.todo-section-toggle .bi { font-size: 12px; color: #808080; }
.todo-section-count {
    font-size: 12px; font-weight: 600; color: #808080; margin-left: 2px;
}
.todo-section-add {
    display: inline-flex; align-items: center; gap: 4px;
    background: none; border: 0; cursor: pointer;
    font-size: 13px; color: #808080; padding: 2px 6px; border-radius: 4px;
    opacity: 0; transition: opacity 0.12s ease;
}
.todo-section-header:hover .todo-section-add,
.todo-section-add:focus-visible { opacity: 1; }
.todo-section-add:hover { background: rgba(0, 0, 0, 0.04); color: #202020; }
/* Táctil: sin hover → el "+ Add task" siempre visible. */
@media (hover: none) { .todo-section-add { opacity: 1; } }
/* SECTIONS-MGMT: menú "···" en la cabecera de una sección inline (rename/delete).
   Reusa .todo-proj-menu-btn (opacity 0 por defecto) → visible al hover del header. */
.todo-section-menuwrap { flex: 0 0 auto; }
.todo-section-header:hover .todo-section-menuwrap .todo-proj-menu-btn,
.todo-section-menuwrap .todo-proj-menu-btn:focus-visible { opacity: 1; }
@media (hover: none) { .todo-section-menuwrap .todo-proj-menu-btn { opacity: 1; } }
/* SECTIONS-MGMT: fila de una lista GTD especial con su menú "···" (Mirror of +
   Add section). El botón del nav ocupa el ancho; el kebab aparece al hover. */
.todo-nav-row { position: relative; display: flex; align-items: center; }
.todo-nav-row > .todo-nav-item { flex: 1 1 auto; }
.todo-special-menu-btn { flex: 0 0 auto; }
.todo-nav-row:hover .todo-special-menu-btn,
.todo-special-menu-btn:focus-visible { opacity: 1; }
@media (hover: none) { .todo-special-menu-btn { opacity: 1; } }
.todo-row {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 4px 9px 0;
    border-bottom: 1px solid #eeeeee;
}
/* Escritorio: .todo-row-fg es un envoltorio transparente (los hijos participan en el
   flex de .todo-row, layout original). En móvil el @media lo vuelve flex con transform
   para el swipe. */
.todo-row-fg { display: contents; }
.todo-row:hover { background: #fbfbfb; }
.todo-row.focused { background: #f4f8ff; box-shadow: inset 2px 0 0 #4073ff; }
/* SUBTASK-AS-TASK: subtarea = fila completa, indentada bajo su padre.
   BUG-NEST: la indentación crece por NIVEL real de anidación (--nest-depth, que
   pone _todo_row.html: 1 = subtarea directa, 2 = nieta, 3, 4…). Antes era un valor
   fijo (34px) para cualquier nivel anidado, así que 2/3/4 se pintaban iguales.
   Paso de 26px/nivel + 8px de base → nivel 1 = 34px (idéntico al diseño previo),
   nivel 2 = 60px, nivel 3 = 86px, nivel 4 = 112px. El nivel está capado en JS a 6. */
.todo-row-nested { padding-left: calc(var(--nest-depth, 1) * 26px + 8px); }
.todo-row-nested::before {
    content: ""; position: absolute;
    /* La guía vertical se alinea ~18px a la izquierda del contenido de la fila. */
    left: calc(var(--nest-depth, 1) * 26px - 10px); top: 0; bottom: 0;
    border-left: 2px solid #ededed;
}
.todo-row:hover .todo-drag { opacity: 1; }
/* DRAG-ORDER (descubribilidad): cuando el arrastre de tareas está ACTIVO (vista de
   proyecto + sort "default" → la lista lleva .todo-can-drag), el grip ⠿ se ve
   siempre (gris suave), no solo al hover, para que se note que se puede reordenar/
   anidar arrastrando. Al hover, full. En el resto de vistas el grip sigue oculto
   hasta el hover (decorativo). */
.todo-list.todo-can-drag .todo-drag { opacity: 0.5; }
.todo-list.todo-can-drag .todo-row:hover .todo-drag { opacity: 1; }
/* Reveal the overlay on hover AND keyboard focus inside the row (a11y). When
   shown, restore pointer-events so the icons are clickable. */
.todo-row:hover .todo-row-actions,
.todo-row:focus-within .todo-row-actions {
    opacity: 1; pointer-events: auto;
}

/* Drag handle (placeholder visual; el DnD real llega en PTS-3t) */
.todo-drag {
    flex-shrink: 0; width: 14px; margin-top: 2px;
    color: #c0c0c0; font-size: 0.95rem; line-height: 1;
    opacity: 0; cursor: grab; transition: opacity 0.12s;
    display: flex; align-items: center; justify-content: center;
}

.todo-check {
    flex-shrink: 0;
    width: 18px; height: 18px;
    margin-top: 2px;
    border: 1px solid #999999;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: background 0.12s;
}
.todo-check:hover::after {
    content: "\F26E"; /* bi-check */
    font-family: "bootstrap-icons";
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; color: #888;
}
/* Color del check por prioridad (p1 urgente → rojo … p4 → gris) + tinte */
.todo-row.completed .todo-content { text-decoration: line-through; color: #aaa; }
.todo-row.completed .todo-desc-sub { text-decoration: line-through; }
.todo-row.completed .todo-check { background: #888; border-color: #888; }
.todo-row.completed .todo-check::after {
    content: "\F26E"; font-family: "bootstrap-icons"; position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; color: #fff;
}
.todo-row.prio-urgent .todo-check { border-color: var(--td-p1); background: rgba(219, 64, 53, 0.08); }
.todo-row.prio-high   .todo-check { border-color: var(--td-p2); background: rgba(255, 153, 0, 0.08); }
.todo-row.prio-medium .todo-check { border-color: var(--td-p3); background: rgba(64, 115, 255, 0.08); }
/* P4 / no priority: keep the neutral grey checkbox border (#999, base rule),
   NOT the P4 flag colour (--td-p4 #808080). Default tasks are prio-low now. */
.todo-row.prio-low    .todo-check { border-color: #999999; }

.todo-body { flex: 1; min-width: 0; cursor: pointer; }
.todo-content {
    font-size: 0.875rem; line-height: 21px; color: var(--td-text); word-break: break-word;
    /* Todoist: el título de la fila se limita a 2 líneas con "…" (el panel de detalle
       muestra el título completo). Evita que un título largo desborde la lista. */
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* INCREMENT B — marca de tipo (milestone/task) siempre visible al inicio de la
   fila. Discreta (atenuada) y alineada con el título; el texto del título fluye
   a su lado (float). Colores coherentes con los chips de tipo (kind-*). */
.todo-type-icon { float: left; margin: 1px 6px 0 0; line-height: 1.4; }
.todo-type-icon .bi { font-size: 0.82rem; }
.todo-type-icon.is-milestone .bi { color: #2e9b63; }
.todo-type-icon.is-work .bi      { color: #4a7fbf; }
.todo-type-icon.is-personal .bi  { color: #b5666a; }
.todo-row.completed .todo-type-icon .bi { color: #bbb; }
/* LINK-1: enlaces detectados en el nombre de la tarea. FASE 5 (L4): mismo color que
   el texto (no rojo) + subrayado tenue; el hover refuerza ligeramente el subrayado. */
.todo-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(0, 0, 0, 0.28);
    text-underline-offset: 2px;
}
.todo-link:hover { color: inherit; text-decoration-color: currentColor; }
.todo-desc-sub {
    font-size: 12px; color: var(--td-text-2); margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.todo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.todo-due {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 0.75rem; color: var(--td-future);
}
.todo-due .bi { font-size: 0.72rem; }
.todo-due .todo-recur { font-size: 0.66rem; }
.todo-due.due-overdue  { color: var(--td-overdue); }
.todo-due.due-today    { color: var(--td-today); }
.todo-due.due-tomorrow { color: var(--td-tomorrow); }
.todo-due.due-future   { color: var(--td-future); }
.todo-chip {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 12px; color: #666; background: transparent;
    border-radius: 4px; padding: 1px 4px;
}
.todo-chip .bi { font-size: 0.64rem; opacity: 0.9; }

/* PTS-4b.1 — Synapsis Projects (proyección del árbol estratégico) */
.todo-syn-heading {
    display: flex; align-items: center; gap: 4px;
}
/* PRJ-2 — caret de colapso de SECCIÓN del sidebar (Projects / Synapsis Projects).
   Grupo caret+label a la izquierda; el control de cola (+ o scope Mine/All) empujado
   a la derecha con margin-left:auto, recreando el space-between previo del heading. */
.todo-section-caret {
    border: none; background: transparent; cursor: pointer; color: #aaa;
    width: 16px; flex-shrink: 0; padding: 0; font-size: 0.7rem; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.todo-section-caret:hover { color: #555; }
.todo-syn-heading > .todo-proj-add,
.todo-syn-heading > .todo-syn-scope { margin-left: auto; }
.todo-syn-scope, .todo-list-scope { display: inline-flex; gap: 2px; }
.todo-syn-scope button, .todo-list-scope button {
    border: none; background: transparent; cursor: pointer;
    font-size: 0.68rem; color: #999; padding: 1px 6px; border-radius: 4px;
    text-transform: none; letter-spacing: 0;
}
.todo-syn-scope button:hover, .todo-list-scope button:hover { background: #efefef; color: #333; }
.todo-syn-scope button.sel, .todo-list-scope button.sel { background: #ffefe9; color: #d1453b; font-weight: 600; }
/* El toggle de la lista vive en el header, junto al título: separación. */
/* PC-2: dentro de .todo-header-actions el espaciado lo da el `gap`; el antiguo
   margin-left (cuando scope era hermano suelto del título) ya no aplica ahí. */
.todo-header-actions .todo-list-scope { margin-left: 0; }
.todo-list-scope { margin-left: 12px; }
.todo-pool-toggle {
    border: 1px solid #e0e0e0; background: #fff; cursor: pointer;
    font-size: 0.7rem; color: #888; padding: 2px 8px; border-radius: 5px;
    margin-left: 8px; display: inline-flex; align-items: center; gap: 4px;
}
.todo-pool-toggle:hover { background: #f5f5f5; color: #333; }
.todo-pool-toggle.sel { background: #ffefe9; color: #d1453b; border-color: #f3c4ba; }

/* PTS-4c.5 — editor de filtro: color + favorito + preview */
.todo-filter-meta {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin: 10px 0; flex-wrap: wrap;
}
.todo-filter-meta .todo-color-row { margin: 0; }
.todo-color-dot.sel { outline: 2px solid #333; outline-offset: 1px; }
.todo-color-none {
    background: #fff !important; border: 1px solid #ccc; color: #888;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.7rem;
}
.todo-filter-preview {
    color: #888; font-size: 0.78rem; font-style: italic;
}
.todo-modal-hint {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.todo-syn-empty { padding: 6px 10px; font-size: 0.8rem; color: #aaa; }

/* Vista read-only de un objetivo en el panel principal */
.todo-syn-hint {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.8rem; color: #999; padding: 4px 0 12px;
}
.todo-syn-block { margin-bottom: 4px; }
.todo-syn-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 6px; border-bottom: 1px solid #f0f0f0;
    font-size: 0.92rem; color: #333;
}
.todo-syn-item > .bi { color: #888; width: 18px; text-align: center; }
.todo-syn-item.kind-milestone .todo-syn-name { font-weight: 600; }
.todo-syn-sub { padding-left: 22px; color: #555; }
.todo-syn-name { flex: 0 1 auto; }
.todo-syn-pill {
    font-size: 0.7rem; color: #666; background: #f1f1f1;
    border-radius: 4px; padding: 1px 7px;
    /* PTS-4d: la etiqueta ya viene con el casing canónico de la columna del
       Kanban ("Can't start yet", "Not this week"…) → sin capitalize, que
       destrozaría apóstrofos y mayúsculas. */
}
/* GTD-MIRRORS: pill work coloreada según la lista GTD de su lane (texto del
   color del token + fondo suave = rgba del mismo color al 12%, patrón tint()
   de los chips de label). done/desconocido caen al gris default de arriba. */
.todo-syn-pill--following { color: var(--gtd-following); background: rgba(26, 127, 55, 0.12); }
.todo-syn-pill--waiting { color: var(--gtd-waiting); background: rgba(180, 83, 9, 0.12); }
.todo-syn-pill--notthisweek { color: var(--gtd-notthisweek); background: rgba(194, 37, 92, 0.12); }
.todo-syn-pill--cantstart { color: var(--gtd-cantstart); background: rgba(71, 85, 105, 0.12); }
.todo-syn-pill--someday { color: var(--gtd-someday); background: rgba(103, 65, 217, 0.12); }
/* R4.1 — el chip de texto de tipo (.todo-kind-chip) se eliminó de la fila: los
   iconos .todo-type-icon ya indican Milestone/Work/Personal. CSS retirado. */
/* #6 — executor / líder en la fila de empresa (chip discreto). */
.todo-syn-person {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 0.72rem; color: #777;
}
.todo-syn-person .bi { font-size: 0.74rem; color: #999; }
.todo-syn-lead { color: #b06a00; }
.todo-syn-lead .bi { color: #d18a14; }

/* PTS-4b.3 — página "Filters & Labels" (calcada a Todoist) */
.todo-fl-page { max-width: 800px; }
.todo-fl-sectionhead {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 2px; border-bottom: 1px solid #ededed; margin-bottom: 4px;
}
.todo-fl-caret {
    border: none; background: transparent; cursor: pointer; color: #888;
    padding: 0; font-size: 0.8rem; width: 18px;
}
.todo-fl-title { font-weight: 700; font-size: 0.95rem; color: #333; flex: 1; }
.todo-fl-add, .todo-proj-add {
    border: none; background: transparent; cursor: pointer; color: #888;
    padding: 2px 6px; border-radius: 5px;
}
.todo-fl-add:hover, .todo-proj-add:hover { background: #efefef; color: #db4035; }
.todo-fl-row {
    position: relative; display: flex; align-items: center;
    padding: 8px 6px; border-bottom: 1px solid #f3f3f3;
}
.todo-fl-row:hover { background: #fafafa; }
.todo-fl-main {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
    border: none; background: transparent; cursor: pointer; text-align: left;
    color: #333; font-size: 0.9rem; padding: 0;
}
.todo-fl-icon { width: 18px; text-align: center; flex-shrink: 0; }
.todo-fl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-fl-row .todo-fav { color: #f9c000; font-size: 0.72rem; flex-shrink: 0; }
.todo-fl-row .todo-proj-menu-btn { opacity: 0; }
.todo-fl-row:hover .todo-proj-menu-btn { opacity: 1; }
.todo-fl-empty { padding: 10px 6px; color: #aaa; font-size: 0.85rem; }
.todo-fl-addlabel { padding: 6px 0; }
.todo-fl-addlabel input {
    width: 100%; border: none; background: transparent; padding: 7px 6px;
    font-size: 0.9rem; color: #333;
}
.todo-fl-addlabel input:focus { outline: none; border-bottom: 1px solid #db4035; }

/* PTS-4b.5 — Settings del /todo */
.todo-settings-btn { margin-top: 8px; color: #777; }

/* FASE 9 — Modular Settings: 2-panel modal (left categories, right content).
   The card is a flex row; the right panel scrolls so long content (Import)
   never stretches the card past the viewport. */
/* Specificity: the card carries BOTH `todo-modal-card todo-settings-card`; the base
   `.todo-modal-card { width:640px }` lives LATER in the file, so a single-class
   `.todo-settings-card` lost the cascade and the modal stayed 640px. Two classes
   (0,2,0) win regardless of source order → the wide settings modal sticks. */
.todo-modal-card.todo-settings-card {
    /* FASE 11 — wider still on PC so Import (Tom Select rules + preview) is roomy. */
    width: 88vw; max-width: 1300px; height: 85vh; max-height: 85vh;
    display: flex; flex-direction: row;
    padding: 0; overflow: hidden;
}
/* Left panel — category list + search. */
.todo-settings-nav {
    flex: 0 0 220px; min-width: 0;
    display: flex; flex-direction: column;
    background: #fafafa; border-right: 1px solid #efefef;
    padding: 16px 12px; gap: 10px;
}
.todo-settings-nav-head h3 { font-size: 1.05rem; margin: 0; }
.todo-settings-search {
    width: 100%; border: 1px solid #e0e0e0; border-radius: 8px;
    padding: 6px 10px; font-size: 0.85rem; color: #333; background: #fff;
}
.todo-settings-search:focus { outline: none; border-color: #c0c0c0; }
.todo-settings-cats { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.todo-settings-cat {
    display: flex; align-items: center; gap: 10px; width: 100%;
    border: none; background: none; text-align: left;
    padding: 8px 10px; border-radius: 8px; cursor: pointer;
    font-size: 0.9rem; color: #444;
}
.todo-settings-cat .bi { font-size: 1rem; width: 18px; text-align: center; color: #888; }
.todo-settings-cat:hover { background: #f0f0f0; }
.todo-settings-cat.active { background: #ececec; color: #202020; font-weight: 600; }
.todo-settings-cat.active .bi { color: var(--td-red, #db4035); }
/* Right panel — selected category content. */
.todo-settings-content {
    flex: 1 1 auto; min-width: 0;
    display: flex; flex-direction: column;
}
.todo-settings-content-head {
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 8px;
    padding: 16px 16px 12px; border-bottom: 1px solid #f3f3f3;
}
.todo-settings-content-head h3 { font-size: 1.05rem; margin: 0; flex: 1 1 auto; }
/* "Back" arrow is mobile-only (desktop shows both panels). */
.todo-settings-back { display: none; }
.todo-settings-body {
    flex: 1 1 auto; min-height: 0;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 16px;
}

.todo-settings-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
}
.todo-settings-head h3 { font-size: 1.05rem; margin: 0; }
.todo-settings-field { margin-bottom: 16px; }
.todo-settings-field > label {
    display: block; font-size: 0.72rem; text-transform: uppercase;
    letter-spacing: 0.04em; color: #999; font-weight: 600; margin-bottom: 6px;
}
.todo-settings-field select {
    width: 100%; border: 1px solid #ddd; border-radius: 6px;
    padding: 6px 8px; font-size: 0.9rem; color: #333;
}
.todo-settings-check {
    display: flex; align-items: center; gap: 8px; text-transform: none;
    letter-spacing: 0; font-size: 0.9rem; color: #333; font-weight: 400;
    margin-bottom: 6px; cursor: pointer;
}
.todo-settings-check input { width: auto; margin: 0; }

/* FASE 7/8 — Todoist import */
.todo-import-help { font-size: 0.76rem; color: #999; margin: 0 0 10px; line-height: 1.4; }
[data-testid="todo-import"] input[type="file"] { display: block; font-size: 0.82rem; margin-bottom: 10px; }
.todo-import-error { font-size: 0.8rem; color: #db4035; margin: 4px 0; }
.todo-import-result { font-size: 0.82rem; color: #2e7d32; margin: 8px 0 0; }
.todo-import-counts { font-size: 0.82rem; color: #555; margin: 0 0 12px; padding-left: 16px; }
.todo-import-rules { margin: 10px 0; }
.todo-import-rules-head {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.78rem; color: #777; font-weight: 600; margin-bottom: 6px;
}
.todo-import-rule {
    display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.todo-import-rule span { color: #999; }

/* FASE 9 — Import lives inside the Settings 'import' category (.todo-settings-body
   scrolls), so the footer is just an in-flow action row at the end of the flow. */
.todo-import-foot {
    display: flex; gap: 8px; justify-content: flex-end;
    border-top: 1px solid #f0f0f0; padding: 12px 0 0; margin-top: 12px;
}
.todo-import-action { display: block; }
/* Generic field styling inside the import modal (no longer under .todo-settings-field). */
.todo-import-label {
    display: block; font-size: 0.72rem; text-transform: uppercase;
    letter-spacing: 0.04em; color: #999; font-weight: 600; margin: 4px 0 6px;
}
.todo-import-select {
    width: 100%; border: 1px solid #ddd; border-radius: 6px;
    padding: 6px 8px; font-size: 0.9rem; color: #333;
}
.todo-import-rule .todo-import-select { flex: 0 0 auto; width: auto; min-width: 160px; }
.todo-import-rule .todo-import-ts,
.todo-import-rule .ts-wrapper { flex: 1 1 auto; min-width: 0; }
.todo-import-rule select:not(.tomselected) { flex: 1; min-width: 0; }
.todo-settings-content :disabled { opacity: 0.5; cursor: not-allowed; }
/* FASE 8 (E) — progress spinner + message. */
.todo-import-progress {
    font-size: 0.84rem; color: #555; margin: 10px 0 0;
    display: flex; align-items: center; gap: 8px;
}
.todo-import-spin { display: inline-block; animation: todo-import-spin 0.9s linear infinite; }
@keyframes todo-import-spin { to { transform: rotate(360deg); } }

/* FASE 10 — Import category UX: collapsible "How to get your JSON", disabled
   button affordance, and a blocking progress overlay with an indeterminate bar. */
.todo-import-cat { position: relative; }   /* anchors the blocking overlay */

/* "How to get your JSON" — collapsible help + copyable prompt. */
.todo-import-howto {
    border: 1px solid #eee; border-radius: 8px; margin: 0 0 14px; background: #fafafa;
}
.todo-import-howto-toggle {
    display: flex; align-items: center; gap: 8px; width: 100%;
    border: none; background: none; cursor: pointer; text-align: left;
    padding: 10px 12px; font-size: 0.86rem; font-weight: 600; color: #444;
}
.todo-import-howto-toggle .bi { color: #888; font-size: 0.9rem; }
.todo-import-howto-body { padding: 0 12px 12px; }
.todo-import-howto-body p { font-size: 0.8rem; color: #666; line-height: 1.45; margin: 0 0 10px; }
.todo-import-howto-body code {
    background: #ececec; border-radius: 4px; padding: 1px 5px; font-size: 0.78rem; color: #444;
}
.todo-import-prompt-head {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em;
    color: #999; font-weight: 600; margin: 4px 0 6px;
}
.todo-import-prompt-head .todo-btn-link { display: inline-flex; align-items: center; gap: 4px; }
.todo-import-prompt {
    width: 100%; resize: vertical; min-height: 120px;
    border: 1px solid #ddd; border-radius: 8px; padding: 8px 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.74rem; line-height: 1.4; color: #444; background: #fff;
}
.todo-import-prompt:focus { outline: none; border-color: #c0c0c0; }
.todo-import-soon { font-size: 0.74rem; color: #aaa; margin: 8px 0 0; font-style: italic; }

/* Disabled affordance for the Preview/Import buttons (visible grey + no cursor). */
.todo-btn.is-disabled,
.todo-btn:disabled {
    opacity: 0.45; cursor: not-allowed; pointer-events: none;
}

/* Blocking progress overlay (covers the Import category while committing). */
.todo-import-overlay {
    position: absolute; inset: 0; z-index: 5;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 16px; padding: 24px;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px);
    text-align: center;
}
.todo-import-overlay-spin { font-size: 1.6rem; color: var(--td-red, #db4035); }
.todo-import-overlay-msg { font-size: 0.86rem; color: #555; margin: 0; max-width: 360px; }
.todo-import-overlay-pct { font-size: 1.5rem; font-weight: 600; color: #333; margin: 0; }
.todo-import-overlay-count { font-size: 0.82rem; color: #777; margin: 0; }
/* FASE 11 (C) — DETERMINATE bar: width is driven by importPercent() inline. */
.todo-import-bar {
    width: min(280px, 70%); height: 6px; border-radius: 3px;
    background: #eee; overflow: hidden; position: relative;
}
.todo-import-bar-fill {
    height: 100%; width: 0; border-radius: 3px;
    background: var(--td-red, #db4035);
    transition: width 0.4s ease;
}
.todo-btn-link {
    border: none; background: none; color: var(--td-red, #db4035);
    font-size: 0.8rem; cursor: pointer; padding: 0;
}
.todo-btn-link:hover { text-decoration: underline; }

/* PTS-4c.2 — item estratégico (read-only) en las listas GTD */
.todo-strat-dot {
    width: 18px; height: 18px; flex-shrink: 0; display: inline-flex;
    align-items: center; justify-content: center; color: #888;
    font-size: 0.8rem; margin-right: 2px;
}
.todo-strat-dot .bi { opacity: 0.7; }

/* PTS-3q — subtareas: chip de progreso en la fila + filas inline */
.todo-subprog {
    display: inline-flex; align-items: center; gap: 3px;
    border: none; background: transparent; cursor: pointer;
    font-size: 0.72rem; color: #888; padding: 0;
}
.todo-subprog:hover { color: var(--td-red, #db4035); }
.todo-subprog .bi { font-size: 0.7rem; }
.todo-item { display: flex; flex-direction: column; }
.todo-subtasks-inline { padding: 2px 0 6px 46px; }
.todo-subrow { display: flex; align-items: center; gap: 9px; padding: 4px 0; }
.todo-subrow .todo-check { width: 16px; height: 16px; margin-top: 0; }
.todo-check.done { background: #888; border-color: #888; }
.todo-check.done::after {
    content: "\F26E"; font-family: "bootstrap-icons"; position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.62rem; color: #fff;
}
/* .todo-subname pasó de <span> a <button> (SUBTASK-AS-TASK: abre la subtarea como
   tarea). Reset del chrome de botón + layout en fila para nombre + chips. */
.todo-subname {
    font-size: 0.84rem; color: #333;
    background: none; border: 0; padding: 0; text-align: left;
    display: inline-flex; align-items: center; gap: 8px; width: 100%;
    cursor: pointer;
}
.todo-subname.done { text-decoration: line-through; color: #aaa; }
/* Chips de fecha/prioridad dentro de la subfila (los añade el markup de subtarea). */
.todo-subrow-due { font-size: 0.74rem; color: #888; margin-left: auto; white-space: nowrap; }
.todo-subrow-prio { font-size: 0.8rem; }
/* SUBTASK-DEPTH: caret de plegado, espaciador, contador de subhijos y botón "+"
   del árbol de subtareas (hasta 4 niveles, indentado por nivel en el markup). */
.todo-subcaret {
    background: none; border: 0; padding: 0; cursor: pointer;
    color: #888; font-size: 0.8rem; width: 14px; flex: 0 0 14px;
    display: inline-flex; align-items: center; justify-content: center;
}
.todo-subcaret:hover { color: #333; }
.todo-subcaret-spacer { width: 14px; flex: 0 0 14px; }
.todo-subrow-count {
    font-size: 12px; color: #666; background: #f0f0f0;
    border-radius: 8px; padding: 0 6px; white-space: nowrap;
}
.todo-subadd-btn {
    background: none; border: 0; padding: 0 2px; cursor: pointer;
    color: #aaa; font-size: 0.9rem; opacity: 0; transition: opacity .1s;
}
.todo-subrow:hover .todo-subadd-btn { opacity: 1; }
.todo-subadd-btn:hover { color: #db4035; }
/* R4.2 — "+ Add task" bajo un milestone en el panel (texto-enlace, estilo Todoist). */
.todo-subadd-link {
    background: none; border: 0; padding: 4px 2px; cursor: pointer;
    color: #888; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 4px;
}
.todo-subadd-link:hover { color: #db4035; }
.todo-subtask-list { display: flex; flex-direction: column; margin-bottom: 6px; }
.todo-subtask-input {
    width: 100%; border: 1px solid #eee; border-radius: 6px;
    padding: 6px 8px; font-size: 0.85rem; margin-top: 4px;
}
.todo-subtask-input:focus { outline: none; border-color: #db4035; }

/* Proyecto al que pertenece la fila, alineado a la derecha (Todoist).
   GTD-MIRRORS: en NEGRITA para todos; el color del proyecto llega inline
   (listStyle) y lo hereda también el ::before "# ". */
.todo-row-project {
    flex-shrink: 0; align-self: center; margin-left: auto;
    font-size: 0.75rem; color: var(--td-text-2); font-weight: 600;
    white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.todo-row-project::before { content: "# "; opacity: 0.7; }

/* CRITERION-VIEWS: miga de una fila promovida (subtarea que sale por su propia
   fecha/etiqueta en today/upcoming/label:). Mismo peso visual que el chip de
   proyecto pero en cursiva y con la flecha de anidamiento, para que se lea como
   contexto y no como un segundo nombre. `margin-left:auto` igual que el chip:
   cuando están los dos, esta empuja y el chip queda a su derecha. */
.todo-row-parent {
    flex-shrink: 0; align-self: center; margin-left: auto;
    display: inline-flex; align-items: center; gap: 0.25rem;
    font-size: 0.75rem; color: var(--td-text-2); font-style: italic;
    white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.todo-row-parent i { opacity: 0.7; }

/* OVERLAY (Todoist-style): the hover quick-actions float ON TOP of the row's
   right edge instead of reserving a flex slot. With the old in-flow layout the
   action group held its width even at opacity:0, so the title never used the
   full row width (visible "wasted space" on the right). Now they are absolutely
   positioned and pulled out of flow → the title spans 100% until hover. They
   sit centred vertically, anchored to the right, hidden by default and revealed
   on row :hover and :focus-within (keyboard a11y). A solid background matching
   the row's hover colour (#fbfbfb) with a left-fading gradient cleanly masks any
   title text underneath so nothing reads half-covered. The checkbox / due / etc.
   on the left are never covered — the overlay only spans the far right.
   Mobile (<=768px) sets display:none on this group (see @media block) and uses
   swipe instead, so this overlay is desktop-only. */
.todo-row-actions {
    display: flex; gap: 1px;
    position: absolute; top: 0; bottom: 0; right: 4px;
    align-items: center;
    padding-left: 28px;            /* room for the fade so text never abuts the icons */
    background: linear-gradient(to right, rgba(251,251,251,0), #fbfbfb 24px);
    opacity: 0; pointer-events: none; transition: opacity 0.12s;
    z-index: 2;
}
/* E1 — el popover de fila (schedule/priority en hover) se ancla a coords fijas
   del botón pulsado, como el menú contextual. */
/* La fila-popover lleva TAMBIÉN .todo-pop-anchor (ancla de los popovers internos).
   Como .todo-pop-anchor { position:relative } se define más abajo (misma
   especificidad), ganaba y rompía el position:fixed → el left/top de rowPopStyle()
   se interpretaba como offset del flujo y el popover salía fuera del viewport en
   filas anchas. Subimos especificidad para que gane fixed. */
.todo-rowpop.todo-pop-anchor { position: fixed; z-index: 1096; }
.todo-icon-btn {
    border: none; background: transparent; color: #999;
    cursor: pointer; padding: 4px 6px; border-radius: 4px;
}
.todo-icon-btn:hover { background: #efefef; color: var(--td-red); }

.todo-empty { text-align: center; color: #aaa; padding: 60px 0; }
.todo-empty i { font-size: 2.4rem; display: block; margin-bottom: 8px; }
.todo-loading { color: #999; padding: 24px 4px; }
/* FLUIDITY (FASE 4): "Load more" footer of the paginated list (infinite scroll
   fallback + remaining-count). */
.todo-loadmore { padding: 12px 0 28px; text-align: center; }
.todo-loadmore-btn {
    background: none; border: 1px solid #e0e0e0; border-radius: 18px;
    color: #777; font-size: 0.85rem; padding: 6px 18px; cursor: pointer;
}
.todo-loadmore-btn:hover:not(:disabled) { background: #f5f5f5; color: #333; }
.todo-loadmore-btn:disabled { cursor: default; opacity: 0.6; }

/* PTS-3a — Panel de detalle / edición (drawer lateral) */
.todo-app { position: relative; }
.todo-body { cursor: pointer; }
.todo-panel {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: 400px; max-width: 88vw;
    background: #fff; border-left: 1px solid #e6e6e6;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.06);
    transform: translateX(100%); transition: transform 0.18s ease;
    z-index: 20; overflow-y: auto;
}
.todo-panel.open { transform: translateX(0); }
.todo-panel-backdrop {
    position: absolute; inset: 0; background: rgba(0, 0, 0, 0.04);
    opacity: 0; pointer-events: none; transition: opacity 0.18s; z-index: 15;
}
.todo-panel-backdrop.open { opacity: 1; pointer-events: auto; }
.todo-panel-inner { padding: 14px 18px 28px; }
.todo-panel-head { display: flex; justify-content: space-between; align-items: center; }
/* UNIFY-EDITOR: botón "Open full editor" (abre el SynapsisPanel completo). Discreto,
   alineado a la izquierda; Save queda a la derecha. */
.todo-panel-fulledit {
    display: inline-flex; align-items: center; gap: 6px;
    border: none; background: transparent;
    color: #6c757d; font-weight: 500; font-size: 0.85rem;
    padding: 8px 6px; min-height: 44px; cursor: pointer;
}
.todo-panel-fulledit:hover { color: #333; }
/* Botón "Save" del panel (auto-save) — reemplaza la antigua X. Estilo texto
   acento, como el "Guardar" de Todoist. Da sensación de seguridad al cerrar. */
.todo-panel-save {
    display: inline-flex; align-items: center; gap: 6px;
    border: none; background: transparent;
    color: #db4035; font-weight: 600; font-size: 0.95rem;
    padding: 8px 6px; min-height: 44px; cursor: pointer;
}
.todo-panel-save .bi { font-size: 1.05rem; }
.todo-panel-save:hover { color: #c23b30; }
/* "Move to" picker del panel — desktop: card centrada; móvil: pantalla completa
   (override en @media). Estilo "Mover a" de Todoist: cabecera + buscador + lista. */
.todo-move-picker {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: min(92vw, 420px); max-height: 80vh;
    background: #fff; border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    z-index: 1095; display: flex; flex-direction: column; overflow: hidden;
}
.todo-move-head {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-bottom: 1px solid #eee;
}
.todo-move-title { font-weight: 600; }
.todo-move-search {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; border-bottom: 1px solid #f0f0f0; color: #888;
}
.todo-move-search input {
    border: none; outline: none; flex: 1; font-size: 0.95rem; background: transparent;
}
.todo-move-list { overflow-y: auto; flex: 1; padding: 6px 0; }
.todo-move-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 11px 16px; border: none; background: transparent;
    text-align: left; cursor: pointer; font-size: 0.95rem; color: #202020;
}
.todo-move-item:hover { background: #f7f7f7; }
.todo-move-item.active { color: #db4035; font-weight: 600; }
.todo-move-item > .bi:first-child { color: #888; width: 18px; text-align: center; }
.todo-move-tick { margin-left: auto; color: #db4035; }
/* MOVE-TO-COMPANY — badge "Company" en milestones de empresa del picker Move to. */
.todo-move-companytag {
    margin-left: auto; font-size: 0.72rem; font-weight: 600; line-height: 1;
    padding: 3px 7px; border-radius: 10px; background: #eef2ff; color: #4854b8;
    text-transform: uppercase; letter-spacing: 0.03em;
}
/* PTS-3n — breadcrumb del proyecto */
.todo-panel-breadcrumb {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.78rem; color: #888; margin-bottom: 6px;
}
.todo-panel-breadcrumb .bi { font-size: 0.72rem; }
/* PTS-3n — fila título + checkbox de completar */
.todo-panel-titlerow { display: flex; align-items: flex-start; gap: 10px; }
.todo-panel-check { margin-top: 5px; }
.todo-panel-title, .todo-panel-titleview {
    flex: 1; min-width: 0; border: none; font-size: 1.05rem; font-weight: 600;
    color: #202020; padding: 4px 0;
    font-family: inherit; background: transparent; line-height: 1.4;
    resize: none; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
    max-height: 140px;       /* tope: varias líneas pero no infinito (estilo Todoist) */
    min-height: 1.5em;       /* TEXTAREA-COLLAPSE: una línea visible siempre */
    /* NO usar `field-sizing: content`: en navegadores que lo soportan (Chrome
       reciente/Android) corrompe el scrollHeight del que depende `autoGrow`,
       colapsando la caja (cursor diminuto, texto recortado). autoGrow ya da el
       auto-alto en todos los navegadores. */
}
.todo-panel-title:focus { outline: none; border-bottom: 2px solid #db4035; }
/* TITLE-LINK: el título en modo vista (render con links pinchables). Pinchar el
   texto entra a edición; el enlace abre en pestaña nueva. */
.todo-panel-titleview { cursor: text; }
/* TASK-PEEK (2026-10-29): tarea completada en el panel → se lee tachada. */
.todo-panel-titleview.done { text-decoration: line-through; color: #888; }
.todo-panel-donebar {
    display: flex; align-items: center; gap: 8px; margin: 8px 0 0 30px;
    font-size: 0.85rem; color: #2e7d32;
}
/* TASK-PEEK (2026-10-29): la vista rápida reutiliza `.todo-panel`, pero fuera de
   /todo no hay `.todo-app` que la contenga: va fija al viewport, por encima de la
   navegación y de la barra lateral/inferior de Notes (1200/1250, toasts 1300) y
   por debajo de los modales (2000). En móvil `.todo-panel` ya es pantalla completa. */
.todo-panel.task-peek { position: fixed; top: 0; bottom: 0; right: 0; z-index: 1500; }
.task-peek-backdrop {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.12);
    opacity: 0; pointer-events: none; transition: opacity 0.18s; z-index: 1499;
}
.task-peek-backdrop.open { opacity: 1; pointer-events: auto; }
.task-peek-facts { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 16px; font-size: 0.9rem; }
.todo-panel-reopen {
    border: 0; background: none; padding: 0; color: #246fe0;
    font-size: 0.85rem; cursor: pointer; text-decoration: underline;
}
.todo-panel-titleview a { color: #246fe0; text-decoration: none; cursor: pointer; }
.todo-panel-titleview a:hover { text-decoration: underline; }
/* PTS-3n — descripción markdown (render + edición) */
.todo-panel-descwrap { margin-top: 8px; }
.todo-panel-descview {
    font-size: 0.88rem; color: #444; line-height: 1.5; cursor: text;
    padding: 8px; border-radius: 6px; border: 1px solid transparent;
    word-break: break-word;
}
.todo-panel-descview:hover { border-color: #eee; background: #fafafa; }
.todo-panel-descview code {
    background: #f1f1f1; border-radius: 3px; padding: 0 4px; font-size: 0.84em;
}
.todo-panel-descview a { color: #246fe0; }
.todo-panel-desc {
    width: 100%; border: 1px solid #eee; border-radius: 6px; padding: 8px;
    font-size: 0.88rem; resize: vertical; margin-top: 8px;
}
.todo-panel-field { margin-top: 16px; }
/* COMPACT-PANEL (2026-07-19): fila de 2 columnas del panel de edición. Se aplica
   condicionalmente desde Alpine (:class="{ 'todo-panel-row': ... }") SOLO cuando
   ambos campos de la fila son visibles; si el compañero está oculto por x-show, el
   wrapper queda un <div> bloque normal y el .todo-panel-field visible cae a ancho
   completo (display:block). Los hijos comparten el margin-top del bloque (reseteado
   a 0) para no duplicar la separación vertical entre filas. */
.todo-panel-row { display: flex; gap: 8px; margin-top: 16px; }
/* Rejilla ~42/58 ALINEADA (decisión Andreu 2026-07-20): la columna izquierda es
   estrecha y de ancho FIJO (flex-basis 42%), así la 2ª columna arranca en el mismo
   x en las 3 filas de 2-col → Due Date, Project y Note quedan alineados verticalmente.
   El 2º hijo llena el resto. */
.todo-panel-row > .todo-panel-field { flex: 1 1 0; min-width: 0; margin-top: 0; }
.todo-panel-row > .todo-panel-field:first-child { flex: 0 0 42%; }
.todo-panel-field > label {
    display: block; font-size: 0.72rem; text-transform: uppercase;
    letter-spacing: 0.04em; color: #999; margin-bottom: 6px; font-weight: 600;
}
.todo-panel-field select,
.todo-panel-field input[type="date"] {
    width: 100%; border: 1px solid #ddd; border-radius: 6px;
    padding: 6px 8px; font-size: 0.88rem;
}
.todo-quick-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.todo-quick-row button {
    border: 1px solid #ddd; background: #fafafa; border-radius: 6px;
    padding: 4px 10px; font-size: 0.82rem; cursor: pointer; color: #444;
}
.todo-quick-row button:hover { background: #f0f0f0; }
.todo-prio-pick button.prio-flag-urgent { color: #d1453b; }
.todo-prio-pick button.prio-flag-high { color: #eb8909; }
.todo-prio-pick button.prio-flag-medium { color: #246fe0; }
.todo-prio-pick button.prio-flag-low { color: #888; }
.todo-quick-row button.sel {
    border-color: #d1453b; background: #ffefe9; color: #d1453b; font-weight: 600;
}
.todo-label-pick button { display: inline-flex; align-items: center; gap: 5px; }
.todo-label-pick button .bi { font-size: 0.7rem; }
/* RECURRING: Repeat picker controls in the unified panel. */
.todo-recur-row { align-items: center; }
.todo-recur-row select, .todo-recur-row input {
    border: 1px solid #ddd; background: #fafafa; border-radius: 6px;
    padding: 4px 8px; font-size: 0.82rem; color: #444;
}
.todo-recur-custom { display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.82rem; color: #444; }
.todo-recur-n { width: 56px; }
.todo-panel-actions { margin-top: 24px; }
.todo-del-btn {
    border: none; background: transparent; color: #b03a31; cursor: pointer;
    font-size: 0.88rem; padding: 6px 0;
}
.todo-del-btn:hover { text-decoration: underline; }

/* ── PTS-3v — comentarios + actividad en el panel de detalle ─────────── */
.todo-panel-section { margin-top: 22px; border-top: 1px solid #f0f0f0; padding-top: 14px; }
.todo-panel-seclabel {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
    color: #888; font-weight: 600; margin-bottom: 10px;
}
.todo-panel-seclabel .bi { font-size: 0.8rem; }
.todo-comment { display: flex; gap: 8px; margin-bottom: 12px; }
.todo-comment-avatar {
    flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
    background: #e0e0e0; color: #555; font-size: 0.66rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
}
.todo-comment-body { flex: 1; min-width: 0; }
.todo-comment-head { display: flex; gap: 8px; align-items: baseline; }
.todo-comment-author { font-size: 0.82rem; font-weight: 600; color: #333; }
.todo-comment-date { font-size: 0.7rem; color: #aaa; }
.todo-comment-text { font-size: 0.85rem; color: #333; white-space: pre-wrap; margin-top: 2px; }
.todo-comment-empty { font-size: 0.82rem; color: #aaa; margin-bottom: 10px; }
.todo-comment-add { display: flex; flex-direction: column; gap: 6px; }
.todo-comment-input {
    width: 100%; border: 1px solid #e0e0e0; border-radius: 8px; padding: 8px 10px;
    font-size: 0.85rem; resize: vertical; font-family: inherit;
}
.todo-comment-add .todo-btn-primary { align-self: flex-end; }
.todo-comment-add .todo-btn-primary:disabled { opacity: 0.45; cursor: default; }
.todo-activity-row { display: flex; gap: 8px; margin-bottom: 10px; }
.todo-activity-body { flex: 1; min-width: 0; font-size: 0.82rem; color: #555; }
.todo-activity-body strong { color: #333; font-weight: 600; }
.todo-activity-line { font-size: 0.78rem; color: #777; margin-top: 1px; }

/* ── PTS-3i — "+ Add task" inline + modal central de creación ───────── */
.todo-add-inline {
    display: flex; align-items: center; gap: 8px; width: 100%;
    border: none; background: transparent; cursor: pointer;
    padding: 8px 4px; margin-bottom: 6px; border-radius: 6px;
    color: var(--td-text-2, #808080); font-size: 0.875rem; text-align: left;
}
.todo-add-inline:hover { color: var(--td-red, #db4035); }
.todo-add-inline .bi {
    color: var(--td-red, #db4035); font-size: 0.95rem;
    width: 18px; display: inline-flex; justify-content: center;
}

.todo-modal-backdrop {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45);
    z-index: 1080;
}
.todo-modal {
    position: fixed; inset: 0; z-index: 1090;
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 12vh; pointer-events: none;
}
.todo-modal-card {
    pointer-events: auto;
    width: 640px; max-width: 92vw; background: #fff;
    border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
    padding: 16px 16px 12px;
}
.todo-modal-name {
    width: 100%; border: none; outline: none;
    font-size: 1.18rem; font-weight: 600; color: #202020;
    font-family: inherit; background: transparent; line-height: 1.35;
    resize: none; white-space: pre-wrap; word-break: break-word;
    max-height: 140px; overflow-y: auto;
    min-height: 1.6em;   /* TEXTAREA-COLLAPSE: una línea visible aunque autoGrow aún no haya corrido */
    /* NO usar `field-sizing: content`: choca con `autoGrow` (corrompe scrollHeight)
       y colapsaba la caja → el texto compartido "parecía vacío" y el cursor salía
       diminuto hasta teclear. autoGrow da el auto-alto en todos los navegadores. */
}
.todo-modal-name::placeholder { color: #b0b0b0; font-weight: 600; }
.todo-modal-desc {
    width: 100%; border: none; outline: none; resize: none;
    font-size: 0.9rem; color: #444; margin-top: 6px;
}
.todo-modal-desc::placeholder { color: #b8b8b8; }
.todo-modal-tokens { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
/* SAFETY-CONFIRMS: título del modal de confirmación (borrado de proyecto). */
.todo-modal-title {
    font-size: 1.12rem; font-weight: 600; color: #202020;
    margin: 0 0 8px; line-height: 1.35; word-break: break-word;
}
.todo-modal-hint { font-size: 0.76rem; color: #999; margin: 6px 0 12px; }
.todo-modal-hint em { font-style: normal; color: #777; }
/* OBJ-MS-NOTE: aviso discreto "objetivo -> milestone" en el quick-add. */
.todo-modal-note {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.78rem; color: #b06b1f; margin: -4px 0 12px;
}
.todo-modal-note .bi { font-size: 0.9rem; flex-shrink: 0; }
.todo-modal-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; border-top: 1px solid #f0f0f0; padding-top: 12px;
}
.todo-modal-project {
    border: 1px solid #e0e0e0; border-radius: 6px;
    padding: 6px 10px; font-size: 0.85rem; color: #444; max-width: 220px;
}
.todo-modal-buttons { display: flex; gap: 8px; }
.todo-btn-secondary {
    border: none; background: #f1f1f1; color: #444; border-radius: 6px;
    padding: 7px 14px; font-size: 0.86rem; cursor: pointer;
}
.todo-btn-secondary:hover { background: #e6e6e6; }
.todo-btn-primary {
    border: none; background: var(--td-red, #db4035); color: #fff;
    border-radius: 6px; padding: 7px 16px; font-size: 0.86rem;
    font-weight: 500; cursor: pointer;
}
.todo-btn-primary:hover { background: #c0392b; }
.todo-btn-primary:disabled { background: #f3a9a4; cursor: not-allowed; }

/* PTS-3j — autocomplete @etiqueta / #proyecto */
.todo-ac-wrap { position: relative; }
.todo-ac {
    position: absolute; left: 0; top: 100%; z-index: 5;
    margin-top: 4px; min-width: 240px; max-width: 320px;
    background: #fff; border: 1px solid #e0e0e0; border-radius: 8px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16); padding: 4px;
    max-height: 260px; overflow-y: auto;
}
.todo-ac-item {
    display: flex; align-items: center; gap: 8px; width: 100%;
    border: none; background: transparent; text-align: left; cursor: pointer;
    padding: 6px 10px; border-radius: 5px; font-size: 0.86rem; color: #333;
}
.todo-ac-item .bi { font-size: 0.8rem; width: 16px; text-align: center; color: #999; }
.todo-ac-item.active { background: #f3f3f3; }

/* PTS-3k — fila de acciones del modal + popovers de fecha/prioridad */
.todo-modal-actions { display: flex; gap: 8px; margin: 4px 0 12px; align-items: center; }
/* PTS-4d.2f — selector de Board Column en el modal de creación. */
.todo-modal-lane {
    border: 1px solid #e0e0e0; background: #fff; border-radius: 6px;
    padding: 5px 8px; font-size: 0.8rem; color: #555; cursor: pointer;
}
/* PTS-4d.3a — destino estratégico (#Objetivo/#Milestone) en el modal. */
.todo-modal-dest {
    display: inline-flex; align-items: center; gap: 6px;
    background: #e3effb; color: #1c4e80; border-radius: 6px;
    padding: 5px 10px; font-size: 0.8rem; max-width: 260px;
}
.todo-modal-dest > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-modal-dest-x {
    border: none; background: transparent; color: #1c4e80; cursor: pointer;
    padding: 0; display: inline-flex; opacity: 0.7;
}
.todo-modal-dest-x:hover { opacity: 1; }
.todo-ac-kind {
    margin-left: auto; font-size: 0.66rem; color: #999;
    text-transform: uppercase; letter-spacing: 0.02em;
}
/* PTS-4d.5 — popovers de picker (labels multi-select + proyecto/destino buscable). */
.todo-pickerpop {
    position: absolute; left: 0; top: 100%; z-index: 12; margin-top: 6px;
    width: 260px; background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18); padding: 6px;
}
.todo-pickerpop-up { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 6px; }
.todo-picker-search {
    width: 100%; border: 1px solid #e6e6e6; border-radius: 6px;
    padding: 5px 8px; font-size: 0.82rem; margin-bottom: 4px;
}
.todo-picker-list { max-height: 240px; overflow-y: auto; }
.todo-picker-item {
    display: flex; align-items: center; gap: 7px; width: 100%;
    border: none; background: transparent; cursor: pointer; text-align: left;
    padding: 6px 8px; border-radius: 6px; font-size: 0.84rem; color: #333;
}
.todo-picker-item:hover { background: #f4f4f4; }
/* PRJ-2b: item resaltado por navegación de teclado (↑/↓) en el picker de destino. */
.todo-picker-item.is-active { background: #eef2ff; }
.todo-picker-item .bi { font-size: 0.82rem; }
.todo-picker-empty { padding: 8px; font-size: 0.8rem; color: #999; text-align: center; }
/* "Remove all labels" — separado de la lista por un borde, en rojo discreto. */
.todo-picker-clear {
    display: flex; align-items: center; gap: 7px; width: 100%;
    border: none; border-top: 1px solid #f0f0f0; background: transparent;
    cursor: pointer; text-align: left; margin-top: 4px; padding: 8px;
    font-size: 0.82rem; color: #db4035; border-radius: 0 0 6px 6px;
}
.todo-picker-clear:hover { background: #fdf0ef; }
/* Todoist: nombre a la izquierda (con su tag de color) y el checkbox a la DERECHA. */
.todo-picker-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-picker-check { margin-left: auto; color: #888; }
.todo-picker-check.bi-check-square-fill { color: #db4035; }
.todo-modal-projbtn { max-width: 260px; }
.todo-modal-projbtn > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* PTS-4d.6 — fila "Board column" del editor de filtro. */
.todo-filter-board { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.todo-filter-board-label { font-size: 0.8rem; color: #666; }
/* PTS-4d.4 — botón Claim (reclamar del pool): color distintivo (verde). Aparece
   en hover como el resto de quick-actions; también está en el menú contextual. */
.todo-claim-btn { color: #1c7c4a; }
.todo-claim-btn:hover { background: #e3f5ea; color: #155724; }
.todo-pop-anchor { position: relative; }
/* COMPACT-PANEL: en el layout de 2 columnas, un popover en la columna DERECHA
   (p.ej. el campo Date, .todo-pop-anchor.todo-pop-right) anclado a left:0 se saldría
   del panel de 400px (los popovers miden 252-268px, más que media columna) → lo
   anclamos a la derecha. Solo en escritorio: en móvil (@media max-width:768px) los
   popovers pasan a hoja fija a pantalla completa (inset:0) y este right-anchor NO
   debe aplicar, por eso va acotado a min-width:769px. */
@media (min-width: 769px) {
    .todo-pop-right .todo-datepop,
    .todo-pop-right .todo-priopop,
    .todo-pop-right .todo-pickerpop { left: auto; right: 0; }
}
.todo-action-btn {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid #e0e0e0; background: #fff; border-radius: 6px;
    padding: 5px 10px; font-size: 0.8rem; color: #555; cursor: pointer;
}
.todo-action-btn:hover { background: #f7f7f7; border-color: #d0d0d0; }
.todo-action-btn.set { border-color: #c9c9c9; color: #222; }
.todo-action-btn .bi { font-size: 0.82rem; }

/* START-DATE: el control "Start" (quick-add y panel) reutiliza .todo-action-btn
   + el popover compartido (_date_popover.html, targets 'draft-start'/'panel-start')
   — mismo componente y aspecto que el campo Date (due). Sin CSS propio. */

.todo-datepop {
    position: absolute; left: 0; top: 100%; z-index: 10; margin-top: 6px;
    width: 268px; background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18); padding: 8px;
}
/* G3 (RONDA 3.1): cabecera "Date" + Done del popover full-screen móvil. Oculta en
   escritorio (el dropdown de PC queda byte-igual); se muestra solo en el @media
   max-width:768px más abajo. */
.todo-datepop-mhead { display: none; }
/* Cabecera "Título + Done" de los pickers (prioridad/etiquetas): oculta en PC,
   visible solo cuando pasan a hoja a pantalla completa en móvil (@media abajo). */
.todo-pop-mhead { display: none; }
.todo-datepop-quick { display: flex; flex-direction: column; gap: 1px;
    border-bottom: 1px solid #f0f0f0; padding-bottom: 6px; margin-bottom: 6px; }
.todo-datepop-quick button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    border: none; background: transparent; text-align: left; cursor: pointer;
    padding: 7px 8px; border-radius: 6px; font-size: 0.85rem; color: #333;
}
.todo-datepop-quick button:hover { background: #f3f3f3; }
.todo-datepop-quick .bi { width: 16px; text-align: center; color: #888; }
.todo-datepop-nodate { color: #999 !important; }
/* Fecha resuelta a la derecha de cada atajo (estilo Todoist). */
.todo-datepop-when { margin-left: auto; color: #999; font-size: 12px; }
.todo-cal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 2px 6px 6px; font-size: 0.85rem; font-weight: 600; text-transform: capitalize;
}
.todo-cal-head button {
    border: none; background: transparent; cursor: pointer; color: #777;
    padding: 2px 6px; border-radius: 5px;
}
.todo-cal-head button:hover { background: #f0f0f0; }
.todo-cal-dow, .todo-cal-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.todo-cal-dow span {
    text-align: center; font-size: 0.66rem; color: #aaa; padding: 2px 0;
}
.todo-cal-day {
    border: none; background: transparent; cursor: pointer; aspect-ratio: 1;
    border-radius: 50%; font-size: 0.78rem; color: #333;
    display: flex; align-items: center; justify-content: center;
}
.todo-cal-day:hover { background: #f0f0f0; }
/* CAL-COMPACT: días anteriores a hoy apagados; 1º de mes marcado para orientar
   dentro de la ventana de varias semanas (la cabecera ya da el rango de meses). */
.todo-cal-day.past { color: #c4c4c4; }
.todo-cal-day.monthstart:not(.today):not(.sel) { font-weight: 700; color: #555; }
.todo-cal-day.today { color: #db4035; font-weight: 700; }
.todo-cal-day.sel { background: #db4035; color: #fff; }

/* G2 (RONDA 3): Repeat dentro del popover de fecha (estilo Todoist: la
   recurrencia vive con la fecha). Separado del calendario por un borde superior. */
.todo-datepop-repeat {
    border-top: 1px solid #f0f0f0; margin-top: 6px; padding-top: 8px;
    display: flex; flex-direction: column; gap: 6px;
}
.todo-datepop-repeat-lbl {
    font-size: 0.72rem; font-weight: 600; color: #888; text-transform: uppercase;
    letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 6px;
}
.todo-datepop-repeat-lbl .bi { color: #888; }
.todo-datepop-repeat .todo-recur-row { display: flex; flex-wrap: wrap; gap: 6px; }
/* ↻ junto al chip de fecha cuando hay recurrencia. */
.todo-recur-ind { color: #db4035; font-size: 0.82rem; margin-left: 4px; }

.todo-priopop {
    position: absolute; left: 0; top: 100%; z-index: 10; margin-top: 6px;
    width: 252px; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18); padding: 6px;
}
/* Todoist: 4 tarjetas de bandera en fila (no una lista vertical). */
.todo-priopop-grid { display: flex; gap: 6px; }
.todo-priopop-card {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center;
    gap: 5px; border: 1px solid #e6e6e6; background: #fff; border-radius: 8px;
    padding: 10px 4px; cursor: pointer; color: #444; font-size: 0.78rem; font-weight: 600;
}
.todo-priopop-card:hover { background: #f6f6f6; }
.todo-priopop-card .bi { font-size: 1.15rem; }
.todo-priopop-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    border: none; background: transparent; text-align: left; cursor: pointer;
    padding: 7px 10px; border-radius: 6px; font-size: 0.85rem; color: #333;
}
.todo-priopop-item:hover { background: #f3f3f3; }

/* PTS-3l — panel de ayuda de atajos */
.todo-help {
    position: fixed; inset: 0; z-index: 1090;
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 12vh; pointer-events: none;
}
.todo-help-card {
    pointer-events: auto; width: 520px; max-width: 92vw; background: #fff;
    border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28); padding: 18px 20px;
}
.todo-help-head {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.todo-help-head h3 { margin: 0; font-size: 1.05rem; font-weight: 700; color: #202020; }
.todo-help-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px;
}
.todo-help-grid > div {
    display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: #555;
}
.todo-help-grid kbd {
    background: #f1f1f1; border: 1px solid #ddd; border-bottom-width: 2px;
    border-radius: 4px; padding: 1px 6px; font-size: 0.74rem; color: #444;
}
.todo-help-grid span { color: #666; }

/* PTS-3m — menú contextual de tarea (click derecho) */
.todo-ctxmenu {
    position: fixed; z-index: 1095; min-width: 200px;
    background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); padding: 5px;
}
.todo-ctx-item {
    display: flex; align-items: center; gap: 9px; width: 100%;
    border: none; background: transparent; text-align: left; cursor: pointer;
    padding: 7px 10px; border-radius: 6px; font-size: 0.85rem; color: #333;
}
.todo-ctx-item:hover { background: #f3f3f3; }
.todo-ctx-item .bi { width: 16px; text-align: center; color: #888; }
.todo-ctx-item.todo-danger, .todo-ctx-item.todo-danger .bi { color: #db4035; }
.todo-ctx-sep { height: 1px; background: #f0f0f0; margin: 5px 4px; }
.todo-ctx-label {
    font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.04em;
    color: #aaa; padding: 4px 10px 2px; font-weight: 600;
}
.todo-ctx-quick { display: flex; gap: 2px; padding: 0 6px 4px; }
.todo-ctx-quick button {
    border: none; background: transparent; cursor: pointer;
    padding: 6px 8px; border-radius: 6px; font-size: 0.9rem; color: #777;
}
.todo-ctx-quick button:hover { background: #f0f0f0; }

/* ─────────────────────────────────────────────
   LOTE A — /todo móvil tipo Todoist (≤768px)
   Presentacional puro. Markup/JS los aportan los lotes C/D con las clases
   del CONTRATO DE CLASES (docs/architecture/todo-mobile-design.md). Reusa los tokens
   --td-* del tema claro de .todo-app (acento --td-red #db4035, fondo #fff).
   Verificado mentalmente a 375px: sin overflow horizontal, bottom-nav no
   tapa la última fila, FAB por encima de la bottom-nav.
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
    /* TYPO-MOBILE (prioridad móvil): en el teléfono Todoist usa el título de tarea
       mayor que 14px y más aire entre filas. Subimos título y cabecera, y damos
       algo más de padding vertical a la fila. (En escritorio se quedan como están.) */
    .todo-content { font-size: 15px; line-height: 21px; }
    .todo-title { font-size: 22px; line-height: 28px; }
    .todo-row { padding-top: 11px; padding-bottom: 11px; }

    /* 1 ─ Re-stack a una sola columna; el sidebar pasa a cajón deslizante */
    .todo-app {
        display: block;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;   /* llena el viewport aunque la lista sea corta */
        background: #fff;
        border: none;
        border-radius: 0;
        overflow: visible;
        position: relative;
    }

    /* .todo-nav = menú "Browse" a PANTALLA COMPLETA (estilo Todoist "Explorar").
       Fuera de pantalla por defecto; Browse lo desliza con translateX. Ocupa todo
       el ancho del viewport, pero su z-index queda POR DEBAJO de la bottom-nav
       (1083) y del FAB (1086) para que ambos se vean ENCIMA del menú abierto.
       Sin borde/sombra de cajón: a pantalla completa no hay "lateral". */
    .todo-nav {
        position: fixed;
        top: 0; bottom: 0; left: 0;
        width: 100vw;
        max-width: 100vw;
        z-index: 1081;
        transform: translateX(-100%);
        transition: transform 0.24s ease;
        border-right: none;
        box-shadow: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* Los últimos items no quedan tapados por la bottom-nav (56px) + safe-area */
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
    .todo-drawer-open .todo-nav { transform: none; }

    /* NV-1: el divisor de resize no aplica en móvil (drawer full-screen). */
    .todo-nav-resizer { display: none; }

    /* Backdrop por debajo del menú a pantalla completa y de la bottom-nav/FAB. */
    .todo-drawer-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1080;
        background: rgba(0, 0, 0, 0.45);
    }

    /* .todo-nav-synapsis — acceso "a la app" arriba del menú Browse (lo añade el
       Lote C): fila con icono + texto, estilo de acción destacada, ≥44px,
       separada del resto por un borde inferior. Equivale a la fila de cuenta de
       Todoist arriba de "Explorar". Dispara el ≡ global (sidebar Synapsis). */
    .todo-nav-synapsis {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        min-height: 44px;
        border: none;
        background: transparent;
        cursor: pointer;
        text-align: left;
        padding: 10px 10px;
        margin-bottom: 8px;
        border-bottom: 1px solid #eee;
        border-radius: 0;
        color: var(--td-red, #db4035);
        font-weight: 600;
        font-size: 0.92rem;
    }
    .todo-nav-synapsis:hover { background: #fff3f0; }
    .todo-nav-synapsis i { font-size: 1.1rem; width: 20px; text-align: center; }

    /* Área principal: ya no es flex:1 dentro de un row; ocupa todo el ancho.
       padding-bottom reserva sitio para la bottom-nav (56px) + FAB + safe-area
       para que la última fila nunca quede tapada. */
    .todo-main {
        padding: 16px 14px;
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        overflow-y: visible;
    }

    /* 2 ─ Bottom-nav fija (solo móvil) */
    .todo-bottomnav {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        z-index: 1083;
        display: flex;
        align-items: stretch;
        height: 56px;
        background: #fff;
        border-top: 1px solid #e6e6e6;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    }
    .todo-bottomnav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-height: 44px;
        border: none;
        background: transparent;
        color: var(--td-text-2, #808080);
        cursor: pointer;
        padding: 6px 1px;   /* 1px laterales para que quepan 6 items a 360-390px */
        min-width: 0;       /* permite que el label encoja/elipse sin desbordar */
        text-decoration: none;  /* todos los items son <button> (paridad con .app-bottomnav) */
    }
    .todo-bottomnav-item.active {
        color: var(--td-red, #db4035);
    }
    .todo-bottomnav-icon { font-size: 1.2rem; line-height: 1; }
    .todo-bottomnav-label {
        font-size: 0.62rem; line-height: 1;   /* R5.2: algo menor para 6 items */
        max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }

    /* 3 ─ FAB "+" por encima de la bottom-nav */
    /* RENDER-FLICKER R3b (mobile): the fixed sync pill sits ABOVE the
       bottom-nav (56px) and on the LEFT — the FAB owns the bottom-right. */
    .todo-sync-status {
        right: auto;
        left: 14px;
        bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    }

    .todo-fab {
        position: fixed;
        right: 18px;
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        z-index: 1086;
        width: 56px;
        height: 56px;
        border: none;
        border-radius: 50%;
        background: var(--td-red, #db4035);
        color: #fff;
        font-size: 1.5rem;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
        cursor: pointer;
    }

    /* 4 ─ Swipe en filas. La fila contiene 2 capas de fondo absolutas y el
       primer plano .todo-row-fg que C traslada con touch. */
    .todo-row {
        position: relative;
        overflow: hidden;
        padding: 0;   /* el padding pasa al .todo-row-fg para que cubra las capas de swipe en reposo */
    }
    .todo-row-fg {
        position: relative;
        z-index: 1;
        display: flex;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
        padding: 9px 4px 9px 0;   /* cubre borde a borde → sin "marco gris" al reposar */
        background: #fff;
        transition: transform 0.18s ease;
    }
    /* BUG-NEST (móvil): el swipe mueve `.todo-row-fg`, así que aquí va el padding.
       --nest-depth hereda desde `.todo-row`. Mismo paso que en escritorio. */
    .todo-row-nested .todo-row-fg { padding-left: calc(var(--nest-depth, 1) * 26px + 8px); }
    /* Mientras se arrastra, JS controla el transform → sin transición. */
    .todo-row.todo-swiping .todo-row-fg { transition: none; }
    .todo-swipe-bg {
        position: absolute;
        inset: 0;
        z-index: 0;
        display: flex;
        align-items: center;
        font-size: 1.25rem;
    }
    /* Swipe a la derecha → completar (verde, icono check a la izquierda) */
    .todo-swipe-bg--complete {
        justify-content: flex-start;
        padding-left: 18px;
        background: var(--td-today, #058527);
        color: #fff;
    }
    /* Swipe a la izquierda → acciones (fondo neutro, acciones a la derecha) */
    .todo-swipe-bg--actions {
        justify-content: flex-end;
        gap: 4px;
        padding-right: 12px;
        background: #ececec;
        color: #555;
    }
    .todo-swipe-bg--actions button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        border: none;
        background: transparent;
        color: #555;
        font-size: 1.2rem;
        cursor: pointer;
    }

    /* 6 ─ Targets táctiles ≥44px */
    .todo-check {
        width: 22px; height: 22px;
        /* área táctil ampliada sin agrandar el dibujo del círculo */
        position: relative;
    }
    .todo-check::before {
        content: "";
        position: absolute;
        inset: -11px;
    }
    .todo-icon-btn {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .todo-nav-item { min-height: 44px; }

    /* 7 ─ Modal / header sin overflow horizontal */
    .todo-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    /* El ancla del botón "Display" SIEMPRE a la derecha (aunque el header envuelva
       en vistas GTD con scope+pool) → el popover (right:0) nunca se sale por la
       izquierda. Solo el del header; los pop-anchor del panel no se tocan. */
    .todo-header .todo-pop-anchor { margin-left: auto; }
    /* PC-2: en móvil el grupo de acciones puede envolver y debe poder usar todo
       el ancho disponible para que el ancla de Display quede a la derecha. */
    .todo-header-actions { flex-wrap: wrap; width: 100%; }
    .todo-syn-scope, .todo-list-scope {
        flex-wrap: wrap;
    }

    /* 7a ─ Quick-add (y demás .todo-modal) como HOJA INFERIOR estilo Todoist.
       El overlay alinea la tarjeta al borde inferior; la tarjeta ocupa todo el
       ancho, se pega abajo y crece hacia arriba. Así el teclado (que empuja
       desde abajo) no tapa el input "Task name", que queda arriba de la tarjeta.
       El modal de Settings (.todo-settings-card) se vuelve a centrar más abajo. */
    .todo-modal {
        align-items: flex-end;
        justify-content: stretch;
        padding: 0;
    }
    .todo-modal-card {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: 85dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
    /* FASE 9 — Settings as a near-full-screen bottom sheet. The 2 panels STACK:
       only one is on screen at a time (governed by .is-content on the card). The
       category list shows first; picking a category swaps to its content + Back. */
    .todo-settings-card {
        width: 100%; max-width: 100%;
        flex-direction: column;
        height: auto; max-height: 92dvh;
        border-radius: 16px 16px 0 0;
        overflow: hidden; padding: 0;
    }
    .todo-settings-nav {
        flex: 1 1 auto; min-height: 0;
        border-right: none; border-bottom: 1px solid #efefef;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }
    .todo-settings-content { display: none; }
    /* When a category is picked, hide the list and show its content full-width. */
    .todo-settings-card.is-content .todo-settings-nav { display: none; }
    .todo-settings-card.is-content .todo-settings-content { display: flex; }
    .todo-settings-back { display: inline-flex !important; }
    .todo-settings-body {
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }
    .todo-modal-actions,
    .todo-modal-foot {
        flex-wrap: wrap;
    }
    /* 7b ─ Hint "Smart: …": Todoist no muestra ayuda de sintaxis en móvil; se
       parsea inline al escribir. Lo ocultamos para una hoja compacta y limpia. */
    .todo-modal-hint {
        display: none;
    }
    .todo-modal-foot { align-items: stretch; }
    .todo-modal-buttons { width: 100%; }
    .todo-modal-buttons .todo-btn-primary,
    .todo-modal-buttons .todo-btn-secondary { flex: 1; }
    .todo-modal-project,
    .todo-modal-projbtn,
    .todo-modal-lane,
    .todo-panel-field select,
    .todo-panel-field input[type="date"] {
        max-width: none;
        width: 100%;
    }

    /* 7c ─ Detalle/edición de tarea (.todo-panel) a PANTALLA COMPLETA estilo
       Todoist. En escritorio es un panel lateral de 400px; en móvil pasa a
       fixed + inset:0 + 100dvh, por encima de bottom-nav (1083)/FAB (1086) para
       cubrir todo. La cabecera (X) queda fija arriba al hacer scroll. */
    .todo-panel {
        position: fixed;
        inset: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        z-index: 1090;
        border-left: none;
        box-shadow: none;
    }
    /* PANEL-DESC (2026-09-13) — el panel ABIERTO no puede conservar un `transform`.
       Un ancestro transformado es el BLOQUE CONTENEDOR de sus descendientes
       `position: fixed` (CSS Transforms §3), así que las hojas a pantalla completa
       que viven DENTRO del panel —calendario de fecha, prioridad, etiquetas,
       "Move to"— dejaban de anclarse al viewport y se anclaban al principio del
       CONTENIDO SCROLLEADO del panel. Medido con Playwright en un viewport de
       390x844 y una descripción de 40 líneas: al tocar "Due Date" el calendario
       nacía en `top: -1550px`, es decir 1.550px por encima de la pantalla — la
       queja literal de Andreu («el calendario sale arriba escondido y tengo que
       subir con el scroll para verlo»).
       CERRADO sigue en `translateX(100%)`: el deslizamiento de entrada no cambia
       (`none` interpola como la identidad), solo desaparece el bloque contenedor
       cuando el panel ya está en su sitio, que es cuando se abren las hojas. */
    .todo-panel.open {
        transform: none;
    }
    .todo-panel-inner {
        padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    }
    .todo-panel-head {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 2;
        padding-top: 4px;
    }

    /* "Move to" picker a PANTALLA COMPLETA en móvil (estilo Todoist "Mover a"). */
    .todo-move-picker {
        top: 0; left: 0; transform: none;
        width: 100vw; max-width: 100vw; height: 100dvh; max-height: none;
        border-radius: 0;
    }
    .todo-move-item { min-height: 48px; }

    /* 7c-bis ─ G3 (RONDA 3.1): el popover de fecha (.todo-datepop) deja de ser un
       dropdown absoluto colgando bajo el botón "Date" (que se cortaba por debajo
       de la hoja inferior, ocultando Repeat) y pasa a OVERLAY A PANTALLA COMPLETA
       estilo Todoist. z-index 1095 > .todo-modal (1090) y su backdrop (1080) para
       cubrir el quick-add. Atajos + calendario + Repeat caben con scroll vertical. */
    .todo-datepop {
        position: fixed;
        inset: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        z-index: 1095;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: calc(12px + env(safe-area-inset-top, 0px)) 16px
                 calc(16px + env(safe-area-inset-bottom, 0px));
    }
    /* Cabecera "Date" + Done: visible solo a pantalla completa (cerrar sin "fuera"). */
    .todo-datepop-mhead {
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid #f0f0f0;
        padding-bottom: 10px;
    }
    .todo-datepop-mhead-title {
        font-size: 1.05rem; font-weight: 700; color: #202020;
    }
    .todo-datepop-mhead-done {
        border: none; background: transparent; cursor: pointer;
        color: #db4035; font-weight: 600; font-size: 0.95rem;
        padding: 6px 4px; min-height: 44px;
    }
    /* Las secciones internas ocupan el ancho disponible y no se desbordan. */
    .todo-datepop-cal,
    .todo-cal,
    .todo-datepop-quick,
    .todo-datepop-repeat,
    .todo-datepop .todo-recur-row {
        width: 100%;
    }
    /* Días del calendario más grandes para tap cómodo a pantalla completa. */
    .todo-datepop .todo-cal-day { font-size: 0.95rem; }
    .todo-datepop .todo-datepop-quick button { padding: 11px 8px; font-size: 0.95rem; }

    /* PICKERS-MOBILE: prioridad (.todo-priopop) y etiquetas (.todo-pickerpop) pasan
       a hoja a PANTALLA COMPLETA igual que el date picker, en vez de un popover
       absoluto de 168/260px que se cortaba y descolocaba el contenido ("se va hacia
       abajo"). Combinado con la exclusividad mutua, ya no se solapan. */
    .todo-priopop,
    .todo-pickerpop {
        position: fixed;
        inset: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        z-index: 1095;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: calc(12px + env(safe-area-inset-top, 0px)) 16px
                 calc(16px + env(safe-area-inset-bottom, 0px));
    }
    .todo-pop-mhead {
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid #f0f0f0;
        padding-bottom: 10px;
        margin-bottom: 4px;
    }
    .todo-pop-mhead-title { font-size: 1.05rem; font-weight: 700; color: #202020; }
    .todo-pop-mhead-done {
        border: none; background: transparent; cursor: pointer;
        color: #db4035; font-weight: 600; font-size: 0.95rem;
        padding: 6px 4px; min-height: 44px;
    }
    /* Tap targets más cómodos en la hoja. */
    .todo-priopop-card { padding: 16px 4px; font-size: 0.85rem; }
    .todo-pickerpop .todo-picker-item { padding: 13px 10px; font-size: 0.95rem; }
    .todo-pickerpop .todo-picker-search { font-size: 0.95rem; padding: 11px 10px; }
    .todo-pickerpop .todo-picker-list { max-height: none; }

    /* 7d ─ Subtareas DENTRO del panel como filas tipo tarea (no un checklist
       apretado). El Lote C las hace clicables (abren la subtarea como tarea) y
       puede añadir chips de due/priority. Scope a .todo-panel para no afectar a
       posibles subrows inline en la lista. Coherente con .todo-row. */
    .todo-panel .todo-subrow {
        align-items: center;
        gap: 10px;
        min-height: 40px;
        padding: 6px 4px;
        border-radius: 6px;
        /* Indentadas para que "cuelguen" del padre (igual que .todo-row-nested). */
        margin-left: 8px;
    }
    .todo-panel .todo-subrow:hover { background: #f7f7f7; }
    .todo-panel .todo-subname {
        flex: 1;
        cursor: pointer;
        font-size: 0.9rem;
        line-height: 1.3;
    }
    /* Si el Lote C añade chips de due/priority a la subfila, que igualen el estilo
       de la meta de la fila (.todo-due / .todo-meta). */
    .todo-panel .todo-subrow .todo-due,
    .todo-panel .todo-subrow .todo-meta {
        flex-shrink: 0;
    }

    /* 8 ─ Densidad de fila: ocultar meta secundaria + acciones inline (las
       acciones viven en el swipe-izquierda y en el tap→detalle). Se mantiene
       nombre, fecha, chips de tipo/estado/labels y la barra de subtareas. */
    .todo-syn-person,
    .todo-syn-lead,
    .todo-row-project,
    .todo-row-actions {
        display: none;
    }

    /* 9 ─ Grips de arrastre (⋮⋮): ocultos en móvil como Todoist. Esto gana
       sobre el `opacity: 0.5` del bloque @media (hover:none) (propiedad distinta
       + viewport más específico para teléfonos). */
    .todo-drag {
        display: none;
    }

    /* 10 ─ "+ Add task" inline: oculto en móvil; el FAB ya cubre esa acción
       (Todoist tampoco muestra la fila inline en móvil). El "Add task" del
       sidebar (.todo-addtask-btn, dentro del cajón Browse) se conserva. */
    .todo-add-inline {
        display: none;
    }

    /* 11 ─ Control "Display": solo el icono (oculta el texto "Display") para
       ahorrar ancho en la cabecera. El <span> tras el <i.bi-sliders> se esconde. */
    .todo-display-btn {
        font-size: 0;          /* colapsa el nodo de texto "Display" suelto */
        gap: 0;
    }
    .todo-display-btn .bi {
        font-size: 1rem;       /* restituye el icono (el font-size:0 lo afectaba) */
    }

    /* 12 ─ Topbar global (base.html) OCULTO ENTERO SOLO dentro de /todo. Scope
       con body:has(.todo-app) → no afecta a ninguna otra vista de Synapsis. El
       founder quiere /todo a pantalla completa (sin la banda con ≡ + selector de
       quarter + buscador): "Inbox"/listas arrancan arriba del todo y hay más
       pantalla para tareas. El #sidebar-toggle vive dentro de .topbar → queda
       oculto pero SIGUE en el DOM (el Lote C lo dispara por JS desde el menú). */
    body:has(.todo-app) .main-content .topbar {
        display: none;
    }
    /* El .content-body deja de reservar hueco para el topbar y se pega arriba.
       Quitamos su padding para que .todo-app/.todo-nav/.todo-main lleguen al
       borde superior; .todo-main ya tiene su propio padding interno. */
    body:has(.todo-app) .main-content .content-body {
        padding: 0;
    }
    /* En móvil .todo-app ya no resta los ~120px del topbar de escritorio: ocupa
       toda la altura del viewport desde arriba. */
    body:has(.todo-app) .todo-app {
        min-height: 100vh;
        min-height: 100dvh;
    }
    /* Reglas parciales previas (ahora redundantes: el topbar entero está oculto),
       conservadas como cinturón-y-tirantes por si algún navegador no soporta
       :has() sobre .topbar pero sí sobre estos descendientes. */
    body:has(.todo-app) #quarter-selector {
        display: none;
    }
    body:has(.todo-app) .topbar-search #global-search-input {
        display: none;
    }
    body:has(.todo-app) .topbar-search .input-group {
        width: auto;
    }
}

/* ─────────────────────────────────────────────
   FOLD-SPLIT (2026-11-16) — nivel «partido táctil» de /todo, 600–768px
   (Galaxy Z Fold abierto: viewport 752×693; girado ≈693×752).
   Separa DISPOSICIÓN de ERGONOMÍA: todo lo táctil del bloque móvil de arriba
   (swipe, FAB, bottom-nav, panel a pantalla completa, 44px) SIGUE aplicando;
   aquí solo cambia que la columna de proyectos deja de ser el cajón «Browse» y
   se queda fija a la izquierda, con la lista a la derecha.
   · Fuente de verdad: la clase .todo-split que pone todo.js (isSplit = rango +
     preferencia Split/Full del dispositivo).
   · DOBLE CERROJO: además de la clase, este @media. Fuera de 600–768 nada de
     esto puede aplicar, aunque la clase se quedara puesta por error: <600px y
     >768px quedan byte-iguales.
   · La columna reutiliza el position:fixed del cajón (solo quita el translateX y
     toma el ancho de --todo-nav-w). La lista se aparta con margin-left y sigue
     scrolleando en window, como en móvil (el swipe y el panel cuentan con eso).
   ───────────────────────────────────────────── */
/* El interruptor Partido/Completo no existe fuera del rango (x-show también lo
   gobierna; esto es el cinturón). */
.todo-layout-toggle { display: none; }

@media (min-width: 600px) and (max-width: 768px) {
    .todo-layout-toggle {
        display: inline-flex;
        align-items: center;
        gap: 2px;
        padding: 2px;
        border-radius: 8px;
        background: #f3f3f3;
    }
    .todo-layout-toggle button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-width: 44px;
        min-height: 40px;     /* + 2px de padding del grupo arriba y abajo = 44px */
        padding: 0 10px;
        border: none;
        border-radius: 6px;
        background: transparent;
        color: var(--td-text-2, #808080);
        font-size: 0.8rem;
        cursor: pointer;
    }
    .todo-layout-toggle button.sel {
        background: #fff;
        color: var(--td-red, #db4035);
        font-weight: 600;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

    /* La columna: fija a la izquierda, siempre a la vista. z-index bajo (10):
       por encima de la lista, por debajo de bottom-nav (1083), FAB (1086),
       panel de detalle (1090), popovers de fila (1096) y modales (1190). */
    .todo-app.todo-split .todo-nav {
        transform: none;
        width: var(--todo-nav-w, 240px);
        max-width: none;
        z-index: 10;
        border-right: 1px solid #eee;
    }
    .todo-app.todo-split .todo-main {
        margin-left: var(--todo-nav-w, 240px);
    }
    .todo-app.todo-split .todo-drawer-backdrop { display: none; }

    /* Divisor táctil. El de escritorio es una tira de 6px DENTRO del .todo-nav,
       que tiene overflow-x:hidden y scrollea: se recortaría y se iría con el
       scroll. Aquí es fijo al viewport, de 20px (para el dedo) centrado en el
       borde, y acaba encima de la bottom-nav para no robarle toques. El drag es
       el mismo (Pointer Events + touch-action:none, mismo clamp y misma clave). */
    .todo-app.todo-split .todo-nav-resizer {
        display: block;
        position: fixed;
        top: 0;
        bottom: calc(56px + env(safe-area-inset-bottom, 0px));
        left: calc(var(--todo-nav-w, 240px) - 10px);
        right: auto;
        width: 20px;
        height: auto;
        z-index: 11;
        background: transparent;
    }
    .todo-app.todo-split .todo-nav-resizer::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 9px;
        width: 2px;
        background: transparent;
        transition: background 0.12s ease;
    }
    .todo-app.todo-split .todo-nav-resizer:hover,
    .todo-app.todo-split .todo-nav-resizer.active { background: transparent; }
    .todo-app.todo-split .todo-nav-resizer:hover::after,
    .todo-app.todo-split .todo-nav-resizer.active::after {
        background: rgba(219, 64, 53, 0.45);
    }

    /* La píldora de sincronización (abajo-izquierda en móvil) no tapa la columna. */
    .todo-app.todo-split .todo-sync-status {
        left: calc(var(--todo-nav-w, 240px) + 14px);
    }
}

/* ─────────────────────────────────────────────
   FOLD-SPLIT F1b (2026-11-16) — el PANEL DE DETALLE como HOJA LATERAL, 600–768px.
   En ≤768 los dos paneles (.todo-panel de /todo y el SynapsisPanel
   #details-offcanvas del resto de páginas) abren a pantalla completa. En este
   rango abren anclados a la derecha y dejan ver el contexto.
   · Aquí NO hay clase de JS a propósito: no hay preferencia que combinar (el
     rango manda, también en /todo modo Full), así que el @media ES la única
     fuente de verdad. Una clase calculada en JS sería una segunda fuente que
     podría discrepar. <600 y >768 quedan byte-iguales.
   · Todo lo demás del panel móvil sigue (va en el bloque ≤768 de arriba):
     cabecera sticky con Save, scroll interno, `transform: none` del abierto
     (las hojas internas —fecha, prioridad, Move to— se anclan al viewport),
     Atrás/History de /todo, el teclado (interactive-widget=resizes-content).
   ───────────────────────────────────────────── */
@media (min-width: 600px) and (max-width: 768px) {
    /* /todo — ancho: el del panel de escritorio (400px, probado cómodo) con algo
       de aire, sin tapar la columna de proyectos (240px por defecto), y nunca por
       debajo de 360px (formulario primero: con la columna ensanchada al máximo
       en un viewport de 600, la hoja pisa un poco la columna antes que cortar
       campos). 752 → 420px; 693 → 420px (deja 273px); 600 → 360px. */
    .todo-app .todo-panel {
        inset: 0 0 0 auto;
        width: max(360px, min(420px, calc(100vw - var(--todo-nav-w, 240px))));
        max-width: 100vw;
        border-left: 1px solid #e6e6e6;
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.14);
    }
    /* Velo sobre la zona que queda fuera: tocarlo cierra el panel (closePanel),
       como el backdrop del escritorio. Por encima de bottom-nav (1083) y FAB
       (1086), por debajo del panel (1090). */
    .todo-app .todo-panel-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1089;
        background: rgba(0, 0, 0, 0.28);
    }

    /* SynapsisPanel (Planner, Dashboard, Kanban, Timeline… y «Open full editor»
       de /todo). Ancho: su formulario está pensado para ≥480px (el min-width de
       escritorio), así que ese es el suelo; 68vw deja una franja de página.
       752 → 511px (franja de 241px); 693 → 480px (213px); 600 → 480px (120px).
       El backdrop de Bootstrap (.offcanvas-backdrop) ya cubre la franja y tocarlo
       cierra el panel, como en escritorio. El modo expandido sigue a 100vw (lo
       fija la regla ≤768 con más especificidad). */
    #details-offcanvas {
        min-width: 0;
        width: max(480px, 68vw) !important;
        max-width: 100vw;
    }
    /* La .app-bottomnav global (z 1083) queda por encima del offcanvas (1045) y
       tapaba el final del formulario («Save changes» a medias). Hueco al final
       del cuerpo para que el último campo pueda subir por encima de la barra.
       (A <600px pasa lo mismo desde antes de esta rama; no se toca: invariante.) */
    #details-offcanvas .offcanvas-body {
        padding-bottom: calc(1rem + 56px + env(safe-area-inset-bottom, 0px));
    }
}

/* Escritorio: la bottom-nav, el FAB y el backdrop del cajón nunca aparecen
   (markup x-cloak; aquí cinturón-y-tirantes por si el media query no aplica). */
@media (min-width: 769px) {
    .todo-bottomnav,
    .todo-fab,
    .todo-drawer-backdrop { display: none; }
}

/* ── PLANNER-MOBILE (max-width:768px) ───────────────────────────────────────
   El Planner NO tenía media query móvil (confirmado): las filas de
   pillar/challenge/objective/milestone alineaban en UNA sola línea, sin
   flex-wrap, controles de ancho fijo (input date 88px + select de lane 118px +
   badges + botones) → el nombre se comprimía y había riesgo de OVERFLOW
   horizontal del body en 360px. Aquí, y SOLO en móvil (el escritorio queda
   byte-igual):
     · permitimos que las cabeceras/filas envuelvan (flex-wrap);
     · damos al nombre un ancho mínimo para que no se aplaste — así los
       controles de ancho fijo caen a la línea siguiente en vez de exprimir el
       texto o desbordar;
     · escondemos la progress-bar del pillar-header (roba ~120px al nombre; el
       % numérico a su lado se conserva). */
@media (max-width: 768px) {
    .pillar-header,
    .challenge-card .card-header,
    .obj-header,
    .milestone-item {
        flex-wrap: wrap;
    }

    /* El nombre ocupa la mayor parte de la 1ª línea; date/lane/badges/botones
       envuelven a la siguiente al no caber. */
    .milestone-item .milestone-name,
    .obj-header .entity-name,
    .challenge-card .card-header .entity-name,
    .pillar-header .entity-name {
        min-width: 55%;
    }

    /* La progress-bar compite con el nombre por el ancho: fuera en móvil. */
    .pillar-header .progress {
        display: none;
    }
}

/* ── Item-panel Notes preview: frozen Synapsis widgets ────────────────────────
   The side-panel "Notes" preview (details_panel) injects a FROZEN widget snapshot
   (notes_item_service.preview_html → notes_widgets.freeze_for_preview). Bootstrap
   supplies the .badge base + synapsis.css the .badge-* colours; here we polish the
   compact-widget chrome so the frozen table reads inside the narrow panel. */
.item-note-preview .notes-widget-export { border: 1px solid #ebebe9; border-radius: 6px;
    background: #fbfbfa; margin: .5rem 0; padding: 8px 10px; }
.item-note-preview .notes-widget-export-title { font-weight: 600; margin-bottom: .3rem; }
.item-note-preview table { border-collapse: collapse; width: 100%; font-size: 12px;
    table-layout: fixed; margin: .25rem 0; }
.item-note-preview th, .item-note-preview td { border: 1px solid #ebebe9;
    padding: 3px 6px; text-align: left; vertical-align: top;
    overflow-wrap: anywhere; word-break: break-word; }
.item-note-preview thead th { background: #f6f8f7; }
.item-note-preview .logbook-embed-summary { display: flex; flex-wrap: wrap;
    align-items: baseline; gap: 6px; font-size: 12.5px; margin: 0 0 .3rem; }
.item-note-preview .logbook-embed-summary-text { font-weight: 600; }
.item-note-preview .logbook-embed-summary-icon { color: #dc3545; }
.item-note-preview .logbook-embed-open { margin-left: auto; font-size: 12px;
    color: #2383e2; text-decoration: none; white-space: nowrap; }
.item-note-preview details.logbook-embed-more,
.item-note-preview details.lqd-breakdown { margin: .3rem 0 0; }
.item-note-preview details > summary { cursor: pointer; font-size: 12px;
    color: #787770; padding: 2px 0; }
.item-note-preview .lqd-kpis { display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 6px; margin: .25rem 0 .4rem; }
.item-note-preview .lqd-kpi { border: 1px solid #ebebe9; border-radius: 6px;
    background: #fff; padding: 6px 4px; text-align: center; min-width: 0; }
.item-note-preview .lqd-kpi-val { font-size: 17px; font-weight: 700; line-height: 1.1; }
.item-note-preview .lqd-kpi-lbl { font-size: 10px; color: #7d7a75;
    text-transform: uppercase; letter-spacing: .02em; margin-top: 1px; }
.item-note-preview .logbook-embed-subtitle { font-weight: 600; font-size: 11px;
    color: #7d7a75; text-transform: uppercase; letter-spacing: .03em;
    margin: .4rem 0 .2rem; }
.item-note-preview .logbook-embed-caption { font-size: 11px; color: #91918e;
    margin-top: .3rem; }
.item-note-preview .pct-good { color: #198754; font-weight: 700; }
.item-note-preview .pct-warn { color: #fd7e14; font-weight: 700; }
.item-note-preview .pct-bad { color: #dc3545; font-weight: 700; }
.item-note-preview .lqd-num { font-weight: 700; }
.item-note-preview .lqd-zero { color: #adb5bd; }
.item-note-preview .lqd-warn { color: #dc3545; }
