/* Pegoletes en escritorio: fondo Cloud Dancer con la barra lateral encima y, sobre él, hojas casi
   blancas (la lista y, a su derecha, la ficha). Un solo color fuerte, Viva Magenta, para casillas
   marcadas, crear, destacadas y vencidas; Classic Blue solo para enlaces y lo que el analizador reconoce. */
:root {
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #f0eee9;        /* fondo de la ventana, barra lateral, franja de la ficha */
  --screen: #faf9f6;    /* hojas */
  --band: #f0eee9;      /* franja, pastillas rellenas, cabeceras, tinte de fila */
  --chip: #e6e3dc;      /* pastilla sobre la franja, elemento activo de la barra */
  --pop: #faf9f6;       /* popovers y menús */
  --line: #e3dfd7;
  --ink: #1c1a17;
  --muted: #6e695f;
  --faint: #8f8a80;
  --box: #bdb8ae;
  --ghost: #d6d1c7;
  --hot: #bb2649;
  --on-hot: #f0eee9;
  --blue: #0f4c81;
  --blue-line: #9db6cf;
  --ok: #1f9d55;
  --amber: #c77d12;
  --hover: rgba(28, 26, 23, .045);
  --pop-shadow: 0 10px 34px rgba(28, 26, 23, .14), 0 1px 3px rgba(28, 26, 23, .08);
  --lift: 0 14px 38px rgba(28, 26, 23, .12), 0 1px 2px rgba(28, 26, 23, .06);
  --glow: rgba(187, 38, 73, .3);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1f23; --screen: #141518; --band: #1d1f23; --chip: #2c2e34; --pop: #24262b; --line: #2c2e34;
    --ink: #edebe6; --muted: #9a968f; --faint: #77736c; --box: #5c5f67; --ghost: #44474e;
    --hot: #cb3a5e; --on-hot: #f0eee9; --blue: #8db3da; --blue-line: #3f5f80; --ok: #3cba6d; --amber: #e0a13c;
    --hover: rgba(237, 235, 230, .05);
    --pop-shadow: 0 10px 34px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4);
    --lift: 0 14px 38px rgba(0, 0, 0, .45), 0 1px 2px rgba(0, 0, 0, .3);
    --glow: rgba(203, 58, 94, .32);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1d1f23; --screen: #141518; --band: #1d1f23; --chip: #2c2e34; --pop: #24262b; --line: #2c2e34;
  --ink: #edebe6; --muted: #9a968f; --faint: #77736c; --box: #5c5f67; --ghost: #44474e;
  --hot: #cb3a5e; --on-hot: #f0eee9; --blue: #8db3da; --blue-line: #3f5f80; --ok: #3cba6d; --amber: #e0a13c;
  --hover: rgba(237, 235, 230, .05);
  --pop-shadow: 0 10px 34px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4);
  --lift: 0 14px 38px rgba(0, 0, 0, .45), 0 1px 2px rgba(0, 0, 0, .3);
  --glow: rgba(203, 58, 94, .32);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { flex: none; }
kbd { font-family: var(--font); font-size: 11.5px; font-weight: 500; color: var(--muted); background: var(--band);
  border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
[hidden] { display: none !important; }

/* iconos de trazo fino: todos los <svg> de la interfaz */
.ic, .side svg, .tools svg, .menu-item svg, .pill svg, .meta svg, .pop svg, .dp svg, .adder svg, .agenda svg {
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- acceso ---------- */
.gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.gate-card { width: 100%; max-width: 360px; background: var(--screen); border-radius: 22px; padding: 30px 26px 22px;
  box-shadow: var(--lift); display: flex; flex-direction: column; gap: 10px; }
.gate-logo { width: 54px; height: 54px; border-radius: 27px; margin-bottom: 6px; }
.gate-title { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -1px; line-height: 1.05; }
.gate-sub { margin: 0 0 8px; color: var(--muted); }
.field { width: 100%; height: 44px; border: 1px solid var(--line); background: transparent; border-radius: 12px; padding: 0 14px;
  outline: none; transition: border-color .15s; }
.field:focus { border-color: var(--ink); }
.field::placeholder { color: var(--faint); }
.btn-hot { height: 44px; border-radius: 22px; background: var(--hot); color: var(--on-hot); font-weight: 600; padding: 0 20px;
  transition: filter .15s, transform .1s; }
.btn-hot:hover { filter: brightness(1.07); }
.btn-hot:active { transform: scale(.98); }
.btn-hot:disabled { opacity: .6; cursor: default; }
.btn-plain { height: 44px; border-radius: 22px; padding: 0 18px; font-weight: 500; color: var(--muted); }
.btn-plain:hover { background: var(--hover); color: var(--ink); }
.btn-link { color: var(--blue); font-size: 14px; padding: 4px; align-self: center; }
.btn-link:disabled { opacity: .5; cursor: default; }
.gate-msg { min-height: 1.2em; margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.gate-msg.err { color: var(--hot); }
.gate-msg.ok { color: var(--ok); }

/* ---------- armazón ---------- */
.app { display: flex; height: 100vh; height: 100dvh; padding: 10px 10px 10px 0; gap: 10px; }
.pane { background: var(--screen); border-radius: 14px; position: relative; overflow-y: auto; overflow-x: hidden; min-width: 0;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.list-pane { flex: 1 1 auto; }
.detail-pane { flex: 0 0 min(46%, 580px); display: flex; flex-direction: column; overflow: hidden; }

/* ---------- barra lateral ---------- */
.side { width: 256px; flex: none; display: flex; flex-direction: column; padding: 14px 10px 6px 12px; min-height: 0; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 700; font-size: 16px; letter-spacing: -.3px; }
.side-brand img { width: 26px; height: 26px; border-radius: 13px; }
.side-nav { flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px; scrollbar-width: none; }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; height: 34px; padding: 0 10px;
  border-radius: 9px; font-size: 14.5px; text-align: left; transition: background-color .14s; }
.nav-item:hover { background: var(--hover); }
.nav-item.on { background: var(--chip); font-weight: 500; }
.nav-item.on::after { content: ""; position: absolute; right: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--hot); }
.nav-item svg { width: 17px; height: 17px; color: var(--hot); }
.nav-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { min-width: 20px; height: 19px; padding: 0 6px; border-radius: 10px; background: var(--chip); color: var(--muted);
  font-size: 11.5px; font-weight: 600; display: grid; place-items: center; }
.nav-item.on .count { background: var(--screen); }
.nav-item .tag-n { color: var(--muted); font-size: 12.5px; }
.nav-sec { display: flex; align-items: center; margin: 20px 0 2px; }
.nav-sec-btn { flex: 1; display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; font-size: 12.5px; color: var(--muted);
  border-radius: 8px; }
.nav-sec-btn:hover { color: var(--ink); }
.nav-sec-btn svg { width: 13px; height: 13px; transition: transform .18s; }
.nav-sec-btn.shut .chev { transform: rotate(-90deg); }
.nav-sec-add { width: 28px; height: 28px; border-radius: 8px; color: var(--muted); display: grid; place-items: center; }
.nav-sec-add:hover { background: var(--hover); color: var(--ink); }
.nav-sec-add svg { width: 15px; height: 15px; }
.nav-new { display: flex; align-items: center; gap: 11px; height: 34px; padding: 0 10px; }
.nav-new svg { width: 17px; height: 17px; }
.nav-new input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 14.5px; }
.nav-new input::placeholder { color: var(--faint); }
.nav-empty { padding: 4px 10px; color: var(--faint); font-size: 13px; }

.side-foot { display: flex; align-items: center; gap: 8px; padding: 10px 2px 4px; }
.plus-btn { width: 60px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--screen); display: grid; place-items: center;
  transition: background-color .14s, transform .1s; }
.plus-btn:hover { background: var(--pop); border-color: var(--box); }
.plus-btn:active { transform: scale(.96); }
.plus-btn svg { width: 19px; height: 19px; stroke-width: 1.9; }
.plus-btn[aria-expanded="true"] svg { transform: rotate(45deg); }
.plus-btn svg { transition: transform .18s; }
.sync { flex: 1; min-width: 0; display: block; text-align: center; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync::before { content: ""; display: inline-block; vertical-align: 1px; margin-right: 6px; width: 6px; height: 6px; border-radius: 3px; background: var(--box); }
.sync[data-state="synced"]::before { background: var(--ok); }
.sync[data-state="connecting"]::before, .sync[data-state="offline"]::before { background: var(--amber); }
.sync[data-state="connecting"]::before { animation: pulse 1.2s ease-in-out infinite; }
.sync[data-state="signin"] { color: var(--blue); cursor: pointer; }
@keyframes pulse { 50% { opacity: .3; } }
.me-btn { width: 36px; height: 36px; border-radius: 18px; border: 1px solid var(--line); padding: 3px; background: var(--screen); }
.me-btn img { width: 100%; height: 100%; border-radius: 50%; display: block; }

/* menús (cuenta, crear, opciones de la lista) */
.menu-wrap { position: relative; flex: none; }
.menu, .pop { background: var(--pop); border-radius: 14px; box-shadow: var(--pop-shadow); border: 1px solid var(--line); }
.menu { position: absolute; z-index: 60; min-width: 220px; padding: 5px; display: flex; flex-direction: column; animation: popin .14s ease-out; }
.menu.up { bottom: calc(100% + 8px); left: 0; transform-origin: bottom left; }
.menu.up.right { left: auto; right: 0; transform-origin: bottom right; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 6px 10px; border-radius: 9px;
  font-size: 14px; text-align: left; }
.menu-item:hover, .menu-item.kb { background: var(--hover); }
.menu-item svg { width: 16px; height: 16px; color: var(--muted); }
.menu-item span { flex: 1; }
.menu-item.danger { color: var(--hot); }
.menu-item.danger svg { color: var(--hot); }
.menu-sep { height: 1px; background: var(--line); margin: 4px 6px; }
@keyframes popin { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- lista ---------- */
.tools { position: sticky; top: 0; z-index: 5; display: flex; align-items: flex-start; gap: 8px; padding: 14px 16px 0; height: 0; overflow: visible; }
.tools-gap { flex: 1; }
.tool { height: 34px; min-width: 34px; border-radius: 17px; background: var(--band); display: grid; place-items: center; color: var(--ink);
  transition: background-color .14s; }
.tool:hover { background: var(--chip); }
.tool svg { width: 17px; height: 17px; }
.nav-toggle { display: none; }
.search { display: flex; align-items: center; gap: 0; padding: 0 9px; cursor: text; }
.search input { width: 0; border: 0; background: transparent; outline: none; font-size: 14px; padding: 0; transition: width .2s ease, margin .2s ease; }
.search:focus-within input, .search.has input { width: 180px; margin-left: 7px; }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }

.list-col { max-width: 680px; margin: 0 auto; padding: 72px 40px 120px; }
.has-detail .list-col { margin: 0; max-width: 640px; padding-left: 52px; }
.list-head h1 { margin: 0; font-size: 36px; line-height: 1.08; font-weight: 700; letter-spacing: -1.1px; overflow-wrap: anywhere; }
.list-head .title-in { width: 100%; border: 0; background: transparent; outline: none; padding: 0; margin: 0; font-size: 36px; line-height: 1.08;
  font-weight: 700; letter-spacing: -1.1px; }
.list-sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.list-head { margin-bottom: 22px; }

/* fila de añadir, arriba de la lista: al escribir se ven las frases reconocidas en azul y las pastillas */
.adder { position: relative; isolation: isolate; display: flex; align-items: flex-start; gap: 13px; padding: 8px 12px; margin: 0 -12px 10px; border-radius: 12px;
  transition: background-color .22s, box-shadow .26s, margin .26s cubic-bezier(.2,.8,.2,1); }
.adder.open { background: var(--band); box-shadow: var(--lift); padding: 14px 12px 12px; margin-bottom: 18px; }
.adder-box { width: 22px; height: 22px; margin-top: 1px; flex: none; border: 1.5px dashed var(--box); border-radius: 7px; display: grid; place-items: center; color: var(--muted); }
.adder-box svg { width: 14px; height: 14px; stroke-width: 2; }
.adder-main { flex: 1; min-width: 0; }
.adder-field { position: relative; display: flex; align-items: flex-start; gap: 10px; }
.adder-field textarea, .adder-mirror { font-size: 16px; line-height: 1.4; letter-spacing: 0; padding: 0; margin: 0; white-space: pre-wrap;
  overflow-wrap: anywhere; word-break: normal; transition: font-size .24s cubic-bezier(.2,.8,.2,1), letter-spacing .24s ease; }
.adder-field textarea { flex: 1; min-width: 0; display: block; border: 0; background: transparent; outline: none; resize: none; overflow: hidden;
  color: transparent; caret-color: var(--ink); height: 22px; min-height: 22px; position: relative; z-index: 1; }
.adder-field textarea::placeholder { color: var(--muted); }
.adder-mirror { position: absolute; left: 0; top: 0; right: 0; pointer-events: none; color: var(--ink); }
.adder-mirror .hit { color: var(--blue); text-decoration: underline; text-decoration-color: var(--blue-line); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.adder-mirror .tok { color: var(--blue); }
.adder.open .adder-field textarea, .adder.open .adder-mirror { font-size: 20px; font-weight: 600; letter-spacing: -.3px; line-height: 1.3; }
.adder.open .adder-field textarea { height: 26px; }
.adder-kbd { flex: none; margin-top: 1px; }
.adder.open .adder-kbd, .adder.typed .adder-kbd { display: none; }
.adder-chips { display: none; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.adder.open .adder-chips { display: flex; }
/* el ✓ aparece con un fundido suave (sin rebote) y se ve siempre en su magenta oscuro con la fila
   abierta, haya texto o no (vacía no añade nada) */
.adder-go { position: absolute; right: 12px; bottom: 10px; width: 40px; height: 40px; border-radius: 20px; background: var(--hot); color: var(--on-hot);
  display: grid; place-items: center; opacity: 0; transform: scale(.9); pointer-events: none;
  transition: opacity .1s ease, transform .1s ease; box-shadow: 0 6px 18px var(--glow); }
.adder-go svg { width: 20px; height: 20px; stroke-width: 2.4; }
/* al abrir entra despacio; al cerrar (regla de arriba) se apaga enseguida, antes de que la tarjeta se recoja */
.adder.open .adder-go { opacity: 1; transform: none; pointer-events: auto; transition: opacity .28s ease .06s, transform .34s cubic-bezier(.2,.8,.2,1) .06s; }
/* resplandor líquido detrás del ✓, como en la app: tres manchas magenta que giran despacio alrededor
   del botón y respiran (app.js las mueve en un ciclo de 14 s); queda dentro de la tarjeta */
.adder-glow { position: absolute; inset: 0; z-index: -1; border-radius: inherit; overflow: hidden; pointer-events: none;
  opacity: 0; transition: opacity .12s ease; }
.adder.open .adder-glow { opacity: 1; transition: opacity .4s ease .06s; }
.adder-glow i { position: absolute; right: calc(32px - var(--r)); bottom: calc(30px - var(--r)); width: calc(2 * var(--r)); height: calc(2 * var(--r));
  border-radius: 50%; will-change: transform;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--hot) var(--k), transparent),
    color-mix(in srgb, var(--hot) calc(var(--k) * .45), transparent) 50%, transparent); }
.adder-glow i:nth-child(1) { --r: 120px; --k: 15%; }
.adder-glow i:nth-child(2) { --r: 98px; --k: 13%; }
.adder-glow i:nth-child(3) { --r: 79px; --k: 11%; }
.adder.open .adder-chips { padding-right: 50px; }
.adder-go:active { transform: scale(.92); }
.adder .flash { position: absolute; left: 47px; top: -22px; font-size: 12.5px; color: var(--ok); font-weight: 600; animation: flash 1.4s ease forwards; }
@keyframes flash { 0% { opacity: 0; transform: translateY(4px); } 15%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* pastillas: en la ficha y al añadir */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 500; color: var(--muted); white-space: nowrap; max-width: 100%; transition: background-color .14s, border-color .14s, color .14s; }
.pill:hover { border-color: var(--box); color: var(--ink); }
.pill.set { background: var(--screen); color: var(--ink); }
.pill.found { color: var(--blue); }
.pill.hot { color: var(--hot); }
.pill.open { border-color: var(--ink); color: var(--ink); }
.pill svg { width: 15px; height: 15px; }
.pill .t { overflow: hidden; text-overflow: ellipsis; }
.pill .x { display: grid; place-items: center; width: 18px; height: 18px; margin-right: -6px; border-radius: 9px; }
.pill .x:hover { background: var(--hover); }
.pill .x svg { width: 12px; height: 12px; stroke-width: 2.2; }
.pill.star.hot svg { fill: currentColor; }

/* grupos */
.group-label { display: flex; align-items: center; gap: 8px; margin: 22px 0 4px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.group-label.late { color: var(--hot); }
.group-label:first-child { margin-top: 4px; }
.more-btn { display: inline-flex; align-items: center; gap: 6px; margin: 18px 0 2px; font-size: 13px; font-weight: 500; color: var(--muted); padding: 4px 0; }
.more-btn:hover { color: var(--ink); }
.more-btn svg { width: 13px; height: 13px; stroke-width: 2; transition: transform .18s; }
.more-btn.shut svg { transform: rotate(-90deg); }

/* fila de tarea */
ul.rows { list-style: none; margin: 0; padding: 0; }
.row { position: relative; display: flex; align-items: flex-start; gap: 13px; padding: 9px 12px; margin: 0 -12px; border-radius: 10px;
  cursor: pointer; transition: background-color 110ms ease; }
.row:hover { background: var(--hover); }
.row.press { background: var(--band); }
.row.sel { background: var(--band); }
.row.sel::after { content: ""; position: absolute; right: 0; top: 7px; bottom: 7px; width: 2px; background: var(--hot); border-radius: 2px; }
.cb { position: relative; width: 22px; height: 22px; margin-top: 0; flex: none; border-radius: 7px; border: 1.5px solid var(--box);
  display: grid; place-items: center; transition: background-color 180ms ease-out, border-color 90ms ease-out; }
.cb:hover { border-color: var(--hot); }
.cb svg { width: 14px; height: 14px; fill: none; stroke: var(--on-hot); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cb svg path { stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset 180ms ease-out; }
.row.ghost .cb { border-style: dashed; }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 1px; }
.row-title { font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; transition: color 180ms ease; }
.strike { background-image: linear-gradient(var(--hot), var(--hot)); background-repeat: no-repeat; background-position: 0 58%; background-size: 0% 2px;
  transition: background-size 120ms ease-in; }
.row.ghost .row-title { color: var(--muted); }
.meta { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); min-width: 0; overflow: hidden; white-space: nowrap;
  transition: opacity 180ms ease; }
.meta > span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; flex: none; }
.meta > span .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.meta svg { width: 13px; height: 13px; }
.meta .late { color: var(--hot); }
.meta .star { color: var(--hot); }
.meta .star svg { fill: currentColor; }
.meta .all { color: var(--ok); }
.row-acts { display: flex; gap: 2px; margin: -4px -6px -4px 0; opacity: 0; transition: opacity .12s; }
.row:hover .row-acts, .row:focus-within .row-acts { opacity: 1; }
.row-act { width: 30px; height: 30px; border-radius: 15px; display: grid; place-items: center; color: var(--muted); }
.row-act:hover { background: var(--chip); color: var(--ink); }
.row-act svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.row-act.on { color: var(--hot); }
.row-act.on svg { fill: currentColor; }

/* marcada: relleno magenta del 0 al 60 %, check del 25 al 85 %, raya del 15 al 75 % (300 ms) */
.row.checked .cb { background: var(--hot); border-color: var(--hot); }
.row.checked .cb svg path { stroke-dashoffset: 0; transition-delay: 75ms; }
.row.checked .strike { background-size: 100% 2px; transition: background-size 180ms ease-out 45ms; }
.row.checked .row-title { color: var(--muted); }
.row.checked .meta { opacity: .35; }
.row.done .cb { background: var(--hot); border-color: var(--hot); }
.row.done .cb svg path { stroke-dashoffset: 0; }
.row.done .row-title { color: var(--muted); }
.row.done .strike { background-size: 100% 2px; transition: none; }
.row.done .meta { opacity: .5; }
.row.leaving { pointer-events: none; }
.row.new { animation: rowin .22s ease-out; }
@keyframes rowin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* lista vacía: tres filas dibujadas a mano que tiemblan */
.empty { padding: 18px 0 0; animation: rise .34s cubic-bezier(.2,.8,.2,1) both; }
.empty-art { position: relative; width: 300px; height: 132px; max-width: 100%; }
.empty-art svg { position: absolute; inset: 0; width: 300px; height: 132px; fill: none; stroke: var(--box); opacity: .75; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; visibility: hidden; animation: boil .54s steps(1, end) infinite; }
.empty-art svg:nth-child(2) { animation-delay: -.36s; }
.empty-art svg:nth-child(3) { animation-delay: -.18s; }
@keyframes boil { 0% { visibility: visible; } 33.33%, 100% { visibility: hidden; } }
.empty p { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* agenda: semana y día */
.agenda { margin-top: 20px; }
.week-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.week-nav .month { flex: 1; font-size: 14px; font-weight: 600; text-transform: capitalize; }
.icon-btn { width: 30px; height: 30px; border-radius: 15px; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
.today-btn { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line); font-size: 13px; font-weight: 500; }
.today-btn:hover { border-color: var(--box); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0 6px; border-radius: 12px; font-size: 12px; color: var(--muted);
  transition: background-color .14s; }
.day:hover { background: var(--hover); }
.day .num { font-size: 16px; font-weight: 600; color: var(--ink); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 15px; }
.day.today .num { color: var(--hot); }
.day.sel { background: var(--band); color: var(--ink); }
.day.sel .num { background: var(--hot); color: var(--on-hot); }
.day .dot { width: 4px; height: 4px; border-radius: 2px; background: var(--box); }
.day .dot.off { visibility: hidden; }

/* ---------- ficha ---------- */
.dp { display: flex; flex-direction: column; height: 100%; }
.dp-top { background: var(--band); padding: 14px 20px 20px; }
.dp-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dp-bar .tool { background: var(--chip); }
.dp-bar .tool:hover { filter: brightness(.97); }
.dp-title-row { display: flex; align-items: flex-start; gap: 13px; }
.dp-title-row .cb { width: 28px; height: 28px; border-radius: 9px; margin-top: 3px; }
.dp-title-row .cb svg { width: 17px; height: 17px; }
.dp-title { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; resize: none; overflow: hidden; padding: 0; margin: 0;
  font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.8px; color: var(--ink); height: 33px; transition: color 180ms; }
.dp.done .dp-title { color: var(--muted); }
.dp.done .cb, .dp-title-row.checked .cb { background: var(--hot); border-color: var(--hot); }
.dp.done .cb svg path, .dp-title-row.checked .cb svg path { stroke-dashoffset: 0; }
.dp-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.dp-pills .pill.set { background: var(--screen); }
.dp-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px 20px 16px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.sub { display: flex; align-items: flex-start; gap: 13px; padding: 7px 0; }
.sub .cb { width: 20px; height: 20px; border-radius: 6px; margin-top: 1px; }
.sub .cb svg { width: 12px; height: 12px; }
.sub.done .cb { background: var(--hot); border-color: var(--hot); }
.sub.done .cb svg path { stroke-dashoffset: 0; transition-delay: 75ms; }
.sub-in { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; resize: none; overflow: hidden; padding: 0; font-size: 16px; line-height: 1.35;
  height: 22px; transition: color 180ms; }
.sub.done .sub-in { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--hot); text-decoration-thickness: 2px; }
.sub-in::placeholder { color: var(--faint); }
.sub.add .cb { border-style: dashed; border-color: var(--ghost); cursor: default; }
.sub-x { width: 24px; height: 24px; border-radius: 12px; color: var(--muted); display: grid; place-items: center; opacity: 0; }
.sub:hover .sub-x, .sub-x:focus-visible { opacity: 1; }
.sub-x:hover { background: var(--hover); color: var(--hot); }
.sub-x svg { width: 13px; height: 13px; stroke-width: 2; }
.notes { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 16px; }
.notes textarea { display: block; width: 100%; border: 0; background: transparent; outline: none; resize: none; overflow: hidden; padding: 0;
  font-size: 15.5px; line-height: 1.55; min-height: 50px; }
.notes textarea::placeholder { color: var(--faint); }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.link { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px; border-radius: 16px; background: var(--band); color: var(--blue);
  font-size: 13.5px; font-weight: 500; text-decoration: none; max-width: 100%; }
.link:hover { background: var(--chip); }
.link svg { width: 15px; height: 15px; }
.link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-foot { margin-top: auto; padding-top: 28px; text-align: center; color: var(--faint); font-size: 12px; line-height: 1.6; }

/* ---------- popovers ---------- */
.pops { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.pop { position: fixed; pointer-events: auto; width: 290px; max-height: calc(100vh - 24px); overflow-y: auto; animation: popin .14s ease-out;
  scrollbar-width: thin; }
.pop.narrow { width: 230px; }
.pop-sec { padding: 5px; }
.pop-sec + .pop-sec { border-top: 1px solid var(--line); }
.pop-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 6px 10px; border-radius: 9px; font-size: 14px; text-align: left; }
.pop-row:hover, .pop-row.kb { background: var(--hover); }
.pop-row svg { width: 16px; height: 16px; color: var(--muted); }
.pop-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-row .val { color: var(--muted); font-size: 13px; }
.pop-row.on .val { color: var(--ink); font-weight: 500; }
.pop-row .ck { color: var(--hot); }
.pop-row.danger { color: var(--hot); }
.pop-row.danger svg { color: var(--hot); }
.pop-search { display: flex; align-items: center; gap: 9px; padding: 4px 10px; height: 40px; }
.pop-search svg { width: 16px; height: 16px; color: var(--muted); }
.pop-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 14px; }
.pop-search input::placeholder { color: var(--faint); }
.pop-btn { display: block; width: calc(100% - 10px); margin: 5px; height: 34px; border-radius: 10px; background: var(--band); color: var(--muted); font-size: 14px; font-weight: 500; }
.pop-btn:hover { background: var(--chip); color: var(--ink); }
.pop-empty { padding: 8px 10px; color: var(--faint); font-size: 13px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 10px 10px; }
.opt { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line); font-size: 13px; font-weight: 500; }
.opt:hover { border-color: var(--box); }
.opt.sel { background: var(--hot); border-color: var(--hot); color: var(--on-hot); }
.opt-line { display: flex; align-items: center; gap: 8px; padding: 0 10px 10px; font-size: 13px; color: var(--muted); }
.opt-line input, .opt-line select { height: 30px; border: 1px solid var(--line); border-radius: 10px; background: transparent; padding: 0 8px; outline: none; font-size: 13.5px; color: var(--ink); }
.opt-line input[type="number"] { width: 58px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 10px 10px; }
.swatch { width: 24px; height: 24px; border-radius: 12px; border: 2px solid transparent; outline: 2px solid transparent; outline-offset: 1px; }
.swatch.sel { outline-color: var(--ink); }

/* calendario */
.cal { padding: 6px 8px 8px; }
.cal-head { display: flex; align-items: center; gap: 4px; padding: 2px 4px 6px 6px; }
.cal-head .t { flex: 1; font-size: 14px; font-weight: 500; }
.cal-head .icon-btn { width: 28px; height: 28px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0 6px; text-transform: uppercase; letter-spacing: .3px; }
.cal-dow.we, .cal-day.we { background: var(--band); }
.cal-grid > :nth-child(6) { border-top-left-radius: 8px; }
.cal-grid > :nth-child(7) { border-top-right-radius: 8px; }
.cal-grid > :nth-last-child(2) { border-bottom-left-radius: 8px; }
.cal-grid > :last-child { border-bottom-right-radius: 8px; }
.cal-day { height: 34px; display: grid; place-items: center; font-size: 13px; }
.cal-day span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 15px; transition: background-color .12s; }
.cal-day:hover span { background: var(--hover); }
.cal-day.other { color: var(--faint); }
.cal-day.today span { box-shadow: inset 0 0 0 1.5px var(--ink); }
.cal-day.sel span { background: var(--hot); color: var(--on-hot); box-shadow: none; }

/* ---------- avisos y diálogos ---------- */
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 90; transform: translateX(-50%); display: flex; align-items: center; gap: 14px;
  max-width: calc(100vw - 32px); padding: 6px 6px 6px 18px; background: var(--ink); color: var(--screen); border-radius: 22px; box-shadow: var(--pop-shadow);
  font-size: 14px; animation: toastin .18s ease; }
.toast-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-undo { height: 32px; padding: 0 14px; border-radius: 16px; background: var(--hot); color: var(--on-hot); font-weight: 600; font-size: 13.5px; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translateX(-50%); } }
.overlay { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 20px; background: rgba(20, 21, 24, .4); animation: fade .16s ease-out; }
@keyframes fade { from { opacity: 0; } }
.dialog { width: 100%; max-width: 380px; background: var(--screen); border-radius: 20px; padding: 24px; box-shadow: var(--lift); display: flex; flex-direction: column; gap: 10px; }
.dialog h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.dialog-acts { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; }
.scrim { display: none; }

/* ---------- pantallas estrechas: la barra lateral se abre encima y la ficha ocupa la ventana ---------- */
@media (max-width: 1100px) {
  .detail-pane { flex-basis: min(50%, 480px); }
  .has-detail .list-col { padding-left: 32px; padding-right: 28px; }
}
@media (max-width: 860px) {
  .app { padding: 0; gap: 0; }
  .pane { border-radius: 0; }
  .side { position: fixed; z-index: 80; left: 0; top: 0; bottom: 0; background: var(--bg); visibility: hidden;
    transform: translateX(-105%); transition: transform .24s cubic-bezier(.2,.8,.2,1), visibility 0s .24s; padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .side.open { transform: none; visibility: visible; box-shadow: var(--pop-shadow); transition: transform .24s cubic-bezier(.2,.8,.2,1); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 79; background: rgba(20, 21, 24, .35); }
  .nav-item.on::after { display: none; }
  .nav-toggle { display: grid; }
  .detail-pane { position: fixed; inset: 0; z-index: 75; }
  .list-col, .has-detail .list-col { padding: 64px 20px 120px; margin: 0 auto; }
  .row.sel::after { display: none; }
  .tools { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
}
@media (hover: none) { .row-acts, .adder-kbd { display: none; } .sub-x { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; }
  .empty-art svg:first-child { visibility: visible; } }
